Skip to content

Commit cf2005f

Browse files
authored
fix(deps): update dependency google/cloud-compute to v2 (GoogleCloudPlatform#2162)
1 parent 9625dd8 commit cf2005f

File tree

8 files changed

+11
-11
lines changed

8 files changed

+11
-11
lines changed

compute/instances/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"require": {
3-
"google/cloud-compute": "^1.14",
3+
"google/cloud-compute": "^2.0",
44
"google/cloud-storage": "^1.36"
55
}
66
}

compute/instances/src/create_instance.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@
2525

2626
# [START compute_instances_create]
2727
use Google\Cloud\Compute\V1\AttachedDisk;
28+
use Google\Cloud\Compute\V1\AttachedDisk\Type;
2829
use Google\Cloud\Compute\V1\AttachedDiskInitializeParams;
2930
use Google\Cloud\Compute\V1\Client\InstancesClient;
30-
use Google\Cloud\Compute\V1\Enums\AttachedDisk\Type;
3131
use Google\Cloud\Compute\V1\InsertInstanceRequest;
3232

3333
/**
@@ -67,7 +67,7 @@ function create_instance(
6767
$disk = (new AttachedDisk())
6868
->setBoot(true)
6969
->setAutoDelete(true)
70-
->setType(Type::PERSISTENT)
70+
->setType(Type::name(Type::PERSISTENT))
7171
->setInitializeParams($diskInitializeParams);
7272

7373
// Use the network interface provided in the $networkName argument.

compute/instances/src/create_instance_with_encryption_key.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@
2525

2626
# [START compute_instances_create_encrypted]
2727
use Google\Cloud\Compute\V1\AttachedDisk;
28+
use Google\Cloud\Compute\V1\AttachedDisk\Type;
2829
use Google\Cloud\Compute\V1\AttachedDiskInitializeParams;
2930
use Google\Cloud\Compute\V1\Client\InstancesClient;
3031
use Google\Cloud\Compute\V1\CustomerEncryptionKey;
31-
use Google\Cloud\Compute\V1\Enums\AttachedDisk\Type;
3232
use Google\Cloud\Compute\V1\InsertInstanceRequest;
3333

3434
/**
@@ -78,7 +78,7 @@ function create_instance_with_encryption_key(
7878
$disk = (new AttachedDisk())
7979
->setBoot(true)
8080
->setAutoDelete(true)
81-
->setType(Type::PERSISTENT)
81+
->setType(Type::name(Type::PERSISTENT))
8282
->setInitializeParams($diskInitializeParams)
8383
->setDiskEncryptionKey($customerEncryptionKey);
8484

spanner/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"require": {
3-
"google/cloud-spanner": "^1.97"
3+
"google/cloud-spanner": "^2.0"
44
},
55
"autoload": {
66
"psr-4": {

spanner/src/read_stale_data.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
namespace Google\Cloud\Samples\Spanner;
2525

2626
// [START spanner_read_stale_data]
27-
use Google\Cloud\Spanner\Duration;
27+
use Google\Protobuf\Duration;
2828
use Google\Cloud\Spanner\SpannerClient;
2929

3030
/**
@@ -49,7 +49,7 @@ function read_stale_data(string $instanceId, string $databaseId): void
4949
'Albums',
5050
$keySet,
5151
['SingerId', 'AlbumId', 'AlbumTitle'],
52-
['exactStaleness' => new Duration(15)]
52+
['exactStaleness' => new Duration(['seconds' => 15])]
5353
);
5454

5555
foreach ($results->rows() as $row) {

speech/src/create_recognizer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ function create_recognizer(
3333
string $projectId,
3434
string $location,
3535
string $recognizerId,
36-
string $model = "latest_short"
36+
string $model = 'latest_short'
3737
): void {
3838
$apiEndpoint = $location === 'global' ? null : sprintf('%s-speech.googleapis.com', $location);
3939
$speech = new SpeechClient(['apiEndpoint' => $apiEndpoint]);

speech/src/transcribe_async_gcs.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ function transcribe_async_gcs(string $projectId, string $location, string $recog
7777
$response = $operation->getResult();
7878
foreach ($response->getResults() as $result) {
7979
if ($result->getError()) {
80-
print('Error: '. $result->getError()->getMessage());
80+
print('Error: ' . $result->getError()->getMessage());
8181
}
8282
// get the most likely transcription
8383
$transcript = $result->getInlineResult()->getTranscript();

speech/src/transcribe_async_words.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ function transcribe_async_words(string $projectId, string $location, string $rec
9191
$response = $operation->getResult();
9292
foreach ($response->getResults() as $result) {
9393
if ($result->getError()) {
94-
print('Error: '. $result->getError()->getMessage());
94+
print('Error: ' . $result->getError()->getMessage());
9595
}
9696
// get the most likely transcription
9797
$transcript = $result->getInlineResult()->getTranscript();

0 commit comments

Comments
 (0)