diff --git a/src/Admin/V2/Gapic/BigtableInstanceAdminGapicClient.php b/src/Admin/V2/Gapic/BigtableInstanceAdminGapicClient.php index b192660..76fc3d6 100644 --- a/src/Admin/V2/Gapic/BigtableInstanceAdminGapicClient.php +++ b/src/Admin/V2/Gapic/BigtableInstanceAdminGapicClient.php @@ -49,6 +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\State; use Google\Cloud\Bigtable\Admin\V2\Instance\Type; use Google\Cloud\Bigtable\Admin\V2\ListAppProfilesRequest; use Google\Cloud\Bigtable\Admin\V2\ListAppProfilesResponse; @@ -76,11 +77,11 @@ * calls that map to API methods. Sample code to get started: * * ``` - * $bigtableInstanceAdminClient = new BigtableInstanceAdminClient(); + * $bigtableInstanceAdminClient = new Google\Cloud\Bigtable\Admin\V2\BigtableInstanceAdminClient(); * try { * $formattedParent = $bigtableInstanceAdminClient->projectName('[PROJECT]'); * $instanceId = ''; - * $instance = new Instance(); + * $instance = new Google\Cloud\Bigtable\Admin\V2\Instance(); * $clusters = []; * $operationResponse = $bigtableInstanceAdminClient->createInstance($formattedParent, $instanceId, $instance, $clusters); * $operationResponse->pollUntilComplete(); @@ -485,11 +486,11 @@ public function __construct(array $options = []) * * Sample code: * ``` - * $bigtableInstanceAdminClient = new BigtableInstanceAdminClient(); + * $bigtableInstanceAdminClient = new Google\Cloud\Bigtable\Admin\V2\BigtableInstanceAdminClient(); * try { * $formattedParent = $bigtableInstanceAdminClient->projectName('[PROJECT]'); * $instanceId = ''; - * $instance = new Instance(); + * $instance = new Google\Cloud\Bigtable\Admin\V2\Instance(); * $clusters = []; * $operationResponse = $bigtableInstanceAdminClient->createInstance($formattedParent, $instanceId, $instance, $clusters); * $operationResponse->pollUntilComplete(); @@ -580,7 +581,7 @@ public function createInstance($parent, $instanceId, $instance, $clusters, array * * Sample code: * ``` - * $bigtableInstanceAdminClient = new BigtableInstanceAdminClient(); + * $bigtableInstanceAdminClient = new Google\Cloud\Bigtable\Admin\V2\BigtableInstanceAdminClient(); * try { * $formattedName = $bigtableInstanceAdminClient->instanceName('[PROJECT]', '[INSTANCE]'); * $response = $bigtableInstanceAdminClient->getInstance($formattedName); @@ -631,7 +632,7 @@ public function getInstance($name, array $optionalArgs = []) * * Sample code: * ``` - * $bigtableInstanceAdminClient = new BigtableInstanceAdminClient(); + * $bigtableInstanceAdminClient = new Google\Cloud\Bigtable\Admin\V2\BigtableInstanceAdminClient(); * try { * $formattedParent = $bigtableInstanceAdminClient->projectName('[PROJECT]'); * $response = $bigtableInstanceAdminClient->listInstances($formattedParent); @@ -687,11 +688,11 @@ public function listInstances($parent, array $optionalArgs = []) * * Sample code: * ``` - * $bigtableInstanceAdminClient = new BigtableInstanceAdminClient(); + * $bigtableInstanceAdminClient = new Google\Cloud\Bigtable\Admin\V2\BigtableInstanceAdminClient(); * try { * $formattedName = $bigtableInstanceAdminClient->instanceName('[PROJECT]', '[INSTANCE]'); * $displayName = ''; - * $type = Instance\Type::TYPE_UNSPECIFIED; + * $type = Google\Cloud\Bigtable\Admin\V2\Instance\Type::TYPE_UNSPECIFIED; * $labels = []; * $response = $bigtableInstanceAdminClient->updateInstance($formattedName, $displayName, $type, $labels); * } finally { @@ -768,10 +769,10 @@ public function updateInstance($name, $displayName, $type, $labels, array $optio * * Sample code: * ``` - * $bigtableInstanceAdminClient = new BigtableInstanceAdminClient(); + * $bigtableInstanceAdminClient = new Google\Cloud\Bigtable\Admin\V2\BigtableInstanceAdminClient(); * try { - * $instance = new Instance(); - * $updateMask = new FieldMask(); + * $instance = new Google\Cloud\Bigtable\Admin\V2\Instance(); + * $updateMask = new Google\Protobuf\FieldMask(); * $operationResponse = $bigtableInstanceAdminClient->partialUpdateInstance($instance, $updateMask); * $operationResponse->pollUntilComplete(); * if ($operationResponse->operationSucceeded()) { @@ -850,7 +851,7 @@ public function partialUpdateInstance($instance, $updateMask, array $optionalArg * * Sample code: * ``` - * $bigtableInstanceAdminClient = new BigtableInstanceAdminClient(); + * $bigtableInstanceAdminClient = new Google\Cloud\Bigtable\Admin\V2\BigtableInstanceAdminClient(); * try { * $formattedName = $bigtableInstanceAdminClient->instanceName('[PROJECT]', '[INSTANCE]'); * $bigtableInstanceAdminClient->deleteInstance($formattedName); @@ -899,11 +900,11 @@ public function deleteInstance($name, array $optionalArgs = []) * * Sample code: * ``` - * $bigtableInstanceAdminClient = new BigtableInstanceAdminClient(); + * $bigtableInstanceAdminClient = new Google\Cloud\Bigtable\Admin\V2\BigtableInstanceAdminClient(); * try { * $formattedParent = $bigtableInstanceAdminClient->instanceName('[PROJECT]', '[INSTANCE]'); * $clusterId = ''; - * $cluster = new Cluster(); + * $cluster = new Google\Cloud\Bigtable\Admin\V2\Cluster(); * $operationResponse = $bigtableInstanceAdminClient->createCluster($formattedParent, $clusterId, $cluster); * $operationResponse->pollUntilComplete(); * if ($operationResponse->operationSucceeded()) { @@ -988,7 +989,7 @@ public function createCluster($parent, $clusterId, $cluster, array $optionalArgs * * Sample code: * ``` - * $bigtableInstanceAdminClient = new BigtableInstanceAdminClient(); + * $bigtableInstanceAdminClient = new Google\Cloud\Bigtable\Admin\V2\BigtableInstanceAdminClient(); * try { * $formattedName = $bigtableInstanceAdminClient->clusterName('[PROJECT]', '[INSTANCE]', '[CLUSTER]'); * $response = $bigtableInstanceAdminClient->getCluster($formattedName); @@ -1039,7 +1040,7 @@ public function getCluster($name, array $optionalArgs = []) * * Sample code: * ``` - * $bigtableInstanceAdminClient = new BigtableInstanceAdminClient(); + * $bigtableInstanceAdminClient = new Google\Cloud\Bigtable\Admin\V2\BigtableInstanceAdminClient(); * try { * $formattedParent = $bigtableInstanceAdminClient->instanceName('[PROJECT]', '[INSTANCE]'); * $response = $bigtableInstanceAdminClient->listClusters($formattedParent); @@ -1097,7 +1098,7 @@ public function listClusters($parent, array $optionalArgs = []) * * Sample code: * ``` - * $bigtableInstanceAdminClient = new BigtableInstanceAdminClient(); + * $bigtableInstanceAdminClient = new Google\Cloud\Bigtable\Admin\V2\BigtableInstanceAdminClient(); * try { * $formattedName = $bigtableInstanceAdminClient->clusterName('[PROJECT]', '[INSTANCE]', '[CLUSTER]'); * $serveNodes = 0; @@ -1205,7 +1206,7 @@ public function updateCluster($name, $serveNodes, array $optionalArgs = []) * * Sample code: * ``` - * $bigtableInstanceAdminClient = new BigtableInstanceAdminClient(); + * $bigtableInstanceAdminClient = new Google\Cloud\Bigtable\Admin\V2\BigtableInstanceAdminClient(); * try { * $formattedName = $bigtableInstanceAdminClient->clusterName('[PROJECT]', '[INSTANCE]', '[CLUSTER]'); * $bigtableInstanceAdminClient->deleteCluster($formattedName); @@ -1254,11 +1255,11 @@ public function deleteCluster($name, array $optionalArgs = []) * * Sample code: * ``` - * $bigtableInstanceAdminClient = new BigtableInstanceAdminClient(); + * $bigtableInstanceAdminClient = new Google\Cloud\Bigtable\Admin\V2\BigtableInstanceAdminClient(); * try { * $formattedParent = $bigtableInstanceAdminClient->instanceName('[PROJECT]', '[INSTANCE]'); * $appProfileId = ''; - * $appProfile = new AppProfile(); + * $appProfile = new Google\Cloud\Bigtable\Admin\V2\AppProfile(); * $response = $bigtableInstanceAdminClient->createAppProfile($formattedParent, $appProfileId, $appProfile); * } finally { * $bigtableInstanceAdminClient->close(); @@ -1320,7 +1321,7 @@ public function createAppProfile($parent, $appProfileId, $appProfile, array $opt * * Sample code: * ``` - * $bigtableInstanceAdminClient = new BigtableInstanceAdminClient(); + * $bigtableInstanceAdminClient = new Google\Cloud\Bigtable\Admin\V2\BigtableInstanceAdminClient(); * try { * $formattedName = $bigtableInstanceAdminClient->appProfileName('[PROJECT]', '[INSTANCE]', '[APP_PROFILE]'); * $response = $bigtableInstanceAdminClient->getAppProfile($formattedName); @@ -1371,7 +1372,7 @@ public function getAppProfile($name, array $optionalArgs = []) * * Sample code: * ``` - * $bigtableInstanceAdminClient = new BigtableInstanceAdminClient(); + * $bigtableInstanceAdminClient = new Google\Cloud\Bigtable\Admin\V2\BigtableInstanceAdminClient(); * try { * $formattedParent = $bigtableInstanceAdminClient->instanceName('[PROJECT]', '[INSTANCE]'); * // Iterate over pages of elements @@ -1454,10 +1455,10 @@ public function listAppProfiles($parent, array $optionalArgs = []) * * Sample code: * ``` - * $bigtableInstanceAdminClient = new BigtableInstanceAdminClient(); + * $bigtableInstanceAdminClient = new Google\Cloud\Bigtable\Admin\V2\BigtableInstanceAdminClient(); * try { - * $appProfile = new AppProfile(); - * $updateMask = new FieldMask(); + * $appProfile = new Google\Cloud\Bigtable\Admin\V2\AppProfile(); + * $updateMask = new Google\Protobuf\FieldMask(); * $operationResponse = $bigtableInstanceAdminClient->updateAppProfile($appProfile, $updateMask); * $operationResponse->pollUntilComplete(); * if ($operationResponse->operationSucceeded()) { @@ -1541,7 +1542,7 @@ public function updateAppProfile($appProfile, $updateMask, array $optionalArgs = * * Sample code: * ``` - * $bigtableInstanceAdminClient = new BigtableInstanceAdminClient(); + * $bigtableInstanceAdminClient = new Google\Cloud\Bigtable\Admin\V2\BigtableInstanceAdminClient(); * try { * $formattedName = $bigtableInstanceAdminClient->appProfileName('[PROJECT]', '[INSTANCE]', '[APP_PROFILE]'); * $ignoreWarnings = false; @@ -1594,7 +1595,7 @@ public function deleteAppProfile($name, $ignoreWarnings, array $optionalArgs = [ * * Sample code: * ``` - * $bigtableInstanceAdminClient = new BigtableInstanceAdminClient(); + * $bigtableInstanceAdminClient = new Google\Cloud\Bigtable\Admin\V2\BigtableInstanceAdminClient(); * try { * $formattedResource = $bigtableInstanceAdminClient->instanceName('[PROJECT]', '[INSTANCE]'); * $response = $bigtableInstanceAdminClient->getIamPolicy($formattedResource); @@ -1646,10 +1647,10 @@ public function getIamPolicy($resource, array $optionalArgs = []) * * Sample code: * ``` - * $bigtableInstanceAdminClient = new BigtableInstanceAdminClient(); + * $bigtableInstanceAdminClient = new Google\Cloud\Bigtable\Admin\V2\BigtableInstanceAdminClient(); * try { * $formattedResource = $bigtableInstanceAdminClient->instanceName('[PROJECT]', '[INSTANCE]'); - * $policy = new Policy(); + * $policy = new Google\Cloud\Iam\V1\Policy(); * $response = $bigtableInstanceAdminClient->setIamPolicy($formattedResource, $policy); * } finally { * $bigtableInstanceAdminClient->close(); @@ -1703,7 +1704,7 @@ public function setIamPolicy($resource, $policy, array $optionalArgs = []) * * Sample code: * ``` - * $bigtableInstanceAdminClient = new BigtableInstanceAdminClient(); + * $bigtableInstanceAdminClient = new Google\Cloud\Bigtable\Admin\V2\BigtableInstanceAdminClient(); * try { * $formattedResource = $bigtableInstanceAdminClient->instanceName('[PROJECT]', '[INSTANCE]'); * $permissions = []; diff --git a/src/Admin/V2/Gapic/BigtableTableAdminGapicClient.php b/src/Admin/V2/Gapic/BigtableTableAdminGapicClient.php index 199c974..248455c 100644 --- a/src/Admin/V2/Gapic/BigtableTableAdminGapicClient.php +++ b/src/Admin/V2/Gapic/BigtableTableAdminGapicClient.php @@ -58,6 +58,7 @@ use Google\Cloud\Bigtable\Admin\V2\Snapshot; use Google\Cloud\Bigtable\Admin\V2\SnapshotTableRequest; use Google\Cloud\Bigtable\Admin\V2\Table; +use Google\Cloud\Bigtable\Admin\V2\Table\View; use Google\LongRunning\Operation; use Google\Protobuf\Duration; use Google\Protobuf\GPBEmpty; @@ -73,11 +74,11 @@ * calls that map to API methods. Sample code to get started: * * ``` - * $bigtableTableAdminClient = new BigtableTableAdminClient(); + * $bigtableTableAdminClient = new Google\Cloud\Bigtable\Admin\V2\BigtableTableAdminClient(); * try { * $formattedParent = $bigtableTableAdminClient->instanceName('[PROJECT]', '[INSTANCE]'); * $tableId = ''; - * $table = new Table(); + * $table = new Google\Cloud\Bigtable\Admin\V2\Table(); * $response = $bigtableTableAdminClient->createTable($formattedParent, $tableId, $table); * } finally { * $bigtableTableAdminClient->close(); @@ -431,11 +432,11 @@ public function __construct(array $options = []) * * Sample code: * ``` - * $bigtableTableAdminClient = new BigtableTableAdminClient(); + * $bigtableTableAdminClient = new Google\Cloud\Bigtable\Admin\V2\BigtableTableAdminClient(); * try { * $formattedParent = $bigtableTableAdminClient->instanceName('[PROJECT]', '[INSTANCE]'); * $tableId = ''; - * $table = new Table(); + * $table = new Google\Cloud\Bigtable\Admin\V2\Table(); * $response = $bigtableTableAdminClient->createTable($formattedParent, $tableId, $table); * } finally { * $bigtableTableAdminClient->close(); @@ -450,7 +451,7 @@ public function __construct(array $options = []) * @param array $optionalArgs { * Optional. * - * @type CreateTableRequest\Split[] $initialSplits + * @type Split[] $initialSplits * The optional list of row keys that will be used to initially split the * table into several tablets (tablets are similar to HBase regions). * Given two split keys, `s1` and `s2`, three tablets will be created, @@ -516,7 +517,7 @@ public function createTable($parent, $tableId, $table, array $optionalArgs = []) * * Sample code: * ``` - * $bigtableTableAdminClient = new BigtableTableAdminClient(); + * $bigtableTableAdminClient = new Google\Cloud\Bigtable\Admin\V2\BigtableTableAdminClient(); * try { * $formattedParent = $bigtableTableAdminClient->instanceName('[PROJECT]', '[INSTANCE]'); * $tableId = ''; @@ -605,7 +606,7 @@ public function createTableFromSnapshot($parent, $tableId, $sourceSnapshot, arra * * Sample code: * ``` - * $bigtableTableAdminClient = new BigtableTableAdminClient(); + * $bigtableTableAdminClient = new Google\Cloud\Bigtable\Admin\V2\BigtableTableAdminClient(); * try { * $formattedParent = $bigtableTableAdminClient->instanceName('[PROJECT]', '[INSTANCE]'); * // Iterate over pages of elements @@ -692,7 +693,7 @@ public function listTables($parent, array $optionalArgs = []) * * Sample code: * ``` - * $bigtableTableAdminClient = new BigtableTableAdminClient(); + * $bigtableTableAdminClient = new Google\Cloud\Bigtable\Admin\V2\BigtableTableAdminClient(); * try { * $formattedName = $bigtableTableAdminClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); * $response = $bigtableTableAdminClient->getTable($formattedName); @@ -751,7 +752,7 @@ public function getTable($name, array $optionalArgs = []) * * Sample code: * ``` - * $bigtableTableAdminClient = new BigtableTableAdminClient(); + * $bigtableTableAdminClient = new Google\Cloud\Bigtable\Admin\V2\BigtableTableAdminClient(); * try { * $formattedName = $bigtableTableAdminClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); * $bigtableTableAdminClient->deleteTable($formattedName); @@ -804,7 +805,7 @@ public function deleteTable($name, array $optionalArgs = []) * * Sample code: * ``` - * $bigtableTableAdminClient = new BigtableTableAdminClient(); + * $bigtableTableAdminClient = new Google\Cloud\Bigtable\Admin\V2\BigtableTableAdminClient(); * try { * $formattedName = $bigtableTableAdminClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); * $modifications = []; @@ -814,15 +815,15 @@ 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. - * Entries are applied in order, meaning that earlier modifications can be - * masked by later ones (in the case of repeated updates to the same family, - * for example). - * @param array $optionalArgs { - * Optional. + * @param string $name The unique name of the table whose families should be modified. + * Values are of the form + * `projects//instances//tables/
`. + * @param 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). + * @param array $optionalArgs { + * Optional. * * @type RetrySettings|array $retrySettings * Retry settings to use for this call. Can be a @@ -864,7 +865,7 @@ public function modifyColumnFamilies($name, $modifications, array $optionalArgs * * Sample code: * ``` - * $bigtableTableAdminClient = new BigtableTableAdminClient(); + * $bigtableTableAdminClient = new Google\Cloud\Bigtable\Admin\V2\BigtableTableAdminClient(); * try { * $formattedName = $bigtableTableAdminClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); * $bigtableTableAdminClient->dropRowRange($formattedName); @@ -928,7 +929,7 @@ public function dropRowRange($name, array $optionalArgs = []) * * Sample code: * ``` - * $bigtableTableAdminClient = new BigtableTableAdminClient(); + * $bigtableTableAdminClient = new Google\Cloud\Bigtable\Admin\V2\BigtableTableAdminClient(); * try { * $formattedName = $bigtableTableAdminClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); * $response = $bigtableTableAdminClient->generateConsistencyToken($formattedName); @@ -982,7 +983,7 @@ public function generateConsistencyToken($name, array $optionalArgs = []) * * Sample code: * ``` - * $bigtableTableAdminClient = new BigtableTableAdminClient(); + * $bigtableTableAdminClient = new Google\Cloud\Bigtable\Admin\V2\BigtableTableAdminClient(); * try { * $formattedName = $bigtableTableAdminClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); * $consistencyToken = ''; @@ -1044,7 +1045,7 @@ public function checkConsistency($name, $consistencyToken, array $optionalArgs = * * Sample code: * ``` - * $bigtableTableAdminClient = new BigtableTableAdminClient(); + * $bigtableTableAdminClient = new Google\Cloud\Bigtable\Admin\V2\BigtableTableAdminClient(); * try { * $formattedName = $bigtableTableAdminClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); * $cluster = ''; @@ -1152,7 +1153,7 @@ public function snapshotTable($name, $cluster, $snapshotId, $description, array * * Sample code: * ``` - * $bigtableTableAdminClient = new BigtableTableAdminClient(); + * $bigtableTableAdminClient = new Google\Cloud\Bigtable\Admin\V2\BigtableTableAdminClient(); * try { * $formattedName = $bigtableTableAdminClient->snapshotName('[PROJECT]', '[INSTANCE]', '[CLUSTER]', '[SNAPSHOT]'); * $response = $bigtableTableAdminClient->getSnapshot($formattedName); @@ -1210,7 +1211,7 @@ public function getSnapshot($name, array $optionalArgs = []) * * Sample code: * ``` - * $bigtableTableAdminClient = new BigtableTableAdminClient(); + * $bigtableTableAdminClient = new Google\Cloud\Bigtable\Admin\V2\BigtableTableAdminClient(); * try { * $formattedParent = $bigtableTableAdminClient->clusterName('[PROJECT]', '[INSTANCE]', '[CLUSTER]'); * // Iterate over pages of elements @@ -1300,7 +1301,7 @@ public function listSnapshots($parent, array $optionalArgs = []) * * Sample code: * ``` - * $bigtableTableAdminClient = new BigtableTableAdminClient(); + * $bigtableTableAdminClient = new Google\Cloud\Bigtable\Admin\V2\BigtableTableAdminClient(); * try { * $formattedName = $bigtableTableAdminClient->snapshotName('[PROJECT]', '[INSTANCE]', '[CLUSTER]', '[SNAPSHOT]'); * $bigtableTableAdminClient->deleteSnapshot($formattedName); diff --git a/src/V2/Gapic/BigtableGapicClient.php b/src/V2/Gapic/BigtableGapicClient.php index 3790fff..c062487 100644 --- a/src/V2/Gapic/BigtableGapicClient.php +++ b/src/V2/Gapic/BigtableGapicClient.php @@ -61,7 +61,7 @@ * calls that map to API methods. Sample code to get started: * * ``` - * $bigtableClient = new BigtableClient(); + * $bigtableClient = new Google\Cloud\Bigtable\V2\BigtableClient(); * try { * $formattedTableName = $bigtableClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); * // Read all responses until the stream is complete @@ -286,7 +286,7 @@ public function __construct(array $options = []) * * Sample code: * ``` - * $bigtableClient = new BigtableClient(); + * $bigtableClient = new Google\Cloud\Bigtable\V2\BigtableClient(); * try { * $formattedTableName = $bigtableClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); * // Read all responses until the stream is complete @@ -366,7 +366,7 @@ public function readRows($tableName, array $optionalArgs = []) * * Sample code: * ``` - * $bigtableClient = new BigtableClient(); + * $bigtableClient = new Google\Cloud\Bigtable\V2\BigtableClient(); * try { * $formattedTableName = $bigtableClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); * // Read all responses until the stream is complete @@ -427,7 +427,7 @@ public function sampleRowKeys($tableName, array $optionalArgs = []) * * Sample code: * ``` - * $bigtableClient = new BigtableClient(); + * $bigtableClient = new Google\Cloud\Bigtable\V2\BigtableClient(); * try { * $formattedTableName = $bigtableClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); * $rowKey = ''; @@ -495,7 +495,7 @@ public function mutateRow($tableName, $rowKey, $mutations, array $optionalArgs = * * Sample code: * ``` - * $bigtableClient = new BigtableClient(); + * $bigtableClient = new Google\Cloud\Bigtable\V2\BigtableClient(); * try { * $formattedTableName = $bigtableClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); * $entries = []; @@ -509,14 +509,14 @@ 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. - * Each entry is applied as an atomic mutation, but the entries may be - * applied in arbitrary order (even between entries for the same row). - * At least one entry must be specified, and in total the entries can - * contain at most 100000 mutations. - * @param array $optionalArgs { - * Optional. + * @param string $tableName The unique name of the table to which the mutations should be applied. + * @param 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 + * contain at most 100000 mutations. + * @param array $optionalArgs { + * Optional. * * @type string $appProfileId * This value specifies routing for replication. If not specified, the @@ -560,7 +560,7 @@ public function mutateRows($tableName, $entries, array $optionalArgs = []) * * Sample code: * ``` - * $bigtableClient = new BigtableClient(); + * $bigtableClient = new Google\Cloud\Bigtable\V2\BigtableClient(); * try { * $formattedTableName = $bigtableClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); * $rowKey = ''; @@ -652,7 +652,7 @@ public function checkAndMutateRow($tableName, $rowKey, array $optionalArgs = []) * * Sample code: * ``` - * $bigtableClient = new BigtableClient(); + * $bigtableClient = new Google\Cloud\Bigtable\V2\BigtableClient(); * try { * $formattedTableName = $bigtableClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); * $rowKey = ''; diff --git a/src/V2/ReadRowsResponse/CellChunk.php b/src/V2/ReadRowsResponse/CellChunk.php index 61a2e93..0b6b84b 100644 --- a/src/V2/ReadRowsResponse/CellChunk.php +++ b/src/V2/ReadRowsResponse/CellChunk.php @@ -197,6 +197,25 @@ public function getFamilyName() return $this->family_name; } + /** + * Returns the unboxed value from getFamilyName() + + * 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 string|null + */ + public function getFamilyNameValue() + { + $wrapper = $this->getFamilyName(); + return is_null($wrapper) ? null : $wrapper->getValue(); + } + /** * The column family name for this chunk of data. If this message * is not present this CellChunk is a continuation of the same column @@ -217,6 +236,26 @@ public function setFamilyName($var) return $this; } + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\StringValue object. + + * 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 string|null $var + * @return $this + */ + public function setFamilyNameValue($var) + { + $wrappedVar = is_null($var) ? null : new \Google\Protobuf\StringValue(['value' => $var]); + return $this->setFamilyName($wrappedVar); + } + /** * The column qualifier for this chunk of data. If this message * is not present, this CellChunk is a continuation of the same column @@ -232,6 +271,24 @@ public function getQualifier() return $this->qualifier; } + /** + * Returns the unboxed value from getQualifier() + + * 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 string|null + */ + public function getQualifierValue() + { + $wrapper = $this->getQualifier(); + return is_null($wrapper) ? null : $wrapper->getValue(); + } + /** * The column qualifier for this chunk of data. If this message * is not present, this CellChunk is a continuation of the same column @@ -251,6 +308,25 @@ public function setQualifier($var) return $this; } + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\BytesValue object. + + * 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 string|null $var + * @return $this + */ + public function setQualifierValue($var) + { + $wrappedVar = is_null($var) ? null : new \Google\Protobuf\BytesValue(['value' => $var]); + return $this->setQualifier($wrappedVar); + } + /** * The cell's stored timestamp, which also uniquely identifies it * within its column. Values are always expressed in diff --git a/synth.metadata b/synth.metadata index 8f07ee4..9b71179 100644 --- a/synth.metadata +++ b/synth.metadata @@ -1,19 +1,19 @@ { - "updateTime": "2019-05-10T09:59:00.226308Z", + "updateTime": "2019-06-24T19:26:55.271919Z", "sources": [ { "generator": { "name": "artman", - "version": "0.19.0", - "dockerImage": "googleapis/artman@sha256:d3df563538225ac6caac45d8ad86499500211d1bcb2536955a6dbda15e1b368e" + "version": "0.29.0", + "dockerImage": "googleapis/artman@sha256:b79c8c20ee51e5302686c9d1294672d59290df1489be93749ef17d0172cc508d" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "07883be5bf3c3233095e99d8e92b8094f5d7084a", - "internalRef": "247530843" + "sha": "de1150ccad2a3daa4e265a0948bec54fdf9c8b54", + "internalRef": "254446031" } } ], diff --git a/synth.py b/synth.py index e09ff8e..3fd6c07 100644 --- a/synth.py +++ b/synth.py @@ -68,38 +68,41 @@ 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') - # fix unit test namespace s.replace( 'tests/Unit/Admin/*/*.php', - r'namespace\ Google\\Cloud\\Bigtable\\Admin\\Tests\\Unit', - 'namespace Google\\Cloud\\Bigtable\\Tests\\Unit\\Admin') + r'namespace Google\\Cloud\\Bigtable\\Admin\\Tests\\Unit', + r'namespace Google\\Cloud\\Bigtable\\Tests\\Unit\\Admin') + +# fix test group +s.replace( + 'tests/**/Admin/**/*Test.php', + '@group admin', + '@group bigtable' + '\n' + ' * bigtable-admin') + +# Fix class references in gapic samples +for version in ['V2']: + pathExpr = [ + 'src/' + version + '/Gapic/BigtableGapicClient.php', + 'src/Admin/' + version + '/Gapic/*GapicClient.php' + ] + + types = { + 'new BigtableClient': r'new Google\\Cloud\\Bigtable\\' + version + r'\\BigtableClient', + 'new BigtableInstanceAdminClient': r'new Google\\Cloud\\Bigtable\\Admin\\' + version + r'\\BigtableInstanceAdminClient', + r'\$instance = new Instance': r'$instance = new Google\\Cloud\\Bigtable\\Admin\\' + version + r'\\Instance', + '= Type::': r'= Google\\Cloud\\Bigtable\\Admin\\' + version + r'\\Instance\\Type::', + 'new FieldMask': r'new Google\\Protobuf\\FieldMask', + r'\$cluster = new Cluster': r'$cluster = new Google\\Cloud\\Bigtable\\Admin\\' + version + r'\\Cluster', + 'new AppProfile': r'new Google\\Cloud\\Bigtable\\Admin\\' + version + r'\\AppProfile', + 'new Policy': r'new Google\\Cloud\\Iam\\V1\\Policy', + 'new BigtableTableAdminClient': r'new Google\\Cloud\\Bigtable\\Admin\\' + version + r'\\BigtableTableAdminClient', + 'new Table': r'new Google\\Cloud\\Bigtable\\Admin\\' + version + r'\\Table', + } + + for search, replace in types.items(): + s.replace( + pathExpr, + search, + replace +) diff --git a/tests/Unit/Admin/V2/BigtableInstanceAdminClientTest.php b/tests/Unit/Admin/V2/BigtableInstanceAdminClientTest.php index fd1f3e7..66a7e34 100644 --- a/tests/Unit/Admin/V2/BigtableInstanceAdminClientTest.php +++ b/tests/Unit/Admin/V2/BigtableInstanceAdminClientTest.php @@ -31,7 +31,7 @@ use Google\Cloud\Bigtable\Admin\V2\AppProfile; use Google\Cloud\Bigtable\Admin\V2\Cluster; 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\ListAppProfilesResponse; use Google\Cloud\Bigtable\Admin\V2\ListClustersResponse; use Google\Cloud\Bigtable\Admin\V2\ListInstancesResponse; @@ -46,7 +46,8 @@ use stdClass; /** - * @group bigtable-admin + * @group bigtable + * bigtable-admin * @group gapic */ class BigtableInstanceAdminClientTest extends GeneratedTest @@ -59,15 +60,23 @@ private function createTransport($deserialize = null) return new MockTransport($deserialize); } + /** + * @return CredentialsWrapper + */ + private function createCredentials() + { + return $this->getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); + } + /** * @return BigtableInstanceAdminClient */ private function createClient(array $options = []) { $options += [ - 'credentials' => $this->getMockBuilder(CredentialsWrapper::class) - ->disableOriginalConstructor() - ->getMock(), + 'credentials' => $this->createCredentials(), ]; return new BigtableInstanceAdminClient($options); @@ -82,6 +91,7 @@ public function createInstanceTest() $operationsClient = new OperationsClient([ 'serviceAddress' => '', 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), ]); $transport = $this->createTransport(); $client = $this->createClient([ @@ -171,6 +181,7 @@ public function createInstanceExceptionTest() $operationsClient = new OperationsClient([ 'serviceAddress' => '', 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), ]); $transport = $this->createTransport(); $client = $this->createClient([ @@ -399,7 +410,7 @@ public function updateInstanceTest() // Mock request $formattedName = $client->instanceName('[PROJECT]', '[INSTANCE]'); $displayName = 'displayName1615086568'; - $type = Instance_Type::TYPE_UNSPECIFIED; + $type = Type::TYPE_UNSPECIFIED; $labels = []; $response = $client->updateInstance($formattedName, $displayName, $type, $labels); @@ -451,7 +462,7 @@ public function updateInstanceExceptionTest() // Mock request $formattedName = $client->instanceName('[PROJECT]', '[INSTANCE]'); $displayName = 'displayName1615086568'; - $type = Instance_Type::TYPE_UNSPECIFIED; + $type = Type::TYPE_UNSPECIFIED; $labels = []; try { @@ -477,6 +488,7 @@ public function partialUpdateInstanceTest() $operationsClient = new OperationsClient([ 'serviceAddress' => '', 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), ]); $transport = $this->createTransport(); $client = $this->createClient([ @@ -558,6 +570,7 @@ public function partialUpdateInstanceExceptionTest() $operationsClient = new OperationsClient([ 'serviceAddress' => '', 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), ]); $transport = $this->createTransport(); $client = $this->createClient([ @@ -694,6 +707,7 @@ public function createClusterTest() $operationsClient = new OperationsClient([ 'serviceAddress' => '', 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), ]); $transport = $this->createTransport(); $client = $this->createClient([ @@ -781,6 +795,7 @@ public function createClusterExceptionTest() $operationsClient = new OperationsClient([ 'serviceAddress' => '', 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), ]); $transport = $this->createTransport(); $client = $this->createClient([ @@ -998,6 +1013,7 @@ public function updateClusterTest() $operationsClient = new OperationsClient([ 'serviceAddress' => '', 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), ]); $transport = $this->createTransport(); $client = $this->createClient([ @@ -1081,6 +1097,7 @@ public function updateClusterExceptionTest() $operationsClient = new OperationsClient([ 'serviceAddress' => '', 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), ]); $transport = $this->createTransport(); $client = $this->createClient([ @@ -1460,6 +1477,7 @@ public function updateAppProfileTest() $operationsClient = new OperationsClient([ 'serviceAddress' => '', 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), ]); $transport = $this->createTransport(); $client = $this->createClient([ @@ -1543,6 +1561,7 @@ public function updateAppProfileExceptionTest() $operationsClient = new OperationsClient([ 'serviceAddress' => '', 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), ]); $transport = $this->createTransport(); $client = $this->createClient([ diff --git a/tests/Unit/Admin/V2/BigtableTableAdminClientTest.php b/tests/Unit/Admin/V2/BigtableTableAdminClientTest.php index 321dcd6..013f5eb 100644 --- a/tests/Unit/Admin/V2/BigtableTableAdminClientTest.php +++ b/tests/Unit/Admin/V2/BigtableTableAdminClientTest.php @@ -42,7 +42,8 @@ use stdClass; /** - * @group bigtable-admin + * @group bigtable + * bigtable-admin * @group gapic */ class BigtableTableAdminClientTest extends GeneratedTest @@ -55,15 +56,23 @@ private function createTransport($deserialize = null) return new MockTransport($deserialize); } + /** + * @return CredentialsWrapper + */ + private function createCredentials() + { + return $this->getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); + } + /** * @return BigtableTableAdminClient */ private function createClient(array $options = []) { $options += [ - 'credentials' => $this->getMockBuilder(CredentialsWrapper::class) - ->disableOriginalConstructor() - ->getMock(), + 'credentials' => $this->createCredentials(), ]; return new BigtableTableAdminClient($options); @@ -161,6 +170,7 @@ public function createTableFromSnapshotTest() $operationsClient = new OperationsClient([ 'serviceAddress' => '', 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), ]); $transport = $this->createTransport(); $client = $this->createClient([ @@ -244,6 +254,7 @@ public function createTableFromSnapshotExceptionTest() $operationsClient = new OperationsClient([ 'serviceAddress' => '', 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), ]); $transport = $this->createTransport(); $client = $this->createClient([ @@ -832,6 +843,7 @@ public function snapshotTableTest() $operationsClient = new OperationsClient([ 'serviceAddress' => '', 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), ]); $transport = $this->createTransport(); $client = $this->createClient([ @@ -923,6 +935,7 @@ public function snapshotTableExceptionTest() $operationsClient = new OperationsClient([ 'serviceAddress' => '', 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), ]); $transport = $this->createTransport(); $client = $this->createClient([ diff --git a/tests/Unit/V2/BigtableClientTest.php b/tests/Unit/V2/BigtableClientTest.php index f869266..351903d 100644 --- a/tests/Unit/V2/BigtableClientTest.php +++ b/tests/Unit/V2/BigtableClientTest.php @@ -52,15 +52,23 @@ private function createTransport($deserialize = null) return new MockTransport($deserialize); } + /** + * @return CredentialsWrapper + */ + private function createCredentials() + { + return $this->getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); + } + /** * @return BigtableClient */ private function createClient(array $options = []) { $options += [ - 'credentials' => $this->getMockBuilder(CredentialsWrapper::class) - ->disableOriginalConstructor() - ->getMock(), + 'credentials' => $this->createCredentials(), ]; return new BigtableClient($options);