Skip to content

Commit

Permalink
docs: update documentation (#2695)
Browse files Browse the repository at this point in the history
  • Loading branch information
yoshi-automation authored Feb 13, 2020
1 parent 3adb76e commit 675ec72
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 15 deletions.
6 changes: 5 additions & 1 deletion Redis/src/V1/Gapic/CloudRedisGapicClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -633,9 +633,13 @@ public function createInstance($parent, $instanceId, $instance, array $optionalA
* $paths = [$pathsElement, $pathsElement2];
* $updateMask = new Google\Protobuf\FieldMask();
* $updateMask->setPaths($paths);
* $displayName = ' instance.memory_size_gb=4';
* $displayName = 'UpdatedDisplayName';
* $name = 'projects/<project-name>/locations/<location>/instances/<instance>';
* $memorySizeGb = 4;
* $instance = new Google\Cloud\Redis\V1\Instance();
* $instance->setDisplayName($displayName);
* $instance->setName($name);
* $instance->setMemorySizeGb($memorySizeGb);
* $operationResponse = $cloudRedisClient->updateInstance($updateMask, $instance);
* $operationResponse->pollUntilComplete();
* if ($operationResponse->operationSucceeded()) {
Expand Down
2 changes: 2 additions & 0 deletions Redis/src/V1beta1/Gapic/CloudRedisGapicClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -636,9 +636,11 @@ public function createInstance($parent, $instanceId, $instance, array $optionalA
* $updateMask = new Google\Protobuf\FieldMask();
* $updateMask->setPaths($paths);
* $displayName = 'UpdatedDisplayName';
* $name = 'projects/<project-name>/locations/<location>/instances/<instance>';
* $memorySizeGb = 4;
* $instance = new Google\Cloud\Redis\V1beta1\Instance();
* $instance->setDisplayName($displayName);
* $instance->setName($name);
* $instance->setMemorySizeGb($memorySizeGb);
* $operationResponse = $cloudRedisClient->updateInstance($updateMask, $instance);
* $operationResponse->pollUntilComplete();
Expand Down
26 changes: 20 additions & 6 deletions Redis/synth.metadata

Large diffs are not rendered by default.

20 changes: 14 additions & 6 deletions Redis/tests/Unit/V1/CloudRedisClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ public function updateInstanceTest()
$incompleteOperation->setName('operations/updateInstanceTest');
$incompleteOperation->setDone(false);
$transport->addResponse($incompleteOperation);
$name = 'name3373707';
$name2 = 'name2-1052831874';
$displayName2 = 'displayName21615000987';
$locationId = 'locationId552319461';
$alternativeLocationId = 'alternativeLocationId-718920621';
Expand All @@ -472,11 +472,11 @@ public function updateInstanceTest()
$port = 3446913;
$currentLocationId = 'currentLocationId1312712735';
$statusMessage = 'statusMessage-239442758';
$memorySizeGb = 34199707;
$memorySizeGb2 = 1493816946;
$authorizedNetwork = 'authorizedNetwork-1733809270';
$persistenceIamIdentity = 'persistenceIamIdentity1061944584';
$expectedResponse = new Instance();
$expectedResponse->setName($name);
$expectedResponse->setName($name2);
$expectedResponse->setDisplayName($displayName2);
$expectedResponse->setLocationId($locationId);
$expectedResponse->setAlternativeLocationId($alternativeLocationId);
Expand All @@ -486,7 +486,7 @@ public function updateInstanceTest()
$expectedResponse->setPort($port);
$expectedResponse->setCurrentLocationId($currentLocationId);
$expectedResponse->setStatusMessage($statusMessage);
$expectedResponse->setMemorySizeGb($memorySizeGb);
$expectedResponse->setMemorySizeGb($memorySizeGb2);
$expectedResponse->setAuthorizedNetwork($authorizedNetwork);
$expectedResponse->setPersistenceIamIdentity($persistenceIamIdentity);
$anyResponse = new Any();
Expand All @@ -503,9 +503,13 @@ public function updateInstanceTest()
$paths = [$pathsElement, $pathsElement2];
$updateMask = new FieldMask();
$updateMask->setPaths($paths);
$displayName = ' instance.memory_size_gb=4';
$displayName = 'UpdatedDisplayName';
$name = 'projects/<project-name>/locations/<location>/instances/<instance>';
$memorySizeGb = 4;
$instance = new Instance();
$instance->setDisplayName($displayName);
$instance->setName($name);
$instance->setMemorySizeGb($memorySizeGb);

$response = $client->updateInstance($updateMask, $instance);
$this->assertFalse($response->isDone());
Expand Down Expand Up @@ -591,9 +595,13 @@ public function updateInstanceExceptionTest()
$paths = [$pathsElement, $pathsElement2];
$updateMask = new FieldMask();
$updateMask->setPaths($paths);
$displayName = ' instance.memory_size_gb=4';
$displayName = 'UpdatedDisplayName';
$name = 'projects/<project-name>/locations/<location>/instances/<instance>';
$memorySizeGb = 4;
$instance = new Instance();
$instance->setDisplayName($displayName);
$instance->setName($name);
$instance->setMemorySizeGb($memorySizeGb);

$response = $client->updateInstance($updateMask, $instance);
$this->assertFalse($response->isDone());
Expand Down
8 changes: 6 additions & 2 deletions Redis/tests/Unit/V1beta1/CloudRedisClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ public function updateInstanceTest()
$incompleteOperation->setName('operations/updateInstanceTest');
$incompleteOperation->setDone(false);
$transport->addResponse($incompleteOperation);
$name = 'name3373707';
$name2 = 'name2-1052831874';
$displayName2 = 'displayName21615000987';
$locationId = 'locationId552319461';
$alternativeLocationId = 'alternativeLocationId-718920621';
Expand All @@ -476,7 +476,7 @@ public function updateInstanceTest()
$authorizedNetwork = 'authorizedNetwork-1733809270';
$persistenceIamIdentity = 'persistenceIamIdentity1061944584';
$expectedResponse = new Instance();
$expectedResponse->setName($name);
$expectedResponse->setName($name2);
$expectedResponse->setDisplayName($displayName2);
$expectedResponse->setLocationId($locationId);
$expectedResponse->setAlternativeLocationId($alternativeLocationId);
Expand Down Expand Up @@ -504,9 +504,11 @@ public function updateInstanceTest()
$updateMask = new FieldMask();
$updateMask->setPaths($paths);
$displayName = 'UpdatedDisplayName';
$name = 'projects/<project-name>/locations/<location>/instances/<instance>';
$memorySizeGb = 4;
$instance = new Instance();
$instance->setDisplayName($displayName);
$instance->setName($name);
$instance->setMemorySizeGb($memorySizeGb);

$response = $client->updateInstance($updateMask, $instance);
Expand Down Expand Up @@ -594,9 +596,11 @@ public function updateInstanceExceptionTest()
$updateMask = new FieldMask();
$updateMask->setPaths($paths);
$displayName = 'UpdatedDisplayName';
$name = 'projects/<project-name>/locations/<location>/instances/<instance>';
$memorySizeGb = 4;
$instance = new Instance();
$instance->setDisplayName($displayName);
$instance->setName($name);
$instance->setMemorySizeGb($memorySizeGb);

$response = $client->updateInstance($updateMask, $instance);
Expand Down

0 comments on commit 675ec72

Please sign in to comment.