Skip to content

Commit b2a56c6

Browse files
feat: spanner JSON type (googleapis#1260)
This PR was generated using Autosynth. 🌈 Synth log will be available here: https://source.cloud.google.com/results/invocations/4d5db7cf-fc22-48ae-84c6-bc8d1a1a2408/targets - [ ] To automatically regenerate this PR, check this box. (May take up to 24 hours.) PiperOrigin-RevId: 381156241 Source-Link: googleapis/googleapis@fb5c4fb Source-Link: googleapis/googleapis@02f6236 PiperOrigin-RevId: 380923948 Source-Link: googleapis/googleapis@370df45
1 parent 4593395 commit b2a56c6

File tree

4 files changed

+52
-9
lines changed

4 files changed

+52
-9
lines changed

proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/TypeCode.java

+34
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,22 @@ public enum TypeCode implements com.google.protobuf.ProtocolMessageEnum {
161161
* <code>NUMERIC = 10;</code>
162162
*/
163163
NUMERIC(10),
164+
/**
165+
*
166+
*
167+
* <pre>
168+
* Encoded as a JSON-formatted 'string' as described in RFC 7159. The
169+
* following rules will be applied when parsing JSON input:
170+
* - Whitespace will be stripped from the document.
171+
* - If a JSON object has duplicate keys, only the first key will be
172+
* preserved.
173+
* - Members of a JSON object are not guaranteed to have their order
174+
* preserved. JSON array elements will have their order preserved.
175+
* </pre>
176+
*
177+
* <code>JSON = 11;</code>
178+
*/
179+
JSON(11),
164180
UNRECOGNIZED(-1),
165181
;
166182

@@ -292,6 +308,22 @@ public enum TypeCode implements com.google.protobuf.ProtocolMessageEnum {
292308
* <code>NUMERIC = 10;</code>
293309
*/
294310
public static final int NUMERIC_VALUE = 10;
311+
/**
312+
*
313+
*
314+
* <pre>
315+
* Encoded as a JSON-formatted 'string' as described in RFC 7159. The
316+
* following rules will be applied when parsing JSON input:
317+
* - Whitespace will be stripped from the document.
318+
* - If a JSON object has duplicate keys, only the first key will be
319+
* preserved.
320+
* - Members of a JSON object are not guaranteed to have their order
321+
* preserved. JSON array elements will have their order preserved.
322+
* </pre>
323+
*
324+
* <code>JSON = 11;</code>
325+
*/
326+
public static final int JSON_VALUE = 11;
295327

296328
public final int getNumber() {
297329
if (this == UNRECOGNIZED) {
@@ -339,6 +371,8 @@ public static TypeCode forNumber(int value) {
339371
return STRUCT;
340372
case 10:
341373
return NUMERIC;
374+
case 11:
375+
return JSON;
342376
default:
343377
return null;
344378
}

proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/TypeProto.java

+6-6
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,15 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
5858
+ "ructType\0223\n\006fields\030\001 \003(\0132#.google.spanne"
5959
+ "r.v1.StructType.Field\032<\n\005Field\022\014\n\004name\030\001"
6060
+ " \001(\t\022%\n\004type\030\002 \001(\0132\027.google.spanner.v1.T"
61-
+ "ype*\233\001\n\010TypeCode\022\031\n\025TYPE_CODE_UNSPECIFIE"
61+
+ "ype*\245\001\n\010TypeCode\022\031\n\025TYPE_CODE_UNSPECIFIE"
6262
+ "D\020\000\022\010\n\004BOOL\020\001\022\t\n\005INT64\020\002\022\013\n\007FLOAT64\020\003\022\r\n"
6363
+ "\tTIMESTAMP\020\004\022\010\n\004DATE\020\005\022\n\n\006STRING\020\006\022\t\n\005BY"
6464
+ "TES\020\007\022\t\n\005ARRAY\020\010\022\n\n\006STRUCT\020\t\022\013\n\007NUMERIC\020"
65-
+ "\nB\257\001\n\025com.google.spanner.v1B\tTypeProtoP\001"
66-
+ "Z8google.golang.org/genproto/googleapis/"
67-
+ "spanner/v1;spanner\252\002\027Google.Cloud.Spanne"
68-
+ "r.V1\312\002\027Google\\Cloud\\Spanner\\V1\352\002\032Google:"
69-
+ ":Cloud::Spanner::V1b\006proto3"
65+
+ "\n\022\010\n\004JSON\020\013B\257\001\n\025com.google.spanner.v1B\tT"
66+
+ "ypeProtoP\001Z8google.golang.org/genproto/g"
67+
+ "oogleapis/spanner/v1;spanner\252\002\027Google.Cl"
68+
+ "oud.Spanner.V1\312\002\027Google\\Cloud\\Spanner\\V1"
69+
+ "\352\002\032Google::Cloud::Spanner::V1b\006proto3"
7070
};
7171
descriptor =
7272
com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom(

proto-google-cloud-spanner-v1/src/main/proto/google/spanner/v1/type.proto

+9
Original file line numberDiff line numberDiff line change
@@ -128,4 +128,13 @@ enum TypeCode {
128128
// <br>`[+-][Digits].Digits[ExponentIndicator[+-]Digits]`
129129
// <br>(ExponentIndicator is `"e"` or `"E"`)
130130
NUMERIC = 10;
131+
132+
// Encoded as a JSON-formatted 'string' as described in RFC 7159. The
133+
// following rules will be applied when parsing JSON input:
134+
// - Whitespace will be stripped from the document.
135+
// - If a JSON object has duplicate keys, only the first key will be
136+
// preserved.
137+
// - Members of a JSON object are not guaranteed to have their order
138+
// preserved. JSON array elements will have their order preserved.
139+
JSON = 11;
131140
}

synth.metadata

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44
"git": {
55
"name": ".",
66
"remote": "https://github.com/googleapis/java-spanner.git",
7-
"sha": "0da851ba875a78c3d50042fe611e6e5204b6ceab"
7+
"sha": "4593395d291f6e9370c2d3df2695cb28b7d27e8d"
88
}
99
},
1010
{
1111
"git": {
1212
"name": "googleapis",
1313
"remote": "https://github.com/googleapis/googleapis.git",
14-
"sha": "551681f25e36b11829e87e580281350461f4f3f5",
15-
"internalRef": "379784268"
14+
"sha": "fb5c4fbc1ded09e6958d6be7ca36a9221dc7e52f",
15+
"internalRef": "381156241"
1616
}
1717
},
1818
{

0 commit comments

Comments
 (0)