From 77cb585d57fd30f953b0ffb80be124e3cb1c6f39 Mon Sep 17 00:00:00 2001 From: Sakthivel Subramanian <179120858+sakthivelmanii@users.noreply.github.com> Date: Sat, 23 Nov 2024 22:36:52 +0530 Subject: [PATCH] fix(spanner): getEdition() is returning null for Instance (#3496) --- .../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()) {