Skip to content

Commit

Permalink
feat: Adds support for custom audiences (#107)
Browse files Browse the repository at this point in the history
* feat: Adds support for custom audiences

Custom Audiences
 * The new field is found in https://cloud.google.com/run/docs/reference/rest/v2/projects.locations.services.
 * For more information, see https://cloud.google.com/run/docs/configuring/custom-audiences.

PiperOrigin-RevId: 546032394

Source-Link: googleapis/googleapis@96f0194

Source-Link: googleapis/googleapis-gen@f95d5ca
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZjk1ZDVjYWZjNTczMGRkMWM2ZTMwYWEyMzk1ZTFiMzdjNDEyMmFkOCJ9

* 🦉 Updates from OwlBot post-processor

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

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
gcf-owl-bot[bot] and gcf-owl-bot[bot] authored Jul 6, 2023
1 parent 96ae812 commit a9d5bb6
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
11 changes: 11 additions & 0 deletions packages/google-cloud-run/google/cloud/run_v2/types/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,13 @@ class Service(proto.Message):
uri (str):
Output only. The main URI in which this
Service is serving traffic.
custom_audiences (MutableSequence[str]):
One or more custom audiences that you want
this service to support. Specify each custom
audience as the full URL in a string. The custom
audiences are encoded in the token and used to
authenticate requests. For more information, see
https://cloud.google.com/run/docs/configuring/custom-audiences.
satisfies_pzs (bool):
Output only. Reserved for future use.
reconciling (bool):
Expand Down Expand Up @@ -535,6 +542,10 @@ class Service(proto.Message):
proto.STRING,
number=36,
)
custom_audiences: MutableSequence[str] = proto.RepeatedField(
proto.STRING,
number=37,
)
satisfies_pzs: bool = proto.Field(
proto.BOOL,
number=38,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
],
"language": "PYTHON",
"name": "google-cloud-run",
"version": "0.8.1"
"version": "0.1.0"
},
"snippets": [
{
Expand Down
10 changes: 10 additions & 0 deletions packages/google-cloud-run/tests/unit/gapic/run_v2/test_services.py
Original file line number Diff line number Diff line change
Expand Up @@ -935,6 +935,7 @@ def test_get_service(request_type, transport: str = "grpc"):
latest_ready_revision="latest_ready_revision_value",
latest_created_revision="latest_created_revision_value",
uri="uri_value",
custom_audiences=["custom_audiences_value"],
satisfies_pzs=True,
reconciling=True,
etag="etag_value",
Expand Down Expand Up @@ -962,6 +963,7 @@ def test_get_service(request_type, transport: str = "grpc"):
assert response.latest_ready_revision == "latest_ready_revision_value"
assert response.latest_created_revision == "latest_created_revision_value"
assert response.uri == "uri_value"
assert response.custom_audiences == ["custom_audiences_value"]
assert response.satisfies_pzs is True
assert response.reconciling is True
assert response.etag == "etag_value"
Expand Down Expand Up @@ -1015,6 +1017,7 @@ async def test_get_service_async(
latest_ready_revision="latest_ready_revision_value",
latest_created_revision="latest_created_revision_value",
uri="uri_value",
custom_audiences=["custom_audiences_value"],
satisfies_pzs=True,
reconciling=True,
etag="etag_value",
Expand Down Expand Up @@ -1043,6 +1046,7 @@ async def test_get_service_async(
assert response.latest_ready_revision == "latest_ready_revision_value"
assert response.latest_created_revision == "latest_created_revision_value"
assert response.uri == "uri_value"
assert response.custom_audiences == ["custom_audiences_value"]
assert response.satisfies_pzs is True
assert response.reconciling is True
assert response.etag == "etag_value"
Expand Down Expand Up @@ -2590,6 +2594,7 @@ def test_create_service_rest(request_type):
}
],
"uri": "uri_value",
"custom_audiences": ["custom_audiences_value1", "custom_audiences_value2"],
"satisfies_pzs": True,
"reconciling": True,
"etag": "etag_value",
Expand Down Expand Up @@ -2931,6 +2936,7 @@ def test_create_service_rest_bad_request(
}
],
"uri": "uri_value",
"custom_audiences": ["custom_audiences_value1", "custom_audiences_value2"],
"satisfies_pzs": True,
"reconciling": True,
"etag": "etag_value",
Expand Down Expand Up @@ -3048,6 +3054,7 @@ def test_get_service_rest(request_type):
latest_ready_revision="latest_ready_revision_value",
latest_created_revision="latest_created_revision_value",
uri="uri_value",
custom_audiences=["custom_audiences_value"],
satisfies_pzs=True,
reconciling=True,
etag="etag_value",
Expand Down Expand Up @@ -3079,6 +3086,7 @@ def test_get_service_rest(request_type):
assert response.latest_ready_revision == "latest_ready_revision_value"
assert response.latest_created_revision == "latest_created_revision_value"
assert response.uri == "uri_value"
assert response.custom_audiences == ["custom_audiences_value"]
assert response.satisfies_pzs is True
assert response.reconciling is True
assert response.etag == "etag_value"
Expand Down Expand Up @@ -3785,6 +3793,7 @@ def test_update_service_rest(request_type):
}
],
"uri": "uri_value",
"custom_audiences": ["custom_audiences_value1", "custom_audiences_value2"],
"satisfies_pzs": True,
"reconciling": True,
"etag": "etag_value",
Expand Down Expand Up @@ -4104,6 +4113,7 @@ def test_update_service_rest_bad_request(
}
],
"uri": "uri_value",
"custom_audiences": ["custom_audiences_value1", "custom_audiences_value2"],
"satisfies_pzs": True,
"reconciling": True,
"etag": "etag_value",
Expand Down

0 comments on commit a9d5bb6

Please sign in to comment.