diff --git a/google/cloud/binaryauthorization_v1/services/binauthz_management_service_v1/async_client.py b/google/cloud/binaryauthorization_v1/services/binauthz_management_service_v1/async_client.py index fbb751d..6781b81 100644 --- a/google/cloud/binaryauthorization_v1/services/binauthz_management_service_v1/async_client.py +++ b/google/cloud/binaryauthorization_v1/services/binauthz_management_service_v1/async_client.py @@ -1109,7 +1109,7 @@ async def sample_delete_attestor(): metadata=metadata, ) - async def __aenter__(self): + async def __aenter__(self) -> "BinauthzManagementServiceV1AsyncClient": return self async def __aexit__(self, exc_type, exc, tb): diff --git a/google/cloud/binaryauthorization_v1/services/system_policy_v1/async_client.py b/google/cloud/binaryauthorization_v1/services/system_policy_v1/async_client.py index a7289c3..650ba61 100644 --- a/google/cloud/binaryauthorization_v1/services/system_policy_v1/async_client.py +++ b/google/cloud/binaryauthorization_v1/services/system_policy_v1/async_client.py @@ -319,7 +319,7 @@ async def sample_get_system_policy(): # Done; return the response. return response - async def __aenter__(self): + async def __aenter__(self) -> "SystemPolicyV1AsyncClient": return self async def __aexit__(self, exc_type, exc, tb): diff --git a/google/cloud/binaryauthorization_v1/services/validation_helper_v1/async_client.py b/google/cloud/binaryauthorization_v1/services/validation_helper_v1/async_client.py index e52ec92..772e24d 100644 --- a/google/cloud/binaryauthorization_v1/services/validation_helper_v1/async_client.py +++ b/google/cloud/binaryauthorization_v1/services/validation_helper_v1/async_client.py @@ -297,7 +297,7 @@ async def sample_validate_attestation_occurrence(): # Done; return the response. return response - async def __aenter__(self): + async def __aenter__(self) -> "ValidationHelperV1AsyncClient": return self async def __aexit__(self, exc_type, exc, tb): diff --git a/google/cloud/binaryauthorization_v1beta1/services/binauthz_management_service_v1_beta1/async_client.py b/google/cloud/binaryauthorization_v1beta1/services/binauthz_management_service_v1_beta1/async_client.py index 0c5f741..0ab80ab 100644 --- a/google/cloud/binaryauthorization_v1beta1/services/binauthz_management_service_v1_beta1/async_client.py +++ b/google/cloud/binaryauthorization_v1beta1/services/binauthz_management_service_v1_beta1/async_client.py @@ -1122,7 +1122,7 @@ async def sample_delete_attestor(): metadata=metadata, ) - async def __aenter__(self): + async def __aenter__(self) -> "BinauthzManagementServiceV1Beta1AsyncClient": return self async def __aexit__(self, exc_type, exc, tb): diff --git a/google/cloud/binaryauthorization_v1beta1/services/system_policy_v1_beta1/async_client.py b/google/cloud/binaryauthorization_v1beta1/services/system_policy_v1_beta1/async_client.py index e496afe..da7cf16 100644 --- a/google/cloud/binaryauthorization_v1beta1/services/system_policy_v1_beta1/async_client.py +++ b/google/cloud/binaryauthorization_v1beta1/services/system_policy_v1_beta1/async_client.py @@ -321,7 +321,7 @@ async def sample_get_system_policy(): # Done; return the response. return response - async def __aenter__(self): + async def __aenter__(self) -> "SystemPolicyV1Beta1AsyncClient": return self async def __aexit__(self, exc_type, exc, tb): diff --git a/samples/generated_samples/snippet_metadata_google.cloud.binaryauthorization.v1.json b/samples/generated_samples/snippet_metadata_google.cloud.binaryauthorization.v1.json index 9830aac..6d7a035 100644 --- a/samples/generated_samples/snippet_metadata_google.cloud.binaryauthorization.v1.json +++ b/samples/generated_samples/snippet_metadata_google.cloud.binaryauthorization.v1.json @@ -8,7 +8,7 @@ ], "language": "PYTHON", "name": "google-cloud-binary-authorization", - "version": "1.6.1" + "version": "0.1.0" }, "snippets": [ { diff --git a/samples/generated_samples/snippet_metadata_google.cloud.binaryauthorization.v1beta1.json b/samples/generated_samples/snippet_metadata_google.cloud.binaryauthorization.v1beta1.json index a476868..c60d526 100644 --- a/samples/generated_samples/snippet_metadata_google.cloud.binaryauthorization.v1beta1.json +++ b/samples/generated_samples/snippet_metadata_google.cloud.binaryauthorization.v1beta1.json @@ -8,7 +8,7 @@ ], "language": "PYTHON", "name": "google-cloud-binary-authorization", - "version": "1.6.1" + "version": "0.1.0" }, "snippets": [ { diff --git a/tests/unit/gapic/binaryauthorization_v1/test_binauthz_management_service_v1.py b/tests/unit/gapic/binaryauthorization_v1/test_binauthz_management_service_v1.py index 38c11e4..682efdc 100644 --- a/tests/unit/gapic/binaryauthorization_v1/test_binauthz_management_service_v1.py +++ b/tests/unit/gapic/binaryauthorization_v1/test_binauthz_management_service_v1.py @@ -1265,9 +1265,6 @@ def test_create_attestor(request_type, transport: str = "grpc"): call.return_value = resources.Attestor( name="name_value", description="description_value", - user_owned_grafeas_note=resources.UserOwnedGrafeasNote( - note_reference="note_reference_value" - ), ) response = client.create_attestor(request) @@ -1520,9 +1517,6 @@ def test_get_attestor(request_type, transport: str = "grpc"): call.return_value = resources.Attestor( name="name_value", description="description_value", - user_owned_grafeas_note=resources.UserOwnedGrafeasNote( - note_reference="note_reference_value" - ), ) response = client.get_attestor(request) @@ -1755,9 +1749,6 @@ def test_update_attestor(request_type, transport: str = "grpc"): call.return_value = resources.Attestor( name="name_value", description="description_value", - user_owned_grafeas_note=resources.UserOwnedGrafeasNote( - note_reference="note_reference_value" - ), ) response = client.update_attestor(request) @@ -2379,9 +2370,11 @@ async def test_list_attestors_async_pages(): RuntimeError, ) pages = [] - async for page_ in ( + # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` + # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 + async for page_ in ( # pragma: no branch await client.list_attestors(request={}) - ).pages: # pragma: no branch + ).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -3218,9 +3211,6 @@ def test_create_attestor_rest(request_type): return_value = resources.Attestor( name="name_value", description="description_value", - user_owned_grafeas_note=resources.UserOwnedGrafeasNote( - note_reference="note_reference_value" - ), ) # Wrap the value into a proper Response obj @@ -3534,9 +3524,6 @@ def test_get_attestor_rest(request_type): return_value = resources.Attestor( name="name_value", description="description_value", - user_owned_grafeas_note=resources.UserOwnedGrafeasNote( - note_reference="note_reference_value" - ), ) # Wrap the value into a proper Response obj @@ -3819,9 +3806,6 @@ def test_update_attestor_rest(request_type): return_value = resources.Attestor( name="name_value", description="description_value", - user_owned_grafeas_note=resources.UserOwnedGrafeasNote( - note_reference="note_reference_value" - ), ) # Wrap the value into a proper Response obj diff --git a/tests/unit/gapic/binaryauthorization_v1beta1/test_binauthz_management_service_v1_beta1.py b/tests/unit/gapic/binaryauthorization_v1beta1/test_binauthz_management_service_v1_beta1.py index a8398a5..2d219d8 100644 --- a/tests/unit/gapic/binaryauthorization_v1beta1/test_binauthz_management_service_v1_beta1.py +++ b/tests/unit/gapic/binaryauthorization_v1beta1/test_binauthz_management_service_v1_beta1.py @@ -1277,9 +1277,6 @@ def test_create_attestor(request_type, transport: str = "grpc"): call.return_value = resources.Attestor( name="name_value", description="description_value", - user_owned_drydock_note=resources.UserOwnedDrydockNote( - note_reference="note_reference_value" - ), ) response = client.create_attestor(request) @@ -1532,9 +1529,6 @@ def test_get_attestor(request_type, transport: str = "grpc"): call.return_value = resources.Attestor( name="name_value", description="description_value", - user_owned_drydock_note=resources.UserOwnedDrydockNote( - note_reference="note_reference_value" - ), ) response = client.get_attestor(request) @@ -1767,9 +1761,6 @@ def test_update_attestor(request_type, transport: str = "grpc"): call.return_value = resources.Attestor( name="name_value", description="description_value", - user_owned_drydock_note=resources.UserOwnedDrydockNote( - note_reference="note_reference_value" - ), ) response = client.update_attestor(request) @@ -2391,9 +2382,11 @@ async def test_list_attestors_async_pages(): RuntimeError, ) pages = [] - async for page_ in ( + # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` + # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 + async for page_ in ( # pragma: no branch await client.list_attestors(request={}) - ).pages: # pragma: no branch + ).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -3231,9 +3224,6 @@ def test_create_attestor_rest(request_type): return_value = resources.Attestor( name="name_value", description="description_value", - user_owned_drydock_note=resources.UserOwnedDrydockNote( - note_reference="note_reference_value" - ), ) # Wrap the value into a proper Response obj @@ -3549,9 +3539,6 @@ def test_get_attestor_rest(request_type): return_value = resources.Attestor( name="name_value", description="description_value", - user_owned_drydock_note=resources.UserOwnedDrydockNote( - note_reference="note_reference_value" - ), ) # Wrap the value into a proper Response obj @@ -3834,9 +3821,6 @@ def test_update_attestor_rest(request_type): return_value = resources.Attestor( name="name_value", description="description_value", - user_owned_drydock_note=resources.UserOwnedDrydockNote( - note_reference="note_reference_value" - ), ) # Wrap the value into a proper Response obj