Skip to content

Commit

Permalink
feat: add PG.OID type cod annotation (#1023)
Browse files Browse the repository at this point in the history
* chore: Update gapic-generator-python to v1.11.7

PiperOrigin-RevId: 573230664

Source-Link: googleapis/googleapis@93beed3

Source-Link: googleapis/googleapis-gen@f4a4eda
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZjRhNGVkYWE4MDU3NjM5ZmNmNmFkZjkxNzk4NzIyODBkMWE4ZjY1MSJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* chore: Update gapic-generator-python to v1.11.8

PiperOrigin-RevId: 574178735

Source-Link: googleapis/googleapis@7307199

Source-Link: googleapis/googleapis-gen@ce3af21
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiY2UzYWYyMWI3YzU1OWE4N2MyYmVmYzA3NmJlMGUzYWVkYTNhMjZmMCJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* chore: Update gapic-generator-python to v1.11.9

PiperOrigin-RevId: 574520922

Source-Link: googleapis/googleapis@5183984

Source-Link: googleapis/googleapis-gen@a59af19
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYTU5YWYxOWQ0YWM2NTA5ZmFlZGYxY2MzOTAyOTE0MWI2YTViODk2OCJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* feat: add PG.OID type cod annotation

PiperOrigin-RevId: 577053414

Source-Link: googleapis/googleapis@727c286

Source-Link: googleapis/googleapis-gen@2015275
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMjAxNTI3NWE3ZGRhMmFkM2QxNjA5ZjA2YzQyMDgxMjVjN2RlOGE5ZCJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* remove obsolete rst files

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Co-authored-by: Sri Harsha CH <[email protected]>
Co-authored-by: Anthonios Partheniou <[email protected]>
  • Loading branch information
4 people authored Oct 30, 2023
1 parent ea7f8d5 commit 2d59dd0
Show file tree
Hide file tree
Showing 11 changed files with 465 additions and 309 deletions.
12 changes: 6 additions & 6 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ API Documentation
spanner_v1/transaction
spanner_v1/streamed

spanner_v1/services
spanner_v1/types
spanner_admin_database_v1/services
spanner_admin_database_v1/types
spanner_v1/services_
spanner_v1/types_
spanner_admin_database_v1/services_
spanner_admin_database_v1/types_
spanner_admin_database_v1/database_admin
spanner_admin_instance_v1/services
spanner_admin_instance_v1/types
spanner_admin_instance_v1/services_
spanner_admin_instance_v1/types_
spanner_admin_instance_v1/instance_admin


Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
7 changes: 7 additions & 0 deletions google/cloud/spanner_v1/types/type.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,10 +137,17 @@ class TypeAnnotationCode(proto.Enum):
PostgreSQL JSONB values. Currently this annotation is always
needed for [JSON][google.spanner.v1.TypeCode.JSON] when a
client interacts with PostgreSQL-enabled Spanner databases.
PG_OID (4):
PostgreSQL compatible OID type. This
annotation can be used by a client interacting
with PostgreSQL-enabled Spanner database to
specify that a value should be treated using the
semantics of the OID type.
"""
TYPE_ANNOTATION_CODE_UNSPECIFIED = 0
PG_NUMERIC = 2
PG_JSONB = 3
PG_OID = 4


class Type(proto.Message):
Expand Down
472 changes: 291 additions & 181 deletions tests/unit/gapic/spanner_admin_database_v1/test_database_admin.py

Large diffs are not rendered by default.

108 changes: 56 additions & 52 deletions tests/unit/gapic/spanner_admin_instance_v1/test_instance_admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -4838,10 +4838,11 @@ def test_list_instance_configs_rest(request_type):
# Wrap the value into a proper Response obj
response_value = Response()
response_value.status_code = 200
pb_return_value = spanner_instance_admin.ListInstanceConfigsResponse.pb(
# Convert return value to protobuf type
return_value = spanner_instance_admin.ListInstanceConfigsResponse.pb(
return_value
)
json_return_value = json_format.MessageToJson(pb_return_value)
json_return_value = json_format.MessageToJson(return_value)

response_value._content = json_return_value.encode("UTF-8")
req.return_value = response_value
Expand Down Expand Up @@ -4923,10 +4924,11 @@ def test_list_instance_configs_rest_required_fields(
response_value = Response()
response_value.status_code = 200

pb_return_value = spanner_instance_admin.ListInstanceConfigsResponse.pb(
# Convert return value to protobuf type
return_value = spanner_instance_admin.ListInstanceConfigsResponse.pb(
return_value
)
json_return_value = json_format.MessageToJson(pb_return_value)
json_return_value = json_format.MessageToJson(return_value)

response_value._content = json_return_value.encode("UTF-8")
req.return_value = response_value
Expand Down Expand Up @@ -5062,10 +5064,11 @@ def test_list_instance_configs_rest_flattened():
# Wrap the value into a proper Response obj
response_value = Response()
response_value.status_code = 200
pb_return_value = spanner_instance_admin.ListInstanceConfigsResponse.pb(
# Convert return value to protobuf type
return_value = spanner_instance_admin.ListInstanceConfigsResponse.pb(
return_value
)
json_return_value = json_format.MessageToJson(pb_return_value)
json_return_value = json_format.MessageToJson(return_value)
response_value._content = json_return_value.encode("UTF-8")
req.return_value = response_value

Expand Down Expand Up @@ -5196,8 +5199,9 @@ def test_get_instance_config_rest(request_type):
# Wrap the value into a proper Response obj
response_value = Response()
response_value.status_code = 200
pb_return_value = spanner_instance_admin.InstanceConfig.pb(return_value)
json_return_value = json_format.MessageToJson(pb_return_value)
# Convert return value to protobuf type
return_value = spanner_instance_admin.InstanceConfig.pb(return_value)
json_return_value = json_format.MessageToJson(return_value)

response_value._content = json_return_value.encode("UTF-8")
req.return_value = response_value
Expand Down Expand Up @@ -5282,8 +5286,9 @@ def test_get_instance_config_rest_required_fields(
response_value = Response()
response_value.status_code = 200

pb_return_value = spanner_instance_admin.InstanceConfig.pb(return_value)
json_return_value = json_format.MessageToJson(pb_return_value)
# Convert return value to protobuf type
return_value = spanner_instance_admin.InstanceConfig.pb(return_value)
json_return_value = json_format.MessageToJson(return_value)

response_value._content = json_return_value.encode("UTF-8")
req.return_value = response_value
Expand Down Expand Up @@ -5409,8 +5414,9 @@ def test_get_instance_config_rest_flattened():
# Wrap the value into a proper Response obj
response_value = Response()
response_value.status_code = 200
pb_return_value = spanner_instance_admin.InstanceConfig.pb(return_value)
json_return_value = json_format.MessageToJson(pb_return_value)
# Convert return value to protobuf type
return_value = spanner_instance_admin.InstanceConfig.pb(return_value)
json_return_value = json_format.MessageToJson(return_value)
response_value._content = json_return_value.encode("UTF-8")
req.return_value = response_value

Expand Down Expand Up @@ -6299,10 +6305,11 @@ def test_list_instance_config_operations_rest(request_type):
# Wrap the value into a proper Response obj
response_value = Response()
response_value.status_code = 200
pb_return_value = (
spanner_instance_admin.ListInstanceConfigOperationsResponse.pb(return_value)
# Convert return value to protobuf type
return_value = spanner_instance_admin.ListInstanceConfigOperationsResponse.pb(
return_value
)
json_return_value = json_format.MessageToJson(pb_return_value)
json_return_value = json_format.MessageToJson(return_value)

response_value._content = json_return_value.encode("UTF-8")
req.return_value = response_value
Expand Down Expand Up @@ -6385,12 +6392,13 @@ def test_list_instance_config_operations_rest_required_fields(
response_value = Response()
response_value.status_code = 200

pb_return_value = (
# Convert return value to protobuf type
return_value = (
spanner_instance_admin.ListInstanceConfigOperationsResponse.pb(
return_value
)
)
json_return_value = json_format.MessageToJson(pb_return_value)
json_return_value = json_format.MessageToJson(return_value)

response_value._content = json_return_value.encode("UTF-8")
req.return_value = response_value
Expand Down Expand Up @@ -6531,10 +6539,11 @@ def test_list_instance_config_operations_rest_flattened():
# Wrap the value into a proper Response obj
response_value = Response()
response_value.status_code = 200
pb_return_value = (
spanner_instance_admin.ListInstanceConfigOperationsResponse.pb(return_value)
# Convert return value to protobuf type
return_value = spanner_instance_admin.ListInstanceConfigOperationsResponse.pb(
return_value
)
json_return_value = json_format.MessageToJson(pb_return_value)
json_return_value = json_format.MessageToJson(return_value)
response_value._content = json_return_value.encode("UTF-8")
req.return_value = response_value

Expand Down Expand Up @@ -6659,8 +6668,9 @@ def test_list_instances_rest(request_type):
# Wrap the value into a proper Response obj
response_value = Response()
response_value.status_code = 200
pb_return_value = spanner_instance_admin.ListInstancesResponse.pb(return_value)
json_return_value = json_format.MessageToJson(pb_return_value)
# Convert return value to protobuf type
return_value = spanner_instance_admin.ListInstancesResponse.pb(return_value)
json_return_value = json_format.MessageToJson(return_value)

response_value._content = json_return_value.encode("UTF-8")
req.return_value = response_value
Expand Down Expand Up @@ -6743,10 +6753,9 @@ def test_list_instances_rest_required_fields(
response_value = Response()
response_value.status_code = 200

pb_return_value = spanner_instance_admin.ListInstancesResponse.pb(
return_value
)
json_return_value = json_format.MessageToJson(pb_return_value)
# Convert return value to protobuf type
return_value = spanner_instance_admin.ListInstancesResponse.pb(return_value)
json_return_value = json_format.MessageToJson(return_value)

response_value._content = json_return_value.encode("UTF-8")
req.return_value = response_value
Expand Down Expand Up @@ -6882,8 +6891,9 @@ def test_list_instances_rest_flattened():
# Wrap the value into a proper Response obj
response_value = Response()
response_value.status_code = 200
pb_return_value = spanner_instance_admin.ListInstancesResponse.pb(return_value)
json_return_value = json_format.MessageToJson(pb_return_value)
# Convert return value to protobuf type
return_value = spanner_instance_admin.ListInstancesResponse.pb(return_value)
json_return_value = json_format.MessageToJson(return_value)
response_value._content = json_return_value.encode("UTF-8")
req.return_value = response_value

Expand Down Expand Up @@ -7009,8 +7019,9 @@ def test_get_instance_rest(request_type):
# Wrap the value into a proper Response obj
response_value = Response()
response_value.status_code = 200
pb_return_value = spanner_instance_admin.Instance.pb(return_value)
json_return_value = json_format.MessageToJson(pb_return_value)
# Convert return value to protobuf type
return_value = spanner_instance_admin.Instance.pb(return_value)
json_return_value = json_format.MessageToJson(return_value)

response_value._content = json_return_value.encode("UTF-8")
req.return_value = response_value
Expand Down Expand Up @@ -7093,8 +7104,9 @@ def test_get_instance_rest_required_fields(
response_value = Response()
response_value.status_code = 200

pb_return_value = spanner_instance_admin.Instance.pb(return_value)
json_return_value = json_format.MessageToJson(pb_return_value)
# Convert return value to protobuf type
return_value = spanner_instance_admin.Instance.pb(return_value)
json_return_value = json_format.MessageToJson(return_value)

response_value._content = json_return_value.encode("UTF-8")
req.return_value = response_value
Expand Down Expand Up @@ -7219,8 +7231,9 @@ def test_get_instance_rest_flattened():
# Wrap the value into a proper Response obj
response_value = Response()
response_value.status_code = 200
pb_return_value = spanner_instance_admin.Instance.pb(return_value)
json_return_value = json_format.MessageToJson(pb_return_value)
# Convert return value to protobuf type
return_value = spanner_instance_admin.Instance.pb(return_value)
json_return_value = json_format.MessageToJson(return_value)
response_value._content = json_return_value.encode("UTF-8")
req.return_value = response_value

Expand Down Expand Up @@ -8082,8 +8095,7 @@ def test_set_iam_policy_rest(request_type):
# Wrap the value into a proper Response obj
response_value = Response()
response_value.status_code = 200
pb_return_value = return_value
json_return_value = json_format.MessageToJson(pb_return_value)
json_return_value = json_format.MessageToJson(return_value)

response_value._content = json_return_value.encode("UTF-8")
req.return_value = response_value
Expand Down Expand Up @@ -8160,8 +8172,7 @@ def test_set_iam_policy_rest_required_fields(
response_value = Response()
response_value.status_code = 200

pb_return_value = return_value
json_return_value = json_format.MessageToJson(pb_return_value)
json_return_value = json_format.MessageToJson(return_value)

response_value._content = json_return_value.encode("UTF-8")
req.return_value = response_value
Expand Down Expand Up @@ -8290,8 +8301,7 @@ def test_set_iam_policy_rest_flattened():
# Wrap the value into a proper Response obj
response_value = Response()
response_value.status_code = 200
pb_return_value = return_value
json_return_value = json_format.MessageToJson(pb_return_value)
json_return_value = json_format.MessageToJson(return_value)
response_value._content = json_return_value.encode("UTF-8")
req.return_value = response_value

Expand Down Expand Up @@ -8357,8 +8367,7 @@ def test_get_iam_policy_rest(request_type):
# Wrap the value into a proper Response obj
response_value = Response()
response_value.status_code = 200
pb_return_value = return_value
json_return_value = json_format.MessageToJson(pb_return_value)
json_return_value = json_format.MessageToJson(return_value)

response_value._content = json_return_value.encode("UTF-8")
req.return_value = response_value
Expand Down Expand Up @@ -8435,8 +8444,7 @@ def test_get_iam_policy_rest_required_fields(
response_value = Response()
response_value.status_code = 200

pb_return_value = return_value
json_return_value = json_format.MessageToJson(pb_return_value)
json_return_value = json_format.MessageToJson(return_value)

response_value._content = json_return_value.encode("UTF-8")
req.return_value = response_value
Expand Down Expand Up @@ -8557,8 +8565,7 @@ def test_get_iam_policy_rest_flattened():
# Wrap the value into a proper Response obj
response_value = Response()
response_value.status_code = 200
pb_return_value = return_value
json_return_value = json_format.MessageToJson(pb_return_value)
json_return_value = json_format.MessageToJson(return_value)
response_value._content = json_return_value.encode("UTF-8")
req.return_value = response_value

Expand Down Expand Up @@ -8623,8 +8630,7 @@ def test_test_iam_permissions_rest(request_type):
# Wrap the value into a proper Response obj
response_value = Response()
response_value.status_code = 200
pb_return_value = return_value
json_return_value = json_format.MessageToJson(pb_return_value)
json_return_value = json_format.MessageToJson(return_value)

response_value._content = json_return_value.encode("UTF-8")
req.return_value = response_value
Expand Down Expand Up @@ -8704,8 +8710,7 @@ def test_test_iam_permissions_rest_required_fields(
response_value = Response()
response_value.status_code = 200

pb_return_value = return_value
json_return_value = json_format.MessageToJson(pb_return_value)
json_return_value = json_format.MessageToJson(return_value)

response_value._content = json_return_value.encode("UTF-8")
req.return_value = response_value
Expand Down Expand Up @@ -8837,8 +8842,7 @@ def test_test_iam_permissions_rest_flattened():
# Wrap the value into a proper Response obj
response_value = Response()
response_value.status_code = 200
pb_return_value = return_value
json_return_value = json_format.MessageToJson(pb_return_value)
json_return_value = json_format.MessageToJson(return_value)
response_value._content = json_return_value.encode("UTF-8")
req.return_value = response_value

Expand Down
Loading

0 comments on commit 2d59dd0

Please sign in to comment.