Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: update documentation #2695

Merged
merged 1 commit into from
Feb 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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