diff --git a/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/TypeCode.java b/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/TypeCode.java
index 77d751575cb..1fc2b42ef8e 100644
--- a/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/TypeCode.java
+++ b/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/TypeCode.java
@@ -161,6 +161,22 @@ public enum TypeCode implements com.google.protobuf.ProtocolMessageEnum {
* NUMERIC = 10;
*/
NUMERIC(10),
+ /**
+ *
+ *
+ *
+ * Encoded as a JSON-formatted 'string' as described in RFC 7159. The
+ * following rules will be applied when parsing JSON input:
+ * - Whitespace will be stripped from the document.
+ * - If a JSON object has duplicate keys, only the first key will be
+ * preserved.
+ * - Members of a JSON object are not guaranteed to have their order
+ * preserved. JSON array elements will have their order preserved.
+ *
+ *
+ * JSON = 11;
+ */
+ JSON(11),
UNRECOGNIZED(-1),
;
@@ -292,6 +308,22 @@ public enum TypeCode implements com.google.protobuf.ProtocolMessageEnum {
* NUMERIC = 10;
*/
public static final int NUMERIC_VALUE = 10;
+ /**
+ *
+ *
+ *
+ * Encoded as a JSON-formatted 'string' as described in RFC 7159. The
+ * following rules will be applied when parsing JSON input:
+ * - Whitespace will be stripped from the document.
+ * - If a JSON object has duplicate keys, only the first key will be
+ * preserved.
+ * - Members of a JSON object are not guaranteed to have their order
+ * preserved. JSON array elements will have their order preserved.
+ *
+ *
+ * JSON = 11;
+ */
+ public static final int JSON_VALUE = 11;
public final int getNumber() {
if (this == UNRECOGNIZED) {
@@ -339,6 +371,8 @@ public static TypeCode forNumber(int value) {
return STRUCT;
case 10:
return NUMERIC;
+ case 11:
+ return JSON;
default:
return null;
}
diff --git a/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/TypeProto.java b/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/TypeProto.java
index 042f2429197..e781dc621a0 100644
--- a/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/TypeProto.java
+++ b/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/TypeProto.java
@@ -58,15 +58,15 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
+ "ructType\0223\n\006fields\030\001 \003(\0132#.google.spanne"
+ "r.v1.StructType.Field\032<\n\005Field\022\014\n\004name\030\001"
+ " \001(\t\022%\n\004type\030\002 \001(\0132\027.google.spanner.v1.T"
- + "ype*\233\001\n\010TypeCode\022\031\n\025TYPE_CODE_UNSPECIFIE"
+ + "ype*\245\001\n\010TypeCode\022\031\n\025TYPE_CODE_UNSPECIFIE"
+ "D\020\000\022\010\n\004BOOL\020\001\022\t\n\005INT64\020\002\022\013\n\007FLOAT64\020\003\022\r\n"
+ "\tTIMESTAMP\020\004\022\010\n\004DATE\020\005\022\n\n\006STRING\020\006\022\t\n\005BY"
+ "TES\020\007\022\t\n\005ARRAY\020\010\022\n\n\006STRUCT\020\t\022\013\n\007NUMERIC\020"
- + "\nB\257\001\n\025com.google.spanner.v1B\tTypeProtoP\001"
- + "Z8google.golang.org/genproto/googleapis/"
- + "spanner/v1;spanner\252\002\027Google.Cloud.Spanne"
- + "r.V1\312\002\027Google\\Cloud\\Spanner\\V1\352\002\032Google:"
- + ":Cloud::Spanner::V1b\006proto3"
+ + "\n\022\010\n\004JSON\020\013B\257\001\n\025com.google.spanner.v1B\tT"
+ + "ypeProtoP\001Z8google.golang.org/genproto/g"
+ + "oogleapis/spanner/v1;spanner\252\002\027Google.Cl"
+ + "oud.Spanner.V1\312\002\027Google\\Cloud\\Spanner\\V1"
+ + "\352\002\032Google::Cloud::Spanner::V1b\006proto3"
};
descriptor =
com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom(
diff --git a/proto-google-cloud-spanner-v1/src/main/proto/google/spanner/v1/type.proto b/proto-google-cloud-spanner-v1/src/main/proto/google/spanner/v1/type.proto
index 4a5afd485d9..c1f30f51230 100644
--- a/proto-google-cloud-spanner-v1/src/main/proto/google/spanner/v1/type.proto
+++ b/proto-google-cloud-spanner-v1/src/main/proto/google/spanner/v1/type.proto
@@ -128,4 +128,13 @@ enum TypeCode {
//
`[+-][Digits].Digits[ExponentIndicator[+-]Digits]`
//
(ExponentIndicator is `"e"` or `"E"`)
NUMERIC = 10;
+
+ // Encoded as a JSON-formatted 'string' as described in RFC 7159. The
+ // following rules will be applied when parsing JSON input:
+ // - Whitespace will be stripped from the document.
+ // - If a JSON object has duplicate keys, only the first key will be
+ // preserved.
+ // - Members of a JSON object are not guaranteed to have their order
+ // preserved. JSON array elements will have their order preserved.
+ JSON = 11;
}
diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml
index c4ca548bf56..6cc5f51af0b 100644
--- a/samples/install-without-bom/pom.xml
+++ b/samples/install-without-bom/pom.xml
@@ -32,7 +32,7 @@
com.google.cloud
google-cloud-spanner
- 6.6.1
+ 6.7.0
diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml
index 5bb6290dbd7..82bbc1c254d 100644
--- a/samples/snapshot/pom.xml
+++ b/samples/snapshot/pom.xml
@@ -31,7 +31,7 @@
com.google.cloud
google-cloud-spanner
- 6.7.0
+ 6.8.0
diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml
index 619674d833f..a6c8ad1ee29 100644
--- a/samples/snippets/pom.xml
+++ b/samples/snippets/pom.xml
@@ -33,7 +33,7 @@
com.google.cloud
libraries-bom
- 20.6.0
+ 20.7.0
pom
import
diff --git a/samples/snippets/src/main/java/com/example/spanner/CreateInstanceWithProcessingUnitsExample.java b/samples/snippets/src/main/java/com/example/spanner/CreateInstanceWithProcessingUnitsExample.java
new file mode 100644
index 00000000000..263c6f69fa7
--- /dev/null
+++ b/samples/snippets/src/main/java/com/example/spanner/CreateInstanceWithProcessingUnitsExample.java
@@ -0,0 +1,74 @@
+/*
+ * Copyright 2021 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.example.spanner;
+
+//[START spanner_create_instance_with_processing_units]
+import com.google.api.gax.longrunning.OperationFuture;
+import com.google.cloud.spanner.Instance;
+import com.google.cloud.spanner.InstanceAdminClient;
+import com.google.cloud.spanner.InstanceConfigId;
+import com.google.cloud.spanner.InstanceId;
+import com.google.cloud.spanner.InstanceInfo;
+import com.google.cloud.spanner.Spanner;
+import com.google.cloud.spanner.SpannerOptions;
+import com.google.spanner.admin.instance.v1.CreateInstanceMetadata;
+import java.util.concurrent.ExecutionException;
+
+class CreateInstanceWithProcessingUnitsExample {
+
+ static void createInstance() {
+ // TODO(developer): Replace these variables before running the sample.
+ String projectId = "my-project";
+ String instanceId = "my-instance";
+ createInstance(projectId, instanceId);
+ }
+
+ static void createInstance(String projectId, String instanceId) {
+ Spanner spanner = SpannerOptions.newBuilder().setProjectId(projectId).build().getService();
+ InstanceAdminClient instanceAdminClient = spanner.getInstanceAdminClient();
+
+ // Set Instance configuration.
+ String configId = "regional-us-central1";
+ // This will create an instance with the processing power of 0.2 nodes.
+ int processingUnits = 500;
+ String displayName = "Descriptive name";
+
+ // Create an InstanceInfo object that will be used to create the instance.
+ InstanceInfo instanceInfo =
+ InstanceInfo.newBuilder(InstanceId.of(projectId, instanceId))
+ .setInstanceConfigId(InstanceConfigId.of(projectId, configId))
+ .setProcessingUnits(processingUnits)
+ .setDisplayName(displayName)
+ .build();
+ OperationFuture operation =
+ instanceAdminClient.createInstance(instanceInfo);
+ try {
+ // Wait for the createInstance operation to finish.
+ Instance instance = operation.get();
+ System.out.printf("Instance %s was successfully created with %d processing units%n",
+ instance.getId(), instance.getProcessingUnits());
+ } catch (ExecutionException e) {
+ System.out.printf(
+ "Error: Creating instance %s failed with error message %s%n",
+ instanceInfo.getId(), e.getMessage());
+ } catch (InterruptedException e) {
+ System.out.println("Error: Waiting for createInstance operation to finish was interrupted");
+ }
+ spanner.close();
+ }
+}
+//[END spanner_create_instance_with_processing_units]
diff --git a/synth.metadata b/synth.metadata
index 7e0c5fbf272..7c7036a07a6 100644
--- a/synth.metadata
+++ b/synth.metadata
@@ -4,22 +4,22 @@
"git": {
"name": ".",
"remote": "https://github.com/googleapis/java-spanner.git",
- "sha": "9641bc1bf582da93999e64ea09531942e2546795"
+ "sha": "4593395d291f6e9370c2d3df2695cb28b7d27e8d"
}
},
{
"git": {
"name": "googleapis",
"remote": "https://github.com/googleapis/googleapis.git",
- "sha": "551681f25e36b11829e87e580281350461f4f3f5",
- "internalRef": "379784268"
+ "sha": "fb5c4fbc1ded09e6958d6be7ca36a9221dc7e52f",
+ "internalRef": "381156241"
}
},
{
"git": {
"name": "synthtool",
"remote": "https://github.com/googleapis/synthtool.git",
- "sha": "1c0c698705e668ccb3d68556ae7260f16ce63a6e"
+ "sha": "87254ac89a9559864c0a245d6b150406439ce3d8"
}
}
],
diff --git a/versions.txt b/versions.txt
index 40bae0042f3..5beda867e0b 100644
--- a/versions.txt
+++ b/versions.txt
@@ -1,10 +1,10 @@
# Format:
# module:released-version:current-version
-proto-google-cloud-spanner-admin-instance-v1:6.7.0:6.7.0
-proto-google-cloud-spanner-v1:6.7.0:6.7.0
-proto-google-cloud-spanner-admin-database-v1:6.7.0:6.7.0
-grpc-google-cloud-spanner-v1:6.7.0:6.7.0
-grpc-google-cloud-spanner-admin-instance-v1:6.7.0:6.7.0
-grpc-google-cloud-spanner-admin-database-v1:6.7.0:6.7.0
-google-cloud-spanner:6.7.0:6.7.0
\ No newline at end of file
+proto-google-cloud-spanner-admin-instance-v1:6.8.0:6.8.0
+proto-google-cloud-spanner-v1:6.8.0:6.8.0
+proto-google-cloud-spanner-admin-database-v1:6.8.0:6.8.0
+grpc-google-cloud-spanner-v1:6.8.0:6.8.0
+grpc-google-cloud-spanner-admin-instance-v1:6.8.0:6.8.0
+grpc-google-cloud-spanner-admin-database-v1:6.8.0:6.8.0
+google-cloud-spanner:6.8.0:6.8.0
\ No newline at end of file