From 29c4bd71caf3b1fc71edcd48c68a70337e6e9476 Mon Sep 17 00:00:00 2001 From: Sakthivel Subramanian Date: Thu, 21 Nov 2024 10:47:18 +0530 Subject: [PATCH] fix(spanner): getEdition() is returning null for Instance --- .../src/main/java/com/google/cloud/spanner/Instance.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/Instance.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/Instance.java index 04933a67121..4e4bb092702 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/Instance.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/Instance.java @@ -24,6 +24,7 @@ import com.google.longrunning.Operation; import com.google.spanner.admin.database.v1.CreateDatabaseMetadata; import com.google.spanner.admin.instance.v1.AutoscalingConfig; +import com.google.spanner.admin.instance.v1.Instance.Edition; import com.google.spanner.admin.instance.v1.UpdateInstanceMetadata; import java.util.Map; @@ -111,6 +112,12 @@ public Builder putAllLabels(Map labels) { return this; } + @Override + public Builder setEdition(Edition edition) { + infoBuilder.setEdition(edition); + return this; + } + @Override public Instance build() { return new Instance(this); @@ -228,6 +235,7 @@ static Instance fromProto( .setCreateTime(Timestamp.fromProto(proto.getCreateTime())) .setUpdateTime(Timestamp.fromProto(proto.getUpdateTime())) .setAutoscalingConfig(proto.getAutoscalingConfig()) + .setEdition(proto.getEdition()) .setProcessingUnits(proto.getProcessingUnits()); State state; switch (proto.getState()) {