From 3425da18f4b6b029f9b1ff0de229b95e7ce48fd6 Mon Sep 17 00:00:00 2001 From: Alex <7764119+AVaksman@users.noreply.github.com> Date: Thu, 16 Jan 2020 19:28:10 -0500 Subject: [PATCH] refactor: update spanner lroMappers to map types for `metadata` and `response` separately (#2537) --- Spanner/src/Connection/Grpc.php | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/Spanner/src/Connection/Grpc.php b/Spanner/src/Connection/Grpc.php index d67adbd762b7..6575af1ba75c 100644 --- a/Spanner/src/Connection/Grpc.php +++ b/Spanner/src/Connection/Grpc.php @@ -23,10 +23,14 @@ use Google\Cloud\Core\GrpcRequestWrapper; use Google\Cloud\Core\GrpcTrait; use Google\Cloud\Core\LongRunning\OperationResponseTrait; +use Google\Cloud\Spanner\Admin\Database\V1\CreateDatabaseMetadata; +use Google\Cloud\Spanner\Admin\Database\V1\UpdateDatabaseDdlMetadata; use Google\Cloud\Spanner\Admin\Database\V1\Database; use Google\Cloud\Spanner\Admin\Database\V1\DatabaseAdminClient; +use Google\Cloud\Spanner\Admin\Instance\V1\CreateInstanceMetadata; use Google\Cloud\Spanner\Admin\Instance\V1\Instance; use Google\Cloud\Spanner\Admin\Instance\V1\InstanceAdminClient; +use Google\Cloud\Spanner\Admin\Instance\V1\UpdateInstanceMetadata; use Google\Cloud\Spanner\Operation; use Google\Cloud\Spanner\SpannerClient as ManualSpannerClient; use Google\Cloud\Spanner\V1\CreateSessionRequest; @@ -104,18 +108,30 @@ class Grpc implements ConnectionInterface [ 'method' => 'updateDatabaseDdl', 'typeUrl' => 'type.googleapis.com/google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata', - 'message' => GPBEmpty::class + 'message' => UpdateDatabaseDdlMetadata::class ], [ 'method' => 'createDatabase', 'typeUrl' => 'type.googleapis.com/google.spanner.admin.database.v1.CreateDatabaseMetadata', - 'message' => Database::class + 'message' => CreateDatabaseMetadata::class ], [ 'method' => 'createInstance', 'typeUrl' => 'type.googleapis.com/google.spanner.admin.instance.v1.CreateInstanceMetadata', - 'message' => Instance::class + 'message' => CreateInstanceMetadata::class ], [ 'method' => 'updateInstance', 'typeUrl' => 'type.googleapis.com/google.spanner.admin.instance.v1.UpdateInstanceMetadata', + 'message' => UpdateInstanceMetadata::class + ], [ + 'method' => 'updateDatabaseDdl', + 'typeUrl' => 'type.googleapis.com/google.protobuf.Empty', + 'message' => GPBEmpty::class + ], [ + 'method' => 'createDatabase', + 'typeUrl' => 'type.googleapis.com/google.spanner.admin.database.v1.Database', + 'message' => Database::class + ], [ + 'method' => 'createInstance', + 'typeUrl' => 'type.googleapis.com/google.spanner.admin.instance.v1.Instance', 'message' => Instance::class ] ];