From b2f420a0ad69a40ff265ef0631d7b6c2fce4dd45 Mon Sep 17 00:00:00 2001 From: Dave Supplee Date: Thu, 16 Aug 2018 14:50:44 -0400 Subject: [PATCH 1/2] update bigtable with synth script --- Bigtable/src/Admin/V2/AppProfile.php | 39 +- .../AppProfile/MultiClusterRoutingUseAny.php | 39 ++ .../V2/AppProfile/SingleClusterRouting.php | 114 +++++ .../AppProfile_MultiClusterRoutingUseAny.php | 28 +- .../V2/AppProfile_SingleClusterRouting.php | 93 +--- .../src/Admin/V2/CheckConsistencyRequest.php | 18 +- .../src/Admin/V2/CheckConsistencyResponse.php | 15 +- Bigtable/src/Admin/V2/Cluster.php | 32 +- Bigtable/src/Admin/V2/Cluster/State.php | 55 +++ Bigtable/src/Admin/V2/Cluster_State.php | 48 +- Bigtable/src/Admin/V2/ColumnFamily.php | 18 +- .../src/Admin/V2/CreateAppProfileRequest.php | 25 +- .../src/Admin/V2/CreateClusterMetadata.php | 18 +- .../src/Admin/V2/CreateClusterRequest.php | 23 +- .../src/Admin/V2/CreateInstanceMetadata.php | 18 +- .../src/Admin/V2/CreateInstanceRequest.php | 28 +- .../V2/CreateTableFromSnapshotMetadata.php | 19 +- .../V2/CreateTableFromSnapshotRequest.php | 23 +- Bigtable/src/Admin/V2/CreateTableRequest.php | 39 +- .../src/Admin/V2/CreateTableRequest/Split.php | 70 +++ .../src/Admin/V2/CreateTableRequest_Split.php | 53 +- .../src/Admin/V2/DeleteAppProfileRequest.php | 17 +- .../src/Admin/V2/DeleteClusterRequest.php | 15 +- .../src/Admin/V2/DeleteInstanceRequest.php | 15 +- .../src/Admin/V2/DeleteSnapshotRequest.php | 16 +- Bigtable/src/Admin/V2/DeleteTableRequest.php | 16 +- Bigtable/src/Admin/V2/DropRowRangeRequest.php | 21 +- .../BigtableInstanceAdminGapicClient.php | 117 +++-- .../Gapic/BigtableTableAdminGapicClient.php | 60 ++- Bigtable/src/Admin/V2/GcRule.php | 30 +- Bigtable/src/Admin/V2/GcRule/Intersection.php | 70 +++ Bigtable/src/Admin/V2/GcRule/Union.php | 70 +++ Bigtable/src/Admin/V2/GcRule_Intersection.php | 53 +- Bigtable/src/Admin/V2/GcRule_Union.php | 53 +- .../V2/GenerateConsistencyTokenRequest.php | 16 +- .../V2/GenerateConsistencyTokenResponse.php | 14 +- .../src/Admin/V2/GetAppProfileRequest.php | 15 +- Bigtable/src/Admin/V2/GetClusterRequest.php | 15 +- Bigtable/src/Admin/V2/GetInstanceRequest.php | 15 +- Bigtable/src/Admin/V2/GetSnapshotRequest.php | 16 +- Bigtable/src/Admin/V2/GetTableRequest.php | 19 +- Bigtable/src/Admin/V2/Instance.php | 36 +- Bigtable/src/Admin/V2/Instance/State.php | 38 ++ Bigtable/src/Admin/V2/Instance/Type.php | 45 ++ Bigtable/src/Admin/V2/Instance_State.php | 31 +- Bigtable/src/Admin/V2/Instance_Type.php | 38 +- .../src/Admin/V2/ListAppProfilesRequest.php | 18 +- .../src/Admin/V2/ListAppProfilesResponse.php | 18 +- Bigtable/src/Admin/V2/ListClustersRequest.php | 19 +- .../src/Admin/V2/ListClustersResponse.php | 23 +- .../src/Admin/V2/ListInstancesRequest.php | 17 +- .../src/Admin/V2/ListInstancesResponse.php | 24 +- .../src/Admin/V2/ListSnapshotsRequest.php | 22 +- .../src/Admin/V2/ListSnapshotsResponse.php | 18 +- Bigtable/src/Admin/V2/ListTablesRequest.php | 20 +- Bigtable/src/Admin/V2/ListTablesResponse.php | 18 +- .../Admin/V2/ModifyColumnFamiliesRequest.php | 25 +- .../Modification.php | 172 +++++++ ...difyColumnFamiliesRequest_Modification.php | 146 +----- .../Admin/V2/PartialUpdateInstanceRequest.php | 17 +- Bigtable/src/Admin/V2/Snapshot.php | 39 +- Bigtable/src/Admin/V2/Snapshot/State.php | 38 ++ .../src/Admin/V2/SnapshotTableMetadata.php | 18 +- .../src/Admin/V2/SnapshotTableRequest.php | 32 +- Bigtable/src/Admin/V2/Snapshot_State.php | 31 +- Bigtable/src/Admin/V2/StorageType.php | 2 +- Bigtable/src/Admin/V2/Table.php | 36 +- Bigtable/src/Admin/V2/Table/ClusterState.php | 74 +++ .../Table/ClusterState/ReplicationState.php | 54 +++ .../Admin/V2/Table/TimestampGranularity.php | 32 ++ Bigtable/src/Admin/V2/Table/View.php | 49 ++ Bigtable/src/Admin/V2/Table_ClusterState.php | 56 +-- .../Table_ClusterState_ReplicationState.php | 47 +- .../Admin/V2/Table_TimestampGranularity.php | 25 +- Bigtable/src/Admin/V2/Table_View.php | 42 +- .../src/Admin/V2/UpdateAppProfileMetadata.php | 12 +- .../src/Admin/V2/UpdateAppProfileRequest.php | 19 +- .../src/Admin/V2/UpdateClusterMetadata.php | 18 +- .../src/Admin/V2/UpdateInstanceMetadata.php | 18 +- Bigtable/src/V2/Cell.php | 25 +- Bigtable/src/V2/CheckAndMutateRowRequest.php | 39 +- Bigtable/src/V2/CheckAndMutateRowResponse.php | 15 +- Bigtable/src/V2/Column.php | 20 +- Bigtable/src/V2/ColumnRange.php | 22 +- Bigtable/src/V2/Family.php | 21 +- Bigtable/src/V2/MutateRowRequest.php | 25 +- Bigtable/src/V2/MutateRowResponse.php | 12 +- Bigtable/src/V2/MutateRowsRequest.php | 27 +- Bigtable/src/V2/MutateRowsRequest/Entry.php | 114 +++++ Bigtable/src/V2/MutateRowsRequest_Entry.php | 92 +--- Bigtable/src/V2/MutateRowsResponse.php | 18 +- Bigtable/src/V2/MutateRowsResponse/Entry.php | 118 +++++ Bigtable/src/V2/MutateRowsResponse_Entry.php | 95 +--- Bigtable/src/V2/Mutation.php | 36 +- Bigtable/src/V2/Mutation/DeleteFromColumn.php | 147 ++++++ Bigtable/src/V2/Mutation/DeleteFromFamily.php | 74 +++ Bigtable/src/V2/Mutation/DeleteFromRow.php | 36 ++ Bigtable/src/V2/Mutation/SetCell.php | 196 ++++++++ Bigtable/src/V2/Mutation_DeleteFromColumn.php | 124 +---- Bigtable/src/V2/Mutation_DeleteFromFamily.php | 56 +-- Bigtable/src/V2/Mutation_DeleteFromRow.php | 25 +- Bigtable/src/V2/Mutation_SetCell.php | 167 +------ Bigtable/src/V2/ReadModifyWriteRowRequest.php | 26 +- .../src/V2/ReadModifyWriteRowResponse.php | 14 +- Bigtable/src/V2/ReadModifyWriteRule.php | 28 +- Bigtable/src/V2/ReadRowsRequest.php | 27 +- Bigtable/src/V2/ReadRowsResponse.php | 25 +- .../src/V2/ReadRowsResponse/CellChunk.php | 458 ++++++++++++++++++ .../src/V2/ReadRowsResponse_CellChunk.php | 395 +-------------- Bigtable/src/V2/Row.php | 19 +- Bigtable/src/V2/RowFilter.php | 160 +++++- Bigtable/src/V2/RowFilter/Chain.php | 78 +++ Bigtable/src/V2/RowFilter/Condition.php | 159 ++++++ Bigtable/src/V2/RowFilter/Interleave.php | 159 ++++++ Bigtable/src/V2/RowFilter_Chain.php | 59 +-- Bigtable/src/V2/RowFilter_Condition.php | 134 +---- Bigtable/src/V2/RowFilter_Interleave.php | 120 +---- Bigtable/src/V2/RowRange.php | 20 +- Bigtable/src/V2/RowSet.php | 16 +- Bigtable/src/V2/SampleRowKeysRequest.php | 19 +- Bigtable/src/V2/SampleRowKeysResponse.php | 25 +- Bigtable/src/V2/TimestampRange.php | 16 +- Bigtable/src/V2/ValueRange.php | 20 +- .../V2/resources/bigtable_client_config.json | 11 +- .../V2/BigtableInstanceAdminClientTest.php | 13 +- 125 files changed, 4248 insertions(+), 2122 deletions(-) create mode 100644 Bigtable/src/Admin/V2/AppProfile/MultiClusterRoutingUseAny.php create mode 100644 Bigtable/src/Admin/V2/AppProfile/SingleClusterRouting.php create mode 100644 Bigtable/src/Admin/V2/Cluster/State.php create mode 100644 Bigtable/src/Admin/V2/CreateTableRequest/Split.php create mode 100644 Bigtable/src/Admin/V2/GcRule/Intersection.php create mode 100644 Bigtable/src/Admin/V2/GcRule/Union.php create mode 100644 Bigtable/src/Admin/V2/Instance/State.php create mode 100644 Bigtable/src/Admin/V2/Instance/Type.php create mode 100644 Bigtable/src/Admin/V2/ModifyColumnFamiliesRequest/Modification.php create mode 100644 Bigtable/src/Admin/V2/Snapshot/State.php create mode 100644 Bigtable/src/Admin/V2/Table/ClusterState.php create mode 100644 Bigtable/src/Admin/V2/Table/ClusterState/ReplicationState.php create mode 100644 Bigtable/src/Admin/V2/Table/TimestampGranularity.php create mode 100644 Bigtable/src/Admin/V2/Table/View.php create mode 100644 Bigtable/src/V2/MutateRowsRequest/Entry.php create mode 100644 Bigtable/src/V2/MutateRowsResponse/Entry.php create mode 100644 Bigtable/src/V2/Mutation/DeleteFromColumn.php create mode 100644 Bigtable/src/V2/Mutation/DeleteFromFamily.php create mode 100644 Bigtable/src/V2/Mutation/DeleteFromRow.php create mode 100644 Bigtable/src/V2/Mutation/SetCell.php create mode 100644 Bigtable/src/V2/ReadRowsResponse/CellChunk.php create mode 100644 Bigtable/src/V2/RowFilter/Chain.php create mode 100644 Bigtable/src/V2/RowFilter/Condition.php create mode 100644 Bigtable/src/V2/RowFilter/Interleave.php diff --git a/Bigtable/src/Admin/V2/AppProfile.php b/Bigtable/src/Admin/V2/AppProfile.php index ed1860cfad7f..487a165be2b0 100644 --- a/Bigtable/src/Admin/V2/AppProfile.php +++ b/Bigtable/src/Admin/V2/AppProfile.php @@ -45,9 +45,36 @@ class AppProfile extends \Google\Protobuf\Internal\Message private $description = ''; protected $routing_policy; - public function __construct() { + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * (`OutputOnly`) + * The unique name of the app profile. Values are of the form + * `projects//instances//appProfiles/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`. + * @type string $etag + * Strongly validated etag for optimistic concurrency control. Preserve the + * value returned from `GetAppProfile` when calling `UpdateAppProfile` to + * fail the request if there has been a modification in the mean time. The + * `update_mask` of the request need not include `etag` for this protection + * to apply. + * See [Wikipedia](https://en.wikipedia.org/wiki/HTTP_ETag) and + * [RFC 7232](https://tools.ietf.org/html/rfc7232#section-2.3) for more + * details. + * @type string $description + * Optional long form description of the use case for this AppProfile. + * @type \Google\Cloud\Bigtable\Admin\V2\AppProfile\MultiClusterRoutingUseAny $multi_cluster_routing_use_any + * Use a multi-cluster routing policy that may pick any cluster. + * @type \Google\Cloud\Bigtable\Admin\V2\AppProfile\SingleClusterRouting $single_cluster_routing + * Use a single-cluster routing policy. + * } + */ + public function __construct($data = NULL) { \GPBMetadata\Google\Bigtable\Admin\V2\Instance::initOnce(); - parent::__construct(); + parent::__construct($data); } /** @@ -150,7 +177,7 @@ public function setDescription($var) * Use a multi-cluster routing policy that may pick any cluster. * * Generated from protobuf field .google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny multi_cluster_routing_use_any = 5; - * @return \Google\Cloud\Bigtable\Admin\V2\AppProfile_MultiClusterRoutingUseAny + * @return \Google\Cloud\Bigtable\Admin\V2\AppProfile\MultiClusterRoutingUseAny */ public function getMultiClusterRoutingUseAny() { @@ -161,7 +188,7 @@ public function getMultiClusterRoutingUseAny() * Use a multi-cluster routing policy that may pick any cluster. * * Generated from protobuf field .google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny multi_cluster_routing_use_any = 5; - * @param \Google\Cloud\Bigtable\Admin\V2\AppProfile_MultiClusterRoutingUseAny $var + * @param \Google\Cloud\Bigtable\Admin\V2\AppProfile\MultiClusterRoutingUseAny $var * @return $this */ public function setMultiClusterRoutingUseAny($var) @@ -176,7 +203,7 @@ public function setMultiClusterRoutingUseAny($var) * Use a single-cluster routing policy. * * Generated from protobuf field .google.bigtable.admin.v2.AppProfile.SingleClusterRouting single_cluster_routing = 6; - * @return \Google\Cloud\Bigtable\Admin\V2\AppProfile_SingleClusterRouting + * @return \Google\Cloud\Bigtable\Admin\V2\AppProfile\SingleClusterRouting */ public function getSingleClusterRouting() { @@ -187,7 +214,7 @@ public function getSingleClusterRouting() * Use a single-cluster routing policy. * * Generated from protobuf field .google.bigtable.admin.v2.AppProfile.SingleClusterRouting single_cluster_routing = 6; - * @param \Google\Cloud\Bigtable\Admin\V2\AppProfile_SingleClusterRouting $var + * @param \Google\Cloud\Bigtable\Admin\V2\AppProfile\SingleClusterRouting $var * @return $this */ public function setSingleClusterRouting($var) diff --git a/Bigtable/src/Admin/V2/AppProfile/MultiClusterRoutingUseAny.php b/Bigtable/src/Admin/V2/AppProfile/MultiClusterRoutingUseAny.php new file mode 100644 index 000000000000..bf832845b4b4 --- /dev/null +++ b/Bigtable/src/Admin/V2/AppProfile/MultiClusterRoutingUseAny.php @@ -0,0 +1,39 @@ +google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny + */ +class MultiClusterRoutingUseAny 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\Instance::initOnce(); + parent::__construct($data); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(MultiClusterRoutingUseAny::class, \Google\Cloud\Bigtable\Admin\V2\AppProfile_MultiClusterRoutingUseAny::class); + diff --git a/Bigtable/src/Admin/V2/AppProfile/SingleClusterRouting.php b/Bigtable/src/Admin/V2/AppProfile/SingleClusterRouting.php new file mode 100644 index 000000000000..f8804e94f385 --- /dev/null +++ b/Bigtable/src/Admin/V2/AppProfile/SingleClusterRouting.php @@ -0,0 +1,114 @@ +google.bigtable.admin.v2.AppProfile.SingleClusterRouting + */ +class SingleClusterRouting extends \Google\Protobuf\Internal\Message +{ + /** + * The cluster to which read/write requests should be routed. + * + * Generated from protobuf field string cluster_id = 1; + */ + private $cluster_id = ''; + /** + * Whether or not `CheckAndMutateRow` and `ReadModifyWriteRow` requests are + * allowed by this app profile. It is unsafe to send these requests to + * the same table/row/column in multiple clusters. + * + * Generated from protobuf field bool allow_transactional_writes = 2; + */ + private $allow_transactional_writes = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $cluster_id + * The cluster to which read/write requests should be routed. + * @type bool $allow_transactional_writes + * Whether or not `CheckAndMutateRow` and `ReadModifyWriteRow` requests are + * allowed by this app profile. It is unsafe to send these requests to + * the same table/row/column in multiple clusters. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\Instance::initOnce(); + parent::__construct($data); + } + + /** + * The cluster to which read/write requests should be routed. + * + * Generated from protobuf field string cluster_id = 1; + * @return string + */ + public function getClusterId() + { + return $this->cluster_id; + } + + /** + * The cluster to which read/write requests should be routed. + * + * Generated from protobuf field string cluster_id = 1; + * @param string $var + * @return $this + */ + public function setClusterId($var) + { + GPBUtil::checkString($var, True); + $this->cluster_id = $var; + + return $this; + } + + /** + * Whether or not `CheckAndMutateRow` and `ReadModifyWriteRow` requests are + * allowed by this app profile. It is unsafe to send these requests to + * the same table/row/column in multiple clusters. + * + * Generated from protobuf field bool allow_transactional_writes = 2; + * @return bool + */ + public function getAllowTransactionalWrites() + { + return $this->allow_transactional_writes; + } + + /** + * Whether or not `CheckAndMutateRow` and `ReadModifyWriteRow` requests are + * allowed by this app profile. It is unsafe to send these requests to + * the same table/row/column in multiple clusters. + * + * Generated from protobuf field bool allow_transactional_writes = 2; + * @param bool $var + * @return $this + */ + public function setAllowTransactionalWrites($var) + { + GPBUtil::checkBool($var); + $this->allow_transactional_writes = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(SingleClusterRouting::class, \Google\Cloud\Bigtable\Admin\V2\AppProfile_SingleClusterRouting::class); + diff --git a/Bigtable/src/Admin/V2/AppProfile_MultiClusterRoutingUseAny.php b/Bigtable/src/Admin/V2/AppProfile_MultiClusterRoutingUseAny.php index 247ccecb4d58..b37ee5d7f97e 100644 --- a/Bigtable/src/Admin/V2/AppProfile_MultiClusterRoutingUseAny.php +++ b/Bigtable/src/Admin/V2/AppProfile_MultiClusterRoutingUseAny.php @@ -4,25 +4,13 @@ namespace Google\Cloud\Bigtable\Admin\V2; -use Google\Protobuf\Internal\GPBType; -use Google\Protobuf\Internal\RepeatedField; -use Google\Protobuf\Internal\GPBUtil; - -/** - * Read/write requests may be routed to any cluster in the instance, and will - * fail over to another cluster in the event of transient errors or delays. - * Choosing this option sacrifices read-your-writes consistency to improve - * availability. - * - * Generated from protobuf message google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny - */ -class AppProfile_MultiClusterRoutingUseAny extends \Google\Protobuf\Internal\Message -{ - - public function __construct() { - \GPBMetadata\Google\Bigtable\Admin\V2\Instance::initOnce(); - parent::__construct(); - } - +if (false) { + /** + * This class is deprecated. Use Google\Cloud\Bigtable\Admin\V2\AppProfile\MultiClusterRoutingUseAny instead. + * @deprecated + */ + class AppProfile_MultiClusterRoutingUseAny {} } +class_exists(AppProfile\MultiClusterRoutingUseAny::class); +@trigger_error('Google\Cloud\Bigtable\Admin\V2\AppProfile_MultiClusterRoutingUseAny is deprecated and will be removed in the next major release. Use Google\Cloud\Bigtable\Admin\V2\AppProfile\MultiClusterRoutingUseAny instead', E_USER_DEPRECATED); diff --git a/Bigtable/src/Admin/V2/AppProfile_SingleClusterRouting.php b/Bigtable/src/Admin/V2/AppProfile_SingleClusterRouting.php index 91b8dd0492d8..c6f3760a4d3c 100644 --- a/Bigtable/src/Admin/V2/AppProfile_SingleClusterRouting.php +++ b/Bigtable/src/Admin/V2/AppProfile_SingleClusterRouting.php @@ -4,94 +4,13 @@ namespace Google\Cloud\Bigtable\Admin\V2; -use Google\Protobuf\Internal\GPBType; -use Google\Protobuf\Internal\RepeatedField; -use Google\Protobuf\Internal\GPBUtil; - -/** - * Unconditionally routes all read/write requests to a specific cluster. - * This option preserves read-your-writes consistency, but does not improve - * availability. - * - * Generated from protobuf message google.bigtable.admin.v2.AppProfile.SingleClusterRouting - */ -class AppProfile_SingleClusterRouting extends \Google\Protobuf\Internal\Message -{ - /** - * The cluster to which read/write requests should be routed. - * - * Generated from protobuf field string cluster_id = 1; - */ - private $cluster_id = ''; - /** - * Whether or not `CheckAndMutateRow` and `ReadModifyWriteRow` requests are - * allowed by this app profile. It is unsafe to send these requests to - * the same table/row/column in multiple clusters. - * - * Generated from protobuf field bool allow_transactional_writes = 2; - */ - private $allow_transactional_writes = false; - - public function __construct() { - \GPBMetadata\Google\Bigtable\Admin\V2\Instance::initOnce(); - parent::__construct(); - } - - /** - * The cluster to which read/write requests should be routed. - * - * Generated from protobuf field string cluster_id = 1; - * @return string - */ - public function getClusterId() - { - return $this->cluster_id; - } - +if (false) { /** - * The cluster to which read/write requests should be routed. - * - * Generated from protobuf field string cluster_id = 1; - * @param string $var - * @return $this + * This class is deprecated. Use Google\Cloud\Bigtable\Admin\V2\AppProfile\SingleClusterRouting instead. + * @deprecated */ - public function setClusterId($var) - { - GPBUtil::checkString($var, True); - $this->cluster_id = $var; - - return $this; - } - - /** - * Whether or not `CheckAndMutateRow` and `ReadModifyWriteRow` requests are - * allowed by this app profile. It is unsafe to send these requests to - * the same table/row/column in multiple clusters. - * - * Generated from protobuf field bool allow_transactional_writes = 2; - * @return bool - */ - public function getAllowTransactionalWrites() - { - return $this->allow_transactional_writes; - } - - /** - * Whether or not `CheckAndMutateRow` and `ReadModifyWriteRow` requests are - * allowed by this app profile. It is unsafe to send these requests to - * the same table/row/column in multiple clusters. - * - * Generated from protobuf field bool allow_transactional_writes = 2; - * @param bool $var - * @return $this - */ - public function setAllowTransactionalWrites($var) - { - GPBUtil::checkBool($var); - $this->allow_transactional_writes = $var; - - return $this; - } - + class AppProfile_SingleClusterRouting {} } +class_exists(AppProfile\SingleClusterRouting::class); +@trigger_error('Google\Cloud\Bigtable\Admin\V2\AppProfile_SingleClusterRouting is deprecated and will be removed in the next major release. Use Google\Cloud\Bigtable\Admin\V2\AppProfile\SingleClusterRouting instead', E_USER_DEPRECATED); diff --git a/Bigtable/src/Admin/V2/CheckConsistencyRequest.php b/Bigtable/src/Admin/V2/CheckConsistencyRequest.php index f7794eee0bb7..0b6eb24a89d9 100644 --- a/Bigtable/src/Admin/V2/CheckConsistencyRequest.php +++ b/Bigtable/src/Admin/V2/CheckConsistencyRequest.php @@ -31,9 +31,23 @@ class CheckConsistencyRequest extends \Google\Protobuf\Internal\Message */ private $consistency_token = ''; - public function __construct() { + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The unique name of the Table for which to check replication consistency. + * Values are of the form + * `projects//instances//tables/`. + * @type string $consistency_token + * The token created using GenerateConsistencyToken for the Table. + * } + */ + public function __construct($data = NULL) { \GPBMetadata\Google\Bigtable\Admin\V2\BigtableTableAdmin::initOnce(); - parent::__construct(); + parent::__construct($data); } /** diff --git a/Bigtable/src/Admin/V2/CheckConsistencyResponse.php b/Bigtable/src/Admin/V2/CheckConsistencyResponse.php index ae24b549fa27..b4f54edcb244 100644 --- a/Bigtable/src/Admin/V2/CheckConsistencyResponse.php +++ b/Bigtable/src/Admin/V2/CheckConsistencyResponse.php @@ -24,9 +24,20 @@ class CheckConsistencyResponse extends \Google\Protobuf\Internal\Message */ private $consistent = false; - public function __construct() { + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $consistent + * True only if the token is consistent. A token is consistent if replication + * has caught up with the restrictions specified in the request. + * } + */ + public function __construct($data = NULL) { \GPBMetadata\Google\Bigtable\Admin\V2\BigtableTableAdmin::initOnce(); - parent::__construct(); + parent::__construct($data); } /** diff --git a/Bigtable/src/Admin/V2/Cluster.php b/Bigtable/src/Admin/V2/Cluster.php index cb1b5b2445f1..dcbf99e0ef14 100644 --- a/Bigtable/src/Admin/V2/Cluster.php +++ b/Bigtable/src/Admin/V2/Cluster.php @@ -58,9 +58,37 @@ class Cluster extends \Google\Protobuf\Internal\Message */ private $default_storage_type = 0; - public function __construct() { + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * (`OutputOnly`) + * The unique name of the cluster. Values are of the form + * `projects//instances//clusters/[a-z][-a-z0-9]*`. + * @type string $location + * (`CreationOnly`) + * 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//locations/`. + * @type int $state + * (`OutputOnly`) + * The current state of the cluster. + * @type int $serve_nodes + * The number of nodes allocated to this cluster. More nodes enable higher + * throughput and more consistent performance. + * @type int $default_storage_type + * (`CreationOnly`) + * The type of storage used by this cluster to serve its + * parent instance's tables, unless explicitly overridden. + * } + */ + public function __construct($data = NULL) { \GPBMetadata\Google\Bigtable\Admin\V2\Instance::initOnce(); - parent::__construct(); + parent::__construct($data); } /** diff --git a/Bigtable/src/Admin/V2/Cluster/State.php b/Bigtable/src/Admin/V2/Cluster/State.php new file mode 100644 index 000000000000..09a71ce437bd --- /dev/null +++ b/Bigtable/src/Admin/V2/Cluster/State.php @@ -0,0 +1,55 @@ +google.bigtable.admin.v2.Cluster.State + */ +class State +{ + /** + * The state of the cluster could not be determined. + * + * Generated from protobuf enum STATE_NOT_KNOWN = 0; + */ + const STATE_NOT_KNOWN = 0; + /** + * The cluster has been successfully created and is ready to serve requests. + * + * Generated from protobuf enum READY = 1; + */ + const READY = 1; + /** + * The cluster is currently being created, and may be destroyed + * if the creation process encounters an error. + * A cluster may not be able to serve requests while being created. + * + * Generated from protobuf enum CREATING = 2; + */ + const CREATING = 2; + /** + * The cluster is currently being resized, and may revert to its previous + * node count if the process encounters an error. + * A cluster is still capable of serving requests while being resized, + * but may exhibit performance as if its number of allocated nodes is + * between the starting and requested states. + * + * Generated from protobuf enum RESIZING = 3; + */ + const RESIZING = 3; + /** + * The cluster has no backing nodes. The data (tables) still + * exist, but no operations can be performed on the cluster. + * + * Generated from protobuf enum DISABLED = 4; + */ + const DISABLED = 4; +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(State::class, \Google\Cloud\Bigtable\Admin\V2\Cluster_State::class); + diff --git a/Bigtable/src/Admin/V2/Cluster_State.php b/Bigtable/src/Admin/V2/Cluster_State.php index 122639449102..413bb19d3457 100644 --- a/Bigtable/src/Admin/V2/Cluster_State.php +++ b/Bigtable/src/Admin/V2/Cluster_State.php @@ -4,49 +4,13 @@ namespace Google\Cloud\Bigtable\Admin\V2; -/** - * Possible states of a cluster. - * - * Protobuf enum Google\Bigtable\Admin\V2\Cluster\State - */ -class Cluster_State -{ +if (false) { /** - * The state of the cluster could not be determined. - * - * Generated from protobuf enum STATE_NOT_KNOWN = 0; + * This class is deprecated. Use Google\Cloud\Bigtable\Admin\V2\Cluster\State instead. + * @deprecated */ - const STATE_NOT_KNOWN = 0; - /** - * The cluster has been successfully created and is ready to serve requests. - * - * Generated from protobuf enum READY = 1; - */ - const READY = 1; - /** - * The cluster is currently being created, and may be destroyed - * if the creation process encounters an error. - * A cluster may not be able to serve requests while being created. - * - * Generated from protobuf enum CREATING = 2; - */ - const CREATING = 2; - /** - * The cluster is currently being resized, and may revert to its previous - * node count if the process encounters an error. - * A cluster is still capable of serving requests while being resized, - * but may exhibit performance as if its number of allocated nodes is - * between the starting and requested states. - * - * Generated from protobuf enum RESIZING = 3; - */ - const RESIZING = 3; - /** - * The cluster has no backing nodes. The data (tables) still - * exist, but no operations can be performed on the cluster. - * - * Generated from protobuf enum DISABLED = 4; - */ - const DISABLED = 4; + class Cluster_State {} } +class_exists(Cluster\State::class); +@trigger_error('Google\Cloud\Bigtable\Admin\V2\Cluster_State is deprecated and will be removed in the next major release. Use Google\Cloud\Bigtable\Admin\V2\Cluster\State instead', E_USER_DEPRECATED); diff --git a/Bigtable/src/Admin/V2/ColumnFamily.php b/Bigtable/src/Admin/V2/ColumnFamily.php index a9e9abf49a5c..c89d17ff7e7d 100644 --- a/Bigtable/src/Admin/V2/ColumnFamily.php +++ b/Bigtable/src/Admin/V2/ColumnFamily.php @@ -26,9 +26,23 @@ class ColumnFamily extends \Google\Protobuf\Internal\Message */ private $gc_rule = null; - public function __construct() { + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Bigtable\Admin\V2\GcRule $gc_rule + * Garbage collection rule specified as a protobuf. + * Must serialize to at most 500 bytes. + * NOTE: Garbage collection executes opportunistically in the background, and + * so it's possible for reads to return a cell even if it matches the active + * GC expression for its family. + * } + */ + public function __construct($data = NULL) { \GPBMetadata\Google\Bigtable\Admin\V2\Table::initOnce(); - parent::__construct(); + parent::__construct($data); } /** diff --git a/Bigtable/src/Admin/V2/CreateAppProfileRequest.php b/Bigtable/src/Admin/V2/CreateAppProfileRequest.php index ab94773ba393..059e20a78624 100644 --- a/Bigtable/src/Admin/V2/CreateAppProfileRequest.php +++ b/Bigtable/src/Admin/V2/CreateAppProfileRequest.php @@ -45,9 +45,30 @@ class CreateAppProfileRequest extends \Google\Protobuf\Internal\Message */ private $ignore_warnings = false; - public function __construct() { + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * The unique name of the instance in which to create the new app profile. + * Values are of the form + * `projects//instances/`. + * @type string $app_profile_id + * 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`. + * @type \Google\Cloud\Bigtable\Admin\V2\AppProfile $app_profile + * The app profile to be created. + * Fields marked `OutputOnly` will be ignored. + * @type bool $ignore_warnings + * If true, ignore safety checks when creating the app profile. + * } + */ + public function __construct($data = NULL) { \GPBMetadata\Google\Bigtable\Admin\V2\BigtableInstanceAdmin::initOnce(); - parent::__construct(); + parent::__construct($data); } /** diff --git a/Bigtable/src/Admin/V2/CreateClusterMetadata.php b/Bigtable/src/Admin/V2/CreateClusterMetadata.php index fda12b11041f..cc42b79cf0af 100644 --- a/Bigtable/src/Admin/V2/CreateClusterMetadata.php +++ b/Bigtable/src/Admin/V2/CreateClusterMetadata.php @@ -34,9 +34,23 @@ class CreateClusterMetadata extends \Google\Protobuf\Internal\Message */ private $finish_time = null; - public function __construct() { + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Bigtable\Admin\V2\CreateClusterRequest $original_request + * The request that prompted the initiation of this CreateCluster operation. + * @type \Google\Protobuf\Timestamp $request_time + * The time at which the original request was received. + * @type \Google\Protobuf\Timestamp $finish_time + * The time at which the operation failed or was completed successfully. + * } + */ + public function __construct($data = NULL) { \GPBMetadata\Google\Bigtable\Admin\V2\BigtableInstanceAdmin::initOnce(); - parent::__construct(); + parent::__construct($data); } /** diff --git a/Bigtable/src/Admin/V2/CreateClusterRequest.php b/Bigtable/src/Admin/V2/CreateClusterRequest.php index 85c39916af63..8d071540dc27 100644 --- a/Bigtable/src/Admin/V2/CreateClusterRequest.php +++ b/Bigtable/src/Admin/V2/CreateClusterRequest.php @@ -39,9 +39,28 @@ class CreateClusterRequest extends \Google\Protobuf\Internal\Message */ private $cluster = null; - public function __construct() { + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * The unique name of the instance in which to create the new cluster. + * Values are of the form + * `projects//instances/`. + * @type string $cluster_id + * 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`. + * @type \Google\Cloud\Bigtable\Admin\V2\Cluster $cluster + * The cluster to be created. + * Fields marked `OutputOnly` must be left blank. + * } + */ + public function __construct($data = NULL) { \GPBMetadata\Google\Bigtable\Admin\V2\BigtableInstanceAdmin::initOnce(); - parent::__construct(); + parent::__construct($data); } /** diff --git a/Bigtable/src/Admin/V2/CreateInstanceMetadata.php b/Bigtable/src/Admin/V2/CreateInstanceMetadata.php index 9f3e13490272..bc10d7794ff9 100644 --- a/Bigtable/src/Admin/V2/CreateInstanceMetadata.php +++ b/Bigtable/src/Admin/V2/CreateInstanceMetadata.php @@ -34,9 +34,23 @@ class CreateInstanceMetadata extends \Google\Protobuf\Internal\Message */ private $finish_time = null; - public function __construct() { + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Bigtable\Admin\V2\CreateInstanceRequest $original_request + * The request that prompted the initiation of this CreateInstance operation. + * @type \Google\Protobuf\Timestamp $request_time + * The time at which the original request was received. + * @type \Google\Protobuf\Timestamp $finish_time + * The time at which the operation failed or was completed successfully. + * } + */ + public function __construct($data = NULL) { \GPBMetadata\Google\Bigtable\Admin\V2\BigtableInstanceAdmin::initOnce(); - parent::__construct(); + parent::__construct($data); } /** diff --git a/Bigtable/src/Admin/V2/CreateInstanceRequest.php b/Bigtable/src/Admin/V2/CreateInstanceRequest.php index 921b3b74ff2c..8888fd4d04fc 100644 --- a/Bigtable/src/Admin/V2/CreateInstanceRequest.php +++ b/Bigtable/src/Admin/V2/CreateInstanceRequest.php @@ -48,9 +48,33 @@ class CreateInstanceRequest extends \Google\Protobuf\Internal\Message */ private $clusters; - public function __construct() { + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * The unique name of the project in which to create the new instance. + * Values are of the form `projects/`. + * @type string $instance_id + * The ID to be used when referring to the new instance within its project, + * e.g., just `myinstance` rather than + * `projects/myproject/instances/myinstance`. + * @type \Google\Cloud\Bigtable\Admin\V2\Instance $instance + * The instance to create. + * Fields marked `OutputOnly` must be left blank. + * @type array|\Google\Protobuf\Internal\MapField $clusters + * 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 exactly one cluster must be specified. + * } + */ + public function __construct($data = NULL) { \GPBMetadata\Google\Bigtable\Admin\V2\BigtableInstanceAdmin::initOnce(); - parent::__construct(); + parent::__construct($data); } /** diff --git a/Bigtable/src/Admin/V2/CreateTableFromSnapshotMetadata.php b/Bigtable/src/Admin/V2/CreateTableFromSnapshotMetadata.php index da3ef3bbc9e1..fb73bde01e3d 100644 --- a/Bigtable/src/Admin/V2/CreateTableFromSnapshotMetadata.php +++ b/Bigtable/src/Admin/V2/CreateTableFromSnapshotMetadata.php @@ -39,9 +39,24 @@ class CreateTableFromSnapshotMetadata extends \Google\Protobuf\Internal\Message */ private $finish_time = null; - public function __construct() { + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Bigtable\Admin\V2\CreateTableFromSnapshotRequest $original_request + * The request that prompted the initiation of this CreateTableFromSnapshot + * operation. + * @type \Google\Protobuf\Timestamp $request_time + * The time at which the original request was received. + * @type \Google\Protobuf\Timestamp $finish_time + * The time at which the operation failed or was completed successfully. + * } + */ + public function __construct($data = NULL) { \GPBMetadata\Google\Bigtable\Admin\V2\BigtableTableAdmin::initOnce(); - parent::__construct(); + parent::__construct($data); } /** diff --git a/Bigtable/src/Admin/V2/CreateTableFromSnapshotRequest.php b/Bigtable/src/Admin/V2/CreateTableFromSnapshotRequest.php index 8958186bb36b..69d341ffe263 100644 --- a/Bigtable/src/Admin/V2/CreateTableFromSnapshotRequest.php +++ b/Bigtable/src/Admin/V2/CreateTableFromSnapshotRequest.php @@ -44,9 +44,28 @@ class CreateTableFromSnapshotRequest extends \Google\Protobuf\Internal\Message */ private $source_snapshot = ''; - public function __construct() { + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * The unique name of the instance in which to create the table. + * Values are of the form `projects//instances/`. + * @type string $table_id + * The name by which the new table should be referred to within the parent + * instance, e.g., `foobar` rather than `/tables/foobar`. + * @type string $source_snapshot + * 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//instances//clusters//snapshots/`. + * } + */ + public function __construct($data = NULL) { \GPBMetadata\Google\Bigtable\Admin\V2\BigtableTableAdmin::initOnce(); - parent::__construct(); + parent::__construct($data); } /** diff --git a/Bigtable/src/Admin/V2/CreateTableRequest.php b/Bigtable/src/Admin/V2/CreateTableRequest.php index a818f712902b..19c830216e36 100644 --- a/Bigtable/src/Admin/V2/CreateTableRequest.php +++ b/Bigtable/src/Admin/V2/CreateTableRequest.php @@ -56,9 +56,40 @@ class CreateTableRequest extends \Google\Protobuf\Internal\Message */ private $initial_splits; - public function __construct() { + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * The unique name of the instance in which to create the table. + * Values are of the form `projects//instances/`. + * @type string $table_id + * The name by which the new table should be referred to within the parent + * instance, e.g., `foobar` rather than `/tables/foobar`. + * @type \Google\Cloud\Bigtable\Admin\V2\Table $table + * The Table to create. + * @type \Google\Cloud\Bigtable\Admin\V2\CreateTableRequest\Split[]|\Google\Protobuf\Internal\RepeatedField $initial_splits + * 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"}.` + * } + */ + public function __construct($data = NULL) { \GPBMetadata\Google\Bigtable\Admin\V2\BigtableTableAdmin::initOnce(); - parent::__construct(); + parent::__construct($data); } /** @@ -184,12 +215,12 @@ public function getInitialSplits() * - Tablet 5 `[other, ) => {"other", "zz"}.` * * Generated from protobuf field repeated .google.bigtable.admin.v2.CreateTableRequest.Split initial_splits = 4; - * @param \Google\Cloud\Bigtable\Admin\V2\CreateTableRequest_Split[]|\Google\Protobuf\Internal\RepeatedField $var + * @param \Google\Cloud\Bigtable\Admin\V2\CreateTableRequest\Split[]|\Google\Protobuf\Internal\RepeatedField $var * @return $this */ public function setInitialSplits($var) { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Bigtable\Admin\V2\CreateTableRequest_Split::class); + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Bigtable\Admin\V2\CreateTableRequest\Split::class); $this->initial_splits = $arr; return $this; diff --git a/Bigtable/src/Admin/V2/CreateTableRequest/Split.php b/Bigtable/src/Admin/V2/CreateTableRequest/Split.php new file mode 100644 index 000000000000..42f28883717d --- /dev/null +++ b/Bigtable/src/Admin/V2/CreateTableRequest/Split.php @@ -0,0 +1,70 @@ +google.bigtable.admin.v2.CreateTableRequest.Split + */ +class Split extends \Google\Protobuf\Internal\Message +{ + /** + * Row key to use as an initial tablet boundary. + * + * Generated from protobuf field bytes key = 1; + */ + private $key = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $key + * Row key to use as an initial tablet boundary. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\BigtableTableAdmin::initOnce(); + parent::__construct($data); + } + + /** + * Row key to use as an initial tablet boundary. + * + * Generated from protobuf field bytes key = 1; + * @return string + */ + public function getKey() + { + return $this->key; + } + + /** + * Row key to use as an initial tablet boundary. + * + * Generated from protobuf field bytes key = 1; + * @param string $var + * @return $this + */ + public function setKey($var) + { + GPBUtil::checkString($var, False); + $this->key = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Split::class, \Google\Cloud\Bigtable\Admin\V2\CreateTableRequest_Split::class); + diff --git a/Bigtable/src/Admin/V2/CreateTableRequest_Split.php b/Bigtable/src/Admin/V2/CreateTableRequest_Split.php index d499a11cd267..c74f8496363f 100644 --- a/Bigtable/src/Admin/V2/CreateTableRequest_Split.php +++ b/Bigtable/src/Admin/V2/CreateTableRequest_Split.php @@ -4,54 +4,13 @@ namespace Google\Cloud\Bigtable\Admin\V2; -use Google\Protobuf\Internal\GPBType; -use Google\Protobuf\Internal\RepeatedField; -use Google\Protobuf\Internal\GPBUtil; - -/** - * An initial split point for a newly created table. - * - * Generated from protobuf message google.bigtable.admin.v2.CreateTableRequest.Split - */ -class CreateTableRequest_Split extends \Google\Protobuf\Internal\Message -{ - /** - * Row key to use as an initial tablet boundary. - * - * Generated from protobuf field bytes key = 1; - */ - private $key = ''; - - public function __construct() { - \GPBMetadata\Google\Bigtable\Admin\V2\BigtableTableAdmin::initOnce(); - parent::__construct(); - } - +if (false) { /** - * Row key to use as an initial tablet boundary. - * - * Generated from protobuf field bytes key = 1; - * @return string + * This class is deprecated. Use Google\Cloud\Bigtable\Admin\V2\CreateTableRequest\Split instead. + * @deprecated */ - public function getKey() - { - return $this->key; - } - - /** - * Row key to use as an initial tablet boundary. - * - * Generated from protobuf field bytes key = 1; - * @param string $var - * @return $this - */ - public function setKey($var) - { - GPBUtil::checkString($var, False); - $this->key = $var; - - return $this; - } - + class CreateTableRequest_Split {} } +class_exists(CreateTableRequest\Split::class); +@trigger_error('Google\Cloud\Bigtable\Admin\V2\CreateTableRequest_Split is deprecated and will be removed in the next major release. Use Google\Cloud\Bigtable\Admin\V2\CreateTableRequest\Split instead', E_USER_DEPRECATED); diff --git a/Bigtable/src/Admin/V2/DeleteAppProfileRequest.php b/Bigtable/src/Admin/V2/DeleteAppProfileRequest.php index 4758563b8848..7742ad6b89e3 100644 --- a/Bigtable/src/Admin/V2/DeleteAppProfileRequest.php +++ b/Bigtable/src/Admin/V2/DeleteAppProfileRequest.php @@ -29,9 +29,22 @@ class DeleteAppProfileRequest extends \Google\Protobuf\Internal\Message */ private $ignore_warnings = false; - public function __construct() { + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The unique name of the app profile to be deleted. Values are of the form + * `projects//instances//appProfiles/`. + * @type bool $ignore_warnings + * If true, ignore safety checks when deleting the app profile. + * } + */ + public function __construct($data = NULL) { \GPBMetadata\Google\Bigtable\Admin\V2\BigtableInstanceAdmin::initOnce(); - parent::__construct(); + parent::__construct($data); } /** diff --git a/Bigtable/src/Admin/V2/DeleteClusterRequest.php b/Bigtable/src/Admin/V2/DeleteClusterRequest.php index 7201e2ed5bf9..7fce94b36069 100644 --- a/Bigtable/src/Admin/V2/DeleteClusterRequest.php +++ b/Bigtable/src/Admin/V2/DeleteClusterRequest.php @@ -23,9 +23,20 @@ class DeleteClusterRequest extends \Google\Protobuf\Internal\Message */ private $name = ''; - public function __construct() { + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The unique name of the cluster to be deleted. Values are of the form + * `projects//instances//clusters/`. + * } + */ + public function __construct($data = NULL) { \GPBMetadata\Google\Bigtable\Admin\V2\BigtableInstanceAdmin::initOnce(); - parent::__construct(); + parent::__construct($data); } /** diff --git a/Bigtable/src/Admin/V2/DeleteInstanceRequest.php b/Bigtable/src/Admin/V2/DeleteInstanceRequest.php index ed2f0df385af..c8c9b03c6518 100644 --- a/Bigtable/src/Admin/V2/DeleteInstanceRequest.php +++ b/Bigtable/src/Admin/V2/DeleteInstanceRequest.php @@ -23,9 +23,20 @@ class DeleteInstanceRequest extends \Google\Protobuf\Internal\Message */ private $name = ''; - public function __construct() { + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The unique name of the instance to be deleted. + * Values are of the form `projects//instances/`. + * } + */ + public function __construct($data = NULL) { \GPBMetadata\Google\Bigtable\Admin\V2\BigtableInstanceAdmin::initOnce(); - parent::__construct(); + parent::__construct($data); } /** diff --git a/Bigtable/src/Admin/V2/DeleteSnapshotRequest.php b/Bigtable/src/Admin/V2/DeleteSnapshotRequest.php index 904da4b6f1b6..ea1c893e4e48 100644 --- a/Bigtable/src/Admin/V2/DeleteSnapshotRequest.php +++ b/Bigtable/src/Admin/V2/DeleteSnapshotRequest.php @@ -29,9 +29,21 @@ class DeleteSnapshotRequest extends \Google\Protobuf\Internal\Message */ private $name = ''; - public function __construct() { + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The unique name of the snapshot to be deleted. + * Values are of the form + * `projects//instances//clusters//snapshots/`. + * } + */ + public function __construct($data = NULL) { \GPBMetadata\Google\Bigtable\Admin\V2\BigtableTableAdmin::initOnce(); - parent::__construct(); + parent::__construct($data); } /** diff --git a/Bigtable/src/Admin/V2/DeleteTableRequest.php b/Bigtable/src/Admin/V2/DeleteTableRequest.php index 1006d5975f3d..38ef7ca5f011 100644 --- a/Bigtable/src/Admin/V2/DeleteTableRequest.php +++ b/Bigtable/src/Admin/V2/DeleteTableRequest.php @@ -25,9 +25,21 @@ class DeleteTableRequest extends \Google\Protobuf\Internal\Message */ private $name = ''; - public function __construct() { + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The unique name of the table to be deleted. + * Values are of the form + * `projects//instances//tables/
`. + * } + */ + public function __construct($data = NULL) { \GPBMetadata\Google\Bigtable\Admin\V2\BigtableTableAdmin::initOnce(); - parent::__construct(); + parent::__construct($data); } /** diff --git a/Bigtable/src/Admin/V2/DropRowRangeRequest.php b/Bigtable/src/Admin/V2/DropRowRangeRequest.php index e88cd619bba6..0cc9abaf8370 100644 --- a/Bigtable/src/Admin/V2/DropRowRangeRequest.php +++ b/Bigtable/src/Admin/V2/DropRowRangeRequest.php @@ -26,9 +26,26 @@ class DropRowRangeRequest extends \Google\Protobuf\Internal\Message private $name = ''; protected $target; - public function __construct() { + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The unique name of the table on which to drop a range of rows. + * Values are of the form + * `projects//instances//tables/
`. + * @type string $row_key_prefix + * Delete all rows that start with this row key prefix. Prefix cannot be + * zero length. + * @type bool $delete_all_data_from_table + * Delete all rows in the table. Setting this to false is a no-op. + * } + */ + public function __construct($data = NULL) { \GPBMetadata\Google\Bigtable\Admin\V2\BigtableTableAdmin::initOnce(); - parent::__construct(); + parent::__construct($data); } /** diff --git a/Bigtable/src/Admin/V2/Gapic/BigtableInstanceAdminGapicClient.php b/Bigtable/src/Admin/V2/Gapic/BigtableInstanceAdminGapicClient.php index 0e5ac81e88b5..4ac5c63dd18d 100644 --- a/Bigtable/src/Admin/V2/Gapic/BigtableInstanceAdminGapicClient.php +++ b/Bigtable/src/Admin/V2/Gapic/BigtableInstanceAdminGapicClient.php @@ -85,14 +85,17 @@ * $operationResponse = $bigtableInstanceAdminClient->createInstance($formattedParent, $instanceId, $instance, $clusters); * $operationResponse->pollUntilComplete(); * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) * } else { - * $error = $operationResponse->getError(); - * // handleError($error) + * $error = $operationResponse->getError(); + * // handleError($error) * } * - * // OR start the operation, keep the operation name, and resume later + * + * // Alternatively: + * + * // start the operation, keep the operation name, and resume later * $operationResponse = $bigtableInstanceAdminClient->createInstance($formattedParent, $instanceId, $instance, $clusters); * $operationName = $operationResponse->getName(); * // ... do other work @@ -490,14 +493,17 @@ public function __construct(array $options = []) * $operationResponse = $bigtableInstanceAdminClient->createInstance($formattedParent, $instanceId, $instance, $clusters); * $operationResponse->pollUntilComplete(); * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) * } else { - * $error = $operationResponse->getError(); - * // handleError($error) + * $error = $operationResponse->getError(); + * // handleError($error) * } * - * // OR start the operation, keep the operation name, and resume later + * + * // Alternatively: + * + * // start the operation, keep the operation name, and resume later * $operationResponse = $bigtableInstanceAdminClient->createInstance($formattedParent, $instanceId, $instance, $clusters); * $operationName = $operationResponse->getName(); * // ... do other work @@ -768,14 +774,17 @@ public function updateInstance($name, $displayName, $type, $labels, array $optio * $operationResponse = $bigtableInstanceAdminClient->partialUpdateInstance($instance, $updateMask); * $operationResponse->pollUntilComplete(); * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) * } else { - * $error = $operationResponse->getError(); - * // handleError($error) + * $error = $operationResponse->getError(); + * // handleError($error) * } * - * // OR start the operation, keep the operation name, and resume later + * + * // Alternatively: + * + * // start the operation, keep the operation name, and resume later * $operationResponse = $bigtableInstanceAdminClient->partialUpdateInstance($instance, $updateMask); * $operationName = $operationResponse->getName(); * // ... do other work @@ -897,14 +906,17 @@ public function deleteInstance($name, array $optionalArgs = []) * $operationResponse = $bigtableInstanceAdminClient->createCluster($formattedParent, $clusterId, $cluster); * $operationResponse->pollUntilComplete(); * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) * } else { - * $error = $operationResponse->getError(); - * // handleError($error) + * $error = $operationResponse->getError(); + * // handleError($error) * } * - * // OR start the operation, keep the operation name, and resume later + * + * // Alternatively: + * + * // start the operation, keep the operation name, and resume later * $operationResponse = $bigtableInstanceAdminClient->createCluster($formattedParent, $clusterId, $cluster); * $operationName = $operationResponse->getName(); * // ... do other work @@ -1087,20 +1099,22 @@ public function listClusters($parent, array $optionalArgs = []) * $bigtableInstanceAdminClient = new BigtableInstanceAdminClient(); * try { * $formattedName = $bigtableInstanceAdminClient->clusterName('[PROJECT]', '[INSTANCE]', '[CLUSTER]'); - * $location = ''; * $serveNodes = 0; - * $operationResponse = $bigtableInstanceAdminClient->updateCluster($formattedName, $location, $serveNodes); + * $operationResponse = $bigtableInstanceAdminClient->updateCluster($formattedName, $serveNodes); * $operationResponse->pollUntilComplete(); * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) * } else { - * $error = $operationResponse->getError(); - * // handleError($error) + * $error = $operationResponse->getError(); + * // handleError($error) * } * - * // OR start the operation, keep the operation name, and resume later - * $operationResponse = $bigtableInstanceAdminClient->updateCluster($formattedName, $location, $serveNodes); + * + * // Alternatively: + * + * // start the operation, keep the operation name, and resume later + * $operationResponse = $bigtableInstanceAdminClient->updateCluster($formattedName, $serveNodes); * $operationName = $operationResponse->getName(); * // ... do other work * $newOperationResponse = $bigtableInstanceAdminClient->resumeOperation($operationName, 'updateCluster'); @@ -1123,16 +1137,17 @@ public function listClusters($parent, array $optionalArgs = []) * @param string $name (`OutputOnly`) * The unique name of the cluster. Values are of the form * `projects//instances//clusters/[a-z][-a-z0-9]*`. - * @param string $location (`CreationOnly`) - * 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//locations/`. * @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 + * (`CreationOnly`) + * 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//locations/`. * @type int $state * (`OutputOnly`) * The current state of the cluster. @@ -1154,12 +1169,14 @@ public function listClusters($parent, array $optionalArgs = []) * @throws ApiException if the remote call fails * @experimental */ - public function updateCluster($name, $location, $serveNodes, array $optionalArgs = []) + public function updateCluster($name, $serveNodes, array $optionalArgs = []) { $request = new Cluster(); $request->setName($name); - $request->setLocation($location); $request->setServeNodes($serveNodes); + if (isset($optionalArgs['location'])) { + $request->setLocation($optionalArgs['location']); + } if (isset($optionalArgs['state'])) { $request->setState($optionalArgs['state']); } @@ -1356,19 +1373,22 @@ public function getAppProfile($name, array $optionalArgs = []) * $bigtableInstanceAdminClient = new BigtableInstanceAdminClient(); * try { * $formattedParent = $bigtableInstanceAdminClient->instanceName('[PROJECT]', '[INSTANCE]'); - * // Iterate through all elements - * $pagedResponse = $bigtableInstanceAdminClient->listAppProfiles($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * - * // OR iterate over pages of elements + * // 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(); * } @@ -1432,14 +1452,17 @@ public function listAppProfiles($parent, array $optionalArgs = []) * $operationResponse = $bigtableInstanceAdminClient->updateAppProfile($appProfile, $updateMask); * $operationResponse->pollUntilComplete(); * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) * } else { - * $error = $operationResponse->getError(); - * // handleError($error) + * $error = $operationResponse->getError(); + * // handleError($error) * } * - * // OR start the operation, keep the operation name, and resume later + * + * // Alternatively: + * + * // start the operation, keep the operation name, and resume later * $operationResponse = $bigtableInstanceAdminClient->updateAppProfile($appProfile, $updateMask); * $operationName = $operationResponse->getName(); * // ... do other work diff --git a/Bigtable/src/Admin/V2/Gapic/BigtableTableAdminGapicClient.php b/Bigtable/src/Admin/V2/Gapic/BigtableTableAdminGapicClient.php index 9313b8f8ad25..434462028fac 100644 --- a/Bigtable/src/Admin/V2/Gapic/BigtableTableAdminGapicClient.php +++ b/Bigtable/src/Admin/V2/Gapic/BigtableTableAdminGapicClient.php @@ -523,14 +523,17 @@ public function createTable($parent, $tableId, $table, array $optionalArgs = []) * $operationResponse = $bigtableTableAdminClient->createTableFromSnapshot($formattedParent, $tableId, $sourceSnapshot); * $operationResponse->pollUntilComplete(); * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) * } else { - * $error = $operationResponse->getError(); - * // handleError($error) + * $error = $operationResponse->getError(); + * // handleError($error) * } * - * // OR start the operation, keep the operation name, and resume later + * + * // Alternatively: + * + * // start the operation, keep the operation name, and resume later * $operationResponse = $bigtableTableAdminClient->createTableFromSnapshot($formattedParent, $tableId, $sourceSnapshot); * $operationName = $operationResponse->getName(); * // ... do other work @@ -604,19 +607,22 @@ public function createTableFromSnapshot($parent, $tableId, $sourceSnapshot, arra * $bigtableTableAdminClient = new BigtableTableAdminClient(); * try { * $formattedParent = $bigtableTableAdminClient->instanceName('[PROJECT]', '[INSTANCE]'); - * // Iterate through all elements - * $pagedResponse = $bigtableTableAdminClient->listTables($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * - * // OR iterate over pages of elements + * // 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(); * } @@ -1040,14 +1046,17 @@ public function checkConsistency($name, $consistencyToken, array $optionalArgs = * $operationResponse = $bigtableTableAdminClient->snapshotTable($formattedName, $cluster, $snapshotId, $description); * $operationResponse->pollUntilComplete(); * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) * } else { - * $error = $operationResponse->getError(); - * // handleError($error) + * $error = $operationResponse->getError(); + * // handleError($error) * } * - * // OR start the operation, keep the operation name, and resume later + * + * // Alternatively: + * + * // start the operation, keep the operation name, and resume later * $operationResponse = $bigtableTableAdminClient->snapshotTable($formattedName, $cluster, $snapshotId, $description); * $operationName = $operationResponse->getName(); * // ... do other work @@ -1197,19 +1206,22 @@ public function getSnapshot($name, array $optionalArgs = []) * $bigtableTableAdminClient = new BigtableTableAdminClient(); * try { * $formattedParent = $bigtableTableAdminClient->clusterName('[PROJECT]', '[INSTANCE]', '[CLUSTER]'); - * // Iterate through all elements - * $pagedResponse = $bigtableTableAdminClient->listSnapshots($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * - * // OR iterate over pages of elements + * // 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(); * } diff --git a/Bigtable/src/Admin/V2/GcRule.php b/Bigtable/src/Admin/V2/GcRule.php index 6d98e18d1d0e..0379d284a2f8 100644 --- a/Bigtable/src/Admin/V2/GcRule.php +++ b/Bigtable/src/Admin/V2/GcRule.php @@ -17,9 +17,27 @@ class GcRule extends \Google\Protobuf\Internal\Message { protected $rule; - public function __construct() { + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $max_num_versions + * Delete all cells in a column except the most recent N. + * @type \Google\Protobuf\Duration $max_age + * Delete cells in a column older than the given age. + * Values must be at least one millisecond, and will be truncated to + * microsecond granularity. + * @type \Google\Cloud\Bigtable\Admin\V2\GcRule\Intersection $intersection + * Delete cells that would be deleted by every nested rule. + * @type \Google\Cloud\Bigtable\Admin\V2\GcRule\Union $union + * Delete cells that would be deleted by any nested rule. + * } + */ + public function __construct($data = NULL) { \GPBMetadata\Google\Bigtable\Admin\V2\Table::initOnce(); - parent::__construct(); + parent::__construct($data); } /** @@ -82,7 +100,7 @@ public function setMaxAge($var) * Delete cells that would be deleted by every nested rule. * * Generated from protobuf field .google.bigtable.admin.v2.GcRule.Intersection intersection = 3; - * @return \Google\Cloud\Bigtable\Admin\V2\GcRule_Intersection + * @return \Google\Cloud\Bigtable\Admin\V2\GcRule\Intersection */ public function getIntersection() { @@ -93,7 +111,7 @@ public function getIntersection() * Delete cells that would be deleted by every nested rule. * * Generated from protobuf field .google.bigtable.admin.v2.GcRule.Intersection intersection = 3; - * @param \Google\Cloud\Bigtable\Admin\V2\GcRule_Intersection $var + * @param \Google\Cloud\Bigtable\Admin\V2\GcRule\Intersection $var * @return $this */ public function setIntersection($var) @@ -108,7 +126,7 @@ public function setIntersection($var) * Delete cells that would be deleted by any nested rule. * * Generated from protobuf field .google.bigtable.admin.v2.GcRule.Union union = 4; - * @return \Google\Cloud\Bigtable\Admin\V2\GcRule_Union + * @return \Google\Cloud\Bigtable\Admin\V2\GcRule\Union */ public function getUnion() { @@ -119,7 +137,7 @@ public function getUnion() * Delete cells that would be deleted by any nested rule. * * Generated from protobuf field .google.bigtable.admin.v2.GcRule.Union union = 4; - * @param \Google\Cloud\Bigtable\Admin\V2\GcRule_Union $var + * @param \Google\Cloud\Bigtable\Admin\V2\GcRule\Union $var * @return $this */ public function setUnion($var) diff --git a/Bigtable/src/Admin/V2/GcRule/Intersection.php b/Bigtable/src/Admin/V2/GcRule/Intersection.php new file mode 100644 index 000000000000..6997498b3eca --- /dev/null +++ b/Bigtable/src/Admin/V2/GcRule/Intersection.php @@ -0,0 +1,70 @@ +google.bigtable.admin.v2.GcRule.Intersection + */ +class Intersection extends \Google\Protobuf\Internal\Message +{ + /** + * Only delete cells which would be deleted by every element of `rules`. + * + * Generated from protobuf field repeated .google.bigtable.admin.v2.GcRule rules = 1; + */ + private $rules; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Bigtable\Admin\V2\GcRule[]|\Google\Protobuf\Internal\RepeatedField $rules + * Only delete cells which would be deleted by every element of `rules`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\Table::initOnce(); + parent::__construct($data); + } + + /** + * Only delete cells which would be deleted by every element of `rules`. + * + * Generated from protobuf field repeated .google.bigtable.admin.v2.GcRule rules = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRules() + { + return $this->rules; + } + + /** + * Only delete cells which would be deleted by every element of `rules`. + * + * Generated from protobuf field repeated .google.bigtable.admin.v2.GcRule rules = 1; + * @param \Google\Cloud\Bigtable\Admin\V2\GcRule[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRules($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Bigtable\Admin\V2\GcRule::class); + $this->rules = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Intersection::class, \Google\Cloud\Bigtable\Admin\V2\GcRule_Intersection::class); + diff --git a/Bigtable/src/Admin/V2/GcRule/Union.php b/Bigtable/src/Admin/V2/GcRule/Union.php new file mode 100644 index 000000000000..72abed8943b1 --- /dev/null +++ b/Bigtable/src/Admin/V2/GcRule/Union.php @@ -0,0 +1,70 @@ +google.bigtable.admin.v2.GcRule.Union + */ +class Union extends \Google\Protobuf\Internal\Message +{ + /** + * Delete cells which would be deleted by any element of `rules`. + * + * Generated from protobuf field repeated .google.bigtable.admin.v2.GcRule rules = 1; + */ + private $rules; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Bigtable\Admin\V2\GcRule[]|\Google\Protobuf\Internal\RepeatedField $rules + * Delete cells which would be deleted by any element of `rules`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\Table::initOnce(); + parent::__construct($data); + } + + /** + * Delete cells which would be deleted by any element of `rules`. + * + * Generated from protobuf field repeated .google.bigtable.admin.v2.GcRule rules = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRules() + { + return $this->rules; + } + + /** + * Delete cells which would be deleted by any element of `rules`. + * + * Generated from protobuf field repeated .google.bigtable.admin.v2.GcRule rules = 1; + * @param \Google\Cloud\Bigtable\Admin\V2\GcRule[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRules($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Bigtable\Admin\V2\GcRule::class); + $this->rules = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Union::class, \Google\Cloud\Bigtable\Admin\V2\GcRule_Union::class); + diff --git a/Bigtable/src/Admin/V2/GcRule_Intersection.php b/Bigtable/src/Admin/V2/GcRule_Intersection.php index 80bc315e50d8..8c207f194674 100644 --- a/Bigtable/src/Admin/V2/GcRule_Intersection.php +++ b/Bigtable/src/Admin/V2/GcRule_Intersection.php @@ -4,54 +4,13 @@ namespace Google\Cloud\Bigtable\Admin\V2; -use Google\Protobuf\Internal\GPBType; -use Google\Protobuf\Internal\RepeatedField; -use Google\Protobuf\Internal\GPBUtil; - -/** - * A GcRule which deletes cells matching all of the given rules. - * - * Generated from protobuf message google.bigtable.admin.v2.GcRule.Intersection - */ -class GcRule_Intersection extends \Google\Protobuf\Internal\Message -{ - /** - * Only delete cells which would be deleted by every element of `rules`. - * - * Generated from protobuf field repeated .google.bigtable.admin.v2.GcRule rules = 1; - */ - private $rules; - - public function __construct() { - \GPBMetadata\Google\Bigtable\Admin\V2\Table::initOnce(); - parent::__construct(); - } - +if (false) { /** - * Only delete cells which would be deleted by every element of `rules`. - * - * Generated from protobuf field repeated .google.bigtable.admin.v2.GcRule rules = 1; - * @return \Google\Protobuf\Internal\RepeatedField + * This class is deprecated. Use Google\Cloud\Bigtable\Admin\V2\GcRule\Intersection instead. + * @deprecated */ - public function getRules() - { - return $this->rules; - } - - /** - * Only delete cells which would be deleted by every element of `rules`. - * - * Generated from protobuf field repeated .google.bigtable.admin.v2.GcRule rules = 1; - * @param \Google\Cloud\Bigtable\Admin\V2\GcRule[]|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setRules($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Bigtable\Admin\V2\GcRule::class); - $this->rules = $arr; - - return $this; - } - + class GcRule_Intersection {} } +class_exists(GcRule\Intersection::class); +@trigger_error('Google\Cloud\Bigtable\Admin\V2\GcRule_Intersection is deprecated and will be removed in the next major release. Use Google\Cloud\Bigtable\Admin\V2\GcRule\Intersection instead', E_USER_DEPRECATED); diff --git a/Bigtable/src/Admin/V2/GcRule_Union.php b/Bigtable/src/Admin/V2/GcRule_Union.php index 210baa30ff2c..1ce1a363f9a5 100644 --- a/Bigtable/src/Admin/V2/GcRule_Union.php +++ b/Bigtable/src/Admin/V2/GcRule_Union.php @@ -4,54 +4,13 @@ namespace Google\Cloud\Bigtable\Admin\V2; -use Google\Protobuf\Internal\GPBType; -use Google\Protobuf\Internal\RepeatedField; -use Google\Protobuf\Internal\GPBUtil; - -/** - * A GcRule which deletes cells matching any of the given rules. - * - * Generated from protobuf message google.bigtable.admin.v2.GcRule.Union - */ -class GcRule_Union extends \Google\Protobuf\Internal\Message -{ - /** - * Delete cells which would be deleted by any element of `rules`. - * - * Generated from protobuf field repeated .google.bigtable.admin.v2.GcRule rules = 1; - */ - private $rules; - - public function __construct() { - \GPBMetadata\Google\Bigtable\Admin\V2\Table::initOnce(); - parent::__construct(); - } - +if (false) { /** - * Delete cells which would be deleted by any element of `rules`. - * - * Generated from protobuf field repeated .google.bigtable.admin.v2.GcRule rules = 1; - * @return \Google\Protobuf\Internal\RepeatedField + * This class is deprecated. Use Google\Cloud\Bigtable\Admin\V2\GcRule\Union instead. + * @deprecated */ - public function getRules() - { - return $this->rules; - } - - /** - * Delete cells which would be deleted by any element of `rules`. - * - * Generated from protobuf field repeated .google.bigtable.admin.v2.GcRule rules = 1; - * @param \Google\Cloud\Bigtable\Admin\V2\GcRule[]|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setRules($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Bigtable\Admin\V2\GcRule::class); - $this->rules = $arr; - - return $this; - } - + class GcRule_Union {} } +class_exists(GcRule\Union::class); +@trigger_error('Google\Cloud\Bigtable\Admin\V2\GcRule_Union is deprecated and will be removed in the next major release. Use Google\Cloud\Bigtable\Admin\V2\GcRule\Union instead', E_USER_DEPRECATED); diff --git a/Bigtable/src/Admin/V2/GenerateConsistencyTokenRequest.php b/Bigtable/src/Admin/V2/GenerateConsistencyTokenRequest.php index c4e158e8d899..6c2cdf439df4 100644 --- a/Bigtable/src/Admin/V2/GenerateConsistencyTokenRequest.php +++ b/Bigtable/src/Admin/V2/GenerateConsistencyTokenRequest.php @@ -25,9 +25,21 @@ class GenerateConsistencyTokenRequest extends \Google\Protobuf\Internal\Message */ private $name = ''; - public function __construct() { + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The unique name of the Table for which to create a consistency token. + * Values are of the form + * `projects//instances//tables/
`. + * } + */ + public function __construct($data = NULL) { \GPBMetadata\Google\Bigtable\Admin\V2\BigtableTableAdmin::initOnce(); - parent::__construct(); + parent::__construct($data); } /** diff --git a/Bigtable/src/Admin/V2/GenerateConsistencyTokenResponse.php b/Bigtable/src/Admin/V2/GenerateConsistencyTokenResponse.php index 354f82ae6c2d..54c768b2ce61 100644 --- a/Bigtable/src/Admin/V2/GenerateConsistencyTokenResponse.php +++ b/Bigtable/src/Admin/V2/GenerateConsistencyTokenResponse.php @@ -23,9 +23,19 @@ class GenerateConsistencyTokenResponse extends \Google\Protobuf\Internal\Message */ private $consistency_token = ''; - public function __construct() { + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $consistency_token + * The generated consistency token. + * } + */ + public function __construct($data = NULL) { \GPBMetadata\Google\Bigtable\Admin\V2\BigtableTableAdmin::initOnce(); - parent::__construct(); + parent::__construct($data); } /** diff --git a/Bigtable/src/Admin/V2/GetAppProfileRequest.php b/Bigtable/src/Admin/V2/GetAppProfileRequest.php index 94c6f2a80d93..d7597b7345b4 100644 --- a/Bigtable/src/Admin/V2/GetAppProfileRequest.php +++ b/Bigtable/src/Admin/V2/GetAppProfileRequest.php @@ -23,9 +23,20 @@ class GetAppProfileRequest extends \Google\Protobuf\Internal\Message */ private $name = ''; - public function __construct() { + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The unique name of the requested app profile. Values are of the form + * `projects//instances//appProfiles/`. + * } + */ + public function __construct($data = NULL) { \GPBMetadata\Google\Bigtable\Admin\V2\BigtableInstanceAdmin::initOnce(); - parent::__construct(); + parent::__construct($data); } /** diff --git a/Bigtable/src/Admin/V2/GetClusterRequest.php b/Bigtable/src/Admin/V2/GetClusterRequest.php index 5d29bf5fe071..4f2448cda20d 100644 --- a/Bigtable/src/Admin/V2/GetClusterRequest.php +++ b/Bigtable/src/Admin/V2/GetClusterRequest.php @@ -23,9 +23,20 @@ class GetClusterRequest extends \Google\Protobuf\Internal\Message */ private $name = ''; - public function __construct() { + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The unique name of the requested cluster. Values are of the form + * `projects//instances//clusters/`. + * } + */ + public function __construct($data = NULL) { \GPBMetadata\Google\Bigtable\Admin\V2\BigtableInstanceAdmin::initOnce(); - parent::__construct(); + parent::__construct($data); } /** diff --git a/Bigtable/src/Admin/V2/GetInstanceRequest.php b/Bigtable/src/Admin/V2/GetInstanceRequest.php index 346fb5c53253..b7e9efdcefb0 100644 --- a/Bigtable/src/Admin/V2/GetInstanceRequest.php +++ b/Bigtable/src/Admin/V2/GetInstanceRequest.php @@ -23,9 +23,20 @@ class GetInstanceRequest extends \Google\Protobuf\Internal\Message */ private $name = ''; - public function __construct() { + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The unique name of the requested instance. Values are of the form + * `projects//instances/`. + * } + */ + public function __construct($data = NULL) { \GPBMetadata\Google\Bigtable\Admin\V2\BigtableInstanceAdmin::initOnce(); - parent::__construct(); + parent::__construct($data); } /** diff --git a/Bigtable/src/Admin/V2/GetSnapshotRequest.php b/Bigtable/src/Admin/V2/GetSnapshotRequest.php index cec94218cafa..9d2883a218b2 100644 --- a/Bigtable/src/Admin/V2/GetSnapshotRequest.php +++ b/Bigtable/src/Admin/V2/GetSnapshotRequest.php @@ -29,9 +29,21 @@ class GetSnapshotRequest extends \Google\Protobuf\Internal\Message */ private $name = ''; - public function __construct() { + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The unique name of the requested snapshot. + * Values are of the form + * `projects//instances//clusters//snapshots/`. + * } + */ + public function __construct($data = NULL) { \GPBMetadata\Google\Bigtable\Admin\V2\BigtableTableAdmin::initOnce(); - parent::__construct(); + parent::__construct($data); } /** diff --git a/Bigtable/src/Admin/V2/GetTableRequest.php b/Bigtable/src/Admin/V2/GetTableRequest.php index 3d819e4af6f5..02c3b6398142 100644 --- a/Bigtable/src/Admin/V2/GetTableRequest.php +++ b/Bigtable/src/Admin/V2/GetTableRequest.php @@ -32,9 +32,24 @@ class GetTableRequest extends \Google\Protobuf\Internal\Message */ private $view = 0; - public function __construct() { + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The unique name of the requested table. + * Values are of the form + * `projects//instances//tables/
`. + * @type int $view + * The view to be applied to the returned table's fields. + * Defaults to `SCHEMA_VIEW` if unspecified. + * } + */ + public function __construct($data = NULL) { \GPBMetadata\Google\Bigtable\Admin\V2\BigtableTableAdmin::initOnce(); - parent::__construct(); + parent::__construct($data); } /** diff --git a/Bigtable/src/Admin/V2/Instance.php b/Bigtable/src/Admin/V2/Instance.php index c6ac8b7c15d4..321b2f33f7dd 100644 --- a/Bigtable/src/Admin/V2/Instance.php +++ b/Bigtable/src/Admin/V2/Instance.php @@ -63,9 +63,41 @@ class Instance extends \Google\Protobuf\Internal\Message */ private $labels; - public function __construct() { + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * (`OutputOnly`) + * The unique name of the instance. Values are of the form + * `projects//instances/[a-z][a-z0-9\\-]+[a-z0-9]`. + * @type string $display_name + * 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. + * @type int $state + * (`OutputOnly`) + * The current state of the instance. + * @type int $type + * The type of the instance. Defaults to `PRODUCTION`. + * @type array|\Google\Protobuf\Internal\MapField $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. + * } + */ + public function __construct($data = NULL) { \GPBMetadata\Google\Bigtable\Admin\V2\Instance::initOnce(); - parent::__construct(); + parent::__construct($data); } /** diff --git a/Bigtable/src/Admin/V2/Instance/State.php b/Bigtable/src/Admin/V2/Instance/State.php new file mode 100644 index 000000000000..15a9e0f47cec --- /dev/null +++ b/Bigtable/src/Admin/V2/Instance/State.php @@ -0,0 +1,38 @@ +google.bigtable.admin.v2.Instance.State + */ +class State +{ + /** + * The state of the instance could not be determined. + * + * Generated from protobuf enum STATE_NOT_KNOWN = 0; + */ + const STATE_NOT_KNOWN = 0; + /** + * The instance has been successfully created and can serve requests + * to its tables. + * + * Generated from protobuf enum READY = 1; + */ + const READY = 1; + /** + * The instance is currently being created, and may be destroyed + * if the creation process encounters an error. + * + * Generated from protobuf enum CREATING = 2; + */ + const CREATING = 2; +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(State::class, \Google\Cloud\Bigtable\Admin\V2\Instance_State::class); + diff --git a/Bigtable/src/Admin/V2/Instance/Type.php b/Bigtable/src/Admin/V2/Instance/Type.php new file mode 100644 index 000000000000..7e327c9617d6 --- /dev/null +++ b/Bigtable/src/Admin/V2/Instance/Type.php @@ -0,0 +1,45 @@ +google.bigtable.admin.v2.Instance.Type + */ +class Type +{ + /** + * The type of the instance is unspecified. If set when creating an + * instance, a `PRODUCTION` instance will be created. If set when updating + * an instance, the type will be left unchanged. + * + * Generated from protobuf enum TYPE_UNSPECIFIED = 0; + */ + const TYPE_UNSPECIFIED = 0; + /** + * An instance meant for production use. `serve_nodes` must be set + * on the cluster. + * + * Generated from protobuf enum PRODUCTION = 1; + */ + const PRODUCTION = 1; + /** + * The instance is meant for development and testing purposes only; it has + * no performance or uptime guarantees and is not covered by SLA. + * After a development instance is created, it can be upgraded by + * updating the instance to type `PRODUCTION`. An instance created + * as a production instance cannot be changed to a development instance. + * When creating a development instance, `serve_nodes` on the cluster must + * not be set. + * + * Generated from protobuf enum DEVELOPMENT = 2; + */ + const DEVELOPMENT = 2; +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Type::class, \Google\Cloud\Bigtable\Admin\V2\Instance_Type::class); + diff --git a/Bigtable/src/Admin/V2/Instance_State.php b/Bigtable/src/Admin/V2/Instance_State.php index 449e3b19e727..859a38d93cdd 100644 --- a/Bigtable/src/Admin/V2/Instance_State.php +++ b/Bigtable/src/Admin/V2/Instance_State.php @@ -4,32 +4,13 @@ namespace Google\Cloud\Bigtable\Admin\V2; -/** - * Possible states of an instance. - * - * Protobuf enum Google\Bigtable\Admin\V2\Instance\State - */ -class Instance_State -{ +if (false) { /** - * The state of the instance could not be determined. - * - * Generated from protobuf enum STATE_NOT_KNOWN = 0; + * This class is deprecated. Use Google\Cloud\Bigtable\Admin\V2\Instance\State instead. + * @deprecated */ - const STATE_NOT_KNOWN = 0; - /** - * The instance has been successfully created and can serve requests - * to its tables. - * - * Generated from protobuf enum READY = 1; - */ - const READY = 1; - /** - * The instance is currently being created, and may be destroyed - * if the creation process encounters an error. - * - * Generated from protobuf enum CREATING = 2; - */ - const CREATING = 2; + class Instance_State {} } +class_exists(Instance\State::class); +@trigger_error('Google\Cloud\Bigtable\Admin\V2\Instance_State is deprecated and will be removed in the next major release. Use Google\Cloud\Bigtable\Admin\V2\Instance\State instead', E_USER_DEPRECATED); diff --git a/Bigtable/src/Admin/V2/Instance_Type.php b/Bigtable/src/Admin/V2/Instance_Type.php index 7a42f4d395df..5ed92e809b5c 100644 --- a/Bigtable/src/Admin/V2/Instance_Type.php +++ b/Bigtable/src/Admin/V2/Instance_Type.php @@ -4,39 +4,13 @@ namespace Google\Cloud\Bigtable\Admin\V2; -/** - * The type of the instance. - * - * Protobuf enum Google\Bigtable\Admin\V2\Instance\Type - */ -class Instance_Type -{ +if (false) { /** - * The type of the instance is unspecified. If set when creating an - * instance, a `PRODUCTION` instance will be created. If set when updating - * an instance, the type will be left unchanged. - * - * Generated from protobuf enum TYPE_UNSPECIFIED = 0; + * This class is deprecated. Use Google\Cloud\Bigtable\Admin\V2\Instance\Type instead. + * @deprecated */ - const TYPE_UNSPECIFIED = 0; - /** - * An instance meant for production use. `serve_nodes` must be set - * on the cluster. - * - * Generated from protobuf enum PRODUCTION = 1; - */ - const PRODUCTION = 1; - /** - * The instance is meant for development and testing purposes only; it has - * no performance or uptime guarantees and is not covered by SLA. - * After a development instance is created, it can be upgraded by - * updating the instance to type `PRODUCTION`. An instance created - * as a production instance cannot be changed to a development instance. - * When creating a development instance, `serve_nodes` on the cluster must - * not be set. - * - * Generated from protobuf enum DEVELOPMENT = 2; - */ - const DEVELOPMENT = 2; + class Instance_Type {} } +class_exists(Instance\Type::class); +@trigger_error('Google\Cloud\Bigtable\Admin\V2\Instance_Type is deprecated and will be removed in the next major release. Use Google\Cloud\Bigtable\Admin\V2\Instance\Type instead', E_USER_DEPRECATED); diff --git a/Bigtable/src/Admin/V2/ListAppProfilesRequest.php b/Bigtable/src/Admin/V2/ListAppProfilesRequest.php index a74dbceb260d..e92eba6efdd1 100644 --- a/Bigtable/src/Admin/V2/ListAppProfilesRequest.php +++ b/Bigtable/src/Admin/V2/ListAppProfilesRequest.php @@ -30,9 +30,23 @@ class ListAppProfilesRequest extends \Google\Protobuf\Internal\Message */ private $page_token = ''; - public function __construct() { + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * The unique name of the instance for which a list of app profiles is + * requested. Values are of the form + * `projects//instances/`. + * @type string $page_token + * The value of `next_page_token` returned by a previous call. + * } + */ + public function __construct($data = NULL) { \GPBMetadata\Google\Bigtable\Admin\V2\BigtableInstanceAdmin::initOnce(); - parent::__construct(); + parent::__construct($data); } /** diff --git a/Bigtable/src/Admin/V2/ListAppProfilesResponse.php b/Bigtable/src/Admin/V2/ListAppProfilesResponse.php index 3ccade0cd6f7..1ea1abbe291b 100644 --- a/Bigtable/src/Admin/V2/ListAppProfilesResponse.php +++ b/Bigtable/src/Admin/V2/ListAppProfilesResponse.php @@ -30,9 +30,23 @@ class ListAppProfilesResponse extends \Google\Protobuf\Internal\Message */ private $next_page_token = ''; - public function __construct() { + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Bigtable\Admin\V2\AppProfile[]|\Google\Protobuf\Internal\RepeatedField $app_profiles + * The list of requested app profiles. + * @type string $next_page_token + * Set if not all app profiles could be returned in a single response. + * Pass this value to `page_token` in another request to get the next + * page of results. + * } + */ + public function __construct($data = NULL) { \GPBMetadata\Google\Bigtable\Admin\V2\BigtableInstanceAdmin::initOnce(); - parent::__construct(); + parent::__construct($data); } /** diff --git a/Bigtable/src/Admin/V2/ListClustersRequest.php b/Bigtable/src/Admin/V2/ListClustersRequest.php index 1c0d2c3cd8ca..9d381a13ca42 100644 --- a/Bigtable/src/Admin/V2/ListClustersRequest.php +++ b/Bigtable/src/Admin/V2/ListClustersRequest.php @@ -31,9 +31,24 @@ class ListClustersRequest extends \Google\Protobuf\Internal\Message */ private $page_token = ''; - public function __construct() { + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * The unique name of the instance for which a list of clusters is requested. + * Values are of the form `projects//instances/`. + * Use ` = '-'` to list Clusters for all Instances in a project, + * e.g., `projects/myproject/instances/-`. + * @type string $page_token + * The value of `next_page_token` returned by a previous call. + * } + */ + public function __construct($data = NULL) { \GPBMetadata\Google\Bigtable\Admin\V2\BigtableInstanceAdmin::initOnce(); - parent::__construct(); + parent::__construct($data); } /** diff --git a/Bigtable/src/Admin/V2/ListClustersResponse.php b/Bigtable/src/Admin/V2/ListClustersResponse.php index e891585cd2c2..a1263905d5b9 100644 --- a/Bigtable/src/Admin/V2/ListClustersResponse.php +++ b/Bigtable/src/Admin/V2/ListClustersResponse.php @@ -39,9 +39,28 @@ class ListClustersResponse extends \Google\Protobuf\Internal\Message */ private $next_page_token = ''; - public function __construct() { + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Bigtable\Admin\V2\Cluster[]|\Google\Protobuf\Internal\RepeatedField $clusters + * The list of requested clusters. + * @type string[]|\Google\Protobuf\Internal\RepeatedField $failed_locations + * Locations from which Cluster information could not be retrieved, + * due to an outage or some other transient condition. + * Clusters from these locations may be missing from `clusters`, + * or may only have partial information returned. + * @type string $next_page_token + * Set if not all clusters could be returned in a single response. + * Pass this value to `page_token` in another request to get the next + * page of results. + * } + */ + public function __construct($data = NULL) { \GPBMetadata\Google\Bigtable\Admin\V2\BigtableInstanceAdmin::initOnce(); - parent::__construct(); + parent::__construct($data); } /** diff --git a/Bigtable/src/Admin/V2/ListInstancesRequest.php b/Bigtable/src/Admin/V2/ListInstancesRequest.php index a81bfde85c82..09398109fd6c 100644 --- a/Bigtable/src/Admin/V2/ListInstancesRequest.php +++ b/Bigtable/src/Admin/V2/ListInstancesRequest.php @@ -29,9 +29,22 @@ class ListInstancesRequest extends \Google\Protobuf\Internal\Message */ private $page_token = ''; - public function __construct() { + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * The unique name of the project for which a list of instances is requested. + * Values are of the form `projects/`. + * @type string $page_token + * The value of `next_page_token` returned by a previous call. + * } + */ + public function __construct($data = NULL) { \GPBMetadata\Google\Bigtable\Admin\V2\BigtableInstanceAdmin::initOnce(); - parent::__construct(); + parent::__construct($data); } /** diff --git a/Bigtable/src/Admin/V2/ListInstancesResponse.php b/Bigtable/src/Admin/V2/ListInstancesResponse.php index 9f82287c0973..a65599a68249 100644 --- a/Bigtable/src/Admin/V2/ListInstancesResponse.php +++ b/Bigtable/src/Admin/V2/ListInstancesResponse.php @@ -40,9 +40,29 @@ class ListInstancesResponse extends \Google\Protobuf\Internal\Message */ private $next_page_token = ''; - public function __construct() { + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Bigtable\Admin\V2\Instance[]|\Google\Protobuf\Internal\RepeatedField $instances + * The list of requested instances. + * @type string[]|\Google\Protobuf\Internal\RepeatedField $failed_locations + * Locations from which Instance information could not be retrieved, + * due to an outage or some other transient condition. + * Instances whose Clusters are all in one of the failed locations + * may be missing from `instances`, and Instances with at least one + * Cluster in a failed location may only have partial information returned. + * @type string $next_page_token + * Set if not all instances could be returned in a single response. + * Pass this value to `page_token` in another request to get the next + * page of results. + * } + */ + public function __construct($data = NULL) { \GPBMetadata\Google\Bigtable\Admin\V2\BigtableInstanceAdmin::initOnce(); - parent::__construct(); + parent::__construct($data); } /** diff --git a/Bigtable/src/Admin/V2/ListSnapshotsRequest.php b/Bigtable/src/Admin/V2/ListSnapshotsRequest.php index 79f5290a4aeb..fdf3cfba56c1 100644 --- a/Bigtable/src/Admin/V2/ListSnapshotsRequest.php +++ b/Bigtable/src/Admin/V2/ListSnapshotsRequest.php @@ -43,9 +43,27 @@ class ListSnapshotsRequest extends \Google\Protobuf\Internal\Message */ private $page_token = ''; - public function __construct() { + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * The unique name of the cluster for which snapshots should be listed. + * Values are of the form + * `projects//instances//clusters/`. + * Use ` = '-'` to list snapshots for all clusters in an instance, + * e.g., `projects//instances//clusters/-`. + * @type int $page_size + * The maximum number of snapshots to return. + * @type string $page_token + * The value of `next_page_token` returned by a previous call. + * } + */ + public function __construct($data = NULL) { \GPBMetadata\Google\Bigtable\Admin\V2\BigtableTableAdmin::initOnce(); - parent::__construct(); + parent::__construct($data); } /** diff --git a/Bigtable/src/Admin/V2/ListSnapshotsResponse.php b/Bigtable/src/Admin/V2/ListSnapshotsResponse.php index 9a41a29d2b13..e212db9f2733 100644 --- a/Bigtable/src/Admin/V2/ListSnapshotsResponse.php +++ b/Bigtable/src/Admin/V2/ListSnapshotsResponse.php @@ -35,9 +35,23 @@ class ListSnapshotsResponse extends \Google\Protobuf\Internal\Message */ private $next_page_token = ''; - public function __construct() { + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Bigtable\Admin\V2\Snapshot[]|\Google\Protobuf\Internal\RepeatedField $snapshots + * The snapshots present in the requested cluster. + * @type string $next_page_token + * Set if not all snapshots could be returned in a single response. + * Pass this value to `page_token` in another request to get the next + * page of results. + * } + */ + public function __construct($data = NULL) { \GPBMetadata\Google\Bigtable\Admin\V2\BigtableTableAdmin::initOnce(); - parent::__construct(); + parent::__construct($data); } /** diff --git a/Bigtable/src/Admin/V2/ListTablesRequest.php b/Bigtable/src/Admin/V2/ListTablesRequest.php index 9855e20970db..43add11ddb9d 100644 --- a/Bigtable/src/Admin/V2/ListTablesRequest.php +++ b/Bigtable/src/Admin/V2/ListTablesRequest.php @@ -37,9 +37,25 @@ class ListTablesRequest extends \Google\Protobuf\Internal\Message */ private $page_token = ''; - public function __construct() { + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * The unique name of the instance for which tables should be listed. + * Values are of the form `projects//instances/`. + * @type int $view + * The view to be applied to the returned tables' fields. + * Defaults to `NAME_ONLY` if unspecified; no others are currently supported. + * @type string $page_token + * The value of `next_page_token` returned by a previous call. + * } + */ + public function __construct($data = NULL) { \GPBMetadata\Google\Bigtable\Admin\V2\BigtableTableAdmin::initOnce(); - parent::__construct(); + parent::__construct($data); } /** diff --git a/Bigtable/src/Admin/V2/ListTablesResponse.php b/Bigtable/src/Admin/V2/ListTablesResponse.php index 96abba1c0221..b638389536f5 100644 --- a/Bigtable/src/Admin/V2/ListTablesResponse.php +++ b/Bigtable/src/Admin/V2/ListTablesResponse.php @@ -31,9 +31,23 @@ class ListTablesResponse extends \Google\Protobuf\Internal\Message */ private $next_page_token = ''; - public function __construct() { + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Bigtable\Admin\V2\Table[]|\Google\Protobuf\Internal\RepeatedField $tables + * The tables present in the requested instance. + * @type string $next_page_token + * Set if not all tables could be returned in a single response. + * Pass this value to `page_token` in another request to get the next + * page of results. + * } + */ + public function __construct($data = NULL) { \GPBMetadata\Google\Bigtable\Admin\V2\BigtableTableAdmin::initOnce(); - parent::__construct(); + parent::__construct($data); } /** diff --git a/Bigtable/src/Admin/V2/ModifyColumnFamiliesRequest.php b/Bigtable/src/Admin/V2/ModifyColumnFamiliesRequest.php index cee36741673d..c997e738fbd2 100644 --- a/Bigtable/src/Admin/V2/ModifyColumnFamiliesRequest.php +++ b/Bigtable/src/Admin/V2/ModifyColumnFamiliesRequest.php @@ -34,9 +34,26 @@ class ModifyColumnFamiliesRequest extends \Google\Protobuf\Internal\Message */ private $modifications; - public function __construct() { + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The unique name of the table whose families should be modified. + * Values are of the form + * `projects//instances//tables/
`. + * @type \Google\Cloud\Bigtable\Admin\V2\ModifyColumnFamiliesRequest\Modification[]|\Google\Protobuf\Internal\RepeatedField $modifications + * 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). + * } + */ + public function __construct($data = NULL) { \GPBMetadata\Google\Bigtable\Admin\V2\BigtableTableAdmin::initOnce(); - parent::__construct(); + parent::__construct($data); } /** @@ -90,12 +107,12 @@ public function getModifications() * for example). * * Generated from protobuf field repeated .google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification modifications = 2; - * @param \Google\Cloud\Bigtable\Admin\V2\ModifyColumnFamiliesRequest_Modification[]|\Google\Protobuf\Internal\RepeatedField $var + * @param \Google\Cloud\Bigtable\Admin\V2\ModifyColumnFamiliesRequest\Modification[]|\Google\Protobuf\Internal\RepeatedField $var * @return $this */ public function setModifications($var) { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Bigtable\Admin\V2\ModifyColumnFamiliesRequest_Modification::class); + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Bigtable\Admin\V2\ModifyColumnFamiliesRequest\Modification::class); $this->modifications = $arr; return $this; diff --git a/Bigtable/src/Admin/V2/ModifyColumnFamiliesRequest/Modification.php b/Bigtable/src/Admin/V2/ModifyColumnFamiliesRequest/Modification.php new file mode 100644 index 000000000000..046d69b58b08 --- /dev/null +++ b/Bigtable/src/Admin/V2/ModifyColumnFamiliesRequest/Modification.php @@ -0,0 +1,172 @@ +google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification + */ +class Modification extends \Google\Protobuf\Internal\Message +{ + /** + * The ID of the column family to be modified. + * + * Generated from protobuf field string id = 1; + */ + private $id = ''; + protected $mod; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $id + * The ID of the column family to be modified. + * @type \Google\Cloud\Bigtable\Admin\V2\ColumnFamily $create + * Create a new column family with the specified schema, or fail if + * one already exists with the given ID. + * @type \Google\Cloud\Bigtable\Admin\V2\ColumnFamily $update + * Update an existing column family to the specified schema, or fail + * if no column family exists with the given ID. + * @type bool $drop + * Drop (delete) the column family with the given ID, or fail if no such + * family exists. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\BigtableTableAdmin::initOnce(); + parent::__construct($data); + } + + /** + * The ID of the column family to be modified. + * + * Generated from protobuf field string id = 1; + * @return string + */ + public function getId() + { + return $this->id; + } + + /** + * The ID of the column family to be modified. + * + * 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; + } + + /** + * Create a new column family with the specified schema, or fail if + * one already exists with the given ID. + * + * Generated from protobuf field .google.bigtable.admin.v2.ColumnFamily create = 2; + * @return \Google\Cloud\Bigtable\Admin\V2\ColumnFamily + */ + public function getCreate() + { + return $this->readOneof(2); + } + + /** + * Create a new column family with the specified schema, or fail if + * one already exists with the given ID. + * + * Generated from protobuf field .google.bigtable.admin.v2.ColumnFamily create = 2; + * @param \Google\Cloud\Bigtable\Admin\V2\ColumnFamily $var + * @return $this + */ + public function setCreate($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\Admin\V2\ColumnFamily::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Update an existing column family to the specified schema, or fail + * if no column family exists with the given ID. + * + * Generated from protobuf field .google.bigtable.admin.v2.ColumnFamily update = 3; + * @return \Google\Cloud\Bigtable\Admin\V2\ColumnFamily + */ + public function getUpdate() + { + return $this->readOneof(3); + } + + /** + * Update an existing column family to the specified schema, or fail + * if no column family exists with the given ID. + * + * Generated from protobuf field .google.bigtable.admin.v2.ColumnFamily update = 3; + * @param \Google\Cloud\Bigtable\Admin\V2\ColumnFamily $var + * @return $this + */ + public function setUpdate($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\Admin\V2\ColumnFamily::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Drop (delete) the column family with the given ID, or fail if no such + * family exists. + * + * Generated from protobuf field bool drop = 4; + * @return bool + */ + public function getDrop() + { + return $this->readOneof(4); + } + + /** + * Drop (delete) the column family with the given ID, or fail if no such + * family exists. + * + * Generated from protobuf field bool drop = 4; + * @param bool $var + * @return $this + */ + public function setDrop($var) + { + GPBUtil::checkBool($var); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * @return string + */ + public function getMod() + { + return $this->whichOneof("mod"); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Modification::class, \Google\Cloud\Bigtable\Admin\V2\ModifyColumnFamiliesRequest_Modification::class); + diff --git a/Bigtable/src/Admin/V2/ModifyColumnFamiliesRequest_Modification.php b/Bigtable/src/Admin/V2/ModifyColumnFamiliesRequest_Modification.php index 3abbefc9952e..ff3e5589863d 100644 --- a/Bigtable/src/Admin/V2/ModifyColumnFamiliesRequest_Modification.php +++ b/Bigtable/src/Admin/V2/ModifyColumnFamiliesRequest_Modification.php @@ -4,147 +4,13 @@ namespace Google\Cloud\Bigtable\Admin\V2; -use Google\Protobuf\Internal\GPBType; -use Google\Protobuf\Internal\RepeatedField; -use Google\Protobuf\Internal\GPBUtil; - -/** - * A create, update, or delete of a particular column family. - * - * Generated from protobuf message google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification - */ -class ModifyColumnFamiliesRequest_Modification extends \Google\Protobuf\Internal\Message -{ - /** - * The ID of the column family to be modified. - * - * Generated from protobuf field string id = 1; - */ - private $id = ''; - protected $mod; - - public function __construct() { - \GPBMetadata\Google\Bigtable\Admin\V2\BigtableTableAdmin::initOnce(); - parent::__construct(); - } - - /** - * The ID of the column family to be modified. - * - * Generated from protobuf field string id = 1; - * @return string - */ - public function getId() - { - return $this->id; - } - - /** - * The ID of the column family to be modified. - * - * 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; - } - - /** - * Create a new column family with the specified schema, or fail if - * one already exists with the given ID. - * - * Generated from protobuf field .google.bigtable.admin.v2.ColumnFamily create = 2; - * @return \Google\Cloud\Bigtable\Admin\V2\ColumnFamily - */ - public function getCreate() - { - return $this->readOneof(2); - } - - /** - * Create a new column family with the specified schema, or fail if - * one already exists with the given ID. - * - * Generated from protobuf field .google.bigtable.admin.v2.ColumnFamily create = 2; - * @param \Google\Cloud\Bigtable\Admin\V2\ColumnFamily $var - * @return $this - */ - public function setCreate($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\Admin\V2\ColumnFamily::class); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * Update an existing column family to the specified schema, or fail - * if no column family exists with the given ID. - * - * Generated from protobuf field .google.bigtable.admin.v2.ColumnFamily update = 3; - * @return \Google\Cloud\Bigtable\Admin\V2\ColumnFamily - */ - public function getUpdate() - { - return $this->readOneof(3); - } - - /** - * Update an existing column family to the specified schema, or fail - * if no column family exists with the given ID. - * - * Generated from protobuf field .google.bigtable.admin.v2.ColumnFamily update = 3; - * @param \Google\Cloud\Bigtable\Admin\V2\ColumnFamily $var - * @return $this - */ - public function setUpdate($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\Admin\V2\ColumnFamily::class); - $this->writeOneof(3, $var); - - return $this; - } - +if (false) { /** - * Drop (delete) the column family with the given ID, or fail if no such - * family exists. - * - * Generated from protobuf field bool drop = 4; - * @return bool + * This class is deprecated. Use Google\Cloud\Bigtable\Admin\V2\ModifyColumnFamiliesRequest\Modification instead. + * @deprecated */ - public function getDrop() - { - return $this->readOneof(4); - } - - /** - * Drop (delete) the column family with the given ID, or fail if no such - * family exists. - * - * Generated from protobuf field bool drop = 4; - * @param bool $var - * @return $this - */ - public function setDrop($var) - { - GPBUtil::checkBool($var); - $this->writeOneof(4, $var); - - return $this; - } - - /** - * @return string - */ - public function getMod() - { - return $this->whichOneof("mod"); - } - + class ModifyColumnFamiliesRequest_Modification {} } +class_exists(ModifyColumnFamiliesRequest\Modification::class); +@trigger_error('Google\Cloud\Bigtable\Admin\V2\ModifyColumnFamiliesRequest_Modification is deprecated and will be removed in the next major release. Use Google\Cloud\Bigtable\Admin\V2\ModifyColumnFamiliesRequest\Modification instead', E_USER_DEPRECATED); diff --git a/Bigtable/src/Admin/V2/PartialUpdateInstanceRequest.php b/Bigtable/src/Admin/V2/PartialUpdateInstanceRequest.php index 48829103a15b..e3c60bed2e55 100644 --- a/Bigtable/src/Admin/V2/PartialUpdateInstanceRequest.php +++ b/Bigtable/src/Admin/V2/PartialUpdateInstanceRequest.php @@ -29,9 +29,22 @@ class PartialUpdateInstanceRequest extends \Google\Protobuf\Internal\Message */ private $update_mask = null; - public function __construct() { + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Bigtable\Admin\V2\Instance $instance + * The Instance which will (partially) replace the current value. + * @type \Google\Protobuf\FieldMask $update_mask + * The subset of Instance fields which should be replaced. + * Must be explicitly set. + * } + */ + public function __construct($data = NULL) { \GPBMetadata\Google\Bigtable\Admin\V2\BigtableInstanceAdmin::initOnce(); - parent::__construct(); + parent::__construct($data); } /** diff --git a/Bigtable/src/Admin/V2/Snapshot.php b/Bigtable/src/Admin/V2/Snapshot.php index b33c5f4aef86..3ebfb7c6b41e 100644 --- a/Bigtable/src/Admin/V2/Snapshot.php +++ b/Bigtable/src/Admin/V2/Snapshot.php @@ -76,9 +76,44 @@ class Snapshot extends \Google\Protobuf\Internal\Message */ private $description = ''; - public function __construct() { + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * (`OutputOnly`) + * The unique name of the snapshot. + * Values are of the form + * `projects//instances//clusters//snapshots/`. + * @type \Google\Cloud\Bigtable\Admin\V2\Table $source_table + * (`OutputOnly`) + * The source table at the time the snapshot was taken. + * @type int|string $data_size_bytes + * (`OutputOnly`) + * The size of the data in the source table at the time the snapshot was + * taken. In some cases, this value may be computed asynchronously via a + * background process and a placeholder of 0 will be used in the meantime. + * @type \Google\Protobuf\Timestamp $create_time + * (`OutputOnly`) + * The time when the snapshot is created. + * @type \Google\Protobuf\Timestamp $delete_time + * (`OutputOnly`) + * 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, + * the default maximum of 365 days will be used. + * @type int $state + * (`OutputOnly`) + * The current state of the snapshot. + * @type string $description + * (`OutputOnly`) + * Description of the snapshot. + * } + */ + public function __construct($data = NULL) { \GPBMetadata\Google\Bigtable\Admin\V2\Table::initOnce(); - parent::__construct(); + parent::__construct($data); } /** diff --git a/Bigtable/src/Admin/V2/Snapshot/State.php b/Bigtable/src/Admin/V2/Snapshot/State.php new file mode 100644 index 000000000000..0891428f3156 --- /dev/null +++ b/Bigtable/src/Admin/V2/Snapshot/State.php @@ -0,0 +1,38 @@ +google.bigtable.admin.v2.Snapshot.State + */ +class State +{ + /** + * The state of the snapshot could not be determined. + * + * Generated from protobuf enum STATE_NOT_KNOWN = 0; + */ + const STATE_NOT_KNOWN = 0; + /** + * The snapshot has been successfully created and can serve all requests. + * + * Generated from protobuf enum READY = 1; + */ + const READY = 1; + /** + * The snapshot is currently being created, and may be destroyed if the + * creation process encounters an error. A snapshot may not be restored to a + * table while it is being created. + * + * Generated from protobuf enum CREATING = 2; + */ + const CREATING = 2; +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(State::class, \Google\Cloud\Bigtable\Admin\V2\Snapshot_State::class); + diff --git a/Bigtable/src/Admin/V2/SnapshotTableMetadata.php b/Bigtable/src/Admin/V2/SnapshotTableMetadata.php index 03c9b75bc1a0..07c5ad685f3d 100644 --- a/Bigtable/src/Admin/V2/SnapshotTableMetadata.php +++ b/Bigtable/src/Admin/V2/SnapshotTableMetadata.php @@ -38,9 +38,23 @@ class SnapshotTableMetadata extends \Google\Protobuf\Internal\Message */ private $finish_time = null; - public function __construct() { + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Bigtable\Admin\V2\SnapshotTableRequest $original_request + * The request that prompted the initiation of this SnapshotTable operation. + * @type \Google\Protobuf\Timestamp $request_time + * The time at which the original request was received. + * @type \Google\Protobuf\Timestamp $finish_time + * The time at which the operation failed or was completed successfully. + * } + */ + public function __construct($data = NULL) { \GPBMetadata\Google\Bigtable\Admin\V2\BigtableTableAdmin::initOnce(); - parent::__construct(); + parent::__construct($data); } /** diff --git a/Bigtable/src/Admin/V2/SnapshotTableRequest.php b/Bigtable/src/Admin/V2/SnapshotTableRequest.php index 21e90eedfb9c..4d0116430f9f 100644 --- a/Bigtable/src/Admin/V2/SnapshotTableRequest.php +++ b/Bigtable/src/Admin/V2/SnapshotTableRequest.php @@ -61,9 +61,37 @@ class SnapshotTableRequest extends \Google\Protobuf\Internal\Message */ private $description = ''; - public function __construct() { + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The unique name of the table to have the snapshot taken. + * Values are of the form + * `projects//instances//tables/
`. + * @type string $cluster + * The name of the cluster where the snapshot will be created in. + * Values are of the form + * `projects//instances//clusters/`. + * @type string $snapshot_id + * 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//instances//clusters//snapshots/mysnapshot`. + * @type \Google\Protobuf\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. + * } + */ + public function __construct($data = NULL) { \GPBMetadata\Google\Bigtable\Admin\V2\BigtableTableAdmin::initOnce(); - parent::__construct(); + parent::__construct($data); } /** diff --git a/Bigtable/src/Admin/V2/Snapshot_State.php b/Bigtable/src/Admin/V2/Snapshot_State.php index 36aad718e136..6dad2fe7d1b7 100644 --- a/Bigtable/src/Admin/V2/Snapshot_State.php +++ b/Bigtable/src/Admin/V2/Snapshot_State.php @@ -4,32 +4,13 @@ namespace Google\Cloud\Bigtable\Admin\V2; -/** - * Possible states of a snapshot. - * - * Protobuf enum Google\Bigtable\Admin\V2\Snapshot\State - */ -class Snapshot_State -{ +if (false) { /** - * The state of the snapshot could not be determined. - * - * Generated from protobuf enum STATE_NOT_KNOWN = 0; + * This class is deprecated. Use Google\Cloud\Bigtable\Admin\V2\Snapshot\State instead. + * @deprecated */ - const STATE_NOT_KNOWN = 0; - /** - * The snapshot has been successfully created and can serve all requests. - * - * Generated from protobuf enum READY = 1; - */ - const READY = 1; - /** - * The snapshot is currently being created, and may be destroyed if the - * creation process encounters an error. A snapshot may not be restored to a - * table while it is being created. - * - * Generated from protobuf enum CREATING = 2; - */ - const CREATING = 2; + class Snapshot_State {} } +class_exists(Snapshot\State::class); +@trigger_error('Google\Cloud\Bigtable\Admin\V2\Snapshot_State is deprecated and will be removed in the next major release. Use Google\Cloud\Bigtable\Admin\V2\Snapshot\State instead', E_USER_DEPRECATED); diff --git a/Bigtable/src/Admin/V2/StorageType.php b/Bigtable/src/Admin/V2/StorageType.php index 38985a80cd4d..6a0fb690dc46 100644 --- a/Bigtable/src/Admin/V2/StorageType.php +++ b/Bigtable/src/Admin/V2/StorageType.php @@ -7,7 +7,7 @@ /** * Storage media types for persisting Bigtable data. * - * Protobuf enum Google\Bigtable\Admin\V2\StorageType + * Protobuf type google.bigtable.admin.v2.StorageType */ class StorageType { diff --git a/Bigtable/src/Admin/V2/Table.php b/Bigtable/src/Admin/V2/Table.php index 695e94b3a0b1..36689852ac4b 100644 --- a/Bigtable/src/Admin/V2/Table.php +++ b/Bigtable/src/Admin/V2/Table.php @@ -55,9 +55,39 @@ class Table extends \Google\Protobuf\Internal\Message */ private $granularity = 0; - public function __construct() { + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * (`OutputOnly`) + * The unique name of the table. Values are of the form + * `projects//instances//tables/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`. + * Views: `NAME_ONLY`, `SCHEMA_VIEW`, `REPLICATION_VIEW`, `FULL` + * @type array|\Google\Protobuf\Internal\MapField $cluster_states + * (`OutputOnly`) + * Map from cluster ID to per-cluster table state. + * If it could not be determined whether or not the table has data in a + * particular cluster (for example, if its zone is unavailable), then + * there will be an entry for the cluster with UNKNOWN `replication_status`. + * Views: `REPLICATION_VIEW`, `FULL` + * @type array|\Google\Protobuf\Internal\MapField $column_families + * (`CreationOnly`) + * The column families configured for this table, mapped by column family ID. + * Views: `SCHEMA_VIEW`, `FULL` + * @type int $granularity + * (`CreationOnly`) + * The granularity (i.e. `MILLIS`) at which timestamps are stored in + * this table. Timestamps not matching the granularity will be rejected. + * If unspecified at creation time, the value will be set to `MILLIS`. + * Views: `SCHEMA_VIEW`, `FULL` + * } + */ + public function __construct($data = NULL) { \GPBMetadata\Google\Bigtable\Admin\V2\Table::initOnce(); - parent::__construct(); + parent::__construct($data); } /** @@ -122,7 +152,7 @@ public function getClusterStates() */ public function setClusterStates($var) { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Bigtable\Admin\V2\Table_ClusterState::class); + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Bigtable\Admin\V2\Table\ClusterState::class); $this->cluster_states = $arr; return $this; diff --git a/Bigtable/src/Admin/V2/Table/ClusterState.php b/Bigtable/src/Admin/V2/Table/ClusterState.php new file mode 100644 index 000000000000..51a14bcc2bc9 --- /dev/null +++ b/Bigtable/src/Admin/V2/Table/ClusterState.php @@ -0,0 +1,74 @@ +google.bigtable.admin.v2.Table.ClusterState + */ +class ClusterState extends \Google\Protobuf\Internal\Message +{ + /** + * (`OutputOnly`) + * The state of replication for the table in this cluster. + * + * Generated from protobuf field .google.bigtable.admin.v2.Table.ClusterState.ReplicationState replication_state = 1; + */ + private $replication_state = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $replication_state + * (`OutputOnly`) + * The state of replication for the table in this cluster. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\Table::initOnce(); + parent::__construct($data); + } + + /** + * (`OutputOnly`) + * The state of replication for the table in this cluster. + * + * Generated from protobuf field .google.bigtable.admin.v2.Table.ClusterState.ReplicationState replication_state = 1; + * @return int + */ + public function getReplicationState() + { + return $this->replication_state; + } + + /** + * (`OutputOnly`) + * The state of replication for the table in this cluster. + * + * Generated from protobuf field .google.bigtable.admin.v2.Table.ClusterState.ReplicationState replication_state = 1; + * @param int $var + * @return $this + */ + public function setReplicationState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Bigtable\Admin\V2\Table_ClusterState_ReplicationState::class); + $this->replication_state = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ClusterState::class, \Google\Cloud\Bigtable\Admin\V2\Table_ClusterState::class); + diff --git a/Bigtable/src/Admin/V2/Table/ClusterState/ReplicationState.php b/Bigtable/src/Admin/V2/Table/ClusterState/ReplicationState.php new file mode 100644 index 000000000000..3ed78a0f71f1 --- /dev/null +++ b/Bigtable/src/Admin/V2/Table/ClusterState/ReplicationState.php @@ -0,0 +1,54 @@ +google.bigtable.admin.v2.Table.ClusterState.ReplicationState + */ +class ReplicationState +{ + /** + * The replication state of the table is unknown in this cluster. + * + * Generated from protobuf enum STATE_NOT_KNOWN = 0; + */ + const STATE_NOT_KNOWN = 0; + /** + * The cluster was recently created, and the table must finish copying + * over pre-existing data from other clusters before it can begin + * receiving live replication updates and serving Data API requests. + * + * Generated from protobuf enum INITIALIZING = 1; + */ + const INITIALIZING = 1; + /** + * The table is temporarily unable to serve Data API requests from this + * cluster due to planned internal maintenance. + * + * Generated from protobuf enum PLANNED_MAINTENANCE = 2; + */ + const PLANNED_MAINTENANCE = 2; + /** + * The table is temporarily unable to serve Data API requests from this + * cluster due to unplanned or emergency maintenance. + * + * Generated from protobuf enum UNPLANNED_MAINTENANCE = 3; + */ + const UNPLANNED_MAINTENANCE = 3; + /** + * The table can serve Data API requests from this cluster. Depending on + * replication delay, reads may not immediately reflect the state of the + * table in other clusters. + * + * Generated from protobuf enum READY = 4; + */ + const READY = 4; +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ReplicationState::class, \Google\Cloud\Bigtable\Admin\V2\Table_ClusterState_ReplicationState::class); + diff --git a/Bigtable/src/Admin/V2/Table/TimestampGranularity.php b/Bigtable/src/Admin/V2/Table/TimestampGranularity.php new file mode 100644 index 000000000000..2264e067fab5 --- /dev/null +++ b/Bigtable/src/Admin/V2/Table/TimestampGranularity.php @@ -0,0 +1,32 @@ +google.bigtable.admin.v2.Table.TimestampGranularity + */ +class TimestampGranularity +{ + /** + * The user did not specify a granularity. Should not be returned. + * When specified during table creation, MILLIS will be used. + * + * Generated from protobuf enum TIMESTAMP_GRANULARITY_UNSPECIFIED = 0; + */ + const TIMESTAMP_GRANULARITY_UNSPECIFIED = 0; + /** + * The table keeps data versioned at a granularity of 1ms. + * + * Generated from protobuf enum MILLIS = 1; + */ + const MILLIS = 1; +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(TimestampGranularity::class, \Google\Cloud\Bigtable\Admin\V2\Table_TimestampGranularity::class); + diff --git a/Bigtable/src/Admin/V2/Table/View.php b/Bigtable/src/Admin/V2/Table/View.php new file mode 100644 index 000000000000..5875146dd170 --- /dev/null +++ b/Bigtable/src/Admin/V2/Table/View.php @@ -0,0 +1,49 @@ +google.bigtable.admin.v2.Table.View + */ +class View +{ + /** + * Uses the default view for each method as documented in its request. + * + * Generated from protobuf enum VIEW_UNSPECIFIED = 0; + */ + const VIEW_UNSPECIFIED = 0; + /** + * Only populates `name`. + * + * Generated from protobuf enum NAME_ONLY = 1; + */ + const NAME_ONLY = 1; + /** + * Only populates `name` and fields related to the table's schema. + * + * Generated from protobuf enum SCHEMA_VIEW = 2; + */ + const SCHEMA_VIEW = 2; + /** + * Only populates `name` and fields related to the table's + * replication state. + * + * Generated from protobuf enum REPLICATION_VIEW = 3; + */ + const REPLICATION_VIEW = 3; + /** + * Populates all fields. + * + * Generated from protobuf enum FULL = 4; + */ + const FULL = 4; +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(View::class, \Google\Cloud\Bigtable\Admin\V2\Table_View::class); + diff --git a/Bigtable/src/Admin/V2/Table_ClusterState.php b/Bigtable/src/Admin/V2/Table_ClusterState.php index 7c351ac6eb3c..22d77c472d08 100644 --- a/Bigtable/src/Admin/V2/Table_ClusterState.php +++ b/Bigtable/src/Admin/V2/Table_ClusterState.php @@ -4,57 +4,13 @@ namespace Google\Cloud\Bigtable\Admin\V2; -use Google\Protobuf\Internal\GPBType; -use Google\Protobuf\Internal\RepeatedField; -use Google\Protobuf\Internal\GPBUtil; - -/** - * The state of a table's data in a particular cluster. - * - * Generated from protobuf message google.bigtable.admin.v2.Table.ClusterState - */ -class Table_ClusterState extends \Google\Protobuf\Internal\Message -{ - /** - * (`OutputOnly`) - * The state of replication for the table in this cluster. - * - * Generated from protobuf field .google.bigtable.admin.v2.Table.ClusterState.ReplicationState replication_state = 1; - */ - private $replication_state = 0; - - public function __construct() { - \GPBMetadata\Google\Bigtable\Admin\V2\Table::initOnce(); - parent::__construct(); - } - +if (false) { /** - * (`OutputOnly`) - * The state of replication for the table in this cluster. - * - * Generated from protobuf field .google.bigtable.admin.v2.Table.ClusterState.ReplicationState replication_state = 1; - * @return int + * This class is deprecated. Use Google\Cloud\Bigtable\Admin\V2\Table\ClusterState instead. + * @deprecated */ - public function getReplicationState() - { - return $this->replication_state; - } - - /** - * (`OutputOnly`) - * The state of replication for the table in this cluster. - * - * Generated from protobuf field .google.bigtable.admin.v2.Table.ClusterState.ReplicationState replication_state = 1; - * @param int $var - * @return $this - */ - public function setReplicationState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Bigtable\Admin\V2\Table_ClusterState_ReplicationState::class); - $this->replication_state = $var; - - return $this; - } - + class Table_ClusterState {} } +class_exists(Table\ClusterState::class); +@trigger_error('Google\Cloud\Bigtable\Admin\V2\Table_ClusterState is deprecated and will be removed in the next major release. Use Google\Cloud\Bigtable\Admin\V2\Table\ClusterState instead', E_USER_DEPRECATED); diff --git a/Bigtable/src/Admin/V2/Table_ClusterState_ReplicationState.php b/Bigtable/src/Admin/V2/Table_ClusterState_ReplicationState.php index 70b4d09bff6a..9f233486b008 100644 --- a/Bigtable/src/Admin/V2/Table_ClusterState_ReplicationState.php +++ b/Bigtable/src/Admin/V2/Table_ClusterState_ReplicationState.php @@ -4,48 +4,13 @@ namespace Google\Cloud\Bigtable\Admin\V2; -/** - * Table replication states. - * - * Protobuf enum Google\Bigtable\Admin\V2\Table\ClusterState\ReplicationState - */ -class Table_ClusterState_ReplicationState -{ +if (false) { /** - * The replication state of the table is unknown in this cluster. - * - * Generated from protobuf enum STATE_NOT_KNOWN = 0; + * This class is deprecated. Use Google\Cloud\Bigtable\Admin\V2\Table\ClusterState\ReplicationState instead. + * @deprecated */ - const STATE_NOT_KNOWN = 0; - /** - * The cluster was recently created, and the table must finish copying - * over pre-existing data from other clusters before it can begin - * receiving live replication updates and serving Data API requests. - * - * Generated from protobuf enum INITIALIZING = 1; - */ - const INITIALIZING = 1; - /** - * The table is temporarily unable to serve Data API requests from this - * cluster due to planned internal maintenance. - * - * Generated from protobuf enum PLANNED_MAINTENANCE = 2; - */ - const PLANNED_MAINTENANCE = 2; - /** - * The table is temporarily unable to serve Data API requests from this - * cluster due to unplanned or emergency maintenance. - * - * Generated from protobuf enum UNPLANNED_MAINTENANCE = 3; - */ - const UNPLANNED_MAINTENANCE = 3; - /** - * The table can serve Data API requests from this cluster. Depending on - * replication delay, reads may not immediately reflect the state of the - * table in other clusters. - * - * Generated from protobuf enum READY = 4; - */ - const READY = 4; + class Table_ClusterState_ReplicationState {} } +class_exists(Table\ClusterState\ReplicationState::class); +@trigger_error('Google\Cloud\Bigtable\Admin\V2\Table_ClusterState_ReplicationState is deprecated and will be removed in the next major release. Use Google\Cloud\Bigtable\Admin\V2\Table\ClusterState\ReplicationState instead', E_USER_DEPRECATED); diff --git a/Bigtable/src/Admin/V2/Table_TimestampGranularity.php b/Bigtable/src/Admin/V2/Table_TimestampGranularity.php index f043d0550486..6ebd45df5808 100644 --- a/Bigtable/src/Admin/V2/Table_TimestampGranularity.php +++ b/Bigtable/src/Admin/V2/Table_TimestampGranularity.php @@ -4,26 +4,13 @@ namespace Google\Cloud\Bigtable\Admin\V2; -/** - * Possible timestamp granularities to use when keeping multiple versions - * of data in a table. - * - * Protobuf enum Google\Bigtable\Admin\V2\Table\TimestampGranularity - */ -class Table_TimestampGranularity -{ +if (false) { /** - * The user did not specify a granularity. Should not be returned. - * When specified during table creation, MILLIS will be used. - * - * Generated from protobuf enum TIMESTAMP_GRANULARITY_UNSPECIFIED = 0; + * This class is deprecated. Use Google\Cloud\Bigtable\Admin\V2\Table\TimestampGranularity instead. + * @deprecated */ - const TIMESTAMP_GRANULARITY_UNSPECIFIED = 0; - /** - * The table keeps data versioned at a granularity of 1ms. - * - * Generated from protobuf enum MILLIS = 1; - */ - const MILLIS = 1; + class Table_TimestampGranularity {} } +class_exists(Table\TimestampGranularity::class); +@trigger_error('Google\Cloud\Bigtable\Admin\V2\Table_TimestampGranularity is deprecated and will be removed in the next major release. Use Google\Cloud\Bigtable\Admin\V2\Table\TimestampGranularity instead', E_USER_DEPRECATED); diff --git a/Bigtable/src/Admin/V2/Table_View.php b/Bigtable/src/Admin/V2/Table_View.php index eba93deeac21..8e51be2cb7d1 100644 --- a/Bigtable/src/Admin/V2/Table_View.php +++ b/Bigtable/src/Admin/V2/Table_View.php @@ -4,43 +4,13 @@ namespace Google\Cloud\Bigtable\Admin\V2; -/** - * Defines a view over a table's fields. - * - * Protobuf enum Google\Bigtable\Admin\V2\Table\View - */ -class Table_View -{ +if (false) { /** - * Uses the default view for each method as documented in its request. - * - * Generated from protobuf enum VIEW_UNSPECIFIED = 0; + * This class is deprecated. Use Google\Cloud\Bigtable\Admin\V2\Table\View instead. + * @deprecated */ - const VIEW_UNSPECIFIED = 0; - /** - * Only populates `name`. - * - * Generated from protobuf enum NAME_ONLY = 1; - */ - const NAME_ONLY = 1; - /** - * Only populates `name` and fields related to the table's schema. - * - * Generated from protobuf enum SCHEMA_VIEW = 2; - */ - const SCHEMA_VIEW = 2; - /** - * Only populates `name` and fields related to the table's - * replication state. - * - * Generated from protobuf enum REPLICATION_VIEW = 3; - */ - const REPLICATION_VIEW = 3; - /** - * Populates all fields. - * - * Generated from protobuf enum FULL = 4; - */ - const FULL = 4; + class Table_View {} } +class_exists(Table\View::class); +@trigger_error('Google\Cloud\Bigtable\Admin\V2\Table_View is deprecated and will be removed in the next major release. Use Google\Cloud\Bigtable\Admin\V2\Table\View instead', E_USER_DEPRECATED); diff --git a/Bigtable/src/Admin/V2/UpdateAppProfileMetadata.php b/Bigtable/src/Admin/V2/UpdateAppProfileMetadata.php index 5d60251b5764..aa4ccbf47fe0 100644 --- a/Bigtable/src/Admin/V2/UpdateAppProfileMetadata.php +++ b/Bigtable/src/Admin/V2/UpdateAppProfileMetadata.php @@ -16,9 +16,17 @@ class UpdateAppProfileMetadata extends \Google\Protobuf\Internal\Message { - public function __construct() { + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { \GPBMetadata\Google\Bigtable\Admin\V2\BigtableInstanceAdmin::initOnce(); - parent::__construct(); + parent::__construct($data); } } diff --git a/Bigtable/src/Admin/V2/UpdateAppProfileRequest.php b/Bigtable/src/Admin/V2/UpdateAppProfileRequest.php index be93bc86d78e..32c6a5cf2861 100644 --- a/Bigtable/src/Admin/V2/UpdateAppProfileRequest.php +++ b/Bigtable/src/Admin/V2/UpdateAppProfileRequest.php @@ -35,9 +35,24 @@ class UpdateAppProfileRequest extends \Google\Protobuf\Internal\Message */ private $ignore_warnings = false; - public function __construct() { + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Bigtable\Admin\V2\AppProfile $app_profile + * The app profile which will (partially) replace the current value. + * @type \Google\Protobuf\FieldMask $update_mask + * The subset of app profile fields which should be replaced. + * If unset, all fields will be replaced. + * @type bool $ignore_warnings + * If true, ignore safety checks when updating the app profile. + * } + */ + public function __construct($data = NULL) { \GPBMetadata\Google\Bigtable\Admin\V2\BigtableInstanceAdmin::initOnce(); - parent::__construct(); + parent::__construct($data); } /** diff --git a/Bigtable/src/Admin/V2/UpdateClusterMetadata.php b/Bigtable/src/Admin/V2/UpdateClusterMetadata.php index 6f8dba31557c..46cfcdc41a35 100644 --- a/Bigtable/src/Admin/V2/UpdateClusterMetadata.php +++ b/Bigtable/src/Admin/V2/UpdateClusterMetadata.php @@ -34,9 +34,23 @@ class UpdateClusterMetadata extends \Google\Protobuf\Internal\Message */ private $finish_time = null; - public function __construct() { + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Bigtable\Admin\V2\Cluster $original_request + * The request that prompted the initiation of this UpdateCluster operation. + * @type \Google\Protobuf\Timestamp $request_time + * The time at which the original request was received. + * @type \Google\Protobuf\Timestamp $finish_time + * The time at which the operation failed or was completed successfully. + * } + */ + public function __construct($data = NULL) { \GPBMetadata\Google\Bigtable\Admin\V2\BigtableInstanceAdmin::initOnce(); - parent::__construct(); + parent::__construct($data); } /** diff --git a/Bigtable/src/Admin/V2/UpdateInstanceMetadata.php b/Bigtable/src/Admin/V2/UpdateInstanceMetadata.php index 74b4ab99c4b5..91cd7d7bf137 100644 --- a/Bigtable/src/Admin/V2/UpdateInstanceMetadata.php +++ b/Bigtable/src/Admin/V2/UpdateInstanceMetadata.php @@ -34,9 +34,23 @@ class UpdateInstanceMetadata extends \Google\Protobuf\Internal\Message */ private $finish_time = null; - public function __construct() { + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Bigtable\Admin\V2\PartialUpdateInstanceRequest $original_request + * The request that prompted the initiation of this UpdateInstance operation. + * @type \Google\Protobuf\Timestamp $request_time + * The time at which the original request was received. + * @type \Google\Protobuf\Timestamp $finish_time + * The time at which the operation failed or was completed successfully. + * } + */ + public function __construct($data = NULL) { \GPBMetadata\Google\Bigtable\Admin\V2\BigtableInstanceAdmin::initOnce(); - parent::__construct(); + parent::__construct($data); } /** diff --git a/Bigtable/src/V2/Cell.php b/Bigtable/src/V2/Cell.php index 23713f9efc8b..467ade59ae03 100644 --- a/Bigtable/src/V2/Cell.php +++ b/Bigtable/src/V2/Cell.php @@ -41,9 +41,30 @@ class Cell extends \Google\Protobuf\Internal\Message */ private $labels; - public function __construct() { + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $timestamp_micros + * The cell's stored timestamp, which also uniquely identifies it within + * its column. + * Values are always expressed in microseconds, but individual tables may set + * a coarser granularity to further restrict the allowed values. For + * example, a table which specifies millisecond granularity will only allow + * values of `timestamp_micros` which are multiples of 1000. + * @type string $value + * The value stored in the cell. + * May contain any byte string, including the empty string, up to 100MiB in + * length. + * @type string[]|\Google\Protobuf\Internal\RepeatedField $labels + * Labels applied to the cell by a [RowFilter][google.bigtable.v2.RowFilter]. + * } + */ + public function __construct($data = NULL) { \GPBMetadata\Google\Bigtable\V2\Data::initOnce(); - parent::__construct(); + parent::__construct($data); } /** diff --git a/Bigtable/src/V2/CheckAndMutateRowRequest.php b/Bigtable/src/V2/CheckAndMutateRowRequest.php index a50d0569e970..72e2f5b9fc0f 100644 --- a/Bigtable/src/V2/CheckAndMutateRowRequest.php +++ b/Bigtable/src/V2/CheckAndMutateRowRequest.php @@ -67,9 +67,44 @@ class CheckAndMutateRowRequest extends \Google\Protobuf\Internal\Message */ private $false_mutations; - public function __construct() { + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $table_name + * The unique name of the table to which the conditional mutation should be + * applied. + * Values are of the form + * `projects//instances//tables/
`. + * @type string $app_profile_id + * This value specifies routing for replication. If not specified, the + * "default" application profile will be used. + * @type string $row_key + * The key of the row to which the conditional mutation should be applied. + * @type \Google\Cloud\Bigtable\V2\RowFilter $predicate_filter + * 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 \Google\Cloud\Bigtable\V2\Mutation[]|\Google\Protobuf\Internal\RepeatedField $true_mutations + * 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 \Google\Cloud\Bigtable\V2\Mutation[]|\Google\Protobuf\Internal\RepeatedField $false_mutations + * 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. + * } + */ + public function __construct($data = NULL) { \GPBMetadata\Google\Bigtable\V2\Bigtable::initOnce(); - parent::__construct(); + parent::__construct($data); } /** diff --git a/Bigtable/src/V2/CheckAndMutateRowResponse.php b/Bigtable/src/V2/CheckAndMutateRowResponse.php index a894847c7159..2e970bd41dd4 100644 --- a/Bigtable/src/V2/CheckAndMutateRowResponse.php +++ b/Bigtable/src/V2/CheckAndMutateRowResponse.php @@ -23,9 +23,20 @@ class CheckAndMutateRowResponse extends \Google\Protobuf\Internal\Message */ private $predicate_matched = false; - public function __construct() { + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $predicate_matched + * Whether or not the request's `predicate_filter` yielded any results for + * the specified row. + * } + */ + public function __construct($data = NULL) { \GPBMetadata\Google\Bigtable\V2\Bigtable::initOnce(); - parent::__construct(); + parent::__construct($data); } /** diff --git a/Bigtable/src/V2/Column.php b/Bigtable/src/V2/Column.php index 34a776469406..e82f3ffda8c6 100644 --- a/Bigtable/src/V2/Column.php +++ b/Bigtable/src/V2/Column.php @@ -33,9 +33,25 @@ class Column extends \Google\Protobuf\Internal\Message */ private $cells; - public function __construct() { + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $qualifier + * The unique key which identifies this column within its family. This is the + * same key that's used to identify the column in, for example, a RowFilter + * which sets its `column_qualifier_regex_filter` field. + * May contain any byte string, including the empty string, up to 16kiB in + * length. + * @type \Google\Cloud\Bigtable\V2\Cell[]|\Google\Protobuf\Internal\RepeatedField $cells + * Must not be empty. Sorted in order of decreasing "timestamp_micros". + * } + */ + public function __construct($data = NULL) { \GPBMetadata\Google\Bigtable\V2\Data::initOnce(); - parent::__construct(); + parent::__construct($data); } /** diff --git a/Bigtable/src/V2/ColumnRange.php b/Bigtable/src/V2/ColumnRange.php index f65bf27e62f1..c28511817759 100644 --- a/Bigtable/src/V2/ColumnRange.php +++ b/Bigtable/src/V2/ColumnRange.php @@ -27,9 +27,27 @@ class ColumnRange extends \Google\Protobuf\Internal\Message protected $start_qualifier; protected $end_qualifier; - public function __construct() { + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $family_name + * The name of the column family within which this range falls. + * @type string $start_qualifier_closed + * Used when giving an inclusive lower bound for the range. + * @type string $start_qualifier_open + * Used when giving an exclusive lower bound for the range. + * @type string $end_qualifier_closed + * Used when giving an inclusive upper bound for the range. + * @type string $end_qualifier_open + * Used when giving an exclusive upper bound for the range. + * } + */ + public function __construct($data = NULL) { \GPBMetadata\Google\Bigtable\V2\Data::initOnce(); - parent::__construct(); + parent::__construct($data); } /** diff --git a/Bigtable/src/V2/Family.php b/Bigtable/src/V2/Family.php index 614197acbfca..92b2aaeace8c 100644 --- a/Bigtable/src/V2/Family.php +++ b/Bigtable/src/V2/Family.php @@ -34,9 +34,26 @@ class Family extends \Google\Protobuf\Internal\Message */ private $columns; - public function __construct() { + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The unique key which identifies this family within its row. This is the + * same key that's used to identify the family in, for example, a RowFilter + * which sets its "family_name_regex_filter" field. + * Must match `[-_.a-zA-Z0-9]+`, except that AggregatingRowProcessors may + * produce cells in a sentinel family with an empty name. + * Must be no greater than 64 characters in length. + * @type \Google\Cloud\Bigtable\V2\Column[]|\Google\Protobuf\Internal\RepeatedField $columns + * Must not be empty. Sorted in order of increasing "qualifier". + * } + */ + public function __construct($data = NULL) { \GPBMetadata\Google\Bigtable\V2\Data::initOnce(); - parent::__construct(); + parent::__construct($data); } /** diff --git a/Bigtable/src/V2/MutateRowRequest.php b/Bigtable/src/V2/MutateRowRequest.php index c0c1fb8d499a..3d8f968f8d32 100644 --- a/Bigtable/src/V2/MutateRowRequest.php +++ b/Bigtable/src/V2/MutateRowRequest.php @@ -45,9 +45,30 @@ class MutateRowRequest extends \Google\Protobuf\Internal\Message */ private $mutations; - public function __construct() { + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $table_name + * The unique name of the table to which the mutation should be applied. + * Values are of the form + * `projects//instances//tables/
`. + * @type string $app_profile_id + * This value specifies routing for replication. If not specified, the + * "default" application profile will be used. + * @type string $row_key + * The key of the row to which the mutation should be applied. + * @type \Google\Cloud\Bigtable\V2\Mutation[]|\Google\Protobuf\Internal\RepeatedField $mutations + * 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. + * } + */ + public function __construct($data = NULL) { \GPBMetadata\Google\Bigtable\V2\Bigtable::initOnce(); - parent::__construct(); + parent::__construct($data); } /** diff --git a/Bigtable/src/V2/MutateRowResponse.php b/Bigtable/src/V2/MutateRowResponse.php index 41acdf5d0a8a..2a2cc243d6aa 100644 --- a/Bigtable/src/V2/MutateRowResponse.php +++ b/Bigtable/src/V2/MutateRowResponse.php @@ -16,9 +16,17 @@ class MutateRowResponse extends \Google\Protobuf\Internal\Message { - public function __construct() { + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { \GPBMetadata\Google\Bigtable\V2\Bigtable::initOnce(); - parent::__construct(); + parent::__construct($data); } } diff --git a/Bigtable/src/V2/MutateRowsRequest.php b/Bigtable/src/V2/MutateRowsRequest.php index f1db24c07812..9b3c22abd0f4 100644 --- a/Bigtable/src/V2/MutateRowsRequest.php +++ b/Bigtable/src/V2/MutateRowsRequest.php @@ -39,9 +39,28 @@ class MutateRowsRequest extends \Google\Protobuf\Internal\Message */ private $entries; - public function __construct() { + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $table_name + * The unique name of the table to which the mutations should be applied. + * @type string $app_profile_id + * This value specifies routing for replication. If not specified, the + * "default" application profile will be used. + * @type \Google\Cloud\Bigtable\V2\MutateRowsRequest\Entry[]|\Google\Protobuf\Internal\RepeatedField $entries + * 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. + * } + */ + public function __construct($data = NULL) { \GPBMetadata\Google\Bigtable\V2\Bigtable::initOnce(); - parent::__construct(); + parent::__construct($data); } /** @@ -121,12 +140,12 @@ public function getEntries() * contain at most 100000 mutations. * * Generated from protobuf field repeated .google.bigtable.v2.MutateRowsRequest.Entry entries = 2; - * @param \Google\Cloud\Bigtable\V2\MutateRowsRequest_Entry[]|\Google\Protobuf\Internal\RepeatedField $var + * @param \Google\Cloud\Bigtable\V2\MutateRowsRequest\Entry[]|\Google\Protobuf\Internal\RepeatedField $var * @return $this */ public function setEntries($var) { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Bigtable\V2\MutateRowsRequest_Entry::class); + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Bigtable\V2\MutateRowsRequest\Entry::class); $this->entries = $arr; return $this; diff --git a/Bigtable/src/V2/MutateRowsRequest/Entry.php b/Bigtable/src/V2/MutateRowsRequest/Entry.php new file mode 100644 index 000000000000..25afa286ec4a --- /dev/null +++ b/Bigtable/src/V2/MutateRowsRequest/Entry.php @@ -0,0 +1,114 @@ +google.bigtable.v2.MutateRowsRequest.Entry + */ +class Entry extends \Google\Protobuf\Internal\Message +{ + /** + * The key of the row to which the `mutations` should be applied. + * + * Generated from protobuf field bytes row_key = 1; + */ + private $row_key = ''; + /** + * Changes to be atomically applied to the specified row. Mutations are + * applied in order, meaning that earlier mutations can be masked by + * later ones. + * You must specify at least one mutation. + * + * Generated from protobuf field repeated .google.bigtable.v2.Mutation mutations = 2; + */ + private $mutations; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $row_key + * The key of the row to which the `mutations` should be applied. + * @type \Google\Cloud\Bigtable\V2\Mutation[]|\Google\Protobuf\Internal\RepeatedField $mutations + * Changes to be atomically applied to the specified row. Mutations are + * applied in order, meaning that earlier mutations can be masked by + * later ones. + * You must specify at least one mutation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\V2\Bigtable::initOnce(); + parent::__construct($data); + } + + /** + * The key of the row to which the `mutations` should be applied. + * + * Generated from protobuf field bytes row_key = 1; + * @return string + */ + public function getRowKey() + { + return $this->row_key; + } + + /** + * The key of the row to which the `mutations` should be applied. + * + * Generated from protobuf field bytes row_key = 1; + * @param string $var + * @return $this + */ + public function setRowKey($var) + { + GPBUtil::checkString($var, False); + $this->row_key = $var; + + return $this; + } + + /** + * Changes to be atomically applied to the specified row. Mutations are + * applied in order, meaning that earlier mutations can be masked by + * later ones. + * You must specify at least one mutation. + * + * Generated from protobuf field repeated .google.bigtable.v2.Mutation mutations = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getMutations() + { + return $this->mutations; + } + + /** + * Changes to be atomically applied to the specified row. Mutations are + * applied in order, meaning that earlier mutations can be masked by + * later ones. + * You must specify at least one mutation. + * + * Generated from protobuf field repeated .google.bigtable.v2.Mutation mutations = 2; + * @param \Google\Cloud\Bigtable\V2\Mutation[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setMutations($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Bigtable\V2\Mutation::class); + $this->mutations = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Entry::class, \Google\Cloud\Bigtable\V2\MutateRowsRequest_Entry::class); + diff --git a/Bigtable/src/V2/MutateRowsRequest_Entry.php b/Bigtable/src/V2/MutateRowsRequest_Entry.php index 1b7f40abbd08..a25e607142dd 100644 --- a/Bigtable/src/V2/MutateRowsRequest_Entry.php +++ b/Bigtable/src/V2/MutateRowsRequest_Entry.php @@ -4,93 +4,13 @@ namespace Google\Cloud\Bigtable\V2; -use Google\Protobuf\Internal\GPBType; -use Google\Protobuf\Internal\RepeatedField; -use Google\Protobuf\Internal\GPBUtil; - -/** - * Generated from protobuf message google.bigtable.v2.MutateRowsRequest.Entry - */ -class MutateRowsRequest_Entry extends \Google\Protobuf\Internal\Message -{ - /** - * The key of the row to which the `mutations` should be applied. - * - * Generated from protobuf field bytes row_key = 1; - */ - private $row_key = ''; - /** - * Changes to be atomically applied to the specified row. Mutations are - * applied in order, meaning that earlier mutations can be masked by - * later ones. - * You must specify at least one mutation. - * - * Generated from protobuf field repeated .google.bigtable.v2.Mutation mutations = 2; - */ - private $mutations; - - public function __construct() { - \GPBMetadata\Google\Bigtable\V2\Bigtable::initOnce(); - parent::__construct(); - } - - /** - * The key of the row to which the `mutations` should be applied. - * - * Generated from protobuf field bytes row_key = 1; - * @return string - */ - public function getRowKey() - { - return $this->row_key; - } - +if (false) { /** - * The key of the row to which the `mutations` should be applied. - * - * Generated from protobuf field bytes row_key = 1; - * @param string $var - * @return $this + * This class is deprecated. Use Google\Cloud\Bigtable\V2\MutateRowsRequest\Entry instead. + * @deprecated */ - public function setRowKey($var) - { - GPBUtil::checkString($var, False); - $this->row_key = $var; - - return $this; - } - - /** - * Changes to be atomically applied to the specified row. Mutations are - * applied in order, meaning that earlier mutations can be masked by - * later ones. - * You must specify at least one mutation. - * - * Generated from protobuf field repeated .google.bigtable.v2.Mutation mutations = 2; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getMutations() - { - return $this->mutations; - } - - /** - * Changes to be atomically applied to the specified row. Mutations are - * applied in order, meaning that earlier mutations can be masked by - * later ones. - * You must specify at least one mutation. - * - * Generated from protobuf field repeated .google.bigtable.v2.Mutation mutations = 2; - * @param \Google\Cloud\Bigtable\V2\Mutation[]|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setMutations($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Bigtable\V2\Mutation::class); - $this->mutations = $arr; - - return $this; - } - + class MutateRowsRequest_Entry {} } +class_exists(MutateRowsRequest\Entry::class); +@trigger_error('Google\Cloud\Bigtable\V2\MutateRowsRequest_Entry is deprecated and will be removed in the next major release. Use Google\Cloud\Bigtable\V2\MutateRowsRequest\Entry instead', E_USER_DEPRECATED); diff --git a/Bigtable/src/V2/MutateRowsResponse.php b/Bigtable/src/V2/MutateRowsResponse.php index 76c342f257a8..779d22198881 100644 --- a/Bigtable/src/V2/MutateRowsResponse.php +++ b/Bigtable/src/V2/MutateRowsResponse.php @@ -22,9 +22,19 @@ class MutateRowsResponse extends \Google\Protobuf\Internal\Message */ private $entries; - public function __construct() { + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Bigtable\V2\MutateRowsResponse\Entry[]|\Google\Protobuf\Internal\RepeatedField $entries + * One or more results for Entries from the batch request. + * } + */ + public function __construct($data = NULL) { \GPBMetadata\Google\Bigtable\V2\Bigtable::initOnce(); - parent::__construct(); + parent::__construct($data); } /** @@ -42,12 +52,12 @@ public function getEntries() * One or more results for Entries from the batch request. * * Generated from protobuf field repeated .google.bigtable.v2.MutateRowsResponse.Entry entries = 1; - * @param \Google\Cloud\Bigtable\V2\MutateRowsResponse_Entry[]|\Google\Protobuf\Internal\RepeatedField $var + * @param \Google\Cloud\Bigtable\V2\MutateRowsResponse\Entry[]|\Google\Protobuf\Internal\RepeatedField $var * @return $this */ public function setEntries($var) { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Bigtable\V2\MutateRowsResponse_Entry::class); + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Bigtable\V2\MutateRowsResponse\Entry::class); $this->entries = $arr; return $this; diff --git a/Bigtable/src/V2/MutateRowsResponse/Entry.php b/Bigtable/src/V2/MutateRowsResponse/Entry.php new file mode 100644 index 000000000000..dce8d5aa16f8 --- /dev/null +++ b/Bigtable/src/V2/MutateRowsResponse/Entry.php @@ -0,0 +1,118 @@ +google.bigtable.v2.MutateRowsResponse.Entry + */ +class Entry extends \Google\Protobuf\Internal\Message +{ + /** + * The index into the original request's `entries` list of the Entry + * for which a result is being reported. + * + * Generated from protobuf field int64 index = 1; + */ + private $index = 0; + /** + * The result of the request Entry identified by `index`. + * Depending on how requests are batched during execution, it is possible + * for one Entry to fail due to an error with another Entry. In the event + * that this occurs, the same error will be reported for both entries. + * + * Generated from protobuf field .google.rpc.Status status = 2; + */ + private $status = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $index + * The index into the original request's `entries` list of the Entry + * for which a result is being reported. + * @type \Google\Rpc\Status $status + * The result of the request Entry identified by `index`. + * Depending on how requests are batched during execution, it is possible + * for one Entry to fail due to an error with another Entry. In the event + * that this occurs, the same error will be reported for both entries. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\V2\Bigtable::initOnce(); + parent::__construct($data); + } + + /** + * The index into the original request's `entries` list of the Entry + * for which a result is being reported. + * + * Generated from protobuf field int64 index = 1; + * @return int|string + */ + public function getIndex() + { + return $this->index; + } + + /** + * The index into the original request's `entries` list of the Entry + * for which a result is being reported. + * + * Generated from protobuf field int64 index = 1; + * @param int|string $var + * @return $this + */ + public function setIndex($var) + { + GPBUtil::checkInt64($var); + $this->index = $var; + + return $this; + } + + /** + * The result of the request Entry identified by `index`. + * Depending on how requests are batched during execution, it is possible + * for one Entry to fail due to an error with another Entry. In the event + * that this occurs, the same error will be reported for both entries. + * + * Generated from protobuf field .google.rpc.Status status = 2; + * @return \Google\Rpc\Status + */ + public function getStatus() + { + return $this->status; + } + + /** + * The result of the request Entry identified by `index`. + * Depending on how requests are batched during execution, it is possible + * for one Entry to fail due to an error with another Entry. In the event + * that this occurs, the same error will be reported for both entries. + * + * Generated from protobuf field .google.rpc.Status status = 2; + * @param \Google\Rpc\Status $var + * @return $this + */ + public function setStatus($var) + { + GPBUtil::checkMessage($var, \Google\Rpc\Status::class); + $this->status = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Entry::class, \Google\Cloud\Bigtable\V2\MutateRowsResponse_Entry::class); + diff --git a/Bigtable/src/V2/MutateRowsResponse_Entry.php b/Bigtable/src/V2/MutateRowsResponse_Entry.php index f7fd9856ef8b..5cb4efda8e19 100644 --- a/Bigtable/src/V2/MutateRowsResponse_Entry.php +++ b/Bigtable/src/V2/MutateRowsResponse_Entry.php @@ -4,96 +4,13 @@ namespace Google\Cloud\Bigtable\V2; -use Google\Protobuf\Internal\GPBType; -use Google\Protobuf\Internal\RepeatedField; -use Google\Protobuf\Internal\GPBUtil; - -/** - * Generated from protobuf message google.bigtable.v2.MutateRowsResponse.Entry - */ -class MutateRowsResponse_Entry extends \Google\Protobuf\Internal\Message -{ - /** - * The index into the original request's `entries` list of the Entry - * for which a result is being reported. - * - * Generated from protobuf field int64 index = 1; - */ - private $index = 0; - /** - * The result of the request Entry identified by `index`. - * Depending on how requests are batched during execution, it is possible - * for one Entry to fail due to an error with another Entry. In the event - * that this occurs, the same error will be reported for both entries. - * - * Generated from protobuf field .google.rpc.Status status = 2; - */ - private $status = null; - - public function __construct() { - \GPBMetadata\Google\Bigtable\V2\Bigtable::initOnce(); - parent::__construct(); - } - - /** - * The index into the original request's `entries` list of the Entry - * for which a result is being reported. - * - * Generated from protobuf field int64 index = 1; - * @return int|string - */ - public function getIndex() - { - return $this->index; - } - +if (false) { /** - * The index into the original request's `entries` list of the Entry - * for which a result is being reported. - * - * Generated from protobuf field int64 index = 1; - * @param int|string $var - * @return $this + * This class is deprecated. Use Google\Cloud\Bigtable\V2\MutateRowsResponse\Entry instead. + * @deprecated */ - public function setIndex($var) - { - GPBUtil::checkInt64($var); - $this->index = $var; - - return $this; - } - - /** - * The result of the request Entry identified by `index`. - * Depending on how requests are batched during execution, it is possible - * for one Entry to fail due to an error with another Entry. In the event - * that this occurs, the same error will be reported for both entries. - * - * Generated from protobuf field .google.rpc.Status status = 2; - * @return \Google\Rpc\Status - */ - public function getStatus() - { - return $this->status; - } - - /** - * The result of the request Entry identified by `index`. - * Depending on how requests are batched during execution, it is possible - * for one Entry to fail due to an error with another Entry. In the event - * that this occurs, the same error will be reported for both entries. - * - * Generated from protobuf field .google.rpc.Status status = 2; - * @param \Google\Rpc\Status $var - * @return $this - */ - public function setStatus($var) - { - GPBUtil::checkMessage($var, \Google\Rpc\Status::class); - $this->status = $var; - - return $this; - } - + class MutateRowsResponse_Entry {} } +class_exists(MutateRowsResponse\Entry::class); +@trigger_error('Google\Cloud\Bigtable\V2\MutateRowsResponse_Entry is deprecated and will be removed in the next major release. Use Google\Cloud\Bigtable\V2\MutateRowsResponse\Entry instead', E_USER_DEPRECATED); diff --git a/Bigtable/src/V2/Mutation.php b/Bigtable/src/V2/Mutation.php index d766c5f6f94d..a2224aa8ffcf 100644 --- a/Bigtable/src/V2/Mutation.php +++ b/Bigtable/src/V2/Mutation.php @@ -17,16 +17,32 @@ class Mutation extends \Google\Protobuf\Internal\Message { protected $mutation; - public function __construct() { + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Bigtable\V2\Mutation\SetCell $set_cell + * Set a cell's value. + * @type \Google\Cloud\Bigtable\V2\Mutation\DeleteFromColumn $delete_from_column + * Deletes cells from a column. + * @type \Google\Cloud\Bigtable\V2\Mutation\DeleteFromFamily $delete_from_family + * Deletes cells from a column family. + * @type \Google\Cloud\Bigtable\V2\Mutation\DeleteFromRow $delete_from_row + * Deletes cells from the entire row. + * } + */ + public function __construct($data = NULL) { \GPBMetadata\Google\Bigtable\V2\Data::initOnce(); - parent::__construct(); + parent::__construct($data); } /** * Set a cell's value. * * Generated from protobuf field .google.bigtable.v2.Mutation.SetCell set_cell = 1; - * @return \Google\Cloud\Bigtable\V2\Mutation_SetCell + * @return \Google\Cloud\Bigtable\V2\Mutation\SetCell */ public function getSetCell() { @@ -37,7 +53,7 @@ public function getSetCell() * Set a cell's value. * * Generated from protobuf field .google.bigtable.v2.Mutation.SetCell set_cell = 1; - * @param \Google\Cloud\Bigtable\V2\Mutation_SetCell $var + * @param \Google\Cloud\Bigtable\V2\Mutation\SetCell $var * @return $this */ public function setSetCell($var) @@ -52,7 +68,7 @@ public function setSetCell($var) * Deletes cells from a column. * * Generated from protobuf field .google.bigtable.v2.Mutation.DeleteFromColumn delete_from_column = 2; - * @return \Google\Cloud\Bigtable\V2\Mutation_DeleteFromColumn + * @return \Google\Cloud\Bigtable\V2\Mutation\DeleteFromColumn */ public function getDeleteFromColumn() { @@ -63,7 +79,7 @@ public function getDeleteFromColumn() * Deletes cells from a column. * * Generated from protobuf field .google.bigtable.v2.Mutation.DeleteFromColumn delete_from_column = 2; - * @param \Google\Cloud\Bigtable\V2\Mutation_DeleteFromColumn $var + * @param \Google\Cloud\Bigtable\V2\Mutation\DeleteFromColumn $var * @return $this */ public function setDeleteFromColumn($var) @@ -78,7 +94,7 @@ public function setDeleteFromColumn($var) * Deletes cells from a column family. * * Generated from protobuf field .google.bigtable.v2.Mutation.DeleteFromFamily delete_from_family = 3; - * @return \Google\Cloud\Bigtable\V2\Mutation_DeleteFromFamily + * @return \Google\Cloud\Bigtable\V2\Mutation\DeleteFromFamily */ public function getDeleteFromFamily() { @@ -89,7 +105,7 @@ public function getDeleteFromFamily() * Deletes cells from a column family. * * Generated from protobuf field .google.bigtable.v2.Mutation.DeleteFromFamily delete_from_family = 3; - * @param \Google\Cloud\Bigtable\V2\Mutation_DeleteFromFamily $var + * @param \Google\Cloud\Bigtable\V2\Mutation\DeleteFromFamily $var * @return $this */ public function setDeleteFromFamily($var) @@ -104,7 +120,7 @@ public function setDeleteFromFamily($var) * Deletes cells from the entire row. * * Generated from protobuf field .google.bigtable.v2.Mutation.DeleteFromRow delete_from_row = 4; - * @return \Google\Cloud\Bigtable\V2\Mutation_DeleteFromRow + * @return \Google\Cloud\Bigtable\V2\Mutation\DeleteFromRow */ public function getDeleteFromRow() { @@ -115,7 +131,7 @@ public function getDeleteFromRow() * Deletes cells from the entire row. * * Generated from protobuf field .google.bigtable.v2.Mutation.DeleteFromRow delete_from_row = 4; - * @param \Google\Cloud\Bigtable\V2\Mutation_DeleteFromRow $var + * @param \Google\Cloud\Bigtable\V2\Mutation\DeleteFromRow $var * @return $this */ public function setDeleteFromRow($var) diff --git a/Bigtable/src/V2/Mutation/DeleteFromColumn.php b/Bigtable/src/V2/Mutation/DeleteFromColumn.php new file mode 100644 index 000000000000..e3b6f9565d7d --- /dev/null +++ b/Bigtable/src/V2/Mutation/DeleteFromColumn.php @@ -0,0 +1,147 @@ +google.bigtable.v2.Mutation.DeleteFromColumn + */ +class DeleteFromColumn extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the family from which cells should be deleted. + * Must match `[-_.a-zA-Z0-9]+` + * + * Generated from protobuf field string family_name = 1; + */ + private $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 = ''; + /** + * 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; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $family_name + * The name of the family from which cells should be deleted. + * Must match `[-_.a-zA-Z0-9]+` + * @type string $column_qualifier + * The qualifier of the column from which cells should be deleted. + * Can be any byte string, including the empty string. + * @type \Google\Cloud\Bigtable\V2\TimestampRange $time_range + * The range of timestamps within which cells should be deleted. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\V2\Data::initOnce(); + parent::__construct($data); + } + + /** + * The name of the family from which cells should be deleted. + * Must match `[-_.a-zA-Z0-9]+` + * + * Generated from protobuf field string family_name = 1; + * @return string + */ + public function getFamilyName() + { + return $this->family_name; + } + + /** + * The name of the family from which cells should be deleted. + * Must match `[-_.a-zA-Z0-9]+` + * + * Generated from protobuf field string family_name = 1; + * @param string $var + * @return $this + */ + public function setFamilyName($var) + { + GPBUtil::checkString($var, True); + $this->family_name = $var; + + return $this; + } + + /** + * 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; + * @return string + */ + public function getColumnQualifier() + { + return $this->column_qualifier; + } + + /** + * 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; + * @param string $var + * @return $this + */ + public function setColumnQualifier($var) + { + GPBUtil::checkString($var, False); + $this->column_qualifier = $var; + + return $this; + } + + /** + * The range of timestamps within which cells should be deleted. + * + * Generated from protobuf field .google.bigtable.v2.TimestampRange time_range = 3; + * @return \Google\Cloud\Bigtable\V2\TimestampRange + */ + public function getTimeRange() + { + return $this->time_range; + } + + /** + * The range of timestamps within which cells should be deleted. + * + * Generated from protobuf field .google.bigtable.v2.TimestampRange time_range = 3; + * @param \Google\Cloud\Bigtable\V2\TimestampRange $var + * @return $this + */ + public function setTimeRange($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\TimestampRange::class); + $this->time_range = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(DeleteFromColumn::class, \Google\Cloud\Bigtable\V2\Mutation_DeleteFromColumn::class); + diff --git a/Bigtable/src/V2/Mutation/DeleteFromFamily.php b/Bigtable/src/V2/Mutation/DeleteFromFamily.php new file mode 100644 index 000000000000..b1a7ea953efc --- /dev/null +++ b/Bigtable/src/V2/Mutation/DeleteFromFamily.php @@ -0,0 +1,74 @@ +google.bigtable.v2.Mutation.DeleteFromFamily + */ +class DeleteFromFamily extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the family from which cells should be deleted. + * Must match `[-_.a-zA-Z0-9]+` + * + * Generated from protobuf field string family_name = 1; + */ + private $family_name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $family_name + * The name of the family from which cells should be deleted. + * Must match `[-_.a-zA-Z0-9]+` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\V2\Data::initOnce(); + parent::__construct($data); + } + + /** + * The name of the family from which cells should be deleted. + * Must match `[-_.a-zA-Z0-9]+` + * + * Generated from protobuf field string family_name = 1; + * @return string + */ + public function getFamilyName() + { + return $this->family_name; + } + + /** + * The name of the family from which cells should be deleted. + * Must match `[-_.a-zA-Z0-9]+` + * + * Generated from protobuf field string family_name = 1; + * @param string $var + * @return $this + */ + public function setFamilyName($var) + { + GPBUtil::checkString($var, True); + $this->family_name = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(DeleteFromFamily::class, \Google\Cloud\Bigtable\V2\Mutation_DeleteFromFamily::class); + diff --git a/Bigtable/src/V2/Mutation/DeleteFromRow.php b/Bigtable/src/V2/Mutation/DeleteFromRow.php new file mode 100644 index 000000000000..9200902a1780 --- /dev/null +++ b/Bigtable/src/V2/Mutation/DeleteFromRow.php @@ -0,0 +1,36 @@ +google.bigtable.v2.Mutation.DeleteFromRow + */ +class DeleteFromRow extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\V2\Data::initOnce(); + parent::__construct($data); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(DeleteFromRow::class, \Google\Cloud\Bigtable\V2\Mutation_DeleteFromRow::class); + diff --git a/Bigtable/src/V2/Mutation/SetCell.php b/Bigtable/src/V2/Mutation/SetCell.php new file mode 100644 index 000000000000..bfe91782bbed --- /dev/null +++ b/Bigtable/src/V2/Mutation/SetCell.php @@ -0,0 +1,196 @@ +google.bigtable.v2.Mutation.SetCell + */ +class SetCell extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the family into which new data should be written. + * Must match `[-_.a-zA-Z0-9]+` + * + * Generated from protobuf field string family_name = 1; + */ + private $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 = ''; + /** + * The timestamp of the cell into which new data should be written. + * Use -1 for current Bigtable server time. + * Otherwise, the client should set this value itself, noting that the + * default value is a timestamp of zero if the field is left unspecified. + * Values must match the granularity of the table (e.g. micros, millis). + * + * Generated from protobuf field int64 timestamp_micros = 3; + */ + private $timestamp_micros = 0; + /** + * The value to be written into the specified cell. + * + * Generated from protobuf field bytes value = 4; + */ + private $value = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $family_name + * The name of the family into which new data should be written. + * Must match `[-_.a-zA-Z0-9]+` + * @type string $column_qualifier + * The qualifier of the column into which new data should be written. + * Can be any byte string, including the empty string. + * @type int|string $timestamp_micros + * The timestamp of the cell into which new data should be written. + * Use -1 for current Bigtable server time. + * Otherwise, the client should set this value itself, noting that the + * default value is a timestamp of zero if the field is left unspecified. + * Values must match the granularity of the table (e.g. micros, millis). + * @type string $value + * The value to be written into the specified cell. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\V2\Data::initOnce(); + parent::__construct($data); + } + + /** + * The name of the family into which new data should be written. + * Must match `[-_.a-zA-Z0-9]+` + * + * Generated from protobuf field string family_name = 1; + * @return string + */ + public function getFamilyName() + { + return $this->family_name; + } + + /** + * The name of the family into which new data should be written. + * Must match `[-_.a-zA-Z0-9]+` + * + * Generated from protobuf field string family_name = 1; + * @param string $var + * @return $this + */ + public function setFamilyName($var) + { + GPBUtil::checkString($var, True); + $this->family_name = $var; + + return $this; + } + + /** + * 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; + * @return string + */ + public function getColumnQualifier() + { + return $this->column_qualifier; + } + + /** + * 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; + * @param string $var + * @return $this + */ + public function setColumnQualifier($var) + { + GPBUtil::checkString($var, False); + $this->column_qualifier = $var; + + return $this; + } + + /** + * The timestamp of the cell into which new data should be written. + * Use -1 for current Bigtable server time. + * Otherwise, the client should set this value itself, noting that the + * default value is a timestamp of zero if the field is left unspecified. + * Values must match the granularity of the table (e.g. micros, millis). + * + * Generated from protobuf field int64 timestamp_micros = 3; + * @return int|string + */ + public function getTimestampMicros() + { + return $this->timestamp_micros; + } + + /** + * The timestamp of the cell into which new data should be written. + * Use -1 for current Bigtable server time. + * Otherwise, the client should set this value itself, noting that the + * default value is a timestamp of zero if the field is left unspecified. + * Values must match the granularity of the table (e.g. micros, millis). + * + * Generated from protobuf field int64 timestamp_micros = 3; + * @param int|string $var + * @return $this + */ + public function setTimestampMicros($var) + { + GPBUtil::checkInt64($var); + $this->timestamp_micros = $var; + + return $this; + } + + /** + * The value to be written into the specified cell. + * + * Generated from protobuf field bytes value = 4; + * @return string + */ + public function getValue() + { + return $this->value; + } + + /** + * The value to be written into the specified cell. + * + * Generated from protobuf field bytes value = 4; + * @param string $var + * @return $this + */ + public function setValue($var) + { + GPBUtil::checkString($var, False); + $this->value = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(SetCell::class, \Google\Cloud\Bigtable\V2\Mutation_SetCell::class); + diff --git a/Bigtable/src/V2/Mutation_DeleteFromColumn.php b/Bigtable/src/V2/Mutation_DeleteFromColumn.php index a984e61b40da..0cd0013a1e3e 100644 --- a/Bigtable/src/V2/Mutation_DeleteFromColumn.php +++ b/Bigtable/src/V2/Mutation_DeleteFromColumn.php @@ -4,125 +4,13 @@ namespace Google\Cloud\Bigtable\V2; -use Google\Protobuf\Internal\GPBType; -use Google\Protobuf\Internal\RepeatedField; -use Google\Protobuf\Internal\GPBUtil; - -/** - * A Mutation which deletes cells from the specified column, optionally - * restricting the deletions to a given timestamp range. - * - * Generated from protobuf message google.bigtable.v2.Mutation.DeleteFromColumn - */ -class Mutation_DeleteFromColumn extends \Google\Protobuf\Internal\Message -{ - /** - * The name of the family from which cells should be deleted. - * Must match `[-_.a-zA-Z0-9]+` - * - * Generated from protobuf field string family_name = 1; - */ - private $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 = ''; - /** - * 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; - - public function __construct() { - \GPBMetadata\Google\Bigtable\V2\Data::initOnce(); - parent::__construct(); - } - - /** - * The name of the family from which cells should be deleted. - * Must match `[-_.a-zA-Z0-9]+` - * - * Generated from protobuf field string family_name = 1; - * @return string - */ - public function getFamilyName() - { - return $this->family_name; - } - - /** - * The name of the family from which cells should be deleted. - * Must match `[-_.a-zA-Z0-9]+` - * - * Generated from protobuf field string family_name = 1; - * @param string $var - * @return $this - */ - public function setFamilyName($var) - { - GPBUtil::checkString($var, True); - $this->family_name = $var; - - return $this; - } - - /** - * 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; - * @return string - */ - public function getColumnQualifier() - { - return $this->column_qualifier; - } - - /** - * 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; - * @param string $var - * @return $this - */ - public function setColumnQualifier($var) - { - GPBUtil::checkString($var, False); - $this->column_qualifier = $var; - - return $this; - } - +if (false) { /** - * The range of timestamps within which cells should be deleted. - * - * Generated from protobuf field .google.bigtable.v2.TimestampRange time_range = 3; - * @return \Google\Cloud\Bigtable\V2\TimestampRange + * This class is deprecated. Use Google\Cloud\Bigtable\V2\Mutation\DeleteFromColumn instead. + * @deprecated */ - public function getTimeRange() - { - return $this->time_range; - } - - /** - * The range of timestamps within which cells should be deleted. - * - * Generated from protobuf field .google.bigtable.v2.TimestampRange time_range = 3; - * @param \Google\Cloud\Bigtable\V2\TimestampRange $var - * @return $this - */ - public function setTimeRange($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\TimestampRange::class); - $this->time_range = $var; - - return $this; - } - + class Mutation_DeleteFromColumn {} } +class_exists(Mutation\DeleteFromColumn::class); +@trigger_error('Google\Cloud\Bigtable\V2\Mutation_DeleteFromColumn is deprecated and will be removed in the next major release. Use Google\Cloud\Bigtable\V2\Mutation\DeleteFromColumn instead', E_USER_DEPRECATED); diff --git a/Bigtable/src/V2/Mutation_DeleteFromFamily.php b/Bigtable/src/V2/Mutation_DeleteFromFamily.php index 5ae7e5010880..d3b63a95d593 100644 --- a/Bigtable/src/V2/Mutation_DeleteFromFamily.php +++ b/Bigtable/src/V2/Mutation_DeleteFromFamily.php @@ -4,57 +4,13 @@ namespace Google\Cloud\Bigtable\V2; -use Google\Protobuf\Internal\GPBType; -use Google\Protobuf\Internal\RepeatedField; -use Google\Protobuf\Internal\GPBUtil; - -/** - * A Mutation which deletes all cells from the specified column family. - * - * Generated from protobuf message google.bigtable.v2.Mutation.DeleteFromFamily - */ -class Mutation_DeleteFromFamily extends \Google\Protobuf\Internal\Message -{ - /** - * The name of the family from which cells should be deleted. - * Must match `[-_.a-zA-Z0-9]+` - * - * Generated from protobuf field string family_name = 1; - */ - private $family_name = ''; - - public function __construct() { - \GPBMetadata\Google\Bigtable\V2\Data::initOnce(); - parent::__construct(); - } - +if (false) { /** - * The name of the family from which cells should be deleted. - * Must match `[-_.a-zA-Z0-9]+` - * - * Generated from protobuf field string family_name = 1; - * @return string + * This class is deprecated. Use Google\Cloud\Bigtable\V2\Mutation\DeleteFromFamily instead. + * @deprecated */ - public function getFamilyName() - { - return $this->family_name; - } - - /** - * The name of the family from which cells should be deleted. - * Must match `[-_.a-zA-Z0-9]+` - * - * Generated from protobuf field string family_name = 1; - * @param string $var - * @return $this - */ - public function setFamilyName($var) - { - GPBUtil::checkString($var, True); - $this->family_name = $var; - - return $this; - } - + class Mutation_DeleteFromFamily {} } +class_exists(Mutation\DeleteFromFamily::class); +@trigger_error('Google\Cloud\Bigtable\V2\Mutation_DeleteFromFamily is deprecated and will be removed in the next major release. Use Google\Cloud\Bigtable\V2\Mutation\DeleteFromFamily instead', E_USER_DEPRECATED); diff --git a/Bigtable/src/V2/Mutation_DeleteFromRow.php b/Bigtable/src/V2/Mutation_DeleteFromRow.php index 975aed3f474e..87f780535259 100644 --- a/Bigtable/src/V2/Mutation_DeleteFromRow.php +++ b/Bigtable/src/V2/Mutation_DeleteFromRow.php @@ -4,22 +4,13 @@ namespace Google\Cloud\Bigtable\V2; -use Google\Protobuf\Internal\GPBType; -use Google\Protobuf\Internal\RepeatedField; -use Google\Protobuf\Internal\GPBUtil; - -/** - * A Mutation which deletes all cells from the containing row. - * - * Generated from protobuf message google.bigtable.v2.Mutation.DeleteFromRow - */ -class Mutation_DeleteFromRow extends \Google\Protobuf\Internal\Message -{ - - public function __construct() { - \GPBMetadata\Google\Bigtable\V2\Data::initOnce(); - parent::__construct(); - } - +if (false) { + /** + * This class is deprecated. Use Google\Cloud\Bigtable\V2\Mutation\DeleteFromRow instead. + * @deprecated + */ + class Mutation_DeleteFromRow {} } +class_exists(Mutation\DeleteFromRow::class); +@trigger_error('Google\Cloud\Bigtable\V2\Mutation_DeleteFromRow is deprecated and will be removed in the next major release. Use Google\Cloud\Bigtable\V2\Mutation\DeleteFromRow instead', E_USER_DEPRECATED); diff --git a/Bigtable/src/V2/Mutation_SetCell.php b/Bigtable/src/V2/Mutation_SetCell.php index 6fd33319d685..07a505d274ff 100644 --- a/Bigtable/src/V2/Mutation_SetCell.php +++ b/Bigtable/src/V2/Mutation_SetCell.php @@ -4,168 +4,13 @@ namespace Google\Cloud\Bigtable\V2; -use Google\Protobuf\Internal\GPBType; -use Google\Protobuf\Internal\RepeatedField; -use Google\Protobuf\Internal\GPBUtil; - -/** - * A Mutation which sets the value of the specified cell. - * - * Generated from protobuf message google.bigtable.v2.Mutation.SetCell - */ -class Mutation_SetCell extends \Google\Protobuf\Internal\Message -{ - /** - * The name of the family into which new data should be written. - * Must match `[-_.a-zA-Z0-9]+` - * - * Generated from protobuf field string family_name = 1; - */ - private $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 = ''; +if (false) { /** - * The timestamp of the cell into which new data should be written. - * Use -1 for current Bigtable server time. - * Otherwise, the client should set this value itself, noting that the - * default value is a timestamp of zero if the field is left unspecified. - * Values must match the granularity of the table (e.g. micros, millis). - * - * Generated from protobuf field int64 timestamp_micros = 3; + * This class is deprecated. Use Google\Cloud\Bigtable\V2\Mutation\SetCell instead. + * @deprecated */ - private $timestamp_micros = 0; - /** - * The value to be written into the specified cell. - * - * Generated from protobuf field bytes value = 4; - */ - private $value = ''; - - public function __construct() { - \GPBMetadata\Google\Bigtable\V2\Data::initOnce(); - parent::__construct(); - } - - /** - * The name of the family into which new data should be written. - * Must match `[-_.a-zA-Z0-9]+` - * - * Generated from protobuf field string family_name = 1; - * @return string - */ - public function getFamilyName() - { - return $this->family_name; - } - - /** - * The name of the family into which new data should be written. - * Must match `[-_.a-zA-Z0-9]+` - * - * Generated from protobuf field string family_name = 1; - * @param string $var - * @return $this - */ - public function setFamilyName($var) - { - GPBUtil::checkString($var, True); - $this->family_name = $var; - - return $this; - } - - /** - * 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; - * @return string - */ - public function getColumnQualifier() - { - return $this->column_qualifier; - } - - /** - * 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; - * @param string $var - * @return $this - */ - public function setColumnQualifier($var) - { - GPBUtil::checkString($var, False); - $this->column_qualifier = $var; - - return $this; - } - - /** - * The timestamp of the cell into which new data should be written. - * Use -1 for current Bigtable server time. - * Otherwise, the client should set this value itself, noting that the - * default value is a timestamp of zero if the field is left unspecified. - * Values must match the granularity of the table (e.g. micros, millis). - * - * Generated from protobuf field int64 timestamp_micros = 3; - * @return int|string - */ - public function getTimestampMicros() - { - return $this->timestamp_micros; - } - - /** - * The timestamp of the cell into which new data should be written. - * Use -1 for current Bigtable server time. - * Otherwise, the client should set this value itself, noting that the - * default value is a timestamp of zero if the field is left unspecified. - * Values must match the granularity of the table (e.g. micros, millis). - * - * Generated from protobuf field int64 timestamp_micros = 3; - * @param int|string $var - * @return $this - */ - public function setTimestampMicros($var) - { - GPBUtil::checkInt64($var); - $this->timestamp_micros = $var; - - return $this; - } - - /** - * The value to be written into the specified cell. - * - * Generated from protobuf field bytes value = 4; - * @return string - */ - public function getValue() - { - return $this->value; - } - - /** - * The value to be written into the specified cell. - * - * Generated from protobuf field bytes value = 4; - * @param string $var - * @return $this - */ - public function setValue($var) - { - GPBUtil::checkString($var, False); - $this->value = $var; - - return $this; - } - + class Mutation_SetCell {} } +class_exists(Mutation\SetCell::class); +@trigger_error('Google\Cloud\Bigtable\V2\Mutation_SetCell is deprecated and will be removed in the next major release. Use Google\Cloud\Bigtable\V2\Mutation\SetCell instead', E_USER_DEPRECATED); diff --git a/Bigtable/src/V2/ReadModifyWriteRowRequest.php b/Bigtable/src/V2/ReadModifyWriteRowRequest.php index 284a192a814c..4f0deec69d8b 100644 --- a/Bigtable/src/V2/ReadModifyWriteRowRequest.php +++ b/Bigtable/src/V2/ReadModifyWriteRowRequest.php @@ -46,9 +46,31 @@ class ReadModifyWriteRowRequest extends \Google\Protobuf\Internal\Message */ private $rules; - public function __construct() { + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $table_name + * The unique name of the table to which the read/modify/write rules should be + * applied. + * Values are of the form + * `projects//instances//tables/
`. + * @type string $app_profile_id + * This value specifies routing for replication. If not specified, the + * "default" application profile will be used. + * @type string $row_key + * The key of the row to which the read/modify/write rules should be applied. + * @type \Google\Cloud\Bigtable\V2\ReadModifyWriteRule[]|\Google\Protobuf\Internal\RepeatedField $rules + * 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. + * } + */ + public function __construct($data = NULL) { \GPBMetadata\Google\Bigtable\V2\Bigtable::initOnce(); - parent::__construct(); + parent::__construct($data); } /** diff --git a/Bigtable/src/V2/ReadModifyWriteRowResponse.php b/Bigtable/src/V2/ReadModifyWriteRowResponse.php index c3c1c77bd5c7..f8254afad2ae 100644 --- a/Bigtable/src/V2/ReadModifyWriteRowResponse.php +++ b/Bigtable/src/V2/ReadModifyWriteRowResponse.php @@ -22,9 +22,19 @@ class ReadModifyWriteRowResponse extends \Google\Protobuf\Internal\Message */ private $row = null; - public function __construct() { + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Bigtable\V2\Row $row + * A Row containing the new contents of all cells modified by the request. + * } + */ + public function __construct($data = NULL) { \GPBMetadata\Google\Bigtable\V2\Bigtable::initOnce(); - parent::__construct(); + parent::__construct($data); } /** diff --git a/Bigtable/src/V2/ReadModifyWriteRule.php b/Bigtable/src/V2/ReadModifyWriteRule.php index 384ced4c7f85..777af3492353 100644 --- a/Bigtable/src/V2/ReadModifyWriteRule.php +++ b/Bigtable/src/V2/ReadModifyWriteRule.php @@ -33,9 +33,33 @@ class ReadModifyWriteRule extends \Google\Protobuf\Internal\Message private $column_qualifier = ''; protected $rule; - public function __construct() { + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $family_name + * The name of the family to which the read/modify/write should be applied. + * Must match `[-_.a-zA-Z0-9]+` + * @type string $column_qualifier + * The qualifier of the column to which the read/modify/write should be + * applied. + * Can be any byte string, including the empty string. + * @type string $append_value + * Rule specifying that `append_value` be appended to the existing value. + * If the targeted cell is unset, it will be treated as containing the + * empty string. + * @type int|string $increment_amount + * Rule specifying that `increment_amount` be added to the existing value. + * If the targeted cell is unset, it will be treated as containing a zero. + * Otherwise, the targeted cell must contain an 8-byte value (interpreted + * as a 64-bit big-endian signed integer), or the entire request will fail. + * } + */ + public function __construct($data = NULL) { \GPBMetadata\Google\Bigtable\V2\Data::initOnce(); - parent::__construct(); + parent::__construct($data); } /** diff --git a/Bigtable/src/V2/ReadRowsRequest.php b/Bigtable/src/V2/ReadRowsRequest.php index 8d3dab89e58f..0b89e69e2de9 100644 --- a/Bigtable/src/V2/ReadRowsRequest.php +++ b/Bigtable/src/V2/ReadRowsRequest.php @@ -51,9 +51,32 @@ class ReadRowsRequest extends \Google\Protobuf\Internal\Message */ private $rows_limit = 0; - public function __construct() { + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $table_name + * The unique name of the table from which to read. + * Values are of the form + * `projects//instances//tables/
`. + * @type string $app_profile_id + * This value specifies routing for replication. If not specified, the + * "default" application profile will be used. + * @type \Google\Cloud\Bigtable\V2\RowSet $rows + * The row keys and/or ranges to read. If not specified, reads from all rows. + * @type \Google\Cloud\Bigtable\V2\RowFilter $filter + * The filter to apply to the contents of the specified row(s). If unset, + * reads the entirety of each row. + * @type int|string $rows_limit + * The read will terminate after committing to N rows' worth of results. The + * default (zero) is to return all results. + * } + */ + public function __construct($data = NULL) { \GPBMetadata\Google\Bigtable\V2\Bigtable::initOnce(); - parent::__construct(); + parent::__construct($data); } /** diff --git a/Bigtable/src/V2/ReadRowsResponse.php b/Bigtable/src/V2/ReadRowsResponse.php index a29ab4cdd655..bba39e27b162 100644 --- a/Bigtable/src/V2/ReadRowsResponse.php +++ b/Bigtable/src/V2/ReadRowsResponse.php @@ -32,9 +32,26 @@ class ReadRowsResponse extends \Google\Protobuf\Internal\Message */ private $last_scanned_row_key = ''; - public function __construct() { + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Bigtable\V2\ReadRowsResponse\CellChunk[]|\Google\Protobuf\Internal\RepeatedField $chunks + * @type string $last_scanned_row_key + * Optionally the server might return the row key of the last row it + * has scanned. The client can use this to construct a more + * efficient retry request if needed: any row keys or portions of + * ranges less than this row key can be dropped from the request. + * This is primarily useful for cases where the server has read a + * lot of data that was filtered out since the last committed row + * key, allowing the client to skip that work on a retry. + * } + */ + public function __construct($data = NULL) { \GPBMetadata\Google\Bigtable\V2\Bigtable::initOnce(); - parent::__construct(); + parent::__construct($data); } /** @@ -48,12 +65,12 @@ public function getChunks() /** * Generated from protobuf field repeated .google.bigtable.v2.ReadRowsResponse.CellChunk chunks = 1; - * @param \Google\Cloud\Bigtable\V2\ReadRowsResponse_CellChunk[]|\Google\Protobuf\Internal\RepeatedField $var + * @param \Google\Cloud\Bigtable\V2\ReadRowsResponse\CellChunk[]|\Google\Protobuf\Internal\RepeatedField $var * @return $this */ public function setChunks($var) { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Bigtable\V2\ReadRowsResponse_CellChunk::class); + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Bigtable\V2\ReadRowsResponse\CellChunk::class); $this->chunks = $arr; return $this; diff --git a/Bigtable/src/V2/ReadRowsResponse/CellChunk.php b/Bigtable/src/V2/ReadRowsResponse/CellChunk.php new file mode 100644 index 000000000000..61a2e93205e3 --- /dev/null +++ b/Bigtable/src/V2/ReadRowsResponse/CellChunk.php @@ -0,0 +1,458 @@ +google.bigtable.v2.ReadRowsResponse.CellChunk + */ +class CellChunk extends \Google\Protobuf\Internal\Message +{ + /** + * The row key for this chunk of data. If the row key is empty, + * this CellChunk is a continuation of the same row as the previous + * CellChunk in the response stream, even if that CellChunk was in a + * previous ReadRowsResponse message. + * + * Generated from protobuf field bytes row_key = 1; + */ + private $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 + * family as the previous CellChunk. The empty string can occur as a + * column family name in a response so clients must check + * explicitly for the presence of this message, not just for + * `family_name.value` being non-empty. + * + * Generated from protobuf field .google.protobuf.StringValue family_name = 2; + */ + private $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 + * as the previous CellChunk. Column qualifiers may be empty so + * clients must check for the presence of this message, not just + * for `qualifier.value` being non-empty. + * + * Generated from protobuf field .google.protobuf.BytesValue qualifier = 3; + */ + private $qualifier = null; + /** + * The cell's stored timestamp, which also uniquely identifies it + * within its column. Values are always expressed in + * microseconds, but individual tables may set a coarser + * granularity to further restrict the allowed values. For + * example, a table which specifies millisecond granularity will + * only allow values of `timestamp_micros` which are multiples of + * 1000. Timestamps are only set in the first CellChunk per cell + * (for cells split into multiple chunks). + * + * Generated from protobuf field int64 timestamp_micros = 4; + */ + private $timestamp_micros = 0; + /** + * Labels applied to the cell by a + * [RowFilter][google.bigtable.v2.RowFilter]. Labels are only set + * on the first CellChunk per cell. + * + * Generated from protobuf field repeated string labels = 5; + */ + private $labels; + /** + * The value stored in the cell. Cell values can be split across + * multiple CellChunks. In that case only the value field will be + * set in CellChunks after the first: the timestamp and labels + * will only be present in the first CellChunk, even if the first + * CellChunk came in a previous ReadRowsResponse. + * + * Generated from protobuf field bytes value = 6; + */ + private $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 + * total length of the cell value. The client can use this size + * to pre-allocate memory to hold the full cell value. + * + * Generated from protobuf field int32 value_size = 7; + */ + private $value_size = 0; + protected $row_status; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $row_key + * The row key for this chunk of data. If the row key is empty, + * this CellChunk is a continuation of the same row as the previous + * CellChunk in the response stream, even if that CellChunk was in a + * previous ReadRowsResponse message. + * @type \Google\Protobuf\StringValue $family_name + * The column family name for this chunk of data. If this message + * is not present this CellChunk is a continuation of the same column + * family as the previous CellChunk. The empty string can occur as a + * column family name in a response so clients must check + * explicitly for the presence of this message, not just for + * `family_name.value` being non-empty. + * @type \Google\Protobuf\BytesValue $qualifier + * The column qualifier for this chunk of data. If this message + * is not present, this CellChunk is a continuation of the same column + * as the previous CellChunk. Column qualifiers may be empty so + * clients must check for the presence of this message, not just + * for `qualifier.value` being non-empty. + * @type int|string $timestamp_micros + * The cell's stored timestamp, which also uniquely identifies it + * within its column. Values are always expressed in + * microseconds, but individual tables may set a coarser + * granularity to further restrict the allowed values. For + * example, a table which specifies millisecond granularity will + * only allow values of `timestamp_micros` which are multiples of + * 1000. Timestamps are only set in the first CellChunk per cell + * (for cells split into multiple chunks). + * @type string[]|\Google\Protobuf\Internal\RepeatedField $labels + * Labels applied to the cell by a + * [RowFilter][google.bigtable.v2.RowFilter]. Labels are only set + * on the first CellChunk per cell. + * @type string $value + * The value stored in the cell. Cell values can be split across + * multiple CellChunks. In that case only the value field will be + * set in CellChunks after the first: the timestamp and labels + * will only be present in the first CellChunk, even if the first + * CellChunk came in a previous ReadRowsResponse. + * @type int $value_size + * 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 + * total length of the cell value. The client can use this size + * to pre-allocate memory to hold the full cell value. + * @type bool $reset_row + * Indicates that the client should drop all previous chunks for + * `row_key`, as it will be re-read from the beginning. + * @type bool $commit_row + * Indicates that the client can safely process all previous chunks for + * `row_key`, as its data has been fully read. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\V2\Bigtable::initOnce(); + parent::__construct($data); + } + + /** + * The row key for this chunk of data. If the row key is empty, + * this CellChunk is a continuation of the same row as the previous + * CellChunk in the response stream, even if that CellChunk was in a + * previous ReadRowsResponse message. + * + * Generated from protobuf field bytes row_key = 1; + * @return string + */ + public function getRowKey() + { + return $this->row_key; + } + + /** + * The row key for this chunk of data. If the row key is empty, + * this CellChunk is a continuation of the same row as the previous + * CellChunk in the response stream, even if that CellChunk was in a + * previous ReadRowsResponse message. + * + * Generated from protobuf field bytes row_key = 1; + * @param string $var + * @return $this + */ + public function setRowKey($var) + { + GPBUtil::checkString($var, False); + $this->row_key = $var; + + return $this; + } + + /** + * The column family name for this chunk of data. If this message + * is not present this CellChunk is a continuation of the same column + * family as the previous CellChunk. The empty string can occur as a + * column family name in a response so clients must check + * explicitly for the presence of this message, not just for + * `family_name.value` being non-empty. + * + * Generated from protobuf field .google.protobuf.StringValue family_name = 2; + * @return \Google\Protobuf\StringValue + */ + public function getFamilyName() + { + return $this->family_name; + } + + /** + * The column family name for this chunk of data. If this message + * is not present this CellChunk is a continuation of the same column + * family as the previous CellChunk. The empty string can occur as a + * column family name in a response so clients must check + * explicitly for the presence of this message, not just for + * `family_name.value` being non-empty. + * + * Generated from protobuf field .google.protobuf.StringValue family_name = 2; + * @param \Google\Protobuf\StringValue $var + * @return $this + */ + public function setFamilyName($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\StringValue::class); + $this->family_name = $var; + + return $this; + } + + /** + * The column qualifier for this chunk of data. If this message + * is not present, this CellChunk is a continuation of the same column + * as the previous CellChunk. Column qualifiers may be empty so + * clients must check for the presence of this message, not just + * for `qualifier.value` being non-empty. + * + * Generated from protobuf field .google.protobuf.BytesValue qualifier = 3; + * @return \Google\Protobuf\BytesValue + */ + public function getQualifier() + { + return $this->qualifier; + } + + /** + * The column qualifier for this chunk of data. If this message + * is not present, this CellChunk is a continuation of the same column + * as the previous CellChunk. Column qualifiers may be empty so + * clients must check for the presence of this message, not just + * for `qualifier.value` being non-empty. + * + * Generated from protobuf field .google.protobuf.BytesValue qualifier = 3; + * @param \Google\Protobuf\BytesValue $var + * @return $this + */ + public function setQualifier($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\BytesValue::class); + $this->qualifier = $var; + + return $this; + } + + /** + * The cell's stored timestamp, which also uniquely identifies it + * within its column. Values are always expressed in + * microseconds, but individual tables may set a coarser + * granularity to further restrict the allowed values. For + * example, a table which specifies millisecond granularity will + * only allow values of `timestamp_micros` which are multiples of + * 1000. Timestamps are only set in the first CellChunk per cell + * (for cells split into multiple chunks). + * + * Generated from protobuf field int64 timestamp_micros = 4; + * @return int|string + */ + public function getTimestampMicros() + { + return $this->timestamp_micros; + } + + /** + * The cell's stored timestamp, which also uniquely identifies it + * within its column. Values are always expressed in + * microseconds, but individual tables may set a coarser + * granularity to further restrict the allowed values. For + * example, a table which specifies millisecond granularity will + * only allow values of `timestamp_micros` which are multiples of + * 1000. Timestamps are only set in the first CellChunk per cell + * (for cells split into multiple chunks). + * + * Generated from protobuf field int64 timestamp_micros = 4; + * @param int|string $var + * @return $this + */ + public function setTimestampMicros($var) + { + GPBUtil::checkInt64($var); + $this->timestamp_micros = $var; + + return $this; + } + + /** + * Labels applied to the cell by a + * [RowFilter][google.bigtable.v2.RowFilter]. Labels are only set + * on the first CellChunk per cell. + * + * Generated from protobuf field repeated string labels = 5; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Labels applied to the cell by a + * [RowFilter][google.bigtable.v2.RowFilter]. Labels are only set + * on the first CellChunk per cell. + * + * Generated from protobuf field repeated string labels = 5; + * @param string[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + + /** + * The value stored in the cell. Cell values can be split across + * multiple CellChunks. In that case only the value field will be + * set in CellChunks after the first: the timestamp and labels + * will only be present in the first CellChunk, even if the first + * CellChunk came in a previous ReadRowsResponse. + * + * Generated from protobuf field bytes value = 6; + * @return string + */ + public function getValue() + { + return $this->value; + } + + /** + * The value stored in the cell. Cell values can be split across + * multiple CellChunks. In that case only the value field will be + * set in CellChunks after the first: the timestamp and labels + * will only be present in the first CellChunk, even if the first + * CellChunk came in a previous ReadRowsResponse. + * + * Generated from protobuf field bytes value = 6; + * @param string $var + * @return $this + */ + public function setValue($var) + { + GPBUtil::checkString($var, False); + $this->value = $var; + + return $this; + } + + /** + * 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 + * total length of the cell value. The client can use this size + * to pre-allocate memory to hold the full cell value. + * + * Generated from protobuf field int32 value_size = 7; + * @return int + */ + public function getValueSize() + { + return $this->value_size; + } + + /** + * 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 + * total length of the cell value. The client can use this size + * to pre-allocate memory to hold the full cell value. + * + * Generated from protobuf field int32 value_size = 7; + * @param int $var + * @return $this + */ + public function setValueSize($var) + { + GPBUtil::checkInt32($var); + $this->value_size = $var; + + return $this; + } + + /** + * Indicates that the client should drop all previous chunks for + * `row_key`, as it will be re-read from the beginning. + * + * Generated from protobuf field bool reset_row = 8; + * @return bool + */ + public function getResetRow() + { + return $this->readOneof(8); + } + + /** + * Indicates that the client should drop all previous chunks for + * `row_key`, as it will be re-read from the beginning. + * + * Generated from protobuf field bool reset_row = 8; + * @param bool $var + * @return $this + */ + public function setResetRow($var) + { + GPBUtil::checkBool($var); + $this->writeOneof(8, $var); + + return $this; + } + + /** + * Indicates that the client can safely process all previous chunks for + * `row_key`, as its data has been fully read. + * + * Generated from protobuf field bool commit_row = 9; + * @return bool + */ + public function getCommitRow() + { + return $this->readOneof(9); + } + + /** + * Indicates that the client can safely process all previous chunks for + * `row_key`, as its data has been fully read. + * + * Generated from protobuf field bool commit_row = 9; + * @param bool $var + * @return $this + */ + public function setCommitRow($var) + { + GPBUtil::checkBool($var); + $this->writeOneof(9, $var); + + return $this; + } + + /** + * @return string + */ + public function getRowStatus() + { + return $this->whichOneof("row_status"); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(CellChunk::class, \Google\Cloud\Bigtable\V2\ReadRowsResponse_CellChunk::class); + diff --git a/Bigtable/src/V2/ReadRowsResponse_CellChunk.php b/Bigtable/src/V2/ReadRowsResponse_CellChunk.php index 00e461492b78..8b3e65f4fb19 100644 --- a/Bigtable/src/V2/ReadRowsResponse_CellChunk.php +++ b/Bigtable/src/V2/ReadRowsResponse_CellChunk.php @@ -4,396 +4,13 @@ namespace Google\Cloud\Bigtable\V2; -use Google\Protobuf\Internal\GPBType; -use Google\Protobuf\Internal\RepeatedField; -use Google\Protobuf\Internal\GPBUtil; - -/** - * Specifies a piece of a row's contents returned as part of the read - * response stream. - * - * Generated from protobuf message google.bigtable.v2.ReadRowsResponse.CellChunk - */ -class ReadRowsResponse_CellChunk extends \Google\Protobuf\Internal\Message -{ - /** - * The row key for this chunk of data. If the row key is empty, - * this CellChunk is a continuation of the same row as the previous - * CellChunk in the response stream, even if that CellChunk was in a - * previous ReadRowsResponse message. - * - * Generated from protobuf field bytes row_key = 1; - */ - private $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 - * family as the previous CellChunk. The empty string can occur as a - * column family name in a response so clients must check - * explicitly for the presence of this message, not just for - * `family_name.value` being non-empty. - * - * Generated from protobuf field .google.protobuf.StringValue family_name = 2; - */ - private $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 - * as the previous CellChunk. Column qualifiers may be empty so - * clients must check for the presence of this message, not just - * for `qualifier.value` being non-empty. - * - * Generated from protobuf field .google.protobuf.BytesValue qualifier = 3; - */ - private $qualifier = null; - /** - * The cell's stored timestamp, which also uniquely identifies it - * within its column. Values are always expressed in - * microseconds, but individual tables may set a coarser - * granularity to further restrict the allowed values. For - * example, a table which specifies millisecond granularity will - * only allow values of `timestamp_micros` which are multiples of - * 1000. Timestamps are only set in the first CellChunk per cell - * (for cells split into multiple chunks). - * - * Generated from protobuf field int64 timestamp_micros = 4; - */ - private $timestamp_micros = 0; - /** - * Labels applied to the cell by a - * [RowFilter][google.bigtable.v2.RowFilter]. Labels are only set - * on the first CellChunk per cell. - * - * Generated from protobuf field repeated string labels = 5; - */ - private $labels; - /** - * The value stored in the cell. Cell values can be split across - * multiple CellChunks. In that case only the value field will be - * set in CellChunks after the first: the timestamp and labels - * will only be present in the first CellChunk, even if the first - * CellChunk came in a previous ReadRowsResponse. - * - * Generated from protobuf field bytes value = 6; - */ - private $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 - * total length of the cell value. The client can use this size - * to pre-allocate memory to hold the full cell value. - * - * Generated from protobuf field int32 value_size = 7; - */ - private $value_size = 0; - protected $row_status; - - public function __construct() { - \GPBMetadata\Google\Bigtable\V2\Bigtable::initOnce(); - parent::__construct(); - } - - /** - * The row key for this chunk of data. If the row key is empty, - * this CellChunk is a continuation of the same row as the previous - * CellChunk in the response stream, even if that CellChunk was in a - * previous ReadRowsResponse message. - * - * Generated from protobuf field bytes row_key = 1; - * @return string - */ - public function getRowKey() - { - return $this->row_key; - } - - /** - * The row key for this chunk of data. If the row key is empty, - * this CellChunk is a continuation of the same row as the previous - * CellChunk in the response stream, even if that CellChunk was in a - * previous ReadRowsResponse message. - * - * Generated from protobuf field bytes row_key = 1; - * @param string $var - * @return $this - */ - public function setRowKey($var) - { - GPBUtil::checkString($var, False); - $this->row_key = $var; - - return $this; - } - - /** - * The column family name for this chunk of data. If this message - * is not present this CellChunk is a continuation of the same column - * family as the previous CellChunk. The empty string can occur as a - * column family name in a response so clients must check - * explicitly for the presence of this message, not just for - * `family_name.value` being non-empty. - * - * Generated from protobuf field .google.protobuf.StringValue family_name = 2; - * @return \Google\Protobuf\StringValue - */ - public function getFamilyName() - { - return $this->family_name; - } - - /** - * The column family name for this chunk of data. If this message - * is not present this CellChunk is a continuation of the same column - * family as the previous CellChunk. The empty string can occur as a - * column family name in a response so clients must check - * explicitly for the presence of this message, not just for - * `family_name.value` being non-empty. - * - * Generated from protobuf field .google.protobuf.StringValue family_name = 2; - * @param \Google\Protobuf\StringValue $var - * @return $this - */ - public function setFamilyName($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\StringValue::class); - $this->family_name = $var; - - return $this; - } - - /** - * The column qualifier for this chunk of data. If this message - * is not present, this CellChunk is a continuation of the same column - * as the previous CellChunk. Column qualifiers may be empty so - * clients must check for the presence of this message, not just - * for `qualifier.value` being non-empty. - * - * Generated from protobuf field .google.protobuf.BytesValue qualifier = 3; - * @return \Google\Protobuf\BytesValue - */ - public function getQualifier() - { - return $this->qualifier; - } - - /** - * The column qualifier for this chunk of data. If this message - * is not present, this CellChunk is a continuation of the same column - * as the previous CellChunk. Column qualifiers may be empty so - * clients must check for the presence of this message, not just - * for `qualifier.value` being non-empty. - * - * Generated from protobuf field .google.protobuf.BytesValue qualifier = 3; - * @param \Google\Protobuf\BytesValue $var - * @return $this - */ - public function setQualifier($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\BytesValue::class); - $this->qualifier = $var; - - return $this; - } - - /** - * The cell's stored timestamp, which also uniquely identifies it - * within its column. Values are always expressed in - * microseconds, but individual tables may set a coarser - * granularity to further restrict the allowed values. For - * example, a table which specifies millisecond granularity will - * only allow values of `timestamp_micros` which are multiples of - * 1000. Timestamps are only set in the first CellChunk per cell - * (for cells split into multiple chunks). - * - * Generated from protobuf field int64 timestamp_micros = 4; - * @return int|string - */ - public function getTimestampMicros() - { - return $this->timestamp_micros; - } - +if (false) { /** - * The cell's stored timestamp, which also uniquely identifies it - * within its column. Values are always expressed in - * microseconds, but individual tables may set a coarser - * granularity to further restrict the allowed values. For - * example, a table which specifies millisecond granularity will - * only allow values of `timestamp_micros` which are multiples of - * 1000. Timestamps are only set in the first CellChunk per cell - * (for cells split into multiple chunks). - * - * Generated from protobuf field int64 timestamp_micros = 4; - * @param int|string $var - * @return $this + * This class is deprecated. Use Google\Cloud\Bigtable\V2\ReadRowsResponse\CellChunk instead. + * @deprecated */ - public function setTimestampMicros($var) - { - GPBUtil::checkInt64($var); - $this->timestamp_micros = $var; - - return $this; - } - - /** - * Labels applied to the cell by a - * [RowFilter][google.bigtable.v2.RowFilter]. Labels are only set - * on the first CellChunk per cell. - * - * Generated from protobuf field repeated string labels = 5; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getLabels() - { - return $this->labels; - } - - /** - * Labels applied to the cell by a - * [RowFilter][google.bigtable.v2.RowFilter]. Labels are only set - * on the first CellChunk per cell. - * - * Generated from protobuf field repeated string labels = 5; - * @param string[]|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setLabels($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->labels = $arr; - - return $this; - } - - /** - * The value stored in the cell. Cell values can be split across - * multiple CellChunks. In that case only the value field will be - * set in CellChunks after the first: the timestamp and labels - * will only be present in the first CellChunk, even if the first - * CellChunk came in a previous ReadRowsResponse. - * - * Generated from protobuf field bytes value = 6; - * @return string - */ - public function getValue() - { - return $this->value; - } - - /** - * The value stored in the cell. Cell values can be split across - * multiple CellChunks. In that case only the value field will be - * set in CellChunks after the first: the timestamp and labels - * will only be present in the first CellChunk, even if the first - * CellChunk came in a previous ReadRowsResponse. - * - * Generated from protobuf field bytes value = 6; - * @param string $var - * @return $this - */ - public function setValue($var) - { - GPBUtil::checkString($var, False); - $this->value = $var; - - return $this; - } - - /** - * 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 - * total length of the cell value. The client can use this size - * to pre-allocate memory to hold the full cell value. - * - * Generated from protobuf field int32 value_size = 7; - * @return int - */ - public function getValueSize() - { - return $this->value_size; - } - - /** - * 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 - * total length of the cell value. The client can use this size - * to pre-allocate memory to hold the full cell value. - * - * Generated from protobuf field int32 value_size = 7; - * @param int $var - * @return $this - */ - public function setValueSize($var) - { - GPBUtil::checkInt32($var); - $this->value_size = $var; - - return $this; - } - - /** - * Indicates that the client should drop all previous chunks for - * `row_key`, as it will be re-read from the beginning. - * - * Generated from protobuf field bool reset_row = 8; - * @return bool - */ - public function getResetRow() - { - return $this->readOneof(8); - } - - /** - * Indicates that the client should drop all previous chunks for - * `row_key`, as it will be re-read from the beginning. - * - * Generated from protobuf field bool reset_row = 8; - * @param bool $var - * @return $this - */ - public function setResetRow($var) - { - GPBUtil::checkBool($var); - $this->writeOneof(8, $var); - - return $this; - } - - /** - * Indicates that the client can safely process all previous chunks for - * `row_key`, as its data has been fully read. - * - * Generated from protobuf field bool commit_row = 9; - * @return bool - */ - public function getCommitRow() - { - return $this->readOneof(9); - } - - /** - * Indicates that the client can safely process all previous chunks for - * `row_key`, as its data has been fully read. - * - * Generated from protobuf field bool commit_row = 9; - * @param bool $var - * @return $this - */ - public function setCommitRow($var) - { - GPBUtil::checkBool($var); - $this->writeOneof(9, $var); - - return $this; - } - - /** - * @return string - */ - public function getRowStatus() - { - return $this->whichOneof("row_status"); - } - + class ReadRowsResponse_CellChunk {} } +class_exists(ReadRowsResponse\CellChunk::class); +@trigger_error('Google\Cloud\Bigtable\V2\ReadRowsResponse_CellChunk is deprecated and will be removed in the next major release. Use Google\Cloud\Bigtable\V2\ReadRowsResponse\CellChunk instead', E_USER_DEPRECATED); diff --git a/Bigtable/src/V2/Row.php b/Bigtable/src/V2/Row.php index e930fecb06f4..435d17679e29 100644 --- a/Bigtable/src/V2/Row.php +++ b/Bigtable/src/V2/Row.php @@ -32,9 +32,24 @@ class Row extends \Google\Protobuf\Internal\Message */ private $families; - public function __construct() { + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $key + * The unique key which identifies this row within its table. This is the same + * key that's used to identify the row in, for example, a MutateRowRequest. + * May contain any non-empty byte string up to 4KiB in length. + * @type \Google\Cloud\Bigtable\V2\Family[]|\Google\Protobuf\Internal\RepeatedField $families + * May be empty, but only if the entire row is empty. + * The mutual ordering of column families is not specified. + * } + */ + public function __construct($data = NULL) { \GPBMetadata\Google\Bigtable\V2\Data::initOnce(); - parent::__construct(); + parent::__construct($data); } /** diff --git a/Bigtable/src/V2/RowFilter.php b/Bigtable/src/V2/RowFilter.php index 5b85e0549cd9..d309ecda8713 100644 --- a/Bigtable/src/V2/RowFilter.php +++ b/Bigtable/src/V2/RowFilter.php @@ -44,9 +44,153 @@ class RowFilter extends \Google\Protobuf\Internal\Message { protected $filter; - public function __construct() { + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Bigtable\V2\RowFilter\Chain $chain + * Applies several RowFilters to the data in sequence, progressively + * narrowing the results. + * @type \Google\Cloud\Bigtable\V2\RowFilter\Interleave $interleave + * Applies several RowFilters to the data in parallel and combines the + * results. + * @type \Google\Cloud\Bigtable\V2\RowFilter\Condition $condition + * Applies one of two possible RowFilters to the data based on the output of + * a predicate RowFilter. + * @type bool $sink + * ADVANCED USE ONLY. + * Hook for introspection into the RowFilter. Outputs all cells directly to + * the output of the read rather than to any parent filter. Consider the + * following example: + * Chain( + * FamilyRegex("A"), + * Interleave( + * All(), + * Chain(Label("foo"), Sink()) + * ), + * QualifierRegex("B") + * ) + * A,A,1,w + * A,B,2,x + * B,B,4,z + * | + * FamilyRegex("A") + * | + * A,A,1,w + * A,B,2,x + * | + * +------------+-------------+ + * | | + * All() Label(foo) + * | | + * A,A,1,w A,A,1,w,labels:[foo] + * A,B,2,x A,B,2,x,labels:[foo] + * | | + * | Sink() --------------+ + * | | | + * +------------+ x------+ A,A,1,w,labels:[foo] + * | A,B,2,x,labels:[foo] + * A,A,1,w | + * A,B,2,x | + * | | + * QualifierRegex("B") | + * | | + * A,B,2,x | + * | | + * +--------------------------------+ + * | + * A,A,1,w,labels:[foo] + * A,B,2,x,labels:[foo] // could be switched + * A,B,2,x // could be switched + * Despite being excluded by the qualifier filter, a copy of every cell + * that reaches the sink is present in the final result. + * As with an [Interleave][google.bigtable.v2.RowFilter.Interleave], + * duplicate cells are possible, and appear in an unspecified mutual order. + * In this case we have a duplicate with column "A:B" and timestamp 2, + * because one copy passed through the all filter while the other was + * passed through the label and sink. Note that one copy has label "foo", + * while the other does not. + * Cannot be used within the `predicate_filter`, `true_filter`, or + * `false_filter` of a [Condition][google.bigtable.v2.RowFilter.Condition]. + * @type bool $pass_all_filter + * Matches all cells, regardless of input. Functionally equivalent to + * leaving `filter` unset, but included for completeness. + * @type bool $block_all_filter + * Does not match any cells, regardless of input. Useful for temporarily + * disabling just part of a filter. + * @type string $row_key_regex_filter + * Matches only cells from rows whose keys satisfy the given RE2 regex. In + * other words, passes through the entire row when the key matches, and + * otherwise produces an empty row. + * Note that, since row keys can contain arbitrary bytes, the `\C` escape + * sequence must be used if a true wildcard is desired. The `.` character + * will not match the new line character `\n`, which may be present in a + * binary key. + * @type float $row_sample_filter + * Matches all cells from a row with probability p, and matches no cells + * from the row with probability 1-p. + * @type string $family_name_regex_filter + * Matches only cells from columns whose families satisfy the given RE2 + * regex. For technical reasons, the regex must not contain the `:` + * character, even if it is not being used as a literal. + * Note that, since column families cannot contain the new line character + * `\n`, it is sufficient to use `.` as a full wildcard when matching + * column family names. + * @type string $column_qualifier_regex_filter + * Matches only cells from columns whose qualifiers satisfy the given RE2 + * regex. + * Note that, since column qualifiers can contain arbitrary bytes, the `\C` + * escape sequence must be used if a true wildcard is desired. The `.` + * character will not match the new line character `\n`, which may be + * present in a binary qualifier. + * @type \Google\Cloud\Bigtable\V2\ColumnRange $column_range_filter + * Matches only cells from columns within the given range. + * @type \Google\Cloud\Bigtable\V2\TimestampRange $timestamp_range_filter + * Matches only cells with timestamps within the given range. + * @type string $value_regex_filter + * Matches only cells with values that satisfy the given regular expression. + * Note that, since cell values can contain arbitrary bytes, the `\C` escape + * sequence must be used if a true wildcard is desired. The `.` character + * will not match the new line character `\n`, which may be present in a + * binary value. + * @type \Google\Cloud\Bigtable\V2\ValueRange $value_range_filter + * Matches only cells with values that fall within the given range. + * @type int $cells_per_row_offset_filter + * Skips the first N cells of each row, matching all subsequent cells. + * If duplicate cells are present, as is possible when using an Interleave, + * each copy of the cell is counted separately. + * @type int $cells_per_row_limit_filter + * Matches only the first N cells of each row. + * If duplicate cells are present, as is possible when using an Interleave, + * each copy of the cell is counted separately. + * @type int $cells_per_column_limit_filter + * Matches only the most recent N cells within each column. For example, + * if N=2, this filter would match column `foo:bar` at timestamps 10 and 9, + * skip all earlier cells in `foo:bar`, and then begin matching again in + * column `foo:bar2`. + * If duplicate cells are present, as is possible when using an Interleave, + * each copy of the cell is counted separately. + * @type bool $strip_value_transformer + * Replaces each cell's value with the empty string. + * @type string $apply_label_transformer + * Applies the given label to all cells in the output row. This allows + * the client to determine which results were produced from which part of + * the filter. + * Values must be at most 15 characters in length, and match the RE2 + * pattern `[a-z0-9\\-]+` + * Due to a technical limitation, it is not currently possible to apply + * multiple labels to a cell. As a result, a Chain may have no more than + * one sub-filter which contains a `apply_label_transformer`. It is okay for + * an Interleave to contain multiple `apply_label_transformers`, as they + * will be applied to separate copies of the input. This may be relaxed in + * the future. + * } + */ + public function __construct($data = NULL) { \GPBMetadata\Google\Bigtable\V2\Data::initOnce(); - parent::__construct(); + parent::__construct($data); } /** @@ -54,7 +198,7 @@ public function __construct() { * narrowing the results. * * Generated from protobuf field .google.bigtable.v2.RowFilter.Chain chain = 1; - * @return \Google\Cloud\Bigtable\V2\RowFilter_Chain + * @return \Google\Cloud\Bigtable\V2\RowFilter\Chain */ public function getChain() { @@ -66,7 +210,7 @@ public function getChain() * narrowing the results. * * Generated from protobuf field .google.bigtable.v2.RowFilter.Chain chain = 1; - * @param \Google\Cloud\Bigtable\V2\RowFilter_Chain $var + * @param \Google\Cloud\Bigtable\V2\RowFilter\Chain $var * @return $this */ public function setChain($var) @@ -82,7 +226,7 @@ public function setChain($var) * results. * * Generated from protobuf field .google.bigtable.v2.RowFilter.Interleave interleave = 2; - * @return \Google\Cloud\Bigtable\V2\RowFilter_Interleave + * @return \Google\Cloud\Bigtable\V2\RowFilter\Interleave */ public function getInterleave() { @@ -94,7 +238,7 @@ public function getInterleave() * results. * * Generated from protobuf field .google.bigtable.v2.RowFilter.Interleave interleave = 2; - * @param \Google\Cloud\Bigtable\V2\RowFilter_Interleave $var + * @param \Google\Cloud\Bigtable\V2\RowFilter\Interleave $var * @return $this */ public function setInterleave($var) @@ -110,7 +254,7 @@ public function setInterleave($var) * a predicate RowFilter. * * Generated from protobuf field .google.bigtable.v2.RowFilter.Condition condition = 3; - * @return \Google\Cloud\Bigtable\V2\RowFilter_Condition + * @return \Google\Cloud\Bigtable\V2\RowFilter\Condition */ public function getCondition() { @@ -122,7 +266,7 @@ public function getCondition() * a predicate RowFilter. * * Generated from protobuf field .google.bigtable.v2.RowFilter.Condition condition = 3; - * @param \Google\Cloud\Bigtable\V2\RowFilter_Condition $var + * @param \Google\Cloud\Bigtable\V2\RowFilter\Condition $var * @return $this */ public function setCondition($var) diff --git a/Bigtable/src/V2/RowFilter/Chain.php b/Bigtable/src/V2/RowFilter/Chain.php new file mode 100644 index 000000000000..83497c66a026 --- /dev/null +++ b/Bigtable/src/V2/RowFilter/Chain.php @@ -0,0 +1,78 @@ +google.bigtable.v2.RowFilter.Chain + */ +class Chain extends \Google\Protobuf\Internal\Message +{ + /** + * The elements of "filters" are chained together to process the input row: + * in row -> f(0) -> intermediate row -> f(1) -> ... -> f(N) -> out row + * The full chain is executed atomically. + * + * Generated from protobuf field repeated .google.bigtable.v2.RowFilter filters = 1; + */ + private $filters; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Bigtable\V2\RowFilter[]|\Google\Protobuf\Internal\RepeatedField $filters + * The elements of "filters" are chained together to process the input row: + * in row -> f(0) -> intermediate row -> f(1) -> ... -> f(N) -> out row + * The full chain is executed atomically. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\V2\Data::initOnce(); + parent::__construct($data); + } + + /** + * The elements of "filters" are chained together to process the input row: + * in row -> f(0) -> intermediate row -> f(1) -> ... -> f(N) -> out row + * The full chain is executed atomically. + * + * Generated from protobuf field repeated .google.bigtable.v2.RowFilter filters = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getFilters() + { + return $this->filters; + } + + /** + * The elements of "filters" are chained together to process the input row: + * in row -> f(0) -> intermediate row -> f(1) -> ... -> f(N) -> out row + * The full chain is executed atomically. + * + * Generated from protobuf field repeated .google.bigtable.v2.RowFilter filters = 1; + * @param \Google\Cloud\Bigtable\V2\RowFilter[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setFilters($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Bigtable\V2\RowFilter::class); + $this->filters = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Chain::class, \Google\Cloud\Bigtable\V2\RowFilter_Chain::class); + diff --git a/Bigtable/src/V2/RowFilter/Condition.php b/Bigtable/src/V2/RowFilter/Condition.php new file mode 100644 index 000000000000..2a7c1eb0c622 --- /dev/null +++ b/Bigtable/src/V2/RowFilter/Condition.php @@ -0,0 +1,159 @@ +google.bigtable.v2.RowFilter.Condition + */ +class Condition extends \Google\Protobuf\Internal\Message +{ + /** + * If `predicate_filter` outputs any cells, then `true_filter` will be + * evaluated on the input row. Otherwise, `false_filter` will be evaluated. + * + * Generated from protobuf field .google.bigtable.v2.RowFilter predicate_filter = 1; + */ + private $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; + /** + * 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 + * false case. + * + * Generated from protobuf field .google.bigtable.v2.RowFilter false_filter = 3; + */ + private $false_filter = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Bigtable\V2\RowFilter $predicate_filter + * If `predicate_filter` outputs any cells, then `true_filter` will be + * evaluated on the input row. Otherwise, `false_filter` will be evaluated. + * @type \Google\Cloud\Bigtable\V2\RowFilter $true_filter + * 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. + * @type \Google\Cloud\Bigtable\V2\RowFilter $false_filter + * 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 + * false case. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\V2\Data::initOnce(); + parent::__construct($data); + } + + /** + * If `predicate_filter` outputs any cells, then `true_filter` will be + * evaluated on the input row. Otherwise, `false_filter` will be evaluated. + * + * Generated from protobuf field .google.bigtable.v2.RowFilter predicate_filter = 1; + * @return \Google\Cloud\Bigtable\V2\RowFilter + */ + public function getPredicateFilter() + { + return $this->predicate_filter; + } + + /** + * If `predicate_filter` outputs any cells, then `true_filter` will be + * evaluated on the input row. Otherwise, `false_filter` will be evaluated. + * + * Generated from protobuf field .google.bigtable.v2.RowFilter predicate_filter = 1; + * @param \Google\Cloud\Bigtable\V2\RowFilter $var + * @return $this + */ + public function setPredicateFilter($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\RowFilter::class); + $this->predicate_filter = $var; + + return $this; + } + + /** + * 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; + * @return \Google\Cloud\Bigtable\V2\RowFilter + */ + public function getTrueFilter() + { + return $this->true_filter; + } + + /** + * 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; + * @param \Google\Cloud\Bigtable\V2\RowFilter $var + * @return $this + */ + public function setTrueFilter($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\RowFilter::class); + $this->true_filter = $var; + + return $this; + } + + /** + * 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 + * false case. + * + * Generated from protobuf field .google.bigtable.v2.RowFilter false_filter = 3; + * @return \Google\Cloud\Bigtable\V2\RowFilter + */ + public function getFalseFilter() + { + return $this->false_filter; + } + + /** + * 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 + * false case. + * + * Generated from protobuf field .google.bigtable.v2.RowFilter false_filter = 3; + * @param \Google\Cloud\Bigtable\V2\RowFilter $var + * @return $this + */ + public function setFalseFilter($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\RowFilter::class); + $this->false_filter = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Condition::class, \Google\Cloud\Bigtable\V2\RowFilter_Condition::class); + diff --git a/Bigtable/src/V2/RowFilter/Interleave.php b/Bigtable/src/V2/RowFilter/Interleave.php new file mode 100644 index 000000000000..8c49702f0389 --- /dev/null +++ b/Bigtable/src/V2/RowFilter/Interleave.php @@ -0,0 +1,159 @@ +google.bigtable.v2.RowFilter.Interleave + */ +class Interleave extends \Google\Protobuf\Internal\Message +{ + /** + * The elements of "filters" all process a copy of the input row, and the + * results are pooled, sorted, and combined into a single output row. + * If multiple cells are produced with the same column and timestamp, + * they will all appear in the output row in an unspecified mutual order. + * Consider the following example, with three filters: + * input row + * | + * ----------------------------------------------------- + * | | | + * f(0) f(1) f(2) + * | | | + * 1: foo,bar,10,x foo,bar,10,z far,bar,7,a + * 2: foo,blah,11,z far,blah,5,x far,blah,5,x + * | | | + * ----------------------------------------------------- + * | + * 1: foo,bar,10,z // could have switched with #2 + * 2: foo,bar,10,x // could have switched with #1 + * 3: foo,blah,11,z + * 4: far,bar,7,a + * 5: far,blah,5,x // identical to #6 + * 6: far,blah,5,x // identical to #5 + * All interleaved filters are executed atomically. + * + * Generated from protobuf field repeated .google.bigtable.v2.RowFilter filters = 1; + */ + private $filters; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Bigtable\V2\RowFilter[]|\Google\Protobuf\Internal\RepeatedField $filters + * The elements of "filters" all process a copy of the input row, and the + * results are pooled, sorted, and combined into a single output row. + * If multiple cells are produced with the same column and timestamp, + * they will all appear in the output row in an unspecified mutual order. + * Consider the following example, with three filters: + * input row + * | + * ----------------------------------------------------- + * | | | + * f(0) f(1) f(2) + * | | | + * 1: foo,bar,10,x foo,bar,10,z far,bar,7,a + * 2: foo,blah,11,z far,blah,5,x far,blah,5,x + * | | | + * ----------------------------------------------------- + * | + * 1: foo,bar,10,z // could have switched with #2 + * 2: foo,bar,10,x // could have switched with #1 + * 3: foo,blah,11,z + * 4: far,bar,7,a + * 5: far,blah,5,x // identical to #6 + * 6: far,blah,5,x // identical to #5 + * All interleaved filters are executed atomically. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\V2\Data::initOnce(); + parent::__construct($data); + } + + /** + * The elements of "filters" all process a copy of the input row, and the + * results are pooled, sorted, and combined into a single output row. + * If multiple cells are produced with the same column and timestamp, + * they will all appear in the output row in an unspecified mutual order. + * Consider the following example, with three filters: + * input row + * | + * ----------------------------------------------------- + * | | | + * f(0) f(1) f(2) + * | | | + * 1: foo,bar,10,x foo,bar,10,z far,bar,7,a + * 2: foo,blah,11,z far,blah,5,x far,blah,5,x + * | | | + * ----------------------------------------------------- + * | + * 1: foo,bar,10,z // could have switched with #2 + * 2: foo,bar,10,x // could have switched with #1 + * 3: foo,blah,11,z + * 4: far,bar,7,a + * 5: far,blah,5,x // identical to #6 + * 6: far,blah,5,x // identical to #5 + * All interleaved filters are executed atomically. + * + * Generated from protobuf field repeated .google.bigtable.v2.RowFilter filters = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getFilters() + { + return $this->filters; + } + + /** + * The elements of "filters" all process a copy of the input row, and the + * results are pooled, sorted, and combined into a single output row. + * If multiple cells are produced with the same column and timestamp, + * they will all appear in the output row in an unspecified mutual order. + * Consider the following example, with three filters: + * input row + * | + * ----------------------------------------------------- + * | | | + * f(0) f(1) f(2) + * | | | + * 1: foo,bar,10,x foo,bar,10,z far,bar,7,a + * 2: foo,blah,11,z far,blah,5,x far,blah,5,x + * | | | + * ----------------------------------------------------- + * | + * 1: foo,bar,10,z // could have switched with #2 + * 2: foo,bar,10,x // could have switched with #1 + * 3: foo,blah,11,z + * 4: far,bar,7,a + * 5: far,blah,5,x // identical to #6 + * 6: far,blah,5,x // identical to #5 + * All interleaved filters are executed atomically. + * + * Generated from protobuf field repeated .google.bigtable.v2.RowFilter filters = 1; + * @param \Google\Cloud\Bigtable\V2\RowFilter[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setFilters($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Bigtable\V2\RowFilter::class); + $this->filters = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Interleave::class, \Google\Cloud\Bigtable\V2\RowFilter_Interleave::class); + diff --git a/Bigtable/src/V2/RowFilter_Chain.php b/Bigtable/src/V2/RowFilter_Chain.php index b01ae865f207..7b673832ddcc 100644 --- a/Bigtable/src/V2/RowFilter_Chain.php +++ b/Bigtable/src/V2/RowFilter_Chain.php @@ -4,60 +4,13 @@ namespace Google\Cloud\Bigtable\V2; -use Google\Protobuf\Internal\GPBType; -use Google\Protobuf\Internal\RepeatedField; -use Google\Protobuf\Internal\GPBUtil; - -/** - * A RowFilter which sends rows through several RowFilters in sequence. - * - * Generated from protobuf message google.bigtable.v2.RowFilter.Chain - */ -class RowFilter_Chain extends \Google\Protobuf\Internal\Message -{ - /** - * The elements of "filters" are chained together to process the input row: - * in row -> f(0) -> intermediate row -> f(1) -> ... -> f(N) -> out row - * The full chain is executed atomically. - * - * Generated from protobuf field repeated .google.bigtable.v2.RowFilter filters = 1; - */ - private $filters; - - public function __construct() { - \GPBMetadata\Google\Bigtable\V2\Data::initOnce(); - parent::__construct(); - } - +if (false) { /** - * The elements of "filters" are chained together to process the input row: - * in row -> f(0) -> intermediate row -> f(1) -> ... -> f(N) -> out row - * The full chain is executed atomically. - * - * Generated from protobuf field repeated .google.bigtable.v2.RowFilter filters = 1; - * @return \Google\Protobuf\Internal\RepeatedField + * This class is deprecated. Use Google\Cloud\Bigtable\V2\RowFilter\Chain instead. + * @deprecated */ - public function getFilters() - { - return $this->filters; - } - - /** - * The elements of "filters" are chained together to process the input row: - * in row -> f(0) -> intermediate row -> f(1) -> ... -> f(N) -> out row - * The full chain is executed atomically. - * - * Generated from protobuf field repeated .google.bigtable.v2.RowFilter filters = 1; - * @param \Google\Cloud\Bigtable\V2\RowFilter[]|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setFilters($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Bigtable\V2\RowFilter::class); - $this->filters = $arr; - - return $this; - } - + class RowFilter_Chain {} } +class_exists(RowFilter\Chain::class); +@trigger_error('Google\Cloud\Bigtable\V2\RowFilter_Chain is deprecated and will be removed in the next major release. Use Google\Cloud\Bigtable\V2\RowFilter\Chain instead', E_USER_DEPRECATED); diff --git a/Bigtable/src/V2/RowFilter_Condition.php b/Bigtable/src/V2/RowFilter_Condition.php index 8e158716a2f1..d6d1e9602be8 100644 --- a/Bigtable/src/V2/RowFilter_Condition.php +++ b/Bigtable/src/V2/RowFilter_Condition.php @@ -4,135 +4,13 @@ namespace Google\Cloud\Bigtable\V2; -use Google\Protobuf\Internal\GPBType; -use Google\Protobuf\Internal\RepeatedField; -use Google\Protobuf\Internal\GPBUtil; - -/** - * A RowFilter which evaluates one of two possible RowFilters, depending on - * whether or not a predicate RowFilter outputs any cells from the input row. - * IMPORTANT NOTE: The predicate filter does not execute atomically with the - * true and false filters, which may lead to inconsistent or unexpected - * results. Additionally, Condition filters have poor performance, especially - * when filters are set for the false condition. - * - * Generated from protobuf message google.bigtable.v2.RowFilter.Condition - */ -class RowFilter_Condition extends \Google\Protobuf\Internal\Message -{ - /** - * If `predicate_filter` outputs any cells, then `true_filter` will be - * evaluated on the input row. Otherwise, `false_filter` will be evaluated. - * - * Generated from protobuf field .google.bigtable.v2.RowFilter predicate_filter = 1; - */ - private $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; - /** - * 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 - * false case. - * - * Generated from protobuf field .google.bigtable.v2.RowFilter false_filter = 3; - */ - private $false_filter = null; - - public function __construct() { - \GPBMetadata\Google\Bigtable\V2\Data::initOnce(); - parent::__construct(); - } - - /** - * If `predicate_filter` outputs any cells, then `true_filter` will be - * evaluated on the input row. Otherwise, `false_filter` will be evaluated. - * - * Generated from protobuf field .google.bigtable.v2.RowFilter predicate_filter = 1; - * @return \Google\Cloud\Bigtable\V2\RowFilter - */ - public function getPredicateFilter() - { - return $this->predicate_filter; - } - - /** - * If `predicate_filter` outputs any cells, then `true_filter` will be - * evaluated on the input row. Otherwise, `false_filter` will be evaluated. - * - * Generated from protobuf field .google.bigtable.v2.RowFilter predicate_filter = 1; - * @param \Google\Cloud\Bigtable\V2\RowFilter $var - * @return $this - */ - public function setPredicateFilter($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\RowFilter::class); - $this->predicate_filter = $var; - - return $this; - } - - /** - * 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; - * @return \Google\Cloud\Bigtable\V2\RowFilter - */ - public function getTrueFilter() - { - return $this->true_filter; - } - - /** - * 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; - * @param \Google\Cloud\Bigtable\V2\RowFilter $var - * @return $this - */ - public function setTrueFilter($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\RowFilter::class); - $this->true_filter = $var; - - return $this; - } - +if (false) { /** - * 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 - * false case. - * - * Generated from protobuf field .google.bigtable.v2.RowFilter false_filter = 3; - * @return \Google\Cloud\Bigtable\V2\RowFilter + * This class is deprecated. Use Google\Cloud\Bigtable\V2\RowFilter\Condition instead. + * @deprecated */ - public function getFalseFilter() - { - return $this->false_filter; - } - - /** - * 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 - * false case. - * - * Generated from protobuf field .google.bigtable.v2.RowFilter false_filter = 3; - * @param \Google\Cloud\Bigtable\V2\RowFilter $var - * @return $this - */ - public function setFalseFilter($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\RowFilter::class); - $this->false_filter = $var; - - return $this; - } - + class RowFilter_Condition {} } +class_exists(RowFilter\Condition::class); +@trigger_error('Google\Cloud\Bigtable\V2\RowFilter_Condition is deprecated and will be removed in the next major release. Use Google\Cloud\Bigtable\V2\RowFilter\Condition instead', E_USER_DEPRECATED); diff --git a/Bigtable/src/V2/RowFilter_Interleave.php b/Bigtable/src/V2/RowFilter_Interleave.php index aefb50e8ea75..b7e51c14ac73 100644 --- a/Bigtable/src/V2/RowFilter_Interleave.php +++ b/Bigtable/src/V2/RowFilter_Interleave.php @@ -4,121 +4,13 @@ namespace Google\Cloud\Bigtable\V2; -use Google\Protobuf\Internal\GPBType; -use Google\Protobuf\Internal\RepeatedField; -use Google\Protobuf\Internal\GPBUtil; - -/** - * A RowFilter which sends each row to each of several component - * RowFilters and interleaves the results. - * - * Generated from protobuf message google.bigtable.v2.RowFilter.Interleave - */ -class RowFilter_Interleave extends \Google\Protobuf\Internal\Message -{ - /** - * The elements of "filters" all process a copy of the input row, and the - * results are pooled, sorted, and combined into a single output row. - * If multiple cells are produced with the same column and timestamp, - * they will all appear in the output row in an unspecified mutual order. - * Consider the following example, with three filters: - * input row - * | - * ----------------------------------------------------- - * | | | - * f(0) f(1) f(2) - * | | | - * 1: foo,bar,10,x foo,bar,10,z far,bar,7,a - * 2: foo,blah,11,z far,blah,5,x far,blah,5,x - * | | | - * ----------------------------------------------------- - * | - * 1: foo,bar,10,z // could have switched with #2 - * 2: foo,bar,10,x // could have switched with #1 - * 3: foo,blah,11,z - * 4: far,bar,7,a - * 5: far,blah,5,x // identical to #6 - * 6: far,blah,5,x // identical to #5 - * All interleaved filters are executed atomically. - * - * Generated from protobuf field repeated .google.bigtable.v2.RowFilter filters = 1; - */ - private $filters; - - public function __construct() { - \GPBMetadata\Google\Bigtable\V2\Data::initOnce(); - parent::__construct(); - } - +if (false) { /** - * The elements of "filters" all process a copy of the input row, and the - * results are pooled, sorted, and combined into a single output row. - * If multiple cells are produced with the same column and timestamp, - * they will all appear in the output row in an unspecified mutual order. - * Consider the following example, with three filters: - * input row - * | - * ----------------------------------------------------- - * | | | - * f(0) f(1) f(2) - * | | | - * 1: foo,bar,10,x foo,bar,10,z far,bar,7,a - * 2: foo,blah,11,z far,blah,5,x far,blah,5,x - * | | | - * ----------------------------------------------------- - * | - * 1: foo,bar,10,z // could have switched with #2 - * 2: foo,bar,10,x // could have switched with #1 - * 3: foo,blah,11,z - * 4: far,bar,7,a - * 5: far,blah,5,x // identical to #6 - * 6: far,blah,5,x // identical to #5 - * All interleaved filters are executed atomically. - * - * Generated from protobuf field repeated .google.bigtable.v2.RowFilter filters = 1; - * @return \Google\Protobuf\Internal\RepeatedField + * This class is deprecated. Use Google\Cloud\Bigtable\V2\RowFilter\Interleave instead. + * @deprecated */ - public function getFilters() - { - return $this->filters; - } - - /** - * The elements of "filters" all process a copy of the input row, and the - * results are pooled, sorted, and combined into a single output row. - * If multiple cells are produced with the same column and timestamp, - * they will all appear in the output row in an unspecified mutual order. - * Consider the following example, with three filters: - * input row - * | - * ----------------------------------------------------- - * | | | - * f(0) f(1) f(2) - * | | | - * 1: foo,bar,10,x foo,bar,10,z far,bar,7,a - * 2: foo,blah,11,z far,blah,5,x far,blah,5,x - * | | | - * ----------------------------------------------------- - * | - * 1: foo,bar,10,z // could have switched with #2 - * 2: foo,bar,10,x // could have switched with #1 - * 3: foo,blah,11,z - * 4: far,bar,7,a - * 5: far,blah,5,x // identical to #6 - * 6: far,blah,5,x // identical to #5 - * All interleaved filters are executed atomically. - * - * Generated from protobuf field repeated .google.bigtable.v2.RowFilter filters = 1; - * @param \Google\Cloud\Bigtable\V2\RowFilter[]|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setFilters($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Bigtable\V2\RowFilter::class); - $this->filters = $arr; - - return $this; - } - + class RowFilter_Interleave {} } +class_exists(RowFilter\Interleave::class); +@trigger_error('Google\Cloud\Bigtable\V2\RowFilter_Interleave is deprecated and will be removed in the next major release. Use Google\Cloud\Bigtable\V2\RowFilter\Interleave instead', E_USER_DEPRECATED); diff --git a/Bigtable/src/V2/RowRange.php b/Bigtable/src/V2/RowRange.php index 6e3e5ac6ea54..b60e1af17166 100644 --- a/Bigtable/src/V2/RowRange.php +++ b/Bigtable/src/V2/RowRange.php @@ -18,9 +18,25 @@ class RowRange extends \Google\Protobuf\Internal\Message protected $start_key; protected $end_key; - public function __construct() { + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $start_key_closed + * Used when giving an inclusive lower bound for the range. + * @type string $start_key_open + * Used when giving an exclusive lower bound for the range. + * @type string $end_key_open + * Used when giving an exclusive upper bound for the range. + * @type string $end_key_closed + * Used when giving an inclusive upper bound for the range. + * } + */ + public function __construct($data = NULL) { \GPBMetadata\Google\Bigtable\V2\Data::initOnce(); - parent::__construct(); + parent::__construct($data); } /** diff --git a/Bigtable/src/V2/RowSet.php b/Bigtable/src/V2/RowSet.php index 060466181b95..bd70aa99d969 100644 --- a/Bigtable/src/V2/RowSet.php +++ b/Bigtable/src/V2/RowSet.php @@ -28,9 +28,21 @@ class RowSet extends \Google\Protobuf\Internal\Message */ private $row_ranges; - public function __construct() { + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string[]|\Google\Protobuf\Internal\RepeatedField $row_keys + * Single rows included in the set. + * @type \Google\Cloud\Bigtable\V2\RowRange[]|\Google\Protobuf\Internal\RepeatedField $row_ranges + * Contiguous row ranges included in the set. + * } + */ + public function __construct($data = NULL) { \GPBMetadata\Google\Bigtable\V2\Data::initOnce(); - parent::__construct(); + parent::__construct($data); } /** diff --git a/Bigtable/src/V2/SampleRowKeysRequest.php b/Bigtable/src/V2/SampleRowKeysRequest.php index 4cc524334e25..d1b089d4b5d4 100644 --- a/Bigtable/src/V2/SampleRowKeysRequest.php +++ b/Bigtable/src/V2/SampleRowKeysRequest.php @@ -31,9 +31,24 @@ class SampleRowKeysRequest extends \Google\Protobuf\Internal\Message */ private $app_profile_id = ''; - public function __construct() { + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $table_name + * The unique name of the table from which to sample row keys. + * Values are of the form + * `projects//instances//tables/
`. + * @type string $app_profile_id + * This value specifies routing for replication. If not specified, the + * "default" application profile will be used. + * } + */ + public function __construct($data = NULL) { \GPBMetadata\Google\Bigtable\V2\Bigtable::initOnce(); - parent::__construct(); + parent::__construct($data); } /** diff --git a/Bigtable/src/V2/SampleRowKeysResponse.php b/Bigtable/src/V2/SampleRowKeysResponse.php index 842b5cbebfad..2dc0b5c3b217 100644 --- a/Bigtable/src/V2/SampleRowKeysResponse.php +++ b/Bigtable/src/V2/SampleRowKeysResponse.php @@ -37,9 +37,30 @@ class SampleRowKeysResponse extends \Google\Protobuf\Internal\Message */ private $offset_bytes = 0; - public function __construct() { + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $row_key + * Sorted streamed sequence of sample row keys in the table. The table might + * have contents before the first row key in the list and after the last one, + * but a key containing the empty string indicates "end of table" and will be + * the last response given, if present. + * Note that row keys in this list may not have ever been written to or read + * from, and users should therefore not make any assumptions about the row key + * structure that are specific to their use case. + * @type int|string $offset_bytes + * Approximate total storage space used by all rows in the table which precede + * `row_key`. Buffering the contents of all rows between two subsequent + * samples would require space roughly equal to the difference in their + * `offset_bytes` fields. + * } + */ + public function __construct($data = NULL) { \GPBMetadata\Google\Bigtable\V2\Bigtable::initOnce(); - parent::__construct(); + parent::__construct($data); } /** diff --git a/Bigtable/src/V2/TimestampRange.php b/Bigtable/src/V2/TimestampRange.php index 9d0e31e42169..a75b65d5f109 100644 --- a/Bigtable/src/V2/TimestampRange.php +++ b/Bigtable/src/V2/TimestampRange.php @@ -28,9 +28,21 @@ class TimestampRange extends \Google\Protobuf\Internal\Message */ private $end_timestamp_micros = 0; - public function __construct() { + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $start_timestamp_micros + * Inclusive lower bound. If left empty, interpreted as 0. + * @type int|string $end_timestamp_micros + * Exclusive upper bound. If left empty, interpreted as infinity. + * } + */ + public function __construct($data = NULL) { \GPBMetadata\Google\Bigtable\V2\Data::initOnce(); - parent::__construct(); + parent::__construct($data); } /** diff --git a/Bigtable/src/V2/ValueRange.php b/Bigtable/src/V2/ValueRange.php index 2892359cf431..6c44a8d4efe3 100644 --- a/Bigtable/src/V2/ValueRange.php +++ b/Bigtable/src/V2/ValueRange.php @@ -18,9 +18,25 @@ class ValueRange extends \Google\Protobuf\Internal\Message protected $start_value; protected $end_value; - public function __construct() { + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $start_value_closed + * Used when giving an inclusive lower bound for the range. + * @type string $start_value_open + * Used when giving an exclusive lower bound for the range. + * @type string $end_value_closed + * Used when giving an inclusive upper bound for the range. + * @type string $end_value_open + * Used when giving an exclusive upper bound for the range. + * } + */ + public function __construct($data = NULL) { \GPBMetadata\Google\Bigtable\V2\Data::initOnce(); - parent::__construct(); + parent::__construct($data); } /** diff --git a/Bigtable/src/V2/resources/bigtable_client_config.json b/Bigtable/src/V2/resources/bigtable_client_config.json index bb7d68ad068d..5127b8ec2154 100644 --- a/Bigtable/src/V2/resources/bigtable_client_config.json +++ b/Bigtable/src/V2/resources/bigtable_client_config.json @@ -17,11 +17,20 @@ "rpc_timeout_multiplier": 1.0, "max_rpc_timeout_millis": 20000, "total_timeout_millis": 600000 + }, + "streaming": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 20000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 20000, + "total_timeout_millis": 3600000 } }, "methods": { "ReadRows": { - "timeout_millis": 60000 + "timeout_millis": 3600000 }, "SampleRowKeys": { "timeout_millis": 60000 diff --git a/Bigtable/tests/Unit/Admin/V2/BigtableInstanceAdminClientTest.php b/Bigtable/tests/Unit/Admin/V2/BigtableInstanceAdminClientTest.php index 0f42ec0afdd3..835545e7c1cb 100644 --- a/Bigtable/tests/Unit/Admin/V2/BigtableInstanceAdminClientTest.php +++ b/Bigtable/tests/Unit/Admin/V2/BigtableInstanceAdminClientTest.php @@ -1014,11 +1014,11 @@ public function updateClusterTest() $incompleteOperation->setDone(false); $transport->addResponse($incompleteOperation); $name2 = 'name2-1052831874'; - $location2 = 'location21541837352'; + $location = 'location1901043637'; $serveNodes2 = 1623486220; $expectedResponse = new Cluster(); $expectedResponse->setName($name2); - $expectedResponse->setLocation($location2); + $expectedResponse->setLocation($location); $expectedResponse->setServeNodes($serveNodes2); $anyResponse = new Any(); $anyResponse->setValue($expectedResponse->serializeToString()); @@ -1030,10 +1030,9 @@ public function updateClusterTest() // Mock request $formattedName = $client->clusterName('[PROJECT]', '[INSTANCE]', '[CLUSTER]'); - $location = 'location1901043637'; $serveNodes = 1288838783; - $response = $client->updateCluster($formattedName, $location, $serveNodes); + $response = $client->updateCluster($formattedName, $serveNodes); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); $apiRequests = $transport->popReceivedCalls(); @@ -1047,9 +1046,6 @@ public function updateClusterTest() $actualValue = $actualApiRequestObject->getName(); $this->assertProtobufEquals($formattedName, $actualValue); - $actualValue = $actualApiRequestObject->getLocation(); - - $this->assertProtobufEquals($location, $actualValue); $actualValue = $actualApiRequestObject->getServeNodes(); $this->assertProtobufEquals($serveNodes, $actualValue); @@ -1115,10 +1111,9 @@ public function updateClusterExceptionTest() // Mock request $formattedName = $client->clusterName('[PROJECT]', '[INSTANCE]', '[CLUSTER]'); - $location = 'location1901043637'; $serveNodes = 1288838783; - $response = $client->updateCluster($formattedName, $location, $serveNodes); + $response = $client->updateCluster($formattedName, $serveNodes); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); From 24482348a8977abf475cc19cd24a27791ffa3a06 Mon Sep 17 00:00:00 2001 From: Dave Supplee Date: Thu, 16 Aug 2018 16:47:37 -0400 Subject: [PATCH 2/2] run updated synth script (thanks @jdpedrie) --- .../BigtableInstanceAdminGapicClient.php | 10 +++---- .../Gapic/BigtableTableAdminGapicClient.php | 12 ++++---- Bigtable/src/V2/Gapic/BigtableGapicClient.php | 4 +-- Bigtable/synth.py | 30 +++++++++++++++++++ 4 files changed, 43 insertions(+), 13 deletions(-) diff --git a/Bigtable/src/Admin/V2/Gapic/BigtableInstanceAdminGapicClient.php b/Bigtable/src/Admin/V2/Gapic/BigtableInstanceAdminGapicClient.php index 4ac5c63dd18d..8e50f1756e01 100644 --- a/Bigtable/src/Admin/V2/Gapic/BigtableInstanceAdminGapicClient.php +++ b/Bigtable/src/Admin/V2/Gapic/BigtableInstanceAdminGapicClient.php @@ -49,7 +49,7 @@ use Google\Cloud\Bigtable\Admin\V2\GetClusterRequest; use Google\Cloud\Bigtable\Admin\V2\GetInstanceRequest; use Google\Cloud\Bigtable\Admin\V2\Instance; -use Google\Cloud\Bigtable\Admin\V2\Instance_Type; +use Google\Cloud\Bigtable\Admin\V2\Instance\Type; use Google\Cloud\Bigtable\Admin\V2\ListAppProfilesRequest; use Google\Cloud\Bigtable\Admin\V2\ListAppProfilesResponse; use Google\Cloud\Bigtable\Admin\V2\ListClustersRequest; @@ -690,7 +690,7 @@ public function listInstances($parent, array $optionalArgs = []) * try { * $formattedName = $bigtableInstanceAdminClient->instanceName('[PROJECT]', '[INSTANCE]'); * $displayName = ''; - * $type = Instance_Type::TYPE_UNSPECIFIED; + * $type = Instance\Type::TYPE_UNSPECIFIED; * $labels = []; * $response = $bigtableInstanceAdminClient->updateInstance($formattedName, $displayName, $type, $labels); * } finally { @@ -705,7 +705,7 @@ public function listInstances($parent, array $optionalArgs = []) * 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} + * 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 @@ -723,7 +723,7 @@ public function listInstances($parent, array $optionalArgs = []) * @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} + * For allowed values, use constants defined on {@see \Google\Cloud\Bigtable\Admin\V2\Instance\State} * @type RetrySettings|array $retrySettings * Retry settings to use for this call. Can be a * {@see Google\ApiCore\RetrySettings} object, or an associative array @@ -1151,7 +1151,7 @@ public function listClusters($parent, array $optionalArgs = []) * @type int $state * (`OutputOnly`) * The current state of the cluster. - * For allowed values, use constants defined on {@see \Google\Cloud\Bigtable\Admin\V2\Cluster_State} + * For allowed values, use constants defined on {@see \Google\Cloud\Bigtable\Admin\V2\Cluster\State} * @type int $defaultStorageType * (`CreationOnly`) * The type of storage used by this cluster to serve its diff --git a/Bigtable/src/Admin/V2/Gapic/BigtableTableAdminGapicClient.php b/Bigtable/src/Admin/V2/Gapic/BigtableTableAdminGapicClient.php index 434462028fac..5cf801798b81 100644 --- a/Bigtable/src/Admin/V2/Gapic/BigtableTableAdminGapicClient.php +++ b/Bigtable/src/Admin/V2/Gapic/BigtableTableAdminGapicClient.php @@ -41,7 +41,7 @@ use Google\Cloud\Bigtable\Admin\V2\CheckConsistencyResponse; use Google\Cloud\Bigtable\Admin\V2\CreateTableFromSnapshotRequest; use Google\Cloud\Bigtable\Admin\V2\CreateTableRequest; -use Google\Cloud\Bigtable\Admin\V2\CreateTableRequest_Split; +use Google\Cloud\Bigtable\Admin\V2\CreateTableRequest\Split; use Google\Cloud\Bigtable\Admin\V2\DeleteSnapshotRequest; use Google\Cloud\Bigtable\Admin\V2\DeleteTableRequest; use Google\Cloud\Bigtable\Admin\V2\DropRowRangeRequest; @@ -54,7 +54,7 @@ use Google\Cloud\Bigtable\Admin\V2\ListTablesRequest; use Google\Cloud\Bigtable\Admin\V2\ListTablesResponse; use Google\Cloud\Bigtable\Admin\V2\ModifyColumnFamiliesRequest; -use Google\Cloud\Bigtable\Admin\V2\ModifyColumnFamiliesRequest_Modification; +use Google\Cloud\Bigtable\Admin\V2\ModifyColumnFamiliesRequest\Modification; use Google\Cloud\Bigtable\Admin\V2\Snapshot; use Google\Cloud\Bigtable\Admin\V2\SnapshotTableRequest; use Google\Cloud\Bigtable\Admin\V2\Table; @@ -449,7 +449,7 @@ public function __construct(array $options = []) * @param array $optionalArgs { * Optional. * - * @type CreateTableRequest_Split[] $initialSplits + * @type CreateTableRequest\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, @@ -636,7 +636,7 @@ public function createTableFromSnapshot($parent, $tableId, $sourceSnapshot, arra * @type int $view * The view to be applied to the returned tables' fields. * Defaults to `NAME_ONLY` if unspecified; no others are currently supported. - * For allowed values, use constants defined on {@see \Google\Cloud\Bigtable\Admin\V2\Table_View} + * For allowed values, use constants defined on {@see \Google\Cloud\Bigtable\Admin\V2\Table\View} * @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 @@ -703,7 +703,7 @@ public function listTables($parent, array $optionalArgs = []) * @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} + * 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 Google\ApiCore\RetrySettings} object, or an associative array @@ -810,7 +810,7 @@ public function deleteTable($name, array $optionalArgs = []) * @param string $name The unique name of the table whose families should be modified. * Values are of the form * `projects//instances//tables/
`. - * @param ModifyColumnFamiliesRequest_Modification[] $modifications Modifications to be atomically applied to the specified table's families. + * @param ModifyColumnFamiliesRequest\Modification[] $modifications 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). diff --git a/Bigtable/src/V2/Gapic/BigtableGapicClient.php b/Bigtable/src/V2/Gapic/BigtableGapicClient.php index d5c8830dbaab..4704b242ea26 100644 --- a/Bigtable/src/V2/Gapic/BigtableGapicClient.php +++ b/Bigtable/src/V2/Gapic/BigtableGapicClient.php @@ -41,7 +41,7 @@ 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; +use Google\Cloud\Bigtable\V2\MutateRowsRequest\Entry; use Google\Cloud\Bigtable\V2\MutateRowsResponse; use Google\Cloud\Bigtable\V2\Mutation; use Google\Cloud\Bigtable\V2\ReadModifyWriteRowRequest; @@ -509,7 +509,7 @@ public function mutateRow($tableName, $rowKey, $mutations, array $optionalArgs = * ``` * * @param string $tableName The unique name of the table to which the mutations should be applied. - * @param MutateRowsRequest_Entry[] $entries The row keys and corresponding mutations to be applied in bulk. + * @param MutateRowsRequest\Entry[] $entries 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 diff --git a/Bigtable/synth.py b/Bigtable/synth.py index bddab1167e06..78f200c58730 100644 --- a/Bigtable/synth.py +++ b/Bigtable/synth.py @@ -67,3 +67,33 @@ 'tests/**/V2/*Test.php', r'Copyright \d{4}', r'Copyright 2018') + +# Use new namespaces +s.replace( + 'src/Admin/V2/Gapic/BigtableInstanceAdminGapicClient.php', + r'Cluster_State', + 'Cluster\\State') +s.replace( + 'src/Admin/V2/Gapic/BigtableInstanceAdminGapicClient.php', + r'Instance_Type', + 'Instance\\Type') +s.replace( + 'src/Admin/V2/Gapic/BigtableInstanceAdminGapicClient.php', + r'Instance_State', + 'Instance\\State') +s.replace( + 'src/Admin/V2/Gapic/BigtableTableAdminGapicClient.php', + r'CreateTableRequest_Split', + 'CreateTableRequest\\Split') +s.replace( + 'src/Admin/V2/Gapic/BigtableTableAdminGapicClient.php', + r'ModifyColumnFamiliesRequest_Modification', + 'ModifyColumnFamiliesRequest\\Modification') +s.replace( + 'src/Admin/V2/Gapic/BigtableTableAdminGapicClient.php', + r'Table_View', + 'Table\\View') +s.replace( + 'src/V2/Gapic/BigtableGapicClient.php', + r'MutateRowsRequest_Entry', + 'MutateRowsRequest\\Entry')