From 1f500f506715e9028b98e7c42048aacc276fb9b4 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 3 Feb 2022 21:58:58 +0000 Subject: [PATCH 1/3] chore: use gapic-generator-python 0.62.1 (#113) - [x] Regenerate this pull request now. fix: resolve DuplicateCredentialArgs error when using credentials_file committer: parthea PiperOrigin-RevId: 425964861 Source-Link: https://github.com/googleapis/googleapis/commit/84b1a5a4f6fb2d04905be58e586b8a7a4310a8cf Source-Link: https://github.com/googleapis/googleapis-gen/commit/4fb761bbd8506ac156f49bac5f18306aa8eb3aa8 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNGZiNzYxYmJkODUwNmFjMTU2ZjQ5YmFjNWYxODMwNmFhOGViM2FhOCJ9 --- .../async_client.py | 14 ++-- .../binauthz_management_service_v1/client.py | 14 ++-- .../transports/grpc.py | 5 +- .../transports/grpc_asyncio.py | 5 +- .../services/system_policy_v1/async_client.py | 2 +- .../services/system_policy_v1/client.py | 2 +- .../system_policy_v1/transports/grpc.py | 5 +- .../transports/grpc_asyncio.py | 5 +- .../validation_helper_v1/transports/grpc.py | 5 +- .../transports/grpc_asyncio.py | 5 +- .../binaryauthorization_v1/types/resources.py | 6 +- .../async_client.py | 14 ++-- .../client.py | 14 ++-- .../transports/grpc.py | 5 +- .../transports/grpc_asyncio.py | 5 +- .../system_policy_v1_beta1/async_client.py | 2 +- .../services/system_policy_v1_beta1/client.py | 2 +- .../system_policy_v1_beta1/transports/grpc.py | 5 +- .../transports/grpc_asyncio.py | 5 +- .../types/resources.py | 6 +- .../test_binauthz_management_service_v1.py | 73 ++++++++++++++++- .../test_system_policy_v1.py | 79 ++++++++++++++++++- .../test_validation_helper_v1.py | 79 ++++++++++++++++++- ...st_binauthz_management_service_v1_beta1.py | 73 ++++++++++++++++- .../test_system_policy_v1_beta1.py | 73 ++++++++++++++++- 25 files changed, 443 insertions(+), 60 deletions(-) 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 39dd270..ea80e04 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 @@ -272,7 +272,7 @@ async def get_policy( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([name]) if request is not None and has_flattened_params: @@ -364,7 +364,7 @@ async def update_policy( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([policy]) if request is not None and has_flattened_params: @@ -476,7 +476,7 @@ async def create_attestor( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([parent, attestor_id, attestor]) if request is not None and has_flattened_params: @@ -557,7 +557,7 @@ async def get_attestor( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([name]) if request is not None and has_flattened_params: @@ -647,7 +647,7 @@ async def update_attestor( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([attestor]) if request is not None and has_flattened_params: @@ -736,7 +736,7 @@ async def list_attestors( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([parent]) if request is not None and has_flattened_params: @@ -822,7 +822,7 @@ async def delete_attestor( sent along with the request as metadata. """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([name]) if request is not None and has_flattened_params: diff --git a/google/cloud/binaryauthorization_v1/services/binauthz_management_service_v1/client.py b/google/cloud/binaryauthorization_v1/services/binauthz_management_service_v1/client.py index 3605a79..9a20213 100644 --- a/google/cloud/binaryauthorization_v1/services/binauthz_management_service_v1/client.py +++ b/google/cloud/binaryauthorization_v1/services/binauthz_management_service_v1/client.py @@ -470,7 +470,7 @@ def get_policy( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([name]) if request is not None and has_flattened_params: @@ -552,7 +552,7 @@ def update_policy( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([policy]) if request is not None and has_flattened_params: @@ -654,7 +654,7 @@ def create_attestor( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([parent, attestor_id, attestor]) if request is not None and has_flattened_params: @@ -735,7 +735,7 @@ def get_attestor( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([name]) if request is not None and has_flattened_params: @@ -815,7 +815,7 @@ def update_attestor( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([attestor]) if request is not None and has_flattened_params: @@ -894,7 +894,7 @@ def list_attestors( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([parent]) if request is not None and has_flattened_params: @@ -970,7 +970,7 @@ def delete_attestor( sent along with the request as metadata. """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([name]) if request is not None and has_flattened_params: diff --git a/google/cloud/binaryauthorization_v1/services/binauthz_management_service_v1/transports/grpc.py b/google/cloud/binaryauthorization_v1/services/binauthz_management_service_v1/transports/grpc.py index e4678a2..6fc5a12 100644 --- a/google/cloud/binaryauthorization_v1/services/binauthz_management_service_v1/transports/grpc.py +++ b/google/cloud/binaryauthorization_v1/services/binauthz_management_service_v1/transports/grpc.py @@ -166,8 +166,11 @@ def __init__( if not self._grpc_channel: self._grpc_channel = type(self).create_channel( self._host, + # use the credentials which are saved credentials=self._credentials, - credentials_file=credentials_file, + # Set ``credentials_file`` to ``None`` here as + # the credentials that we saved earlier should be used. + credentials_file=None, scopes=self._scopes, ssl_credentials=self._ssl_channel_credentials, quota_project_id=quota_project_id, diff --git a/google/cloud/binaryauthorization_v1/services/binauthz_management_service_v1/transports/grpc_asyncio.py b/google/cloud/binaryauthorization_v1/services/binauthz_management_service_v1/transports/grpc_asyncio.py index dbb65d7..bd32619 100644 --- a/google/cloud/binaryauthorization_v1/services/binauthz_management_service_v1/transports/grpc_asyncio.py +++ b/google/cloud/binaryauthorization_v1/services/binauthz_management_service_v1/transports/grpc_asyncio.py @@ -213,8 +213,11 @@ def __init__( if not self._grpc_channel: self._grpc_channel = type(self).create_channel( self._host, + # use the credentials which are saved credentials=self._credentials, - credentials_file=credentials_file, + # Set ``credentials_file`` to ``None`` here as + # the credentials that we saved earlier should be used. + credentials_file=None, scopes=self._scopes, ssl_credentials=self._ssl_channel_credentials, quota_project_id=quota_project_id, 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 90779aa..769e899 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 @@ -240,7 +240,7 @@ async def get_system_policy( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([name]) if request is not None and has_flattened_params: diff --git a/google/cloud/binaryauthorization_v1/services/system_policy_v1/client.py b/google/cloud/binaryauthorization_v1/services/system_policy_v1/client.py index 2d6daf3..cde5e9f 100644 --- a/google/cloud/binaryauthorization_v1/services/system_policy_v1/client.py +++ b/google/cloud/binaryauthorization_v1/services/system_policy_v1/client.py @@ -432,7 +432,7 @@ def get_system_policy( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([name]) if request is not None and has_flattened_params: diff --git a/google/cloud/binaryauthorization_v1/services/system_policy_v1/transports/grpc.py b/google/cloud/binaryauthorization_v1/services/system_policy_v1/transports/grpc.py index d3f65a9..56c8d40 100644 --- a/google/cloud/binaryauthorization_v1/services/system_policy_v1/transports/grpc.py +++ b/google/cloud/binaryauthorization_v1/services/system_policy_v1/transports/grpc.py @@ -159,8 +159,11 @@ def __init__( if not self._grpc_channel: self._grpc_channel = type(self).create_channel( self._host, + # use the credentials which are saved credentials=self._credentials, - credentials_file=credentials_file, + # Set ``credentials_file`` to ``None`` here as + # the credentials that we saved earlier should be used. + credentials_file=None, scopes=self._scopes, ssl_credentials=self._ssl_channel_credentials, quota_project_id=quota_project_id, diff --git a/google/cloud/binaryauthorization_v1/services/system_policy_v1/transports/grpc_asyncio.py b/google/cloud/binaryauthorization_v1/services/system_policy_v1/transports/grpc_asyncio.py index 1459e72..646b1f3 100644 --- a/google/cloud/binaryauthorization_v1/services/system_policy_v1/transports/grpc_asyncio.py +++ b/google/cloud/binaryauthorization_v1/services/system_policy_v1/transports/grpc_asyncio.py @@ -204,8 +204,11 @@ def __init__( if not self._grpc_channel: self._grpc_channel = type(self).create_channel( self._host, + # use the credentials which are saved credentials=self._credentials, - credentials_file=credentials_file, + # Set ``credentials_file`` to ``None`` here as + # the credentials that we saved earlier should be used. + credentials_file=None, scopes=self._scopes, ssl_credentials=self._ssl_channel_credentials, quota_project_id=quota_project_id, diff --git a/google/cloud/binaryauthorization_v1/services/validation_helper_v1/transports/grpc.py b/google/cloud/binaryauthorization_v1/services/validation_helper_v1/transports/grpc.py index 5e2ce89..ad6cc37 100644 --- a/google/cloud/binaryauthorization_v1/services/validation_helper_v1/transports/grpc.py +++ b/google/cloud/binaryauthorization_v1/services/validation_helper_v1/transports/grpc.py @@ -158,8 +158,11 @@ def __init__( if not self._grpc_channel: self._grpc_channel = type(self).create_channel( self._host, + # use the credentials which are saved credentials=self._credentials, - credentials_file=credentials_file, + # Set ``credentials_file`` to ``None`` here as + # the credentials that we saved earlier should be used. + credentials_file=None, scopes=self._scopes, ssl_credentials=self._ssl_channel_credentials, quota_project_id=quota_project_id, diff --git a/google/cloud/binaryauthorization_v1/services/validation_helper_v1/transports/grpc_asyncio.py b/google/cloud/binaryauthorization_v1/services/validation_helper_v1/transports/grpc_asyncio.py index 9f4dc93..1699853 100644 --- a/google/cloud/binaryauthorization_v1/services/validation_helper_v1/transports/grpc_asyncio.py +++ b/google/cloud/binaryauthorization_v1/services/validation_helper_v1/transports/grpc_asyncio.py @@ -203,8 +203,11 @@ def __init__( if not self._grpc_channel: self._grpc_channel = type(self).create_channel( self._host, + # use the credentials which are saved credentials=self._credentials, - credentials_file=credentials_file, + # Set ``credentials_file`` to ``None`` here as + # the credentials that we saved earlier should be used. + credentials_file=None, scopes=self._scopes, ssl_credentials=self._ssl_channel_credentials, quota_project_id=quota_project_id, diff --git a/google/cloud/binaryauthorization_v1/types/resources.py b/google/cloud/binaryauthorization_v1/types/resources.py index 027d9ea..e1628cb 100644 --- a/google/cloud/binaryauthorization_v1/types/resources.py +++ b/google/cloud/binaryauthorization_v1/types/resources.py @@ -80,9 +80,9 @@ class Policy(proto.Message): e.g. spiffe://example.com/ns/test-ns/sa/default default_admission_rule (google.cloud.binaryauthorization_v1.types.AdmissionRule): Required. Default admission rule for a - cluster without a per-cluster, per- kubernetes- - service-account, or per-istio-service-identity - admission rule. + cluster without a per-cluster, per- + kubernetes-service-account, or + per-istio-service-identity admission rule. update_time (google.protobuf.timestamp_pb2.Timestamp): Output only. Time when the policy was last updated. 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 43c9cba..410ece7 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 @@ -282,7 +282,7 @@ async def get_policy( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([name]) if request is not None and has_flattened_params: @@ -375,7 +375,7 @@ async def update_policy( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([policy]) if request is not None and has_flattened_params: @@ -488,7 +488,7 @@ async def create_attestor( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([parent, attestor_id, attestor]) if request is not None and has_flattened_params: @@ -569,7 +569,7 @@ async def get_attestor( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([name]) if request is not None and has_flattened_params: @@ -659,7 +659,7 @@ async def update_attestor( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([attestor]) if request is not None and has_flattened_params: @@ -749,7 +749,7 @@ async def list_attestors( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([parent]) if request is not None and has_flattened_params: @@ -835,7 +835,7 @@ async def delete_attestor( sent along with the request as metadata. """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([name]) if request is not None and has_flattened_params: diff --git a/google/cloud/binaryauthorization_v1beta1/services/binauthz_management_service_v1_beta1/client.py b/google/cloud/binaryauthorization_v1beta1/services/binauthz_management_service_v1_beta1/client.py index c943ee0..d8162eb 100644 --- a/google/cloud/binaryauthorization_v1beta1/services/binauthz_management_service_v1_beta1/client.py +++ b/google/cloud/binaryauthorization_v1beta1/services/binauthz_management_service_v1_beta1/client.py @@ -478,7 +478,7 @@ def get_policy( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([name]) if request is not None and has_flattened_params: @@ -561,7 +561,7 @@ def update_policy( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([policy]) if request is not None and has_flattened_params: @@ -664,7 +664,7 @@ def create_attestor( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([parent, attestor_id, attestor]) if request is not None and has_flattened_params: @@ -745,7 +745,7 @@ def get_attestor( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([name]) if request is not None and has_flattened_params: @@ -825,7 +825,7 @@ def update_attestor( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([attestor]) if request is not None and has_flattened_params: @@ -905,7 +905,7 @@ def list_attestors( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([parent]) if request is not None and has_flattened_params: @@ -981,7 +981,7 @@ def delete_attestor( sent along with the request as metadata. """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([name]) if request is not None and has_flattened_params: diff --git a/google/cloud/binaryauthorization_v1beta1/services/binauthz_management_service_v1_beta1/transports/grpc.py b/google/cloud/binaryauthorization_v1beta1/services/binauthz_management_service_v1_beta1/transports/grpc.py index 403e8cb..8c246b1 100644 --- a/google/cloud/binaryauthorization_v1beta1/services/binauthz_management_service_v1_beta1/transports/grpc.py +++ b/google/cloud/binaryauthorization_v1beta1/services/binauthz_management_service_v1_beta1/transports/grpc.py @@ -168,8 +168,11 @@ def __init__( if not self._grpc_channel: self._grpc_channel = type(self).create_channel( self._host, + # use the credentials which are saved credentials=self._credentials, - credentials_file=credentials_file, + # Set ``credentials_file`` to ``None`` here as + # the credentials that we saved earlier should be used. + credentials_file=None, scopes=self._scopes, ssl_credentials=self._ssl_channel_credentials, quota_project_id=quota_project_id, diff --git a/google/cloud/binaryauthorization_v1beta1/services/binauthz_management_service_v1_beta1/transports/grpc_asyncio.py b/google/cloud/binaryauthorization_v1beta1/services/binauthz_management_service_v1_beta1/transports/grpc_asyncio.py index 8c1926c..00cce20 100644 --- a/google/cloud/binaryauthorization_v1beta1/services/binauthz_management_service_v1_beta1/transports/grpc_asyncio.py +++ b/google/cloud/binaryauthorization_v1beta1/services/binauthz_management_service_v1_beta1/transports/grpc_asyncio.py @@ -213,8 +213,11 @@ def __init__( if not self._grpc_channel: self._grpc_channel = type(self).create_channel( self._host, + # use the credentials which are saved credentials=self._credentials, - credentials_file=credentials_file, + # Set ``credentials_file`` to ``None`` here as + # the credentials that we saved earlier should be used. + credentials_file=None, scopes=self._scopes, ssl_credentials=self._ssl_channel_credentials, quota_project_id=quota_project_id, 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 574ffec..b393317 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 @@ -242,7 +242,7 @@ async def get_system_policy( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([name]) if request is not None and has_flattened_params: diff --git a/google/cloud/binaryauthorization_v1beta1/services/system_policy_v1_beta1/client.py b/google/cloud/binaryauthorization_v1beta1/services/system_policy_v1_beta1/client.py index dfa457d..81f832a 100644 --- a/google/cloud/binaryauthorization_v1beta1/services/system_policy_v1_beta1/client.py +++ b/google/cloud/binaryauthorization_v1beta1/services/system_policy_v1_beta1/client.py @@ -435,7 +435,7 @@ def get_system_policy( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([name]) if request is not None and has_flattened_params: diff --git a/google/cloud/binaryauthorization_v1beta1/services/system_policy_v1_beta1/transports/grpc.py b/google/cloud/binaryauthorization_v1beta1/services/system_policy_v1_beta1/transports/grpc.py index 05cbaef..ab71598 100644 --- a/google/cloud/binaryauthorization_v1beta1/services/system_policy_v1_beta1/transports/grpc.py +++ b/google/cloud/binaryauthorization_v1beta1/services/system_policy_v1_beta1/transports/grpc.py @@ -159,8 +159,11 @@ def __init__( if not self._grpc_channel: self._grpc_channel = type(self).create_channel( self._host, + # use the credentials which are saved credentials=self._credentials, - credentials_file=credentials_file, + # Set ``credentials_file`` to ``None`` here as + # the credentials that we saved earlier should be used. + credentials_file=None, scopes=self._scopes, ssl_credentials=self._ssl_channel_credentials, quota_project_id=quota_project_id, diff --git a/google/cloud/binaryauthorization_v1beta1/services/system_policy_v1_beta1/transports/grpc_asyncio.py b/google/cloud/binaryauthorization_v1beta1/services/system_policy_v1_beta1/transports/grpc_asyncio.py index 0502b9d..6998929 100644 --- a/google/cloud/binaryauthorization_v1beta1/services/system_policy_v1_beta1/transports/grpc_asyncio.py +++ b/google/cloud/binaryauthorization_v1beta1/services/system_policy_v1_beta1/transports/grpc_asyncio.py @@ -204,8 +204,11 @@ def __init__( if not self._grpc_channel: self._grpc_channel = type(self).create_channel( self._host, + # use the credentials which are saved credentials=self._credentials, - credentials_file=credentials_file, + # Set ``credentials_file`` to ``None`` here as + # the credentials that we saved earlier should be used. + credentials_file=None, scopes=self._scopes, ssl_credentials=self._ssl_channel_credentials, quota_project_id=quota_project_id, diff --git a/google/cloud/binaryauthorization_v1beta1/types/resources.py b/google/cloud/binaryauthorization_v1beta1/types/resources.py index 617046a..92bc75d 100644 --- a/google/cloud/binaryauthorization_v1beta1/types/resources.py +++ b/google/cloud/binaryauthorization_v1beta1/types/resources.py @@ -79,9 +79,9 @@ class Policy(proto.Message): ``spiffe://example.com/ns/test-ns/sa/default`` default_admission_rule (google.cloud.binaryauthorization_v1beta1.types.AdmissionRule): Required. Default admission rule for a - cluster without a per-cluster, per- kubernetes- - service-account, or per-istio-service-identity - admission rule. + cluster without a per-cluster, per- + kubernetes-service-account, or + per-istio-service-identity admission rule. update_time (google.protobuf.timestamp_pb2.Timestamp): Output only. Time when the policy was last updated. 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 3df746e..133f360 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 @@ -548,25 +548,28 @@ def test_binauthz_management_service_v1_client_client_options_scopes( @pytest.mark.parametrize( - "client_class,transport_class,transport_name", + "client_class,transport_class,transport_name,grpc_helpers", [ ( BinauthzManagementServiceV1Client, transports.BinauthzManagementServiceV1GrpcTransport, "grpc", + grpc_helpers, ), ( BinauthzManagementServiceV1AsyncClient, transports.BinauthzManagementServiceV1GrpcAsyncIOTransport, "grpc_asyncio", + grpc_helpers_async, ), ], ) def test_binauthz_management_service_v1_client_client_options_credentials_file( - client_class, transport_class, transport_name + client_class, transport_class, transport_name, grpc_helpers ): # Check the case credentials file is provided. options = client_options.ClientOptions(credentials_file="credentials.json") + with mock.patch.object(transport_class, "__init__") as patched: patched.return_value = None client = client_class(client_options=options, transport=transport_name) @@ -602,6 +605,72 @@ def test_binauthz_management_service_v1_client_client_options_from_dict(): ) +@pytest.mark.parametrize( + "client_class,transport_class,transport_name,grpc_helpers", + [ + ( + BinauthzManagementServiceV1Client, + transports.BinauthzManagementServiceV1GrpcTransport, + "grpc", + grpc_helpers, + ), + ( + BinauthzManagementServiceV1AsyncClient, + transports.BinauthzManagementServiceV1GrpcAsyncIOTransport, + "grpc_asyncio", + grpc_helpers_async, + ), + ], +) +def test_binauthz_management_service_v1_client_create_channel_credentials_file( + client_class, transport_class, transport_name, grpc_helpers +): + # Check the case credentials file is provided. + options = client_options.ClientOptions(credentials_file="credentials.json") + + with mock.patch.object(transport_class, "__init__") as patched: + patched.return_value = None + client = client_class(client_options=options, transport=transport_name) + patched.assert_called_once_with( + credentials=None, + credentials_file="credentials.json", + host=client.DEFAULT_ENDPOINT, + scopes=None, + client_cert_source_for_mtls=None, + quota_project_id=None, + client_info=transports.base.DEFAULT_CLIENT_INFO, + always_use_jwt_access=True, + ) + + # test that the credentials from file are saved and used as the credentials. + with mock.patch.object( + google.auth, "load_credentials_from_file", autospec=True + ) as load_creds, mock.patch.object( + google.auth, "default", autospec=True + ) as adc, mock.patch.object( + grpc_helpers, "create_channel" + ) as create_channel: + creds = ga_credentials.AnonymousCredentials() + file_creds = ga_credentials.AnonymousCredentials() + load_creds.return_value = (file_creds, None) + adc.return_value = (creds, None) + client = client_class(client_options=options, transport=transport_name) + create_channel.assert_called_with( + "binaryauthorization.googleapis.com:443", + credentials=file_creds, + credentials_file=None, + quota_project_id=None, + default_scopes=("https://www.googleapis.com/auth/cloud-platform",), + scopes=None, + default_host="binaryauthorization.googleapis.com", + ssl_credentials=None, + options=[ + ("grpc.max_send_message_length", -1), + ("grpc.max_receive_message_length", -1), + ], + ) + + @pytest.mark.parametrize("request_type", [service.GetPolicyRequest, dict,]) def test_get_policy(request_type, transport: str = "grpc"): client = BinauthzManagementServiceV1Client( diff --git a/tests/unit/gapic/binaryauthorization_v1/test_system_policy_v1.py b/tests/unit/gapic/binaryauthorization_v1/test_system_policy_v1.py index a564134..1fbe6a1 100644 --- a/tests/unit/gapic/binaryauthorization_v1/test_system_policy_v1.py +++ b/tests/unit/gapic/binaryauthorization_v1/test_system_policy_v1.py @@ -513,21 +513,28 @@ def test_system_policy_v1_client_client_options_scopes( @pytest.mark.parametrize( - "client_class,transport_class,transport_name", + "client_class,transport_class,transport_name,grpc_helpers", [ - (SystemPolicyV1Client, transports.SystemPolicyV1GrpcTransport, "grpc"), + ( + SystemPolicyV1Client, + transports.SystemPolicyV1GrpcTransport, + "grpc", + grpc_helpers, + ), ( SystemPolicyV1AsyncClient, transports.SystemPolicyV1GrpcAsyncIOTransport, "grpc_asyncio", + grpc_helpers_async, ), ], ) def test_system_policy_v1_client_client_options_credentials_file( - client_class, transport_class, transport_name + client_class, transport_class, transport_name, grpc_helpers ): # Check the case credentials file is provided. options = client_options.ClientOptions(credentials_file="credentials.json") + with mock.patch.object(transport_class, "__init__") as patched: patched.return_value = None client = client_class(client_options=options, transport=transport_name) @@ -563,6 +570,72 @@ def test_system_policy_v1_client_client_options_from_dict(): ) +@pytest.mark.parametrize( + "client_class,transport_class,transport_name,grpc_helpers", + [ + ( + SystemPolicyV1Client, + transports.SystemPolicyV1GrpcTransport, + "grpc", + grpc_helpers, + ), + ( + SystemPolicyV1AsyncClient, + transports.SystemPolicyV1GrpcAsyncIOTransport, + "grpc_asyncio", + grpc_helpers_async, + ), + ], +) +def test_system_policy_v1_client_create_channel_credentials_file( + client_class, transport_class, transport_name, grpc_helpers +): + # Check the case credentials file is provided. + options = client_options.ClientOptions(credentials_file="credentials.json") + + with mock.patch.object(transport_class, "__init__") as patched: + patched.return_value = None + client = client_class(client_options=options, transport=transport_name) + patched.assert_called_once_with( + credentials=None, + credentials_file="credentials.json", + host=client.DEFAULT_ENDPOINT, + scopes=None, + client_cert_source_for_mtls=None, + quota_project_id=None, + client_info=transports.base.DEFAULT_CLIENT_INFO, + always_use_jwt_access=True, + ) + + # test that the credentials from file are saved and used as the credentials. + with mock.patch.object( + google.auth, "load_credentials_from_file", autospec=True + ) as load_creds, mock.patch.object( + google.auth, "default", autospec=True + ) as adc, mock.patch.object( + grpc_helpers, "create_channel" + ) as create_channel: + creds = ga_credentials.AnonymousCredentials() + file_creds = ga_credentials.AnonymousCredentials() + load_creds.return_value = (file_creds, None) + adc.return_value = (creds, None) + client = client_class(client_options=options, transport=transport_name) + create_channel.assert_called_with( + "binaryauthorization.googleapis.com:443", + credentials=file_creds, + credentials_file=None, + quota_project_id=None, + default_scopes=("https://www.googleapis.com/auth/cloud-platform",), + scopes=None, + default_host="binaryauthorization.googleapis.com", + ssl_credentials=None, + options=[ + ("grpc.max_send_message_length", -1), + ("grpc.max_receive_message_length", -1), + ], + ) + + @pytest.mark.parametrize("request_type", [service.GetSystemPolicyRequest, dict,]) def test_get_system_policy(request_type, transport: str = "grpc"): client = SystemPolicyV1Client( diff --git a/tests/unit/gapic/binaryauthorization_v1/test_validation_helper_v1.py b/tests/unit/gapic/binaryauthorization_v1/test_validation_helper_v1.py index 5eee0b0..0a9d30a 100644 --- a/tests/unit/gapic/binaryauthorization_v1/test_validation_helper_v1.py +++ b/tests/unit/gapic/binaryauthorization_v1/test_validation_helper_v1.py @@ -524,21 +524,28 @@ def test_validation_helper_v1_client_client_options_scopes( @pytest.mark.parametrize( - "client_class,transport_class,transport_name", + "client_class,transport_class,transport_name,grpc_helpers", [ - (ValidationHelperV1Client, transports.ValidationHelperV1GrpcTransport, "grpc"), + ( + ValidationHelperV1Client, + transports.ValidationHelperV1GrpcTransport, + "grpc", + grpc_helpers, + ), ( ValidationHelperV1AsyncClient, transports.ValidationHelperV1GrpcAsyncIOTransport, "grpc_asyncio", + grpc_helpers_async, ), ], ) def test_validation_helper_v1_client_client_options_credentials_file( - client_class, transport_class, transport_name + client_class, transport_class, transport_name, grpc_helpers ): # Check the case credentials file is provided. options = client_options.ClientOptions(credentials_file="credentials.json") + with mock.patch.object(transport_class, "__init__") as patched: patched.return_value = None client = client_class(client_options=options, transport=transport_name) @@ -574,6 +581,72 @@ def test_validation_helper_v1_client_client_options_from_dict(): ) +@pytest.mark.parametrize( + "client_class,transport_class,transport_name,grpc_helpers", + [ + ( + ValidationHelperV1Client, + transports.ValidationHelperV1GrpcTransport, + "grpc", + grpc_helpers, + ), + ( + ValidationHelperV1AsyncClient, + transports.ValidationHelperV1GrpcAsyncIOTransport, + "grpc_asyncio", + grpc_helpers_async, + ), + ], +) +def test_validation_helper_v1_client_create_channel_credentials_file( + client_class, transport_class, transport_name, grpc_helpers +): + # Check the case credentials file is provided. + options = client_options.ClientOptions(credentials_file="credentials.json") + + with mock.patch.object(transport_class, "__init__") as patched: + patched.return_value = None + client = client_class(client_options=options, transport=transport_name) + patched.assert_called_once_with( + credentials=None, + credentials_file="credentials.json", + host=client.DEFAULT_ENDPOINT, + scopes=None, + client_cert_source_for_mtls=None, + quota_project_id=None, + client_info=transports.base.DEFAULT_CLIENT_INFO, + always_use_jwt_access=True, + ) + + # test that the credentials from file are saved and used as the credentials. + with mock.patch.object( + google.auth, "load_credentials_from_file", autospec=True + ) as load_creds, mock.patch.object( + google.auth, "default", autospec=True + ) as adc, mock.patch.object( + grpc_helpers, "create_channel" + ) as create_channel: + creds = ga_credentials.AnonymousCredentials() + file_creds = ga_credentials.AnonymousCredentials() + load_creds.return_value = (file_creds, None) + adc.return_value = (creds, None) + client = client_class(client_options=options, transport=transport_name) + create_channel.assert_called_with( + "binaryauthorization.googleapis.com:443", + credentials=file_creds, + credentials_file=None, + quota_project_id=None, + default_scopes=("https://www.googleapis.com/auth/cloud-platform",), + scopes=None, + default_host="binaryauthorization.googleapis.com", + ssl_credentials=None, + options=[ + ("grpc.max_send_message_length", -1), + ("grpc.max_receive_message_length", -1), + ], + ) + + @pytest.mark.parametrize( "request_type", [service.ValidateAttestationOccurrenceRequest, dict,] ) 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 121646e..aba6f54 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 @@ -570,25 +570,28 @@ def test_binauthz_management_service_v1_beta1_client_client_options_scopes( @pytest.mark.parametrize( - "client_class,transport_class,transport_name", + "client_class,transport_class,transport_name,grpc_helpers", [ ( BinauthzManagementServiceV1Beta1Client, transports.BinauthzManagementServiceV1Beta1GrpcTransport, "grpc", + grpc_helpers, ), ( BinauthzManagementServiceV1Beta1AsyncClient, transports.BinauthzManagementServiceV1Beta1GrpcAsyncIOTransport, "grpc_asyncio", + grpc_helpers_async, ), ], ) def test_binauthz_management_service_v1_beta1_client_client_options_credentials_file( - client_class, transport_class, transport_name + client_class, transport_class, transport_name, grpc_helpers ): # Check the case credentials file is provided. options = client_options.ClientOptions(credentials_file="credentials.json") + with mock.patch.object(transport_class, "__init__") as patched: patched.return_value = None client = client_class(client_options=options, transport=transport_name) @@ -624,6 +627,72 @@ def test_binauthz_management_service_v1_beta1_client_client_options_from_dict(): ) +@pytest.mark.parametrize( + "client_class,transport_class,transport_name,grpc_helpers", + [ + ( + BinauthzManagementServiceV1Beta1Client, + transports.BinauthzManagementServiceV1Beta1GrpcTransport, + "grpc", + grpc_helpers, + ), + ( + BinauthzManagementServiceV1Beta1AsyncClient, + transports.BinauthzManagementServiceV1Beta1GrpcAsyncIOTransport, + "grpc_asyncio", + grpc_helpers_async, + ), + ], +) +def test_binauthz_management_service_v1_beta1_client_create_channel_credentials_file( + client_class, transport_class, transport_name, grpc_helpers +): + # Check the case credentials file is provided. + options = client_options.ClientOptions(credentials_file="credentials.json") + + with mock.patch.object(transport_class, "__init__") as patched: + patched.return_value = None + client = client_class(client_options=options, transport=transport_name) + patched.assert_called_once_with( + credentials=None, + credentials_file="credentials.json", + host=client.DEFAULT_ENDPOINT, + scopes=None, + client_cert_source_for_mtls=None, + quota_project_id=None, + client_info=transports.base.DEFAULT_CLIENT_INFO, + always_use_jwt_access=True, + ) + + # test that the credentials from file are saved and used as the credentials. + with mock.patch.object( + google.auth, "load_credentials_from_file", autospec=True + ) as load_creds, mock.patch.object( + google.auth, "default", autospec=True + ) as adc, mock.patch.object( + grpc_helpers, "create_channel" + ) as create_channel: + creds = ga_credentials.AnonymousCredentials() + file_creds = ga_credentials.AnonymousCredentials() + load_creds.return_value = (file_creds, None) + adc.return_value = (creds, None) + client = client_class(client_options=options, transport=transport_name) + create_channel.assert_called_with( + "binaryauthorization.googleapis.com:443", + credentials=file_creds, + credentials_file=None, + quota_project_id=None, + default_scopes=("https://www.googleapis.com/auth/cloud-platform",), + scopes=None, + default_host="binaryauthorization.googleapis.com", + ssl_credentials=None, + options=[ + ("grpc.max_send_message_length", -1), + ("grpc.max_receive_message_length", -1), + ], + ) + + @pytest.mark.parametrize("request_type", [service.GetPolicyRequest, dict,]) def test_get_policy(request_type, transport: str = "grpc"): client = BinauthzManagementServiceV1Beta1Client( diff --git a/tests/unit/gapic/binaryauthorization_v1beta1/test_system_policy_v1_beta1.py b/tests/unit/gapic/binaryauthorization_v1beta1/test_system_policy_v1_beta1.py index 315cd3b..6caefae 100644 --- a/tests/unit/gapic/binaryauthorization_v1beta1/test_system_policy_v1_beta1.py +++ b/tests/unit/gapic/binaryauthorization_v1beta1/test_system_policy_v1_beta1.py @@ -534,25 +534,28 @@ def test_system_policy_v1_beta1_client_client_options_scopes( @pytest.mark.parametrize( - "client_class,transport_class,transport_name", + "client_class,transport_class,transport_name,grpc_helpers", [ ( SystemPolicyV1Beta1Client, transports.SystemPolicyV1Beta1GrpcTransport, "grpc", + grpc_helpers, ), ( SystemPolicyV1Beta1AsyncClient, transports.SystemPolicyV1Beta1GrpcAsyncIOTransport, "grpc_asyncio", + grpc_helpers_async, ), ], ) def test_system_policy_v1_beta1_client_client_options_credentials_file( - client_class, transport_class, transport_name + client_class, transport_class, transport_name, grpc_helpers ): # Check the case credentials file is provided. options = client_options.ClientOptions(credentials_file="credentials.json") + with mock.patch.object(transport_class, "__init__") as patched: patched.return_value = None client = client_class(client_options=options, transport=transport_name) @@ -588,6 +591,72 @@ def test_system_policy_v1_beta1_client_client_options_from_dict(): ) +@pytest.mark.parametrize( + "client_class,transport_class,transport_name,grpc_helpers", + [ + ( + SystemPolicyV1Beta1Client, + transports.SystemPolicyV1Beta1GrpcTransport, + "grpc", + grpc_helpers, + ), + ( + SystemPolicyV1Beta1AsyncClient, + transports.SystemPolicyV1Beta1GrpcAsyncIOTransport, + "grpc_asyncio", + grpc_helpers_async, + ), + ], +) +def test_system_policy_v1_beta1_client_create_channel_credentials_file( + client_class, transport_class, transport_name, grpc_helpers +): + # Check the case credentials file is provided. + options = client_options.ClientOptions(credentials_file="credentials.json") + + with mock.patch.object(transport_class, "__init__") as patched: + patched.return_value = None + client = client_class(client_options=options, transport=transport_name) + patched.assert_called_once_with( + credentials=None, + credentials_file="credentials.json", + host=client.DEFAULT_ENDPOINT, + scopes=None, + client_cert_source_for_mtls=None, + quota_project_id=None, + client_info=transports.base.DEFAULT_CLIENT_INFO, + always_use_jwt_access=True, + ) + + # test that the credentials from file are saved and used as the credentials. + with mock.patch.object( + google.auth, "load_credentials_from_file", autospec=True + ) as load_creds, mock.patch.object( + google.auth, "default", autospec=True + ) as adc, mock.patch.object( + grpc_helpers, "create_channel" + ) as create_channel: + creds = ga_credentials.AnonymousCredentials() + file_creds = ga_credentials.AnonymousCredentials() + load_creds.return_value = (file_creds, None) + adc.return_value = (creds, None) + client = client_class(client_options=options, transport=transport_name) + create_channel.assert_called_with( + "binaryauthorization.googleapis.com:443", + credentials=file_creds, + credentials_file=None, + quota_project_id=None, + default_scopes=("https://www.googleapis.com/auth/cloud-platform",), + scopes=None, + default_host="binaryauthorization.googleapis.com", + ssl_credentials=None, + options=[ + ("grpc.max_send_message_length", -1), + ("grpc.max_receive_message_length", -1), + ], + ) + + @pytest.mark.parametrize("request_type", [service.GetSystemPolicyRequest, dict,]) def test_get_system_policy(request_type, transport: str = "grpc"): client = SystemPolicyV1Beta1Client( From 2b0bc791787339808aecd5db1a77297d683c98be Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 11 Feb 2022 14:24:16 -0700 Subject: [PATCH 2/3] chore: use gapic-generator-python 0.63.2 (#116) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: use gapic-generator-python 0.63.2 docs: add generated snippets PiperOrigin-RevId: 427792504 Source-Link: https://github.com/googleapis/googleapis/commit/55b9e1e0b3106c850d13958352bc0751147b6b15 Source-Link: https://github.com/googleapis/googleapis-gen/commit/bf4e86b753f42cb0edb1fd51fbe840d7da0a1cde Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYmY0ZTg2Yjc1M2Y0MmNiMGVkYjFmZDUxZmJlODQwZDdkYTBhMWNkZSJ9 * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- .../async_client.py | 152 ++++ .../binauthz_management_service_v1/client.py | 159 ++++ .../services/system_policy_v1/async_client.py | 20 + .../services/system_policy_v1/client.py | 21 + .../validation_helper_v1/async_client.py | 22 + .../services/validation_helper_v1/client.py | 23 + .../async_client.py | 152 ++++ .../client.py | 159 ++++ .../system_policy_v1_beta1/async_client.py | 20 + .../services/system_policy_v1_beta1/client.py | 21 + ...gement_service_v1_create_attestor_async.py | 51 ++ ...agement_service_v1_create_attestor_sync.py | 51 ++ ...gement_service_v1_delete_attestor_async.py | 43 + ...agement_service_v1_delete_attestor_sync.py | 43 + ...anagement_service_v1_get_attestor_async.py | 45 + ...management_service_v1_get_attestor_sync.py | 45 + ..._management_service_v1_get_policy_async.py | 45 + ...z_management_service_v1_get_policy_sync.py | 45 + ...agement_service_v1_list_attestors_async.py | 46 + ...nagement_service_v1_list_attestors_sync.py | 46 + ...gement_service_v1_update_attestor_async.py | 49 ++ ...agement_service_v1_update_attestor_sync.py | 49 ++ ...nagement_service_v1_update_policy_async.py | 49 ++ ...anagement_service_v1_update_policy_sync.py | 49 ++ ...ystem_policy_v1_get_system_policy_async.py | 45 + ...system_policy_v1_get_system_policy_sync.py | 45 + ...1_validate_attestation_occurrence_async.py | 47 + ...v1_validate_attestation_occurrence_sync.py | 47 + ..._service_v1_beta1_create_attestor_async.py | 51 ++ ...t_service_v1_beta1_create_attestor_sync.py | 51 ++ ..._service_v1_beta1_delete_attestor_async.py | 43 + ...t_service_v1_beta1_delete_attestor_sync.py | 43 + ...ent_service_v1_beta1_get_attestor_async.py | 45 + ...ment_service_v1_beta1_get_attestor_sync.py | 45 + ...ement_service_v1_beta1_get_policy_async.py | 45 + ...gement_service_v1_beta1_get_policy_sync.py | 45 + ...t_service_v1_beta1_list_attestors_async.py | 46 + ...nt_service_v1_beta1_list_attestors_sync.py | 46 + ..._service_v1_beta1_update_attestor_async.py | 49 ++ ...t_service_v1_beta1_update_attestor_sync.py | 49 ++ ...nt_service_v1_beta1_update_policy_async.py | 49 ++ ...ent_service_v1_beta1_update_policy_sync.py | 49 ++ ...policy_v1_beta1_get_system_policy_async.py | 45 + ..._policy_v1_beta1_get_system_policy_sync.py | 45 + ...ippet_metadata_binaryauthorization_v1.json | 801 ++++++++++++++++++ ..._metadata_binaryauthorization_v1beta1.json | 712 ++++++++++++++++ 46 files changed, 3848 insertions(+) create mode 100644 samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1_binauthz_management_service_v1_create_attestor_async.py create mode 100644 samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1_binauthz_management_service_v1_create_attestor_sync.py create mode 100644 samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1_binauthz_management_service_v1_delete_attestor_async.py create mode 100644 samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1_binauthz_management_service_v1_delete_attestor_sync.py create mode 100644 samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1_binauthz_management_service_v1_get_attestor_async.py create mode 100644 samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1_binauthz_management_service_v1_get_attestor_sync.py create mode 100644 samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1_binauthz_management_service_v1_get_policy_async.py create mode 100644 samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1_binauthz_management_service_v1_get_policy_sync.py create mode 100644 samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1_binauthz_management_service_v1_list_attestors_async.py create mode 100644 samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1_binauthz_management_service_v1_list_attestors_sync.py create mode 100644 samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1_binauthz_management_service_v1_update_attestor_async.py create mode 100644 samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1_binauthz_management_service_v1_update_attestor_sync.py create mode 100644 samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1_binauthz_management_service_v1_update_policy_async.py create mode 100644 samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1_binauthz_management_service_v1_update_policy_sync.py create mode 100644 samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1_system_policy_v1_get_system_policy_async.py create mode 100644 samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1_system_policy_v1_get_system_policy_sync.py create mode 100644 samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1_validation_helper_v1_validate_attestation_occurrence_async.py create mode 100644 samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1_validation_helper_v1_validate_attestation_occurrence_sync.py create mode 100644 samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1beta1_binauthz_management_service_v1_beta1_create_attestor_async.py create mode 100644 samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1beta1_binauthz_management_service_v1_beta1_create_attestor_sync.py create mode 100644 samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1beta1_binauthz_management_service_v1_beta1_delete_attestor_async.py create mode 100644 samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1beta1_binauthz_management_service_v1_beta1_delete_attestor_sync.py create mode 100644 samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1beta1_binauthz_management_service_v1_beta1_get_attestor_async.py create mode 100644 samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1beta1_binauthz_management_service_v1_beta1_get_attestor_sync.py create mode 100644 samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1beta1_binauthz_management_service_v1_beta1_get_policy_async.py create mode 100644 samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1beta1_binauthz_management_service_v1_beta1_get_policy_sync.py create mode 100644 samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1beta1_binauthz_management_service_v1_beta1_list_attestors_async.py create mode 100644 samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1beta1_binauthz_management_service_v1_beta1_list_attestors_sync.py create mode 100644 samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1beta1_binauthz_management_service_v1_beta1_update_attestor_async.py create mode 100644 samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1beta1_binauthz_management_service_v1_beta1_update_attestor_sync.py create mode 100644 samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1beta1_binauthz_management_service_v1_beta1_update_policy_async.py create mode 100644 samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1beta1_binauthz_management_service_v1_beta1_update_policy_sync.py create mode 100644 samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1beta1_system_policy_v1_beta1_get_system_policy_async.py create mode 100644 samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1beta1_system_policy_v1_beta1_get_system_policy_sync.py create mode 100644 samples/generated_samples/snippet_metadata_binaryauthorization_v1.json create mode 100644 samples/generated_samples/snippet_metadata_binaryauthorization_v1beta1.json 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 ea80e04..387715e 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 @@ -247,6 +247,26 @@ async def get_policy( [policy][google.cloud.binaryauthorization.v1.Policy] if the project does not have one. + + .. code-block:: + + from google.cloud import binaryauthorization_v1 + + def sample_get_policy(): + # Create a client + client = binaryauthorization_v1.BinauthzManagementServiceV1Client() + + # Initialize request argument(s) + request = binaryauthorization_v1.GetPolicyRequest( + name="name_value", + ) + + # Make the request + response = client.get_policy(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.binaryauthorization_v1.types.GetPolicyRequest, dict]): The request object. Request message for @@ -336,6 +356,30 @@ async def update_policy( NOT_FOUND if the project does not exist, INVALID_ARGUMENT if the request is malformed. + + .. code-block:: + + from google.cloud import binaryauthorization_v1 + + def sample_update_policy(): + # Create a client + client = binaryauthorization_v1.BinauthzManagementServiceV1Client() + + # Initialize request argument(s) + policy = binaryauthorization_v1.Policy() + policy.default_admission_rule.evaluation_mode = "ALWAYS_DENY" + policy.default_admission_rule.enforcement_mode = "DRYRUN_AUDIT_LOG_ONLY" + + request = binaryauthorization_v1.UpdatePolicyRequest( + policy=policy, + ) + + # Make the request + response = client.update_policy(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.binaryauthorization_v1.types.UpdatePolicyRequest, dict]): The request object. Request message for @@ -432,6 +476,32 @@ async def create_attestor( the [attestor][google.cloud.binaryauthorization.v1.Attestor] already exists. + + .. code-block:: + + from google.cloud import binaryauthorization_v1 + + def sample_create_attestor(): + # Create a client + client = binaryauthorization_v1.BinauthzManagementServiceV1Client() + + # Initialize request argument(s) + attestor = binaryauthorization_v1.Attestor() + attestor.user_owned_grafeas_note.note_reference = "note_reference_value" + attestor.name = "name_value" + + request = binaryauthorization_v1.CreateAttestorRequest( + parent="parent_value", + attestor_id="attestor_id_value", + attestor=attestor, + ) + + # Make the request + response = client.create_attestor(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.binaryauthorization_v1.types.CreateAttestorRequest, dict]): The request object. Request message for @@ -531,6 +601,26 @@ async def get_attestor( [attestor][google.cloud.binaryauthorization.v1.Attestor] does not exist. + + .. code-block:: + + from google.cloud import binaryauthorization_v1 + + def sample_get_attestor(): + # Create a client + client = binaryauthorization_v1.BinauthzManagementServiceV1Client() + + # Initialize request argument(s) + request = binaryauthorization_v1.GetAttestorRequest( + name="name_value", + ) + + # Make the request + response = client.get_attestor(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.binaryauthorization_v1.types.GetAttestorRequest, dict]): The request object. Request message for @@ -618,6 +708,30 @@ async def update_attestor( [attestor][google.cloud.binaryauthorization.v1.Attestor] does not exist. + + .. code-block:: + + from google.cloud import binaryauthorization_v1 + + def sample_update_attestor(): + # Create a client + client = binaryauthorization_v1.BinauthzManagementServiceV1Client() + + # Initialize request argument(s) + attestor = binaryauthorization_v1.Attestor() + attestor.user_owned_grafeas_note.note_reference = "note_reference_value" + attestor.name = "name_value" + + request = binaryauthorization_v1.UpdateAttestorRequest( + attestor=attestor, + ) + + # Make the request + response = client.update_attestor(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.binaryauthorization_v1.types.UpdateAttestorRequest, dict]): The request object. Request message for @@ -707,6 +821,27 @@ async def list_attestors( r"""Lists [attestors][google.cloud.binaryauthorization.v1.Attestor]. Returns INVALID_ARGUMENT if the project does not exist. + + .. code-block:: + + from google.cloud import binaryauthorization_v1 + + def sample_list_attestors(): + # Create a client + client = binaryauthorization_v1.BinauthzManagementServiceV1Client() + + # Initialize request argument(s) + request = binaryauthorization_v1.ListAttestorsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_attestors(request=request) + + # Handle the response + for response in page_result: + print(response) + Args: request (Union[google.cloud.binaryauthorization_v1.types.ListAttestorsRequest, dict]): The request object. Request message for @@ -803,6 +938,23 @@ async def delete_attestor( [attestor][google.cloud.binaryauthorization.v1.Attestor] does not exist. + + .. code-block:: + + from google.cloud import binaryauthorization_v1 + + def sample_delete_attestor(): + # Create a client + client = binaryauthorization_v1.BinauthzManagementServiceV1Client() + + # Initialize request argument(s) + request = binaryauthorization_v1.DeleteAttestorRequest( + name="name_value", + ) + + # Make the request + client.delete_attestor(request=request) + Args: request (Union[google.cloud.binaryauthorization_v1.types.DeleteAttestorRequest, dict]): The request object. Request message for diff --git a/google/cloud/binaryauthorization_v1/services/binauthz_management_service_v1/client.py b/google/cloud/binaryauthorization_v1/services/binauthz_management_service_v1/client.py index 9a20213..33b4ce2 100644 --- a/google/cloud/binaryauthorization_v1/services/binauthz_management_service_v1/client.py +++ b/google/cloud/binaryauthorization_v1/services/binauthz_management_service_v1/client.py @@ -445,6 +445,27 @@ def get_policy( [policy][google.cloud.binaryauthorization.v1.Policy] if the project does not have one. + + + .. code-block:: + + from google.cloud import binaryauthorization_v1 + + def sample_get_policy(): + # Create a client + client = binaryauthorization_v1.BinauthzManagementServiceV1Client() + + # Initialize request argument(s) + request = binaryauthorization_v1.GetPolicyRequest( + name="name_value", + ) + + # Make the request + response = client.get_policy(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.binaryauthorization_v1.types.GetPolicyRequest, dict]): The request object. Request message for @@ -524,6 +545,31 @@ def update_policy( NOT_FOUND if the project does not exist, INVALID_ARGUMENT if the request is malformed. + + + .. code-block:: + + from google.cloud import binaryauthorization_v1 + + def sample_update_policy(): + # Create a client + client = binaryauthorization_v1.BinauthzManagementServiceV1Client() + + # Initialize request argument(s) + policy = binaryauthorization_v1.Policy() + policy.default_admission_rule.evaluation_mode = "ALWAYS_DENY" + policy.default_admission_rule.enforcement_mode = "DRYRUN_AUDIT_LOG_ONLY" + + request = binaryauthorization_v1.UpdatePolicyRequest( + policy=policy, + ) + + # Make the request + response = client.update_policy(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.binaryauthorization_v1.types.UpdatePolicyRequest, dict]): The request object. Request message for @@ -610,6 +656,33 @@ def create_attestor( the [attestor][google.cloud.binaryauthorization.v1.Attestor] already exists. + + + .. code-block:: + + from google.cloud import binaryauthorization_v1 + + def sample_create_attestor(): + # Create a client + client = binaryauthorization_v1.BinauthzManagementServiceV1Client() + + # Initialize request argument(s) + attestor = binaryauthorization_v1.Attestor() + attestor.user_owned_grafeas_note.note_reference = "note_reference_value" + attestor.name = "name_value" + + request = binaryauthorization_v1.CreateAttestorRequest( + parent="parent_value", + attestor_id="attestor_id_value", + attestor=attestor, + ) + + # Make the request + response = client.create_attestor(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.binaryauthorization_v1.types.CreateAttestorRequest, dict]): The request object. Request message for @@ -709,6 +782,27 @@ def get_attestor( [attestor][google.cloud.binaryauthorization.v1.Attestor] does not exist. + + + .. code-block:: + + from google.cloud import binaryauthorization_v1 + + def sample_get_attestor(): + # Create a client + client = binaryauthorization_v1.BinauthzManagementServiceV1Client() + + # Initialize request argument(s) + request = binaryauthorization_v1.GetAttestorRequest( + name="name_value", + ) + + # Make the request + response = client.get_attestor(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.binaryauthorization_v1.types.GetAttestorRequest, dict]): The request object. Request message for @@ -786,6 +880,31 @@ def update_attestor( [attestor][google.cloud.binaryauthorization.v1.Attestor] does not exist. + + + .. code-block:: + + from google.cloud import binaryauthorization_v1 + + def sample_update_attestor(): + # Create a client + client = binaryauthorization_v1.BinauthzManagementServiceV1Client() + + # Initialize request argument(s) + attestor = binaryauthorization_v1.Attestor() + attestor.user_owned_grafeas_note.note_reference = "note_reference_value" + attestor.name = "name_value" + + request = binaryauthorization_v1.UpdateAttestorRequest( + attestor=attestor, + ) + + # Make the request + response = client.update_attestor(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.binaryauthorization_v1.types.UpdateAttestorRequest, dict]): The request object. Request message for @@ -865,6 +984,28 @@ def list_attestors( r"""Lists [attestors][google.cloud.binaryauthorization.v1.Attestor]. Returns INVALID_ARGUMENT if the project does not exist. + + + .. code-block:: + + from google.cloud import binaryauthorization_v1 + + def sample_list_attestors(): + # Create a client + client = binaryauthorization_v1.BinauthzManagementServiceV1Client() + + # Initialize request argument(s) + request = binaryauthorization_v1.ListAttestorsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_attestors(request=request) + + # Handle the response + for response in page_result: + print(response) + Args: request (Union[google.cloud.binaryauthorization_v1.types.ListAttestorsRequest, dict]): The request object. Request message for @@ -951,6 +1092,24 @@ def delete_attestor( [attestor][google.cloud.binaryauthorization.v1.Attestor] does not exist. + + + .. code-block:: + + from google.cloud import binaryauthorization_v1 + + def sample_delete_attestor(): + # Create a client + client = binaryauthorization_v1.BinauthzManagementServiceV1Client() + + # Initialize request argument(s) + request = binaryauthorization_v1.DeleteAttestorRequest( + name="name_value", + ) + + # Make the request + client.delete_attestor(request=request) + Args: request (Union[google.cloud.binaryauthorization_v1.types.DeleteAttestorRequest, dict]): The request object. Request message for 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 769e899..9fc18f2 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 @@ -215,6 +215,26 @@ async def get_system_policy( r"""Gets the current system policy in the specified location. + + .. code-block:: + + from google.cloud import binaryauthorization_v1 + + def sample_get_system_policy(): + # Create a client + client = binaryauthorization_v1.SystemPolicyV1Client() + + # Initialize request argument(s) + request = binaryauthorization_v1.GetSystemPolicyRequest( + name="name_value", + ) + + # Make the request + response = client.get_system_policy(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.binaryauthorization_v1.types.GetSystemPolicyRequest, dict]): The request object. Request to read the current system diff --git a/google/cloud/binaryauthorization_v1/services/system_policy_v1/client.py b/google/cloud/binaryauthorization_v1/services/system_policy_v1/client.py index cde5e9f..d8f6d78 100644 --- a/google/cloud/binaryauthorization_v1/services/system_policy_v1/client.py +++ b/google/cloud/binaryauthorization_v1/services/system_policy_v1/client.py @@ -407,6 +407,27 @@ def get_system_policy( r"""Gets the current system policy in the specified location. + + + .. code-block:: + + from google.cloud import binaryauthorization_v1 + + def sample_get_system_policy(): + # Create a client + client = binaryauthorization_v1.SystemPolicyV1Client() + + # Initialize request argument(s) + request = binaryauthorization_v1.GetSystemPolicyRequest( + name="name_value", + ) + + # Make the request + response = client.get_system_policy(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.binaryauthorization_v1.types.GetSystemPolicyRequest, dict]): The request object. Request to read the current system 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 4b8d070..8d9a2b0 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 @@ -211,6 +211,28 @@ async def validate_attestation_occurrence( r"""Returns whether the given Attestation for the given image URI was signed by the given Attestor + + .. code-block:: + + from google.cloud import binaryauthorization_v1 + + def sample_validate_attestation_occurrence(): + # Create a client + client = binaryauthorization_v1.ValidationHelperV1Client() + + # Initialize request argument(s) + request = binaryauthorization_v1.ValidateAttestationOccurrenceRequest( + attestor="attestor_value", + occurrence_note="occurrence_note_value", + occurrence_resource_uri="occurrence_resource_uri_value", + ) + + # Make the request + response = client.validate_attestation_occurrence(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.binaryauthorization_v1.types.ValidateAttestationOccurrenceRequest, dict]): The request object. Request message for diff --git a/google/cloud/binaryauthorization_v1/services/validation_helper_v1/client.py b/google/cloud/binaryauthorization_v1/services/validation_helper_v1/client.py index 9fd3c1a..3200756 100644 --- a/google/cloud/binaryauthorization_v1/services/validation_helper_v1/client.py +++ b/google/cloud/binaryauthorization_v1/services/validation_helper_v1/client.py @@ -395,6 +395,29 @@ def validate_attestation_occurrence( r"""Returns whether the given Attestation for the given image URI was signed by the given Attestor + + + .. code-block:: + + from google.cloud import binaryauthorization_v1 + + def sample_validate_attestation_occurrence(): + # Create a client + client = binaryauthorization_v1.ValidationHelperV1Client() + + # Initialize request argument(s) + request = binaryauthorization_v1.ValidateAttestationOccurrenceRequest( + attestor="attestor_value", + occurrence_note="occurrence_note_value", + occurrence_resource_uri="occurrence_resource_uri_value", + ) + + # Make the request + response = client.validate_attestation_occurrence(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.binaryauthorization_v1.types.ValidateAttestationOccurrenceRequest, dict]): The request object. Request message for 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 410ece7..a7f2761 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 @@ -256,6 +256,26 @@ async def get_policy( [policy][google.cloud.binaryauthorization.v1beta1.Policy] if the project does not have one. + + .. code-block:: + + from google.cloud import binaryauthorization_v1beta1 + + def sample_get_policy(): + # Create a client + client = binaryauthorization_v1beta1.BinauthzManagementServiceV1Beta1Client() + + # Initialize request argument(s) + request = binaryauthorization_v1beta1.GetPolicyRequest( + name="name_value", + ) + + # Make the request + response = client.get_policy(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.binaryauthorization_v1beta1.types.GetPolicyRequest, dict]): The request object. Request message for @@ -346,6 +366,30 @@ async def update_policy( Returns NOT_FOUND if the project does not exist, INVALID_ARGUMENT if the request is malformed. + + .. code-block:: + + from google.cloud import binaryauthorization_v1beta1 + + def sample_update_policy(): + # Create a client + client = binaryauthorization_v1beta1.BinauthzManagementServiceV1Beta1Client() + + # Initialize request argument(s) + policy = binaryauthorization_v1beta1.Policy() + policy.default_admission_rule.evaluation_mode = "ALWAYS_DENY" + policy.default_admission_rule.enforcement_mode = "DRYRUN_AUDIT_LOG_ONLY" + + request = binaryauthorization_v1beta1.UpdatePolicyRequest( + policy=policy, + ) + + # Make the request + response = client.update_policy(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.binaryauthorization_v1beta1.types.UpdatePolicyRequest, dict]): The request object. Request message for @@ -444,6 +488,32 @@ async def create_attestor( [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] already exists. + + .. code-block:: + + from google.cloud import binaryauthorization_v1beta1 + + def sample_create_attestor(): + # Create a client + client = binaryauthorization_v1beta1.BinauthzManagementServiceV1Beta1Client() + + # Initialize request argument(s) + attestor = binaryauthorization_v1beta1.Attestor() + attestor.user_owned_drydock_note.note_reference = "note_reference_value" + attestor.name = "name_value" + + request = binaryauthorization_v1beta1.CreateAttestorRequest( + parent="parent_value", + attestor_id="attestor_id_value", + attestor=attestor, + ) + + # Make the request + response = client.create_attestor(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.binaryauthorization_v1beta1.types.CreateAttestorRequest, dict]): The request object. Request message for @@ -543,6 +613,26 @@ async def get_attestor( [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] does not exist. + + .. code-block:: + + from google.cloud import binaryauthorization_v1beta1 + + def sample_get_attestor(): + # Create a client + client = binaryauthorization_v1beta1.BinauthzManagementServiceV1Beta1Client() + + # Initialize request argument(s) + request = binaryauthorization_v1beta1.GetAttestorRequest( + name="name_value", + ) + + # Make the request + response = client.get_attestor(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.binaryauthorization_v1beta1.types.GetAttestorRequest, dict]): The request object. Request message for @@ -630,6 +720,30 @@ async def update_attestor( [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] does not exist. + + .. code-block:: + + from google.cloud import binaryauthorization_v1beta1 + + def sample_update_attestor(): + # Create a client + client = binaryauthorization_v1beta1.BinauthzManagementServiceV1Beta1Client() + + # Initialize request argument(s) + attestor = binaryauthorization_v1beta1.Attestor() + attestor.user_owned_drydock_note.note_reference = "note_reference_value" + attestor.name = "name_value" + + request = binaryauthorization_v1beta1.UpdateAttestorRequest( + attestor=attestor, + ) + + # Make the request + response = client.update_attestor(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.binaryauthorization_v1beta1.types.UpdateAttestorRequest, dict]): The request object. Request message for @@ -720,6 +834,27 @@ async def list_attestors( [attestors][google.cloud.binaryauthorization.v1beta1.Attestor]. Returns INVALID_ARGUMENT if the project does not exist. + + .. code-block:: + + from google.cloud import binaryauthorization_v1beta1 + + def sample_list_attestors(): + # Create a client + client = binaryauthorization_v1beta1.BinauthzManagementServiceV1Beta1Client() + + # Initialize request argument(s) + request = binaryauthorization_v1beta1.ListAttestorsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_attestors(request=request) + + # Handle the response + for response in page_result: + print(response) + Args: request (Union[google.cloud.binaryauthorization_v1beta1.types.ListAttestorsRequest, dict]): The request object. Request message for @@ -816,6 +951,23 @@ async def delete_attestor( [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] does not exist. + + .. code-block:: + + from google.cloud import binaryauthorization_v1beta1 + + def sample_delete_attestor(): + # Create a client + client = binaryauthorization_v1beta1.BinauthzManagementServiceV1Beta1Client() + + # Initialize request argument(s) + request = binaryauthorization_v1beta1.DeleteAttestorRequest( + name="name_value", + ) + + # Make the request + client.delete_attestor(request=request) + Args: request (Union[google.cloud.binaryauthorization_v1beta1.types.DeleteAttestorRequest, dict]): The request object. Request message for diff --git a/google/cloud/binaryauthorization_v1beta1/services/binauthz_management_service_v1_beta1/client.py b/google/cloud/binaryauthorization_v1beta1/services/binauthz_management_service_v1_beta1/client.py index d8162eb..ba26f96 100644 --- a/google/cloud/binaryauthorization_v1beta1/services/binauthz_management_service_v1_beta1/client.py +++ b/google/cloud/binaryauthorization_v1beta1/services/binauthz_management_service_v1_beta1/client.py @@ -452,6 +452,27 @@ def get_policy( [policy][google.cloud.binaryauthorization.v1beta1.Policy] if the project does not have one. + + + .. code-block:: + + from google.cloud import binaryauthorization_v1beta1 + + def sample_get_policy(): + # Create a client + client = binaryauthorization_v1beta1.BinauthzManagementServiceV1Beta1Client() + + # Initialize request argument(s) + request = binaryauthorization_v1beta1.GetPolicyRequest( + name="name_value", + ) + + # Make the request + response = client.get_policy(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.binaryauthorization_v1beta1.types.GetPolicyRequest, dict]): The request object. Request message for @@ -532,6 +553,31 @@ def update_policy( Returns NOT_FOUND if the project does not exist, INVALID_ARGUMENT if the request is malformed. + + + .. code-block:: + + from google.cloud import binaryauthorization_v1beta1 + + def sample_update_policy(): + # Create a client + client = binaryauthorization_v1beta1.BinauthzManagementServiceV1Beta1Client() + + # Initialize request argument(s) + policy = binaryauthorization_v1beta1.Policy() + policy.default_admission_rule.evaluation_mode = "ALWAYS_DENY" + policy.default_admission_rule.enforcement_mode = "DRYRUN_AUDIT_LOG_ONLY" + + request = binaryauthorization_v1beta1.UpdatePolicyRequest( + policy=policy, + ) + + # Make the request + response = client.update_policy(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.binaryauthorization_v1beta1.types.UpdatePolicyRequest, dict]): The request object. Request message for @@ -620,6 +666,33 @@ def create_attestor( [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] already exists. + + + .. code-block:: + + from google.cloud import binaryauthorization_v1beta1 + + def sample_create_attestor(): + # Create a client + client = binaryauthorization_v1beta1.BinauthzManagementServiceV1Beta1Client() + + # Initialize request argument(s) + attestor = binaryauthorization_v1beta1.Attestor() + attestor.user_owned_drydock_note.note_reference = "note_reference_value" + attestor.name = "name_value" + + request = binaryauthorization_v1beta1.CreateAttestorRequest( + parent="parent_value", + attestor_id="attestor_id_value", + attestor=attestor, + ) + + # Make the request + response = client.create_attestor(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.binaryauthorization_v1beta1.types.CreateAttestorRequest, dict]): The request object. Request message for @@ -719,6 +792,27 @@ def get_attestor( [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] does not exist. + + + .. code-block:: + + from google.cloud import binaryauthorization_v1beta1 + + def sample_get_attestor(): + # Create a client + client = binaryauthorization_v1beta1.BinauthzManagementServiceV1Beta1Client() + + # Initialize request argument(s) + request = binaryauthorization_v1beta1.GetAttestorRequest( + name="name_value", + ) + + # Make the request + response = client.get_attestor(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.binaryauthorization_v1beta1.types.GetAttestorRequest, dict]): The request object. Request message for @@ -796,6 +890,31 @@ def update_attestor( [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] does not exist. + + + .. code-block:: + + from google.cloud import binaryauthorization_v1beta1 + + def sample_update_attestor(): + # Create a client + client = binaryauthorization_v1beta1.BinauthzManagementServiceV1Beta1Client() + + # Initialize request argument(s) + attestor = binaryauthorization_v1beta1.Attestor() + attestor.user_owned_drydock_note.note_reference = "note_reference_value" + attestor.name = "name_value" + + request = binaryauthorization_v1beta1.UpdateAttestorRequest( + attestor=attestor, + ) + + # Make the request + response = client.update_attestor(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.binaryauthorization_v1beta1.types.UpdateAttestorRequest, dict]): The request object. Request message for @@ -876,6 +995,28 @@ def list_attestors( [attestors][google.cloud.binaryauthorization.v1beta1.Attestor]. Returns INVALID_ARGUMENT if the project does not exist. + + + .. code-block:: + + from google.cloud import binaryauthorization_v1beta1 + + def sample_list_attestors(): + # Create a client + client = binaryauthorization_v1beta1.BinauthzManagementServiceV1Beta1Client() + + # Initialize request argument(s) + request = binaryauthorization_v1beta1.ListAttestorsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_attestors(request=request) + + # Handle the response + for response in page_result: + print(response) + Args: request (Union[google.cloud.binaryauthorization_v1beta1.types.ListAttestorsRequest, dict]): The request object. Request message for @@ -962,6 +1103,24 @@ def delete_attestor( [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] does not exist. + + + .. code-block:: + + from google.cloud import binaryauthorization_v1beta1 + + def sample_delete_attestor(): + # Create a client + client = binaryauthorization_v1beta1.BinauthzManagementServiceV1Beta1Client() + + # Initialize request argument(s) + request = binaryauthorization_v1beta1.DeleteAttestorRequest( + name="name_value", + ) + + # Make the request + client.delete_attestor(request=request) + Args: request (Union[google.cloud.binaryauthorization_v1beta1.types.DeleteAttestorRequest, dict]): The request object. Request message for 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 b393317..39c4e79 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 @@ -216,6 +216,26 @@ async def get_system_policy( r"""Gets the current system policy in the specified location. + + .. code-block:: + + from google.cloud import binaryauthorization_v1beta1 + + def sample_get_system_policy(): + # Create a client + client = binaryauthorization_v1beta1.SystemPolicyV1Beta1Client() + + # Initialize request argument(s) + request = binaryauthorization_v1beta1.GetSystemPolicyRequest( + name="name_value", + ) + + # Make the request + response = client.get_system_policy(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.binaryauthorization_v1beta1.types.GetSystemPolicyRequest, dict]): The request object. Request to read the current system diff --git a/google/cloud/binaryauthorization_v1beta1/services/system_policy_v1_beta1/client.py b/google/cloud/binaryauthorization_v1beta1/services/system_policy_v1_beta1/client.py index 81f832a..f8ef374 100644 --- a/google/cloud/binaryauthorization_v1beta1/services/system_policy_v1_beta1/client.py +++ b/google/cloud/binaryauthorization_v1beta1/services/system_policy_v1_beta1/client.py @@ -409,6 +409,27 @@ def get_system_policy( r"""Gets the current system policy in the specified location. + + + .. code-block:: + + from google.cloud import binaryauthorization_v1beta1 + + def sample_get_system_policy(): + # Create a client + client = binaryauthorization_v1beta1.SystemPolicyV1Beta1Client() + + # Initialize request argument(s) + request = binaryauthorization_v1beta1.GetSystemPolicyRequest( + name="name_value", + ) + + # Make the request + response = client.get_system_policy(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.binaryauthorization_v1beta1.types.GetSystemPolicyRequest, dict]): The request object. Request to read the current system diff --git a/samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1_binauthz_management_service_v1_create_attestor_async.py b/samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1_binauthz_management_service_v1_create_attestor_async.py new file mode 100644 index 0000000..de267a6 --- /dev/null +++ b/samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1_binauthz_management_service_v1_create_attestor_async.py @@ -0,0 +1,51 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateAttestor +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-binaryauthorization + + +# [START binaryauthorization_generated_binaryauthorization_v1_BinauthzManagementServiceV1_CreateAttestor_async] +from google.cloud import binaryauthorization_v1 + + +async def sample_create_attestor(): + # Create a client + client = binaryauthorization_v1.BinauthzManagementServiceV1AsyncClient() + + # Initialize request argument(s) + attestor = binaryauthorization_v1.Attestor() + attestor.user_owned_grafeas_note.note_reference = "note_reference_value" + attestor.name = "name_value" + + request = binaryauthorization_v1.CreateAttestorRequest( + parent="parent_value", + attestor_id="attestor_id_value", + attestor=attestor, + ) + + # Make the request + response = await client.create_attestor(request=request) + + # Handle the response + print(response) + +# [END binaryauthorization_generated_binaryauthorization_v1_BinauthzManagementServiceV1_CreateAttestor_async] diff --git a/samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1_binauthz_management_service_v1_create_attestor_sync.py b/samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1_binauthz_management_service_v1_create_attestor_sync.py new file mode 100644 index 0000000..bf2943b --- /dev/null +++ b/samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1_binauthz_management_service_v1_create_attestor_sync.py @@ -0,0 +1,51 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateAttestor +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-binaryauthorization + + +# [START binaryauthorization_generated_binaryauthorization_v1_BinauthzManagementServiceV1_CreateAttestor_sync] +from google.cloud import binaryauthorization_v1 + + +def sample_create_attestor(): + # Create a client + client = binaryauthorization_v1.BinauthzManagementServiceV1Client() + + # Initialize request argument(s) + attestor = binaryauthorization_v1.Attestor() + attestor.user_owned_grafeas_note.note_reference = "note_reference_value" + attestor.name = "name_value" + + request = binaryauthorization_v1.CreateAttestorRequest( + parent="parent_value", + attestor_id="attestor_id_value", + attestor=attestor, + ) + + # Make the request + response = client.create_attestor(request=request) + + # Handle the response + print(response) + +# [END binaryauthorization_generated_binaryauthorization_v1_BinauthzManagementServiceV1_CreateAttestor_sync] diff --git a/samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1_binauthz_management_service_v1_delete_attestor_async.py b/samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1_binauthz_management_service_v1_delete_attestor_async.py new file mode 100644 index 0000000..e637f68 --- /dev/null +++ b/samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1_binauthz_management_service_v1_delete_attestor_async.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteAttestor +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-binaryauthorization + + +# [START binaryauthorization_generated_binaryauthorization_v1_BinauthzManagementServiceV1_DeleteAttestor_async] +from google.cloud import binaryauthorization_v1 + + +async def sample_delete_attestor(): + # Create a client + client = binaryauthorization_v1.BinauthzManagementServiceV1AsyncClient() + + # Initialize request argument(s) + request = binaryauthorization_v1.DeleteAttestorRequest( + name="name_value", + ) + + # Make the request + await client.delete_attestor(request=request) + + +# [END binaryauthorization_generated_binaryauthorization_v1_BinauthzManagementServiceV1_DeleteAttestor_async] diff --git a/samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1_binauthz_management_service_v1_delete_attestor_sync.py b/samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1_binauthz_management_service_v1_delete_attestor_sync.py new file mode 100644 index 0000000..7621791 --- /dev/null +++ b/samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1_binauthz_management_service_v1_delete_attestor_sync.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteAttestor +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-binaryauthorization + + +# [START binaryauthorization_generated_binaryauthorization_v1_BinauthzManagementServiceV1_DeleteAttestor_sync] +from google.cloud import binaryauthorization_v1 + + +def sample_delete_attestor(): + # Create a client + client = binaryauthorization_v1.BinauthzManagementServiceV1Client() + + # Initialize request argument(s) + request = binaryauthorization_v1.DeleteAttestorRequest( + name="name_value", + ) + + # Make the request + client.delete_attestor(request=request) + + +# [END binaryauthorization_generated_binaryauthorization_v1_BinauthzManagementServiceV1_DeleteAttestor_sync] diff --git a/samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1_binauthz_management_service_v1_get_attestor_async.py b/samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1_binauthz_management_service_v1_get_attestor_async.py new file mode 100644 index 0000000..5e3867e --- /dev/null +++ b/samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1_binauthz_management_service_v1_get_attestor_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetAttestor +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-binaryauthorization + + +# [START binaryauthorization_generated_binaryauthorization_v1_BinauthzManagementServiceV1_GetAttestor_async] +from google.cloud import binaryauthorization_v1 + + +async def sample_get_attestor(): + # Create a client + client = binaryauthorization_v1.BinauthzManagementServiceV1AsyncClient() + + # Initialize request argument(s) + request = binaryauthorization_v1.GetAttestorRequest( + name="name_value", + ) + + # Make the request + response = await client.get_attestor(request=request) + + # Handle the response + print(response) + +# [END binaryauthorization_generated_binaryauthorization_v1_BinauthzManagementServiceV1_GetAttestor_async] diff --git a/samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1_binauthz_management_service_v1_get_attestor_sync.py b/samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1_binauthz_management_service_v1_get_attestor_sync.py new file mode 100644 index 0000000..54883c7 --- /dev/null +++ b/samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1_binauthz_management_service_v1_get_attestor_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetAttestor +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-binaryauthorization + + +# [START binaryauthorization_generated_binaryauthorization_v1_BinauthzManagementServiceV1_GetAttestor_sync] +from google.cloud import binaryauthorization_v1 + + +def sample_get_attestor(): + # Create a client + client = binaryauthorization_v1.BinauthzManagementServiceV1Client() + + # Initialize request argument(s) + request = binaryauthorization_v1.GetAttestorRequest( + name="name_value", + ) + + # Make the request + response = client.get_attestor(request=request) + + # Handle the response + print(response) + +# [END binaryauthorization_generated_binaryauthorization_v1_BinauthzManagementServiceV1_GetAttestor_sync] diff --git a/samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1_binauthz_management_service_v1_get_policy_async.py b/samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1_binauthz_management_service_v1_get_policy_async.py new file mode 100644 index 0000000..a883c5d --- /dev/null +++ b/samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1_binauthz_management_service_v1_get_policy_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetPolicy +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-binaryauthorization + + +# [START binaryauthorization_generated_binaryauthorization_v1_BinauthzManagementServiceV1_GetPolicy_async] +from google.cloud import binaryauthorization_v1 + + +async def sample_get_policy(): + # Create a client + client = binaryauthorization_v1.BinauthzManagementServiceV1AsyncClient() + + # Initialize request argument(s) + request = binaryauthorization_v1.GetPolicyRequest( + name="name_value", + ) + + # Make the request + response = await client.get_policy(request=request) + + # Handle the response + print(response) + +# [END binaryauthorization_generated_binaryauthorization_v1_BinauthzManagementServiceV1_GetPolicy_async] diff --git a/samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1_binauthz_management_service_v1_get_policy_sync.py b/samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1_binauthz_management_service_v1_get_policy_sync.py new file mode 100644 index 0000000..1b854cd --- /dev/null +++ b/samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1_binauthz_management_service_v1_get_policy_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetPolicy +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-binaryauthorization + + +# [START binaryauthorization_generated_binaryauthorization_v1_BinauthzManagementServiceV1_GetPolicy_sync] +from google.cloud import binaryauthorization_v1 + + +def sample_get_policy(): + # Create a client + client = binaryauthorization_v1.BinauthzManagementServiceV1Client() + + # Initialize request argument(s) + request = binaryauthorization_v1.GetPolicyRequest( + name="name_value", + ) + + # Make the request + response = client.get_policy(request=request) + + # Handle the response + print(response) + +# [END binaryauthorization_generated_binaryauthorization_v1_BinauthzManagementServiceV1_GetPolicy_sync] diff --git a/samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1_binauthz_management_service_v1_list_attestors_async.py b/samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1_binauthz_management_service_v1_list_attestors_async.py new file mode 100644 index 0000000..765725f --- /dev/null +++ b/samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1_binauthz_management_service_v1_list_attestors_async.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListAttestors +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-binaryauthorization + + +# [START binaryauthorization_generated_binaryauthorization_v1_BinauthzManagementServiceV1_ListAttestors_async] +from google.cloud import binaryauthorization_v1 + + +async def sample_list_attestors(): + # Create a client + client = binaryauthorization_v1.BinauthzManagementServiceV1AsyncClient() + + # Initialize request argument(s) + request = binaryauthorization_v1.ListAttestorsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_attestors(request=request) + + # Handle the response + async for response in page_result: + print(response) + +# [END binaryauthorization_generated_binaryauthorization_v1_BinauthzManagementServiceV1_ListAttestors_async] diff --git a/samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1_binauthz_management_service_v1_list_attestors_sync.py b/samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1_binauthz_management_service_v1_list_attestors_sync.py new file mode 100644 index 0000000..e58ea93 --- /dev/null +++ b/samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1_binauthz_management_service_v1_list_attestors_sync.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListAttestors +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-binaryauthorization + + +# [START binaryauthorization_generated_binaryauthorization_v1_BinauthzManagementServiceV1_ListAttestors_sync] +from google.cloud import binaryauthorization_v1 + + +def sample_list_attestors(): + # Create a client + client = binaryauthorization_v1.BinauthzManagementServiceV1Client() + + # Initialize request argument(s) + request = binaryauthorization_v1.ListAttestorsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_attestors(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END binaryauthorization_generated_binaryauthorization_v1_BinauthzManagementServiceV1_ListAttestors_sync] diff --git a/samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1_binauthz_management_service_v1_update_attestor_async.py b/samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1_binauthz_management_service_v1_update_attestor_async.py new file mode 100644 index 0000000..a8c05ad --- /dev/null +++ b/samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1_binauthz_management_service_v1_update_attestor_async.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdateAttestor +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-binaryauthorization + + +# [START binaryauthorization_generated_binaryauthorization_v1_BinauthzManagementServiceV1_UpdateAttestor_async] +from google.cloud import binaryauthorization_v1 + + +async def sample_update_attestor(): + # Create a client + client = binaryauthorization_v1.BinauthzManagementServiceV1AsyncClient() + + # Initialize request argument(s) + attestor = binaryauthorization_v1.Attestor() + attestor.user_owned_grafeas_note.note_reference = "note_reference_value" + attestor.name = "name_value" + + request = binaryauthorization_v1.UpdateAttestorRequest( + attestor=attestor, + ) + + # Make the request + response = await client.update_attestor(request=request) + + # Handle the response + print(response) + +# [END binaryauthorization_generated_binaryauthorization_v1_BinauthzManagementServiceV1_UpdateAttestor_async] diff --git a/samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1_binauthz_management_service_v1_update_attestor_sync.py b/samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1_binauthz_management_service_v1_update_attestor_sync.py new file mode 100644 index 0000000..f9f552c --- /dev/null +++ b/samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1_binauthz_management_service_v1_update_attestor_sync.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdateAttestor +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-binaryauthorization + + +# [START binaryauthorization_generated_binaryauthorization_v1_BinauthzManagementServiceV1_UpdateAttestor_sync] +from google.cloud import binaryauthorization_v1 + + +def sample_update_attestor(): + # Create a client + client = binaryauthorization_v1.BinauthzManagementServiceV1Client() + + # Initialize request argument(s) + attestor = binaryauthorization_v1.Attestor() + attestor.user_owned_grafeas_note.note_reference = "note_reference_value" + attestor.name = "name_value" + + request = binaryauthorization_v1.UpdateAttestorRequest( + attestor=attestor, + ) + + # Make the request + response = client.update_attestor(request=request) + + # Handle the response + print(response) + +# [END binaryauthorization_generated_binaryauthorization_v1_BinauthzManagementServiceV1_UpdateAttestor_sync] diff --git a/samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1_binauthz_management_service_v1_update_policy_async.py b/samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1_binauthz_management_service_v1_update_policy_async.py new file mode 100644 index 0000000..93552fd --- /dev/null +++ b/samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1_binauthz_management_service_v1_update_policy_async.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdatePolicy +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-binaryauthorization + + +# [START binaryauthorization_generated_binaryauthorization_v1_BinauthzManagementServiceV1_UpdatePolicy_async] +from google.cloud import binaryauthorization_v1 + + +async def sample_update_policy(): + # Create a client + client = binaryauthorization_v1.BinauthzManagementServiceV1AsyncClient() + + # Initialize request argument(s) + policy = binaryauthorization_v1.Policy() + policy.default_admission_rule.evaluation_mode = "ALWAYS_DENY" + policy.default_admission_rule.enforcement_mode = "DRYRUN_AUDIT_LOG_ONLY" + + request = binaryauthorization_v1.UpdatePolicyRequest( + policy=policy, + ) + + # Make the request + response = await client.update_policy(request=request) + + # Handle the response + print(response) + +# [END binaryauthorization_generated_binaryauthorization_v1_BinauthzManagementServiceV1_UpdatePolicy_async] diff --git a/samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1_binauthz_management_service_v1_update_policy_sync.py b/samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1_binauthz_management_service_v1_update_policy_sync.py new file mode 100644 index 0000000..919ebe8 --- /dev/null +++ b/samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1_binauthz_management_service_v1_update_policy_sync.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdatePolicy +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-binaryauthorization + + +# [START binaryauthorization_generated_binaryauthorization_v1_BinauthzManagementServiceV1_UpdatePolicy_sync] +from google.cloud import binaryauthorization_v1 + + +def sample_update_policy(): + # Create a client + client = binaryauthorization_v1.BinauthzManagementServiceV1Client() + + # Initialize request argument(s) + policy = binaryauthorization_v1.Policy() + policy.default_admission_rule.evaluation_mode = "ALWAYS_DENY" + policy.default_admission_rule.enforcement_mode = "DRYRUN_AUDIT_LOG_ONLY" + + request = binaryauthorization_v1.UpdatePolicyRequest( + policy=policy, + ) + + # Make the request + response = client.update_policy(request=request) + + # Handle the response + print(response) + +# [END binaryauthorization_generated_binaryauthorization_v1_BinauthzManagementServiceV1_UpdatePolicy_sync] diff --git a/samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1_system_policy_v1_get_system_policy_async.py b/samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1_system_policy_v1_get_system_policy_async.py new file mode 100644 index 0000000..f0ed424 --- /dev/null +++ b/samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1_system_policy_v1_get_system_policy_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetSystemPolicy +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-binaryauthorization + + +# [START binaryauthorization_generated_binaryauthorization_v1_SystemPolicyV1_GetSystemPolicy_async] +from google.cloud import binaryauthorization_v1 + + +async def sample_get_system_policy(): + # Create a client + client = binaryauthorization_v1.SystemPolicyV1AsyncClient() + + # Initialize request argument(s) + request = binaryauthorization_v1.GetSystemPolicyRequest( + name="name_value", + ) + + # Make the request + response = await client.get_system_policy(request=request) + + # Handle the response + print(response) + +# [END binaryauthorization_generated_binaryauthorization_v1_SystemPolicyV1_GetSystemPolicy_async] diff --git a/samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1_system_policy_v1_get_system_policy_sync.py b/samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1_system_policy_v1_get_system_policy_sync.py new file mode 100644 index 0000000..f1ffbd0 --- /dev/null +++ b/samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1_system_policy_v1_get_system_policy_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetSystemPolicy +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-binaryauthorization + + +# [START binaryauthorization_generated_binaryauthorization_v1_SystemPolicyV1_GetSystemPolicy_sync] +from google.cloud import binaryauthorization_v1 + + +def sample_get_system_policy(): + # Create a client + client = binaryauthorization_v1.SystemPolicyV1Client() + + # Initialize request argument(s) + request = binaryauthorization_v1.GetSystemPolicyRequest( + name="name_value", + ) + + # Make the request + response = client.get_system_policy(request=request) + + # Handle the response + print(response) + +# [END binaryauthorization_generated_binaryauthorization_v1_SystemPolicyV1_GetSystemPolicy_sync] diff --git a/samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1_validation_helper_v1_validate_attestation_occurrence_async.py b/samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1_validation_helper_v1_validate_attestation_occurrence_async.py new file mode 100644 index 0000000..8cd459e --- /dev/null +++ b/samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1_validation_helper_v1_validate_attestation_occurrence_async.py @@ -0,0 +1,47 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ValidateAttestationOccurrence +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-binaryauthorization + + +# [START binaryauthorization_generated_binaryauthorization_v1_ValidationHelperV1_ValidateAttestationOccurrence_async] +from google.cloud import binaryauthorization_v1 + + +async def sample_validate_attestation_occurrence(): + # Create a client + client = binaryauthorization_v1.ValidationHelperV1AsyncClient() + + # Initialize request argument(s) + request = binaryauthorization_v1.ValidateAttestationOccurrenceRequest( + attestor="attestor_value", + occurrence_note="occurrence_note_value", + occurrence_resource_uri="occurrence_resource_uri_value", + ) + + # Make the request + response = await client.validate_attestation_occurrence(request=request) + + # Handle the response + print(response) + +# [END binaryauthorization_generated_binaryauthorization_v1_ValidationHelperV1_ValidateAttestationOccurrence_async] diff --git a/samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1_validation_helper_v1_validate_attestation_occurrence_sync.py b/samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1_validation_helper_v1_validate_attestation_occurrence_sync.py new file mode 100644 index 0000000..8ba7df0 --- /dev/null +++ b/samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1_validation_helper_v1_validate_attestation_occurrence_sync.py @@ -0,0 +1,47 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ValidateAttestationOccurrence +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-binaryauthorization + + +# [START binaryauthorization_generated_binaryauthorization_v1_ValidationHelperV1_ValidateAttestationOccurrence_sync] +from google.cloud import binaryauthorization_v1 + + +def sample_validate_attestation_occurrence(): + # Create a client + client = binaryauthorization_v1.ValidationHelperV1Client() + + # Initialize request argument(s) + request = binaryauthorization_v1.ValidateAttestationOccurrenceRequest( + attestor="attestor_value", + occurrence_note="occurrence_note_value", + occurrence_resource_uri="occurrence_resource_uri_value", + ) + + # Make the request + response = client.validate_attestation_occurrence(request=request) + + # Handle the response + print(response) + +# [END binaryauthorization_generated_binaryauthorization_v1_ValidationHelperV1_ValidateAttestationOccurrence_sync] diff --git a/samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1beta1_binauthz_management_service_v1_beta1_create_attestor_async.py b/samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1beta1_binauthz_management_service_v1_beta1_create_attestor_async.py new file mode 100644 index 0000000..fa78d6e --- /dev/null +++ b/samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1beta1_binauthz_management_service_v1_beta1_create_attestor_async.py @@ -0,0 +1,51 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateAttestor +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-binaryauthorization + + +# [START binaryauthorization_generated_binaryauthorization_v1beta1_BinauthzManagementServiceV1Beta1_CreateAttestor_async] +from google.cloud import binaryauthorization_v1beta1 + + +async def sample_create_attestor(): + # Create a client + client = binaryauthorization_v1beta1.BinauthzManagementServiceV1Beta1AsyncClient() + + # Initialize request argument(s) + attestor = binaryauthorization_v1beta1.Attestor() + attestor.user_owned_drydock_note.note_reference = "note_reference_value" + attestor.name = "name_value" + + request = binaryauthorization_v1beta1.CreateAttestorRequest( + parent="parent_value", + attestor_id="attestor_id_value", + attestor=attestor, + ) + + # Make the request + response = await client.create_attestor(request=request) + + # Handle the response + print(response) + +# [END binaryauthorization_generated_binaryauthorization_v1beta1_BinauthzManagementServiceV1Beta1_CreateAttestor_async] diff --git a/samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1beta1_binauthz_management_service_v1_beta1_create_attestor_sync.py b/samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1beta1_binauthz_management_service_v1_beta1_create_attestor_sync.py new file mode 100644 index 0000000..c0a506a --- /dev/null +++ b/samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1beta1_binauthz_management_service_v1_beta1_create_attestor_sync.py @@ -0,0 +1,51 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateAttestor +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-binaryauthorization + + +# [START binaryauthorization_generated_binaryauthorization_v1beta1_BinauthzManagementServiceV1Beta1_CreateAttestor_sync] +from google.cloud import binaryauthorization_v1beta1 + + +def sample_create_attestor(): + # Create a client + client = binaryauthorization_v1beta1.BinauthzManagementServiceV1Beta1Client() + + # Initialize request argument(s) + attestor = binaryauthorization_v1beta1.Attestor() + attestor.user_owned_drydock_note.note_reference = "note_reference_value" + attestor.name = "name_value" + + request = binaryauthorization_v1beta1.CreateAttestorRequest( + parent="parent_value", + attestor_id="attestor_id_value", + attestor=attestor, + ) + + # Make the request + response = client.create_attestor(request=request) + + # Handle the response + print(response) + +# [END binaryauthorization_generated_binaryauthorization_v1beta1_BinauthzManagementServiceV1Beta1_CreateAttestor_sync] diff --git a/samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1beta1_binauthz_management_service_v1_beta1_delete_attestor_async.py b/samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1beta1_binauthz_management_service_v1_beta1_delete_attestor_async.py new file mode 100644 index 0000000..ac60091 --- /dev/null +++ b/samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1beta1_binauthz_management_service_v1_beta1_delete_attestor_async.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteAttestor +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-binaryauthorization + + +# [START binaryauthorization_generated_binaryauthorization_v1beta1_BinauthzManagementServiceV1Beta1_DeleteAttestor_async] +from google.cloud import binaryauthorization_v1beta1 + + +async def sample_delete_attestor(): + # Create a client + client = binaryauthorization_v1beta1.BinauthzManagementServiceV1Beta1AsyncClient() + + # Initialize request argument(s) + request = binaryauthorization_v1beta1.DeleteAttestorRequest( + name="name_value", + ) + + # Make the request + await client.delete_attestor(request=request) + + +# [END binaryauthorization_generated_binaryauthorization_v1beta1_BinauthzManagementServiceV1Beta1_DeleteAttestor_async] diff --git a/samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1beta1_binauthz_management_service_v1_beta1_delete_attestor_sync.py b/samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1beta1_binauthz_management_service_v1_beta1_delete_attestor_sync.py new file mode 100644 index 0000000..5faffc3 --- /dev/null +++ b/samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1beta1_binauthz_management_service_v1_beta1_delete_attestor_sync.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteAttestor +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-binaryauthorization + + +# [START binaryauthorization_generated_binaryauthorization_v1beta1_BinauthzManagementServiceV1Beta1_DeleteAttestor_sync] +from google.cloud import binaryauthorization_v1beta1 + + +def sample_delete_attestor(): + # Create a client + client = binaryauthorization_v1beta1.BinauthzManagementServiceV1Beta1Client() + + # Initialize request argument(s) + request = binaryauthorization_v1beta1.DeleteAttestorRequest( + name="name_value", + ) + + # Make the request + client.delete_attestor(request=request) + + +# [END binaryauthorization_generated_binaryauthorization_v1beta1_BinauthzManagementServiceV1Beta1_DeleteAttestor_sync] diff --git a/samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1beta1_binauthz_management_service_v1_beta1_get_attestor_async.py b/samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1beta1_binauthz_management_service_v1_beta1_get_attestor_async.py new file mode 100644 index 0000000..0a88db1 --- /dev/null +++ b/samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1beta1_binauthz_management_service_v1_beta1_get_attestor_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetAttestor +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-binaryauthorization + + +# [START binaryauthorization_generated_binaryauthorization_v1beta1_BinauthzManagementServiceV1Beta1_GetAttestor_async] +from google.cloud import binaryauthorization_v1beta1 + + +async def sample_get_attestor(): + # Create a client + client = binaryauthorization_v1beta1.BinauthzManagementServiceV1Beta1AsyncClient() + + # Initialize request argument(s) + request = binaryauthorization_v1beta1.GetAttestorRequest( + name="name_value", + ) + + # Make the request + response = await client.get_attestor(request=request) + + # Handle the response + print(response) + +# [END binaryauthorization_generated_binaryauthorization_v1beta1_BinauthzManagementServiceV1Beta1_GetAttestor_async] diff --git a/samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1beta1_binauthz_management_service_v1_beta1_get_attestor_sync.py b/samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1beta1_binauthz_management_service_v1_beta1_get_attestor_sync.py new file mode 100644 index 0000000..7a0616c --- /dev/null +++ b/samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1beta1_binauthz_management_service_v1_beta1_get_attestor_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetAttestor +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-binaryauthorization + + +# [START binaryauthorization_generated_binaryauthorization_v1beta1_BinauthzManagementServiceV1Beta1_GetAttestor_sync] +from google.cloud import binaryauthorization_v1beta1 + + +def sample_get_attestor(): + # Create a client + client = binaryauthorization_v1beta1.BinauthzManagementServiceV1Beta1Client() + + # Initialize request argument(s) + request = binaryauthorization_v1beta1.GetAttestorRequest( + name="name_value", + ) + + # Make the request + response = client.get_attestor(request=request) + + # Handle the response + print(response) + +# [END binaryauthorization_generated_binaryauthorization_v1beta1_BinauthzManagementServiceV1Beta1_GetAttestor_sync] diff --git a/samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1beta1_binauthz_management_service_v1_beta1_get_policy_async.py b/samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1beta1_binauthz_management_service_v1_beta1_get_policy_async.py new file mode 100644 index 0000000..0dbed45 --- /dev/null +++ b/samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1beta1_binauthz_management_service_v1_beta1_get_policy_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetPolicy +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-binaryauthorization + + +# [START binaryauthorization_generated_binaryauthorization_v1beta1_BinauthzManagementServiceV1Beta1_GetPolicy_async] +from google.cloud import binaryauthorization_v1beta1 + + +async def sample_get_policy(): + # Create a client + client = binaryauthorization_v1beta1.BinauthzManagementServiceV1Beta1AsyncClient() + + # Initialize request argument(s) + request = binaryauthorization_v1beta1.GetPolicyRequest( + name="name_value", + ) + + # Make the request + response = await client.get_policy(request=request) + + # Handle the response + print(response) + +# [END binaryauthorization_generated_binaryauthorization_v1beta1_BinauthzManagementServiceV1Beta1_GetPolicy_async] diff --git a/samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1beta1_binauthz_management_service_v1_beta1_get_policy_sync.py b/samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1beta1_binauthz_management_service_v1_beta1_get_policy_sync.py new file mode 100644 index 0000000..e6b3b34 --- /dev/null +++ b/samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1beta1_binauthz_management_service_v1_beta1_get_policy_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetPolicy +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-binaryauthorization + + +# [START binaryauthorization_generated_binaryauthorization_v1beta1_BinauthzManagementServiceV1Beta1_GetPolicy_sync] +from google.cloud import binaryauthorization_v1beta1 + + +def sample_get_policy(): + # Create a client + client = binaryauthorization_v1beta1.BinauthzManagementServiceV1Beta1Client() + + # Initialize request argument(s) + request = binaryauthorization_v1beta1.GetPolicyRequest( + name="name_value", + ) + + # Make the request + response = client.get_policy(request=request) + + # Handle the response + print(response) + +# [END binaryauthorization_generated_binaryauthorization_v1beta1_BinauthzManagementServiceV1Beta1_GetPolicy_sync] diff --git a/samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1beta1_binauthz_management_service_v1_beta1_list_attestors_async.py b/samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1beta1_binauthz_management_service_v1_beta1_list_attestors_async.py new file mode 100644 index 0000000..7ed88e4 --- /dev/null +++ b/samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1beta1_binauthz_management_service_v1_beta1_list_attestors_async.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListAttestors +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-binaryauthorization + + +# [START binaryauthorization_generated_binaryauthorization_v1beta1_BinauthzManagementServiceV1Beta1_ListAttestors_async] +from google.cloud import binaryauthorization_v1beta1 + + +async def sample_list_attestors(): + # Create a client + client = binaryauthorization_v1beta1.BinauthzManagementServiceV1Beta1AsyncClient() + + # Initialize request argument(s) + request = binaryauthorization_v1beta1.ListAttestorsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_attestors(request=request) + + # Handle the response + async for response in page_result: + print(response) + +# [END binaryauthorization_generated_binaryauthorization_v1beta1_BinauthzManagementServiceV1Beta1_ListAttestors_async] diff --git a/samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1beta1_binauthz_management_service_v1_beta1_list_attestors_sync.py b/samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1beta1_binauthz_management_service_v1_beta1_list_attestors_sync.py new file mode 100644 index 0000000..142b452 --- /dev/null +++ b/samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1beta1_binauthz_management_service_v1_beta1_list_attestors_sync.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListAttestors +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-binaryauthorization + + +# [START binaryauthorization_generated_binaryauthorization_v1beta1_BinauthzManagementServiceV1Beta1_ListAttestors_sync] +from google.cloud import binaryauthorization_v1beta1 + + +def sample_list_attestors(): + # Create a client + client = binaryauthorization_v1beta1.BinauthzManagementServiceV1Beta1Client() + + # Initialize request argument(s) + request = binaryauthorization_v1beta1.ListAttestorsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_attestors(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END binaryauthorization_generated_binaryauthorization_v1beta1_BinauthzManagementServiceV1Beta1_ListAttestors_sync] diff --git a/samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1beta1_binauthz_management_service_v1_beta1_update_attestor_async.py b/samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1beta1_binauthz_management_service_v1_beta1_update_attestor_async.py new file mode 100644 index 0000000..502ede9 --- /dev/null +++ b/samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1beta1_binauthz_management_service_v1_beta1_update_attestor_async.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdateAttestor +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-binaryauthorization + + +# [START binaryauthorization_generated_binaryauthorization_v1beta1_BinauthzManagementServiceV1Beta1_UpdateAttestor_async] +from google.cloud import binaryauthorization_v1beta1 + + +async def sample_update_attestor(): + # Create a client + client = binaryauthorization_v1beta1.BinauthzManagementServiceV1Beta1AsyncClient() + + # Initialize request argument(s) + attestor = binaryauthorization_v1beta1.Attestor() + attestor.user_owned_drydock_note.note_reference = "note_reference_value" + attestor.name = "name_value" + + request = binaryauthorization_v1beta1.UpdateAttestorRequest( + attestor=attestor, + ) + + # Make the request + response = await client.update_attestor(request=request) + + # Handle the response + print(response) + +# [END binaryauthorization_generated_binaryauthorization_v1beta1_BinauthzManagementServiceV1Beta1_UpdateAttestor_async] diff --git a/samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1beta1_binauthz_management_service_v1_beta1_update_attestor_sync.py b/samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1beta1_binauthz_management_service_v1_beta1_update_attestor_sync.py new file mode 100644 index 0000000..96cdd3a --- /dev/null +++ b/samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1beta1_binauthz_management_service_v1_beta1_update_attestor_sync.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdateAttestor +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-binaryauthorization + + +# [START binaryauthorization_generated_binaryauthorization_v1beta1_BinauthzManagementServiceV1Beta1_UpdateAttestor_sync] +from google.cloud import binaryauthorization_v1beta1 + + +def sample_update_attestor(): + # Create a client + client = binaryauthorization_v1beta1.BinauthzManagementServiceV1Beta1Client() + + # Initialize request argument(s) + attestor = binaryauthorization_v1beta1.Attestor() + attestor.user_owned_drydock_note.note_reference = "note_reference_value" + attestor.name = "name_value" + + request = binaryauthorization_v1beta1.UpdateAttestorRequest( + attestor=attestor, + ) + + # Make the request + response = client.update_attestor(request=request) + + # Handle the response + print(response) + +# [END binaryauthorization_generated_binaryauthorization_v1beta1_BinauthzManagementServiceV1Beta1_UpdateAttestor_sync] diff --git a/samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1beta1_binauthz_management_service_v1_beta1_update_policy_async.py b/samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1beta1_binauthz_management_service_v1_beta1_update_policy_async.py new file mode 100644 index 0000000..96bec06 --- /dev/null +++ b/samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1beta1_binauthz_management_service_v1_beta1_update_policy_async.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdatePolicy +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-binaryauthorization + + +# [START binaryauthorization_generated_binaryauthorization_v1beta1_BinauthzManagementServiceV1Beta1_UpdatePolicy_async] +from google.cloud import binaryauthorization_v1beta1 + + +async def sample_update_policy(): + # Create a client + client = binaryauthorization_v1beta1.BinauthzManagementServiceV1Beta1AsyncClient() + + # Initialize request argument(s) + policy = binaryauthorization_v1beta1.Policy() + policy.default_admission_rule.evaluation_mode = "ALWAYS_DENY" + policy.default_admission_rule.enforcement_mode = "DRYRUN_AUDIT_LOG_ONLY" + + request = binaryauthorization_v1beta1.UpdatePolicyRequest( + policy=policy, + ) + + # Make the request + response = await client.update_policy(request=request) + + # Handle the response + print(response) + +# [END binaryauthorization_generated_binaryauthorization_v1beta1_BinauthzManagementServiceV1Beta1_UpdatePolicy_async] diff --git a/samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1beta1_binauthz_management_service_v1_beta1_update_policy_sync.py b/samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1beta1_binauthz_management_service_v1_beta1_update_policy_sync.py new file mode 100644 index 0000000..9569014 --- /dev/null +++ b/samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1beta1_binauthz_management_service_v1_beta1_update_policy_sync.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdatePolicy +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-binaryauthorization + + +# [START binaryauthorization_generated_binaryauthorization_v1beta1_BinauthzManagementServiceV1Beta1_UpdatePolicy_sync] +from google.cloud import binaryauthorization_v1beta1 + + +def sample_update_policy(): + # Create a client + client = binaryauthorization_v1beta1.BinauthzManagementServiceV1Beta1Client() + + # Initialize request argument(s) + policy = binaryauthorization_v1beta1.Policy() + policy.default_admission_rule.evaluation_mode = "ALWAYS_DENY" + policy.default_admission_rule.enforcement_mode = "DRYRUN_AUDIT_LOG_ONLY" + + request = binaryauthorization_v1beta1.UpdatePolicyRequest( + policy=policy, + ) + + # Make the request + response = client.update_policy(request=request) + + # Handle the response + print(response) + +# [END binaryauthorization_generated_binaryauthorization_v1beta1_BinauthzManagementServiceV1Beta1_UpdatePolicy_sync] diff --git a/samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1beta1_system_policy_v1_beta1_get_system_policy_async.py b/samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1beta1_system_policy_v1_beta1_get_system_policy_async.py new file mode 100644 index 0000000..1cb3670 --- /dev/null +++ b/samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1beta1_system_policy_v1_beta1_get_system_policy_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetSystemPolicy +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-binaryauthorization + + +# [START binaryauthorization_generated_binaryauthorization_v1beta1_SystemPolicyV1Beta1_GetSystemPolicy_async] +from google.cloud import binaryauthorization_v1beta1 + + +async def sample_get_system_policy(): + # Create a client + client = binaryauthorization_v1beta1.SystemPolicyV1Beta1AsyncClient() + + # Initialize request argument(s) + request = binaryauthorization_v1beta1.GetSystemPolicyRequest( + name="name_value", + ) + + # Make the request + response = await client.get_system_policy(request=request) + + # Handle the response + print(response) + +# [END binaryauthorization_generated_binaryauthorization_v1beta1_SystemPolicyV1Beta1_GetSystemPolicy_async] diff --git a/samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1beta1_system_policy_v1_beta1_get_system_policy_sync.py b/samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1beta1_system_policy_v1_beta1_get_system_policy_sync.py new file mode 100644 index 0000000..e4f92db --- /dev/null +++ b/samples/generated_samples/binaryauthorization_generated_binaryauthorization_v1beta1_system_policy_v1_beta1_get_system_policy_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetSystemPolicy +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-binaryauthorization + + +# [START binaryauthorization_generated_binaryauthorization_v1beta1_SystemPolicyV1Beta1_GetSystemPolicy_sync] +from google.cloud import binaryauthorization_v1beta1 + + +def sample_get_system_policy(): + # Create a client + client = binaryauthorization_v1beta1.SystemPolicyV1Beta1Client() + + # Initialize request argument(s) + request = binaryauthorization_v1beta1.GetSystemPolicyRequest( + name="name_value", + ) + + # Make the request + response = client.get_system_policy(request=request) + + # Handle the response + print(response) + +# [END binaryauthorization_generated_binaryauthorization_v1beta1_SystemPolicyV1Beta1_GetSystemPolicy_sync] diff --git a/samples/generated_samples/snippet_metadata_binaryauthorization_v1.json b/samples/generated_samples/snippet_metadata_binaryauthorization_v1.json new file mode 100644 index 0000000..c83c420 --- /dev/null +++ b/samples/generated_samples/snippet_metadata_binaryauthorization_v1.json @@ -0,0 +1,801 @@ +{ + "snippets": [ + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "BinauthzManagementServiceV1" + }, + "shortName": "CreateAttestor" + } + }, + "file": "binaryauthorization_generated_binaryauthorization_v1_binauthz_management_service_v1_create_attestor_async.py", + "regionTag": "binaryauthorization_generated_binaryauthorization_v1_BinauthzManagementServiceV1_CreateAttestor_async", + "segments": [ + { + "end": 50, + "start": 27, + "type": "FULL" + }, + { + "end": 50, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 44, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 47, + "start": 45, + "type": "REQUEST_EXECUTION" + }, + { + "end": 51, + "start": 48, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "BinauthzManagementServiceV1" + }, + "shortName": "CreateAttestor" + } + }, + "file": "binaryauthorization_generated_binaryauthorization_v1_binauthz_management_service_v1_create_attestor_sync.py", + "regionTag": "binaryauthorization_generated_binaryauthorization_v1_BinauthzManagementServiceV1_CreateAttestor_sync", + "segments": [ + { + "end": 50, + "start": 27, + "type": "FULL" + }, + { + "end": 50, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 44, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 47, + "start": 45, + "type": "REQUEST_EXECUTION" + }, + { + "end": 51, + "start": 48, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "BinauthzManagementServiceV1" + }, + "shortName": "DeleteAttestor" + } + }, + "file": "binaryauthorization_generated_binaryauthorization_v1_binauthz_management_service_v1_delete_attestor_async.py", + "regionTag": "binaryauthorization_generated_binaryauthorization_v1_BinauthzManagementServiceV1_DeleteAttestor_async", + "segments": [ + { + "end": 42, + "start": 27, + "type": "FULL" + }, + { + "end": 42, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 43, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "BinauthzManagementServiceV1" + }, + "shortName": "DeleteAttestor" + } + }, + "file": "binaryauthorization_generated_binaryauthorization_v1_binauthz_management_service_v1_delete_attestor_sync.py", + "regionTag": "binaryauthorization_generated_binaryauthorization_v1_BinauthzManagementServiceV1_DeleteAttestor_sync", + "segments": [ + { + "end": 42, + "start": 27, + "type": "FULL" + }, + { + "end": 42, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 43, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "BinauthzManagementServiceV1" + }, + "shortName": "GetAttestor" + } + }, + "file": "binaryauthorization_generated_binaryauthorization_v1_binauthz_management_service_v1_get_attestor_async.py", + "regionTag": "binaryauthorization_generated_binaryauthorization_v1_BinauthzManagementServiceV1_GetAttestor_async", + "segments": [ + { + "end": 44, + "start": 27, + "type": "FULL" + }, + { + "end": 44, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 45, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "BinauthzManagementServiceV1" + }, + "shortName": "GetAttestor" + } + }, + "file": "binaryauthorization_generated_binaryauthorization_v1_binauthz_management_service_v1_get_attestor_sync.py", + "regionTag": "binaryauthorization_generated_binaryauthorization_v1_BinauthzManagementServiceV1_GetAttestor_sync", + "segments": [ + { + "end": 44, + "start": 27, + "type": "FULL" + }, + { + "end": 44, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 45, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "BinauthzManagementServiceV1" + }, + "shortName": "GetPolicy" + } + }, + "file": "binaryauthorization_generated_binaryauthorization_v1_binauthz_management_service_v1_get_policy_async.py", + "regionTag": "binaryauthorization_generated_binaryauthorization_v1_BinauthzManagementServiceV1_GetPolicy_async", + "segments": [ + { + "end": 44, + "start": 27, + "type": "FULL" + }, + { + "end": 44, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 45, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "BinauthzManagementServiceV1" + }, + "shortName": "GetPolicy" + } + }, + "file": "binaryauthorization_generated_binaryauthorization_v1_binauthz_management_service_v1_get_policy_sync.py", + "regionTag": "binaryauthorization_generated_binaryauthorization_v1_BinauthzManagementServiceV1_GetPolicy_sync", + "segments": [ + { + "end": 44, + "start": 27, + "type": "FULL" + }, + { + "end": 44, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 45, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "BinauthzManagementServiceV1" + }, + "shortName": "ListAttestors" + } + }, + "file": "binaryauthorization_generated_binaryauthorization_v1_binauthz_management_service_v1_list_attestors_async.py", + "regionTag": "binaryauthorization_generated_binaryauthorization_v1_BinauthzManagementServiceV1_ListAttestors_async", + "segments": [ + { + "end": 45, + "start": 27, + "type": "FULL" + }, + { + "end": 45, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 46, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "BinauthzManagementServiceV1" + }, + "shortName": "ListAttestors" + } + }, + "file": "binaryauthorization_generated_binaryauthorization_v1_binauthz_management_service_v1_list_attestors_sync.py", + "regionTag": "binaryauthorization_generated_binaryauthorization_v1_BinauthzManagementServiceV1_ListAttestors_sync", + "segments": [ + { + "end": 45, + "start": 27, + "type": "FULL" + }, + { + "end": 45, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 46, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "BinauthzManagementServiceV1" + }, + "shortName": "UpdateAttestor" + } + }, + "file": "binaryauthorization_generated_binaryauthorization_v1_binauthz_management_service_v1_update_attestor_async.py", + "regionTag": "binaryauthorization_generated_binaryauthorization_v1_BinauthzManagementServiceV1_UpdateAttestor_async", + "segments": [ + { + "end": 48, + "start": 27, + "type": "FULL" + }, + { + "end": 48, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 42, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 45, + "start": 43, + "type": "REQUEST_EXECUTION" + }, + { + "end": 49, + "start": 46, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "BinauthzManagementServiceV1" + }, + "shortName": "UpdateAttestor" + } + }, + "file": "binaryauthorization_generated_binaryauthorization_v1_binauthz_management_service_v1_update_attestor_sync.py", + "regionTag": "binaryauthorization_generated_binaryauthorization_v1_BinauthzManagementServiceV1_UpdateAttestor_sync", + "segments": [ + { + "end": 48, + "start": 27, + "type": "FULL" + }, + { + "end": 48, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 42, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 45, + "start": 43, + "type": "REQUEST_EXECUTION" + }, + { + "end": 49, + "start": 46, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "BinauthzManagementServiceV1" + }, + "shortName": "UpdatePolicy" + } + }, + "file": "binaryauthorization_generated_binaryauthorization_v1_binauthz_management_service_v1_update_policy_async.py", + "regionTag": "binaryauthorization_generated_binaryauthorization_v1_BinauthzManagementServiceV1_UpdatePolicy_async", + "segments": [ + { + "end": 48, + "start": 27, + "type": "FULL" + }, + { + "end": 48, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 42, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 45, + "start": 43, + "type": "REQUEST_EXECUTION" + }, + { + "end": 49, + "start": 46, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "BinauthzManagementServiceV1" + }, + "shortName": "UpdatePolicy" + } + }, + "file": "binaryauthorization_generated_binaryauthorization_v1_binauthz_management_service_v1_update_policy_sync.py", + "regionTag": "binaryauthorization_generated_binaryauthorization_v1_BinauthzManagementServiceV1_UpdatePolicy_sync", + "segments": [ + { + "end": 48, + "start": 27, + "type": "FULL" + }, + { + "end": 48, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 42, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 45, + "start": 43, + "type": "REQUEST_EXECUTION" + }, + { + "end": 49, + "start": 46, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "SystemPolicyV1" + }, + "shortName": "GetSystemPolicy" + } + }, + "file": "binaryauthorization_generated_binaryauthorization_v1_system_policy_v1_get_system_policy_async.py", + "regionTag": "binaryauthorization_generated_binaryauthorization_v1_SystemPolicyV1_GetSystemPolicy_async", + "segments": [ + { + "end": 44, + "start": 27, + "type": "FULL" + }, + { + "end": 44, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 45, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "SystemPolicyV1" + }, + "shortName": "GetSystemPolicy" + } + }, + "file": "binaryauthorization_generated_binaryauthorization_v1_system_policy_v1_get_system_policy_sync.py", + "regionTag": "binaryauthorization_generated_binaryauthorization_v1_SystemPolicyV1_GetSystemPolicy_sync", + "segments": [ + { + "end": 44, + "start": 27, + "type": "FULL" + }, + { + "end": 44, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 45, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "ValidationHelperV1" + }, + "shortName": "ValidateAttestationOccurrence" + } + }, + "file": "binaryauthorization_generated_binaryauthorization_v1_validation_helper_v1_validate_attestation_occurrence_async.py", + "regionTag": "binaryauthorization_generated_binaryauthorization_v1_ValidationHelperV1_ValidateAttestationOccurrence_async", + "segments": [ + { + "end": 46, + "start": 27, + "type": "FULL" + }, + { + "end": 46, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 40, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 43, + "start": 41, + "type": "REQUEST_EXECUTION" + }, + { + "end": 47, + "start": 44, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "ValidationHelperV1" + }, + "shortName": "ValidateAttestationOccurrence" + } + }, + "file": "binaryauthorization_generated_binaryauthorization_v1_validation_helper_v1_validate_attestation_occurrence_sync.py", + "regionTag": "binaryauthorization_generated_binaryauthorization_v1_ValidationHelperV1_ValidateAttestationOccurrence_sync", + "segments": [ + { + "end": 46, + "start": 27, + "type": "FULL" + }, + { + "end": 46, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 40, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 43, + "start": 41, + "type": "REQUEST_EXECUTION" + }, + { + "end": 47, + "start": 44, + "type": "RESPONSE_HANDLING" + } + ] + } + ] +} diff --git a/samples/generated_samples/snippet_metadata_binaryauthorization_v1beta1.json b/samples/generated_samples/snippet_metadata_binaryauthorization_v1beta1.json new file mode 100644 index 0000000..1e7f06d --- /dev/null +++ b/samples/generated_samples/snippet_metadata_binaryauthorization_v1beta1.json @@ -0,0 +1,712 @@ +{ + "snippets": [ + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "BinauthzManagementServiceV1Beta1" + }, + "shortName": "CreateAttestor" + } + }, + "file": "binaryauthorization_generated_binaryauthorization_v1beta1_binauthz_management_service_v1_beta1_create_attestor_async.py", + "regionTag": "binaryauthorization_generated_binaryauthorization_v1beta1_BinauthzManagementServiceV1Beta1_CreateAttestor_async", + "segments": [ + { + "end": 50, + "start": 27, + "type": "FULL" + }, + { + "end": 50, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 44, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 47, + "start": 45, + "type": "REQUEST_EXECUTION" + }, + { + "end": 51, + "start": 48, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "BinauthzManagementServiceV1Beta1" + }, + "shortName": "CreateAttestor" + } + }, + "file": "binaryauthorization_generated_binaryauthorization_v1beta1_binauthz_management_service_v1_beta1_create_attestor_sync.py", + "regionTag": "binaryauthorization_generated_binaryauthorization_v1beta1_BinauthzManagementServiceV1Beta1_CreateAttestor_sync", + "segments": [ + { + "end": 50, + "start": 27, + "type": "FULL" + }, + { + "end": 50, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 44, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 47, + "start": 45, + "type": "REQUEST_EXECUTION" + }, + { + "end": 51, + "start": 48, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "BinauthzManagementServiceV1Beta1" + }, + "shortName": "DeleteAttestor" + } + }, + "file": "binaryauthorization_generated_binaryauthorization_v1beta1_binauthz_management_service_v1_beta1_delete_attestor_async.py", + "regionTag": "binaryauthorization_generated_binaryauthorization_v1beta1_BinauthzManagementServiceV1Beta1_DeleteAttestor_async", + "segments": [ + { + "end": 42, + "start": 27, + "type": "FULL" + }, + { + "end": 42, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 43, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "BinauthzManagementServiceV1Beta1" + }, + "shortName": "DeleteAttestor" + } + }, + "file": "binaryauthorization_generated_binaryauthorization_v1beta1_binauthz_management_service_v1_beta1_delete_attestor_sync.py", + "regionTag": "binaryauthorization_generated_binaryauthorization_v1beta1_BinauthzManagementServiceV1Beta1_DeleteAttestor_sync", + "segments": [ + { + "end": 42, + "start": 27, + "type": "FULL" + }, + { + "end": 42, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 43, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "BinauthzManagementServiceV1Beta1" + }, + "shortName": "GetAttestor" + } + }, + "file": "binaryauthorization_generated_binaryauthorization_v1beta1_binauthz_management_service_v1_beta1_get_attestor_async.py", + "regionTag": "binaryauthorization_generated_binaryauthorization_v1beta1_BinauthzManagementServiceV1Beta1_GetAttestor_async", + "segments": [ + { + "end": 44, + "start": 27, + "type": "FULL" + }, + { + "end": 44, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 45, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "BinauthzManagementServiceV1Beta1" + }, + "shortName": "GetAttestor" + } + }, + "file": "binaryauthorization_generated_binaryauthorization_v1beta1_binauthz_management_service_v1_beta1_get_attestor_sync.py", + "regionTag": "binaryauthorization_generated_binaryauthorization_v1beta1_BinauthzManagementServiceV1Beta1_GetAttestor_sync", + "segments": [ + { + "end": 44, + "start": 27, + "type": "FULL" + }, + { + "end": 44, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 45, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "BinauthzManagementServiceV1Beta1" + }, + "shortName": "GetPolicy" + } + }, + "file": "binaryauthorization_generated_binaryauthorization_v1beta1_binauthz_management_service_v1_beta1_get_policy_async.py", + "regionTag": "binaryauthorization_generated_binaryauthorization_v1beta1_BinauthzManagementServiceV1Beta1_GetPolicy_async", + "segments": [ + { + "end": 44, + "start": 27, + "type": "FULL" + }, + { + "end": 44, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 45, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "BinauthzManagementServiceV1Beta1" + }, + "shortName": "GetPolicy" + } + }, + "file": "binaryauthorization_generated_binaryauthorization_v1beta1_binauthz_management_service_v1_beta1_get_policy_sync.py", + "regionTag": "binaryauthorization_generated_binaryauthorization_v1beta1_BinauthzManagementServiceV1Beta1_GetPolicy_sync", + "segments": [ + { + "end": 44, + "start": 27, + "type": "FULL" + }, + { + "end": 44, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 45, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "BinauthzManagementServiceV1Beta1" + }, + "shortName": "ListAttestors" + } + }, + "file": "binaryauthorization_generated_binaryauthorization_v1beta1_binauthz_management_service_v1_beta1_list_attestors_async.py", + "regionTag": "binaryauthorization_generated_binaryauthorization_v1beta1_BinauthzManagementServiceV1Beta1_ListAttestors_async", + "segments": [ + { + "end": 45, + "start": 27, + "type": "FULL" + }, + { + "end": 45, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 46, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "BinauthzManagementServiceV1Beta1" + }, + "shortName": "ListAttestors" + } + }, + "file": "binaryauthorization_generated_binaryauthorization_v1beta1_binauthz_management_service_v1_beta1_list_attestors_sync.py", + "regionTag": "binaryauthorization_generated_binaryauthorization_v1beta1_BinauthzManagementServiceV1Beta1_ListAttestors_sync", + "segments": [ + { + "end": 45, + "start": 27, + "type": "FULL" + }, + { + "end": 45, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 46, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "BinauthzManagementServiceV1Beta1" + }, + "shortName": "UpdateAttestor" + } + }, + "file": "binaryauthorization_generated_binaryauthorization_v1beta1_binauthz_management_service_v1_beta1_update_attestor_async.py", + "regionTag": "binaryauthorization_generated_binaryauthorization_v1beta1_BinauthzManagementServiceV1Beta1_UpdateAttestor_async", + "segments": [ + { + "end": 48, + "start": 27, + "type": "FULL" + }, + { + "end": 48, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 42, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 45, + "start": 43, + "type": "REQUEST_EXECUTION" + }, + { + "end": 49, + "start": 46, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "BinauthzManagementServiceV1Beta1" + }, + "shortName": "UpdateAttestor" + } + }, + "file": "binaryauthorization_generated_binaryauthorization_v1beta1_binauthz_management_service_v1_beta1_update_attestor_sync.py", + "regionTag": "binaryauthorization_generated_binaryauthorization_v1beta1_BinauthzManagementServiceV1Beta1_UpdateAttestor_sync", + "segments": [ + { + "end": 48, + "start": 27, + "type": "FULL" + }, + { + "end": 48, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 42, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 45, + "start": 43, + "type": "REQUEST_EXECUTION" + }, + { + "end": 49, + "start": 46, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "BinauthzManagementServiceV1Beta1" + }, + "shortName": "UpdatePolicy" + } + }, + "file": "binaryauthorization_generated_binaryauthorization_v1beta1_binauthz_management_service_v1_beta1_update_policy_async.py", + "regionTag": "binaryauthorization_generated_binaryauthorization_v1beta1_BinauthzManagementServiceV1Beta1_UpdatePolicy_async", + "segments": [ + { + "end": 48, + "start": 27, + "type": "FULL" + }, + { + "end": 48, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 42, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 45, + "start": 43, + "type": "REQUEST_EXECUTION" + }, + { + "end": 49, + "start": 46, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "BinauthzManagementServiceV1Beta1" + }, + "shortName": "UpdatePolicy" + } + }, + "file": "binaryauthorization_generated_binaryauthorization_v1beta1_binauthz_management_service_v1_beta1_update_policy_sync.py", + "regionTag": "binaryauthorization_generated_binaryauthorization_v1beta1_BinauthzManagementServiceV1Beta1_UpdatePolicy_sync", + "segments": [ + { + "end": 48, + "start": 27, + "type": "FULL" + }, + { + "end": 48, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 42, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 45, + "start": 43, + "type": "REQUEST_EXECUTION" + }, + { + "end": 49, + "start": 46, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "SystemPolicyV1Beta1" + }, + "shortName": "GetSystemPolicy" + } + }, + "file": "binaryauthorization_generated_binaryauthorization_v1beta1_system_policy_v1_beta1_get_system_policy_async.py", + "regionTag": "binaryauthorization_generated_binaryauthorization_v1beta1_SystemPolicyV1Beta1_GetSystemPolicy_async", + "segments": [ + { + "end": 44, + "start": 27, + "type": "FULL" + }, + { + "end": 44, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 45, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "SystemPolicyV1Beta1" + }, + "shortName": "GetSystemPolicy" + } + }, + "file": "binaryauthorization_generated_binaryauthorization_v1beta1_system_policy_v1_beta1_get_system_policy_sync.py", + "regionTag": "binaryauthorization_generated_binaryauthorization_v1beta1_SystemPolicyV1Beta1_GetSystemPolicy_sync", + "segments": [ + { + "end": 44, + "start": 27, + "type": "FULL" + }, + { + "end": 44, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 45, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + } + ] +} From d94f375f927b40f2b20934a64b6405119b219706 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 24 Feb 2022 11:38:49 -0800 Subject: [PATCH 3/3] chore(main): release 1.2.1 (#114) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- CHANGELOG.md | 7 +++++++ setup.py | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 40b2efe..fa3b84d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +### [1.2.1](https://github.com/googleapis/python-binary-authorization/compare/v1.2.0...v1.2.1) (2022-02-11) + + +### Bug Fixes + +* resolve DuplicateCredentialArgs error when using credentials_file ([1f500f5](https://github.com/googleapis/python-binary-authorization/commit/1f500f506715e9028b98e7c42048aacc276fb9b4)) + ## [1.2.0](https://github.com/googleapis/python-binary-authorization/compare/v1.1.0...v1.2.0) (2022-01-25) diff --git a/setup.py b/setup.py index 164613e..21c2102 100644 --- a/setup.py +++ b/setup.py @@ -20,7 +20,7 @@ import setuptools # type: ignore -version = "1.2.0" +version = "1.2.1" package_root = os.path.abspath(os.path.dirname(__file__))