Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-sync with .proto / .textproto files from google-cloud-common. #5351

Merged
merged 1 commit into from
May 21, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
816 changes: 758 additions & 58 deletions firestore/google/cloud/firestore_v1beta1/proto/test_pb2.py

Large diffs are not rendered by default.

27 changes: 27 additions & 0 deletions firestore/tests/unit/testdata/create-basic.textproto
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# DO NOT MODIFY. This file was generated by
# github.com/GoogleCloudPlatform/google-cloud-common/testing/firestore/cmd/generate-firestore-tests/generate-firestore-tests.go.

# A simple call, resulting in a single update operation.

description: "create: basic"
create: <
doc_ref_path: "projects/projectID/databases/(default)/documents/C/d"
json_data: "{\"a\": 1}"
request: <
database: "projects/projectID/databases/(default)"
writes: <
update: <
name: "projects/projectID/databases/(default)/documents/C/d"
fields: <
key: "a"
value: <
integer_value: 1
>
>
>
current_document: <
exists: false
>
>
>
>
61 changes: 61 additions & 0 deletions firestore/tests/unit/testdata/create-complex.textproto
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# DO NOT MODIFY. This file was generated by
# github.com/GoogleCloudPlatform/google-cloud-common/testing/firestore/cmd/generate-firestore-tests/generate-firestore-tests.go.

# A call to a write method with complicated input data.

description: "create: complex"
create: <
doc_ref_path: "projects/projectID/databases/(default)/documents/C/d"
json_data: "{\"a\": [1, 2.5], \"b\": {\"c\": [\"three\", {\"d\": true}]}}"
request: <
database: "projects/projectID/databases/(default)"
writes: <
update: <
name: "projects/projectID/databases/(default)/documents/C/d"
fields: <
key: "a"
value: <
array_value: <
values: <
integer_value: 1
>
values: <
double_value: 2.5
>
>
>
>
fields: <
key: "b"
value: <
map_value: <
fields: <
key: "c"
value: <
array_value: <
values: <
string_value: "three"
>
values: <
map_value: <
fields: <
key: "d"
value: <
boolean_value: true
>
>
>
>
>
>
>
>
>
>
>
current_document: <
exists: false
>
>
>
>
13 changes: 13 additions & 0 deletions firestore/tests/unit/testdata/create-del-noarray-nested.textproto
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# DO NOT MODIFY. This file was generated by
# github.com/GoogleCloudPlatform/google-cloud-common/testing/firestore/cmd/generate-firestore-tests/generate-firestore-tests.go.

# The Delete sentinel must be the value of a field. Deletes are implemented by
# turning the path to the Delete sentinel into a FieldPath, and FieldPaths do not
# support array indexing.

description: "create: Delete cannot be anywhere inside an array value"
create: <
doc_ref_path: "projects/projectID/databases/(default)/documents/C/d"
json_data: "{\"a\": [1, {\"b\": \"Delete\"}]}"
is_error: true
>
13 changes: 13 additions & 0 deletions firestore/tests/unit/testdata/create-del-noarray.textproto
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# DO NOT MODIFY. This file was generated by
# github.com/GoogleCloudPlatform/google-cloud-common/testing/firestore/cmd/generate-firestore-tests/generate-firestore-tests.go.

# The Delete sentinel must be the value of a field. Deletes are implemented by
# turning the path to the Delete sentinel into a FieldPath, and FieldPaths do not
# support array indexing.

description: "create: Delete cannot be in an array value"
create: <
doc_ref_path: "projects/projectID/databases/(default)/documents/C/d"
json_data: "{\"a\": [1, 2, \"Delete\"]}"
is_error: true
>
20 changes: 20 additions & 0 deletions firestore/tests/unit/testdata/create-empty.textproto
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# DO NOT MODIFY. This file was generated by
# github.com/GoogleCloudPlatform/google-cloud-common/testing/firestore/cmd/generate-firestore-tests/generate-firestore-tests.go.


description: "create: creating or setting an empty map"
create: <
doc_ref_path: "projects/projectID/databases/(default)/documents/C/d"
json_data: "{}"
request: <
database: "projects/projectID/databases/(default)"
writes: <
update: <
name: "projects/projectID/databases/(default)/documents/C/d"
>
current_document: <
exists: false
>
>
>
>
11 changes: 11 additions & 0 deletions firestore/tests/unit/testdata/create-nodel.textproto
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# DO NOT MODIFY. This file was generated by
# github.com/GoogleCloudPlatform/google-cloud-common/testing/firestore/cmd/generate-firestore-tests/generate-firestore-tests.go.

# The Delete sentinel cannot be used in Create, or in Set without a Merge option.

description: "create: Delete cannot appear in data"
create: <
doc_ref_path: "projects/projectID/databases/(default)/documents/C/d"
json_data: "{\"a\": 1, \"b\": \"Delete\"}"
is_error: true
>
40 changes: 40 additions & 0 deletions firestore/tests/unit/testdata/create-nosplit.textproto
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# DO NOT MODIFY. This file was generated by
# github.com/GoogleCloudPlatform/google-cloud-common/testing/firestore/cmd/generate-firestore-tests/generate-firestore-tests.go.

# Create and Set treat their map keys literally. They do not split on dots.

description: "create: don\342\200\231t split on dots"
create: <
doc_ref_path: "projects/projectID/databases/(default)/documents/C/d"
json_data: "{ \"a.b\": { \"c.d\": 1 }, \"e\": 2 }"
request: <
database: "projects/projectID/databases/(default)"
writes: <
update: <
name: "projects/projectID/databases/(default)/documents/C/d"
fields: <
key: "a.b"
value: <
map_value: <
fields: <
key: "c.d"
value: <
integer_value: 1
>
>
>
>
>
fields: <
key: "e"
value: <
integer_value: 2
>
>
>
current_document: <
exists: false
>
>
>
>
41 changes: 41 additions & 0 deletions firestore/tests/unit/testdata/create-special-chars.textproto
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# DO NOT MODIFY. This file was generated by
# github.com/GoogleCloudPlatform/google-cloud-common/testing/firestore/cmd/generate-firestore-tests/generate-firestore-tests.go.

# Create and Set treat their map keys literally. They do not escape special
# characters.

description: "create: non-alpha characters in map keys"
create: <
doc_ref_path: "projects/projectID/databases/(default)/documents/C/d"
json_data: "{ \"*\": { \".\": 1 }, \"~\": 2 }"
request: <
database: "projects/projectID/databases/(default)"
writes: <
update: <
name: "projects/projectID/databases/(default)/documents/C/d"
fields: <
key: "*"
value: <
map_value: <
fields: <
key: "."
value: <
integer_value: 1
>
>
>
>
>
fields: <
key: "~"
value: <
integer_value: 2
>
>
>
current_document: <
exists: false
>
>
>
>
26 changes: 26 additions & 0 deletions firestore/tests/unit/testdata/create-st-alone.textproto
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# DO NOT MODIFY. This file was generated by
# github.com/GoogleCloudPlatform/google-cloud-common/testing/firestore/cmd/generate-firestore-tests/generate-firestore-tests.go.

# If the only values in the input are ServerTimestamps, then no update operation
# should be produced.

description: "create: ServerTimestamp alone"
create: <
doc_ref_path: "projects/projectID/databases/(default)/documents/C/d"
json_data: "{\"a\": \"ServerTimestamp\"}"
request: <
database: "projects/projectID/databases/(default)"
writes: <
transform: <
document: "projects/projectID/databases/(default)/documents/C/d"
field_transforms: <
field_path: "a"
set_to_server_value: REQUEST_TIME
>
>
current_document: <
exists: false
>
>
>
>
41 changes: 41 additions & 0 deletions firestore/tests/unit/testdata/create-st-multi.textproto
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# DO NOT MODIFY. This file was generated by
# github.com/GoogleCloudPlatform/google-cloud-common/testing/firestore/cmd/generate-firestore-tests/generate-firestore-tests.go.

# A document can have more than one ServerTimestamp field. Since all the
# ServerTimestamp fields are removed, the only field in the update is "a".

description: "create: multiple ServerTimestamp fields"
create: <
doc_ref_path: "projects/projectID/databases/(default)/documents/C/d"
json_data: "{\"a\": 1, \"b\": \"ServerTimestamp\", \"c\": {\"d\": \"ServerTimestamp\"}}"
request: <
database: "projects/projectID/databases/(default)"
writes: <
update: <
name: "projects/projectID/databases/(default)/documents/C/d"
fields: <
key: "a"
value: <
integer_value: 1
>
>
>
current_document: <
exists: false
>
>
writes: <
transform: <
document: "projects/projectID/databases/(default)/documents/C/d"
field_transforms: <
field_path: "b"
set_to_server_value: REQUEST_TIME
>
field_transforms: <
field_path: "c.d"
set_to_server_value: REQUEST_TIME
>
>
>
>
>
38 changes: 38 additions & 0 deletions firestore/tests/unit/testdata/create-st-nested.textproto
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# DO NOT MODIFY. This file was generated by
# github.com/GoogleCloudPlatform/google-cloud-common/testing/firestore/cmd/generate-firestore-tests/generate-firestore-tests.go.

# A ServerTimestamp value can occur at any depth. In this case, the transform
# applies to the field path "b.c". Since "c" is removed from the update, "b"
# becomes empty, so it is also removed from the update.

description: "create: nested ServerTimestamp field"
create: <
doc_ref_path: "projects/projectID/databases/(default)/documents/C/d"
json_data: "{\"a\": 1, \"b\": {\"c\": \"ServerTimestamp\"}}"
request: <
database: "projects/projectID/databases/(default)"
writes: <
update: <
name: "projects/projectID/databases/(default)/documents/C/d"
fields: <
key: "a"
value: <
integer_value: 1
>
>
>
current_document: <
exists: false
>
>
writes: <
transform: <
document: "projects/projectID/databases/(default)/documents/C/d"
field_transforms: <
field_path: "b.c"
set_to_server_value: REQUEST_TIME
>
>
>
>
>
12 changes: 12 additions & 0 deletions firestore/tests/unit/testdata/create-st-noarray-nested.textproto
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# DO NOT MODIFY. This file was generated by
# github.com/GoogleCloudPlatform/google-cloud-common/testing/firestore/cmd/generate-firestore-tests/generate-firestore-tests.go.

# There cannot be an array value anywhere on the path from the document root to
# the ServerTimestamp sentinel. Firestore transforms don't support array indexing.

description: "create: ServerTimestamp cannot be anywhere inside an array value"
create: <
doc_ref_path: "projects/projectID/databases/(default)/documents/C/d"
json_data: "{\"a\": [1, {\"b\": \"ServerTimestamp\"}]}"
is_error: true
>
12 changes: 12 additions & 0 deletions firestore/tests/unit/testdata/create-st-noarray.textproto
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# DO NOT MODIFY. This file was generated by
# github.com/GoogleCloudPlatform/google-cloud-common/testing/firestore/cmd/generate-firestore-tests/generate-firestore-tests.go.

# The ServerTimestamp sentinel must be the value of a field. Firestore transforms
# don't support array indexing.

description: "create: ServerTimestamp cannot be in an array value"
create: <
doc_ref_path: "projects/projectID/databases/(default)/documents/C/d"
json_data: "{\"a\": [1, 2, \"ServerTimestamp\"]}"
is_error: true
>
Loading