From 8fa01f62e30ebfcb750223b9effb0b1e78eab8ed Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 23 Mar 2022 11:44:48 -0600 Subject: [PATCH 01/15] chore(python): configure release-please on previous major versions (#80) Source-Link: https://github.com/googleapis/synthtool/commit/c1dd87e9287f8de99930d3046dd555c4d03384c6 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:2d13c2172a5d6129c861edaa48b60ead15aeaf58aa75e02d870c4cbdfa63aaba Co-authored-by: Owl Bot --- .github/.OwlBot.lock.yaml | 2 +- .github/release-please.yml | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 44c78f7..8807627 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,4 +13,4 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest - digest: sha256:4e1991042fe54b991db9ca17c8fb386e61b22fe4d1472a568bf0fcac85dcf5d3 + digest: sha256:2d13c2172a5d6129c861edaa48b60ead15aeaf58aa75e02d870c4cbdfa63aaba diff --git a/.github/release-please.yml b/.github/release-please.yml index 466597e..6def37a 100644 --- a/.github/release-please.yml +++ b/.github/release-please.yml @@ -1,2 +1,8 @@ releaseType: python handleGHRelease: true +# NOTE: this section is generated by synthtool.languages.python +# See https://github.com/googleapis/synthtool/blob/master/synthtool/languages/python.py +branches: +- branch: v0 + handleGHRelease: true + releaseType: python From 244ca682bfd1dee451da85ee29b587c87c540686 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 29 Mar 2022 00:04:31 +0000 Subject: [PATCH 02/15] chore(python): use black==22.3.0 (#81) Source-Link: https://github.com/googleapis/synthtool/commit/6fab84af09f2cf89a031fd8671d1def6b2931b11 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:7cffbc10910c3ab1b852c05114a08d374c195a81cdec1d4a67a1d129331d0bfe --- .github/.OwlBot.lock.yaml | 2 +- docs/conf.py | 5 +- .../services/datastream/async_client.py | 205 +- .../services/datastream/client.py | 295 ++- .../services/datastream/transports/base.py | 62 +- .../services/datastream/transports/grpc.py | 3 +- .../cloud/datastream_v1/types/datastream.py | 514 ++++- .../types/datastream_resources.py | 700 ++++-- .../services/datastream/async_client.py | 172 +- .../services/datastream/client.py | 244 +- .../services/datastream/transports/base.py | 50 +- .../services/datastream/transports/grpc.py | 3 +- .../datastream_v1alpha1/types/datastream.py | 447 +++- .../types/datastream_resources.py | 621 ++++- noxfile.py | 9 +- .../gapic/datastream_v1/test_datastream.py | 2010 +++++++++++++---- .../datastream_v1alpha1/test_datastream.py | 1688 ++++++++++---- 17 files changed, 5483 insertions(+), 1547 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 8807627..87dd006 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,4 +13,4 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest - digest: sha256:2d13c2172a5d6129c861edaa48b60ead15aeaf58aa75e02d870c4cbdfa63aaba + digest: sha256:7cffbc10910c3ab1b852c05114a08d374c195a81cdec1d4a67a1d129331d0bfe diff --git a/docs/conf.py b/docs/conf.py index 17393f0..2654f0d 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -361,7 +361,10 @@ intersphinx_mapping = { "python": ("https://python.readthedocs.org/en/latest/", None), "google-auth": ("https://googleapis.dev/python/google-auth/latest/", None), - "google.api_core": ("https://googleapis.dev/python/google-api-core/latest/", None,), + "google.api_core": ( + "https://googleapis.dev/python/google-api-core/latest/", + None, + ), "grpc": ("https://grpc.github.io/grpc/python/", None), "proto-plus": ("https://proto-plus-python.readthedocs.io/en/latest/", None), "protobuf": ("https://googleapis.dev/python/protobuf/latest/", None), diff --git a/google/cloud/datastream_v1/services/datastream/async_client.py b/google/cloud/datastream_v1/services/datastream/async_client.py index c098b9b..f7e91f3 100644 --- a/google/cloud/datastream_v1/services/datastream/async_client.py +++ b/google/cloud/datastream_v1/services/datastream/async_client.py @@ -307,12 +307,20 @@ def sample_list_connection_profiles(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # This method is paged; wrap the response in a pager, which provides # an `__aiter__` convenience method. response = pagers.ListConnectionProfilesAsyncPager( - method=rpc, request=request, response=response, metadata=metadata, + method=rpc, + request=request, + response=response, + metadata=metadata, ) # Done; return the response. @@ -406,7 +414,12 @@ def sample_get_connection_profile(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -533,7 +546,12 @@ def sample_create_connection_profile(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Wrap the response in an operation future. response = operation_async.from_gapic( @@ -662,7 +680,12 @@ def sample_update_connection_profile(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Wrap the response in an operation future. response = operation_async.from_gapic( @@ -777,7 +800,12 @@ def sample_delete_connection_profile(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Wrap the response in an operation future. response = operation_async.from_gapic( @@ -865,7 +893,12 @@ def sample_discover_connection_profile(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -959,12 +992,20 @@ def sample_list_streams(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # This method is paged; wrap the response in a pager, which provides # an `__aiter__` convenience method. response = pagers.ListStreamsAsyncPager( - method=rpc, request=request, response=response, metadata=metadata, + method=rpc, + request=request, + response=response, + metadata=metadata, ) # Done; return the response. @@ -1055,7 +1096,12 @@ def sample_get_stream(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -1178,7 +1224,12 @@ def sample_create_stream(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Wrap the response in an operation future. response = operation_async.from_gapic( @@ -1307,7 +1358,12 @@ def sample_update_stream(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Wrap the response in an operation future. response = operation_async.from_gapic( @@ -1422,7 +1478,12 @@ def sample_delete_stream(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Wrap the response in an operation future. response = operation_async.from_gapic( @@ -1520,7 +1581,12 @@ def sample_get_stream_object(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -1595,7 +1661,12 @@ def sample_lookup_stream_object(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -1691,12 +1762,20 @@ def sample_list_stream_objects(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # This method is paged; wrap the response in a pager, which provides # an `__aiter__` convenience method. response = pagers.ListStreamObjectsAsyncPager( - method=rpc, request=request, response=response, metadata=metadata, + method=rpc, + request=request, + response=response, + metadata=metadata, ) # Done; return the response. @@ -1791,7 +1870,12 @@ def sample_start_backfill_job(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -1884,7 +1968,12 @@ def sample_stop_backfill_job(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -1981,12 +2070,20 @@ def sample_fetch_static_ips(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # This method is paged; wrap the response in a pager, which provides # an `__aiter__` convenience method. response = pagers.FetchStaticIpsAsyncPager( - method=rpc, request=request, response=response, metadata=metadata, + method=rpc, + request=request, + response=response, + metadata=metadata, ) # Done; return the response. @@ -2110,7 +2207,12 @@ def sample_create_private_connection(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Wrap the response in an operation future. response = operation_async.from_gapic( @@ -2212,7 +2314,12 @@ def sample_get_private_connection(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -2309,12 +2416,20 @@ def sample_list_private_connections(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # This method is paged; wrap the response in a pager, which provides # an `__aiter__` convenience method. response = pagers.ListPrivateConnectionsAsyncPager( - method=rpc, request=request, response=response, metadata=metadata, + method=rpc, + request=request, + response=response, + metadata=metadata, ) # Done; return the response. @@ -2424,7 +2539,12 @@ def sample_delete_private_connection(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Wrap the response in an operation future. response = operation_async.from_gapic( @@ -2553,7 +2673,12 @@ def sample_create_route(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Wrap the response in an operation future. response = operation_async.from_gapic( @@ -2652,7 +2777,12 @@ def sample_get_route(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -2746,12 +2876,20 @@ def sample_list_routes(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # This method is paged; wrap the response in a pager, which provides # an `__aiter__` convenience method. response = pagers.ListRoutesAsyncPager( - method=rpc, request=request, response=response, metadata=metadata, + method=rpc, + request=request, + response=response, + metadata=metadata, ) # Done; return the response. @@ -2858,7 +2996,12 @@ def sample_delete_route(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Wrap the response in an operation future. response = operation_async.from_gapic( diff --git a/google/cloud/datastream_v1/services/datastream/client.py b/google/cloud/datastream_v1/services/datastream/client.py index 3ab4e19..8bab25a 100644 --- a/google/cloud/datastream_v1/services/datastream/client.py +++ b/google/cloud/datastream_v1/services/datastream/client.py @@ -59,7 +59,10 @@ class DatastreamClientMeta(type): _transport_registry["grpc"] = DatastreamGrpcTransport _transport_registry["grpc_asyncio"] = DatastreamGrpcAsyncIOTransport - def get_transport_class(cls, label: str = None,) -> Type[DatastreamTransport]: + def get_transport_class( + cls, + label: str = None, + ) -> Type[DatastreamTransport]: """Returns an appropriate transport class. Args: @@ -165,11 +168,15 @@ def transport(self) -> DatastreamTransport: @staticmethod def connection_profile_path( - project: str, location: str, connection_profile: str, + project: str, + location: str, + connection_profile: str, ) -> str: """Returns a fully-qualified connection_profile string.""" return "projects/{project}/locations/{location}/connectionProfiles/{connection_profile}".format( - project=project, location=location, connection_profile=connection_profile, + project=project, + location=location, + connection_profile=connection_profile, ) @staticmethod @@ -182,10 +189,14 @@ def parse_connection_profile_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def networks_path(project: str, network: str,) -> str: + def networks_path( + project: str, + network: str, + ) -> str: """Returns a fully-qualified networks string.""" return "projects/{project}/global/networks/{network}".format( - project=project, network=network, + project=project, + network=network, ) @staticmethod @@ -198,11 +209,15 @@ def parse_networks_path(path: str) -> Dict[str, str]: @staticmethod def private_connection_path( - project: str, location: str, private_connection: str, + project: str, + location: str, + private_connection: str, ) -> str: """Returns a fully-qualified private_connection string.""" return "projects/{project}/locations/{location}/privateConnections/{private_connection}".format( - project=project, location=location, private_connection=private_connection, + project=project, + location=location, + private_connection=private_connection, ) @staticmethod @@ -216,7 +231,10 @@ def parse_private_connection_path(path: str) -> Dict[str, str]: @staticmethod def route_path( - project: str, location: str, private_connection: str, route: str, + project: str, + location: str, + private_connection: str, + route: str, ) -> str: """Returns a fully-qualified route string.""" return "projects/{project}/locations/{location}/privateConnections/{private_connection}/routes/{route}".format( @@ -236,10 +254,16 @@ def parse_route_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def stream_path(project: str, location: str, stream: str,) -> str: + def stream_path( + project: str, + location: str, + stream: str, + ) -> str: """Returns a fully-qualified stream string.""" return "projects/{project}/locations/{location}/streams/{stream}".format( - project=project, location=location, stream=stream, + project=project, + location=location, + stream=stream, ) @staticmethod @@ -253,11 +277,17 @@ def parse_stream_path(path: str) -> Dict[str, str]: @staticmethod def stream_object_path( - project: str, location: str, stream: str, object: str, + project: str, + location: str, + stream: str, + object: str, ) -> str: """Returns a fully-qualified stream_object string.""" return "projects/{project}/locations/{location}/streams/{stream}/objects/{object}".format( - project=project, location=location, stream=stream, object=object, + project=project, + location=location, + stream=stream, + object=object, ) @staticmethod @@ -270,7 +300,9 @@ def parse_stream_object_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def common_billing_account_path(billing_account: str,) -> str: + def common_billing_account_path( + billing_account: str, + ) -> str: """Returns a fully-qualified billing_account string.""" return "billingAccounts/{billing_account}".format( billing_account=billing_account, @@ -283,9 +315,13 @@ def parse_common_billing_account_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def common_folder_path(folder: str,) -> str: + def common_folder_path( + folder: str, + ) -> str: """Returns a fully-qualified folder string.""" - return "folders/{folder}".format(folder=folder,) + return "folders/{folder}".format( + folder=folder, + ) @staticmethod def parse_common_folder_path(path: str) -> Dict[str, str]: @@ -294,9 +330,13 @@ def parse_common_folder_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def common_organization_path(organization: str,) -> str: + def common_organization_path( + organization: str, + ) -> str: """Returns a fully-qualified organization string.""" - return "organizations/{organization}".format(organization=organization,) + return "organizations/{organization}".format( + organization=organization, + ) @staticmethod def parse_common_organization_path(path: str) -> Dict[str, str]: @@ -305,9 +345,13 @@ def parse_common_organization_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def common_project_path(project: str,) -> str: + def common_project_path( + project: str, + ) -> str: """Returns a fully-qualified project string.""" - return "projects/{project}".format(project=project,) + return "projects/{project}".format( + project=project, + ) @staticmethod def parse_common_project_path(path: str) -> Dict[str, str]: @@ -316,10 +360,14 @@ def parse_common_project_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def common_location_path(project: str, location: str,) -> str: + def common_location_path( + project: str, + location: str, + ) -> str: """Returns a fully-qualified location string.""" return "projects/{project}/locations/{location}".format( - project=project, location=location, + project=project, + location=location, ) @staticmethod @@ -584,12 +632,20 @@ def sample_list_connection_profiles(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # This method is paged; wrap the response in a pager, which provides # an `__iter__` convenience method. response = pagers.ListConnectionProfilesPager( - method=rpc, request=request, response=response, metadata=metadata, + method=rpc, + request=request, + response=response, + metadata=metadata, ) # Done; return the response. @@ -683,7 +739,12 @@ def sample_get_connection_profile(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -812,7 +873,12 @@ def sample_create_connection_profile(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Wrap the response in an operation future. response = operation.from_gapic( @@ -943,7 +1009,12 @@ def sample_update_connection_profile(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Wrap the response in an operation future. response = operation.from_gapic( @@ -1060,7 +1131,12 @@ def sample_delete_connection_profile(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Wrap the response in an operation future. response = operation.from_gapic( @@ -1151,7 +1227,12 @@ def sample_discover_connection_profile(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -1245,12 +1326,20 @@ def sample_list_streams(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # This method is paged; wrap the response in a pager, which provides # an `__iter__` convenience method. response = pagers.ListStreamsPager( - method=rpc, request=request, response=response, metadata=metadata, + method=rpc, + request=request, + response=response, + metadata=metadata, ) # Done; return the response. @@ -1341,7 +1430,12 @@ def sample_get_stream(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -1464,7 +1558,12 @@ def sample_create_stream(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Wrap the response in an operation future. response = operation.from_gapic( @@ -1593,7 +1692,12 @@ def sample_update_stream(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Wrap the response in an operation future. response = operation.from_gapic( @@ -1708,7 +1812,12 @@ def sample_delete_stream(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Wrap the response in an operation future. response = operation.from_gapic( @@ -1806,7 +1915,12 @@ def sample_get_stream_object(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -1882,7 +1996,12 @@ def sample_lookup_stream_object(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -1978,12 +2097,20 @@ def sample_list_stream_objects(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # This method is paged; wrap the response in a pager, which provides # an `__iter__` convenience method. response = pagers.ListStreamObjectsPager( - method=rpc, request=request, response=response, metadata=metadata, + method=rpc, + request=request, + response=response, + metadata=metadata, ) # Done; return the response. @@ -2078,7 +2205,12 @@ def sample_start_backfill_job(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -2171,7 +2303,12 @@ def sample_stop_backfill_job(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -2268,12 +2405,20 @@ def sample_fetch_static_ips(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # This method is paged; wrap the response in a pager, which provides # an `__iter__` convenience method. response = pagers.FetchStaticIpsPager( - method=rpc, request=request, response=response, metadata=metadata, + method=rpc, + request=request, + response=response, + metadata=metadata, ) # Done; return the response. @@ -2399,7 +2544,12 @@ def sample_create_private_connection(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Wrap the response in an operation future. response = operation.from_gapic( @@ -2501,7 +2651,12 @@ def sample_get_private_connection(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -2598,12 +2753,20 @@ def sample_list_private_connections(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # This method is paged; wrap the response in a pager, which provides # an `__iter__` convenience method. response = pagers.ListPrivateConnectionsPager( - method=rpc, request=request, response=response, metadata=metadata, + method=rpc, + request=request, + response=response, + metadata=metadata, ) # Done; return the response. @@ -2715,7 +2878,12 @@ def sample_delete_private_connection(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Wrap the response in an operation future. response = operation.from_gapic( @@ -2844,7 +3012,12 @@ def sample_create_route(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Wrap the response in an operation future. response = operation.from_gapic( @@ -2943,7 +3116,12 @@ def sample_get_route(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -3037,12 +3215,20 @@ def sample_list_routes(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # This method is paged; wrap the response in a pager, which provides # an `__iter__` convenience method. response = pagers.ListRoutesPager( - method=rpc, request=request, response=response, metadata=metadata, + method=rpc, + request=request, + response=response, + metadata=metadata, ) # Done; return the response. @@ -3149,7 +3335,12 @@ def sample_delete_route(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Wrap the response in an operation future. response = operation.from_gapic( diff --git a/google/cloud/datastream_v1/services/datastream/transports/base.py b/google/cloud/datastream_v1/services/datastream/transports/base.py index 6be6f26..8034d62 100644 --- a/google/cloud/datastream_v1/services/datastream/transports/base.py +++ b/google/cloud/datastream_v1/services/datastream/transports/base.py @@ -154,22 +154,34 @@ def _prep_wrapped_messages(self, client_info): client_info=client_info, ), self.list_streams: gapic_v1.method.wrap_method( - self.list_streams, default_timeout=None, client_info=client_info, + self.list_streams, + default_timeout=None, + client_info=client_info, ), self.get_stream: gapic_v1.method.wrap_method( - self.get_stream, default_timeout=None, client_info=client_info, + self.get_stream, + default_timeout=None, + client_info=client_info, ), self.create_stream: gapic_v1.method.wrap_method( - self.create_stream, default_timeout=60.0, client_info=client_info, + self.create_stream, + default_timeout=60.0, + client_info=client_info, ), self.update_stream: gapic_v1.method.wrap_method( - self.update_stream, default_timeout=60.0, client_info=client_info, + self.update_stream, + default_timeout=60.0, + client_info=client_info, ), self.delete_stream: gapic_v1.method.wrap_method( - self.delete_stream, default_timeout=60.0, client_info=client_info, + self.delete_stream, + default_timeout=60.0, + client_info=client_info, ), self.get_stream_object: gapic_v1.method.wrap_method( - self.get_stream_object, default_timeout=None, client_info=client_info, + self.get_stream_object, + default_timeout=None, + client_info=client_info, ), self.lookup_stream_object: gapic_v1.method.wrap_method( self.lookup_stream_object, @@ -177,16 +189,24 @@ def _prep_wrapped_messages(self, client_info): client_info=client_info, ), self.list_stream_objects: gapic_v1.method.wrap_method( - self.list_stream_objects, default_timeout=None, client_info=client_info, + self.list_stream_objects, + default_timeout=None, + client_info=client_info, ), self.start_backfill_job: gapic_v1.method.wrap_method( - self.start_backfill_job, default_timeout=None, client_info=client_info, + self.start_backfill_job, + default_timeout=None, + client_info=client_info, ), self.stop_backfill_job: gapic_v1.method.wrap_method( - self.stop_backfill_job, default_timeout=None, client_info=client_info, + self.stop_backfill_job, + default_timeout=None, + client_info=client_info, ), self.fetch_static_ips: gapic_v1.method.wrap_method( - self.fetch_static_ips, default_timeout=None, client_info=client_info, + self.fetch_static_ips, + default_timeout=None, + client_info=client_info, ), self.create_private_connection: gapic_v1.method.wrap_method( self.create_private_connection, @@ -209,25 +229,33 @@ def _prep_wrapped_messages(self, client_info): client_info=client_info, ), self.create_route: gapic_v1.method.wrap_method( - self.create_route, default_timeout=60.0, client_info=client_info, + self.create_route, + default_timeout=60.0, + client_info=client_info, ), self.get_route: gapic_v1.method.wrap_method( - self.get_route, default_timeout=None, client_info=client_info, + self.get_route, + default_timeout=None, + client_info=client_info, ), self.list_routes: gapic_v1.method.wrap_method( - self.list_routes, default_timeout=None, client_info=client_info, + self.list_routes, + default_timeout=None, + client_info=client_info, ), self.delete_route: gapic_v1.method.wrap_method( - self.delete_route, default_timeout=60.0, client_info=client_info, + self.delete_route, + default_timeout=60.0, + client_info=client_info, ), } def close(self): """Closes resources associated with the transport. - .. warning:: - Only call this method if the transport is NOT shared - with other clients - this may cause errors in other clients! + .. warning:: + Only call this method if the transport is NOT shared + with other clients - this may cause errors in other clients! """ raise NotImplementedError() diff --git a/google/cloud/datastream_v1/services/datastream/transports/grpc.py b/google/cloud/datastream_v1/services/datastream/transports/grpc.py index e9b279d..58201b4 100644 --- a/google/cloud/datastream_v1/services/datastream/transports/grpc.py +++ b/google/cloud/datastream_v1/services/datastream/transports/grpc.py @@ -228,8 +228,7 @@ def create_channel( @property def grpc_channel(self) -> grpc.Channel: - """Return the channel designed to connect to this service. - """ + """Return the channel designed to connect to this service.""" return self._grpc_channel @property diff --git a/google/cloud/datastream_v1/types/datastream.py b/google/cloud/datastream_v1/types/datastream.py index 1e57cc0..27db130 100644 --- a/google/cloud/datastream_v1/types/datastream.py +++ b/google/cloud/datastream_v1/types/datastream.py @@ -108,16 +108,31 @@ class DiscoverConnectionProfileRequest(proto.Message): This field is a member of `oneof`_ ``data_object``. """ - parent = proto.Field(proto.STRING, number=1,) + parent = proto.Field( + proto.STRING, + number=1, + ) connection_profile = proto.Field( proto.MESSAGE, number=200, oneof="target", message=datastream_resources.ConnectionProfile, ) - connection_profile_name = proto.Field(proto.STRING, number=201, oneof="target",) - full_hierarchy = proto.Field(proto.BOOL, number=3, oneof="hierarchy",) - hierarchy_depth = proto.Field(proto.INT32, number=4, oneof="hierarchy",) + connection_profile_name = proto.Field( + proto.STRING, + number=201, + oneof="target", + ) + full_hierarchy = proto.Field( + proto.BOOL, + number=3, + oneof="hierarchy", + ) + hierarchy_depth = proto.Field( + proto.INT32, + number=4, + oneof="hierarchy", + ) oracle_rdbms = proto.Field( proto.MESSAGE, number=100, @@ -183,9 +198,18 @@ class FetchStaticIpsRequest(proto.Message): call. will likely not be specified. """ - name = proto.Field(proto.STRING, number=1,) - page_size = proto.Field(proto.INT32, number=2,) - page_token = proto.Field(proto.STRING, number=3,) + name = proto.Field( + proto.STRING, + number=1, + ) + page_size = proto.Field( + proto.INT32, + number=2, + ) + page_token = proto.Field( + proto.STRING, + number=3, + ) class FetchStaticIpsResponse(proto.Message): @@ -204,8 +228,14 @@ class FetchStaticIpsResponse(proto.Message): def raw_page(self): return self - static_ips = proto.RepeatedField(proto.STRING, number=1,) - next_page_token = proto.Field(proto.STRING, number=2,) + static_ips = proto.RepeatedField( + proto.STRING, + number=1, + ) + next_page_token = proto.Field( + proto.STRING, + number=2, + ) class ListConnectionProfilesRequest(proto.Message): @@ -234,11 +264,26 @@ class ListConnectionProfilesRequest(proto.Message): Order by fields for the result. """ - parent = proto.Field(proto.STRING, number=1,) - page_size = proto.Field(proto.INT32, number=2,) - page_token = proto.Field(proto.STRING, number=3,) - filter = proto.Field(proto.STRING, number=4,) - order_by = proto.Field(proto.STRING, number=5,) + parent = proto.Field( + proto.STRING, + number=1, + ) + page_size = proto.Field( + proto.INT32, + number=2, + ) + page_token = proto.Field( + proto.STRING, + number=3, + ) + filter = proto.Field( + proto.STRING, + number=4, + ) + order_by = proto.Field( + proto.STRING, + number=5, + ) class ListConnectionProfilesResponse(proto.Message): @@ -260,10 +305,18 @@ def raw_page(self): return self connection_profiles = proto.RepeatedField( - proto.MESSAGE, number=1, message=datastream_resources.ConnectionProfile, + proto.MESSAGE, + number=1, + message=datastream_resources.ConnectionProfile, + ) + next_page_token = proto.Field( + proto.STRING, + number=2, + ) + unreachable = proto.RepeatedField( + proto.STRING, + number=3, ) - next_page_token = proto.Field(proto.STRING, number=2,) - unreachable = proto.RepeatedField(proto.STRING, number=3,) class GetConnectionProfileRequest(proto.Message): @@ -275,7 +328,10 @@ class GetConnectionProfileRequest(proto.Message): resource to get. """ - name = proto.Field(proto.STRING, number=1,) + name = proto.Field( + proto.STRING, + number=1, + ) class CreateConnectionProfileRequest(proto.Message): @@ -317,14 +373,31 @@ class CreateConnectionProfileRequest(proto.Message): without validating it. """ - parent = proto.Field(proto.STRING, number=1,) - connection_profile_id = proto.Field(proto.STRING, number=2,) + parent = proto.Field( + proto.STRING, + number=1, + ) + connection_profile_id = proto.Field( + proto.STRING, + number=2, + ) connection_profile = proto.Field( - proto.MESSAGE, number=3, message=datastream_resources.ConnectionProfile, + proto.MESSAGE, + number=3, + message=datastream_resources.ConnectionProfile, + ) + request_id = proto.Field( + proto.STRING, + number=4, + ) + validate_only = proto.Field( + proto.BOOL, + number=5, + ) + force = proto.Field( + proto.BOOL, + number=6, ) - request_id = proto.Field(proto.STRING, number=4,) - validate_only = proto.Field(proto.BOOL, number=5,) - force = proto.Field(proto.BOOL, number=6,) class UpdateConnectionProfileRequest(proto.Message): @@ -368,14 +441,27 @@ class UpdateConnectionProfileRequest(proto.Message): """ update_mask = proto.Field( - proto.MESSAGE, number=1, message=field_mask_pb2.FieldMask, + proto.MESSAGE, + number=1, + message=field_mask_pb2.FieldMask, ) connection_profile = proto.Field( - proto.MESSAGE, number=2, message=datastream_resources.ConnectionProfile, + proto.MESSAGE, + number=2, + message=datastream_resources.ConnectionProfile, + ) + request_id = proto.Field( + proto.STRING, + number=3, + ) + validate_only = proto.Field( + proto.BOOL, + number=4, + ) + force = proto.Field( + proto.BOOL, + number=5, ) - request_id = proto.Field(proto.STRING, number=3,) - validate_only = proto.Field(proto.BOOL, number=4,) - force = proto.Field(proto.BOOL, number=5,) class DeleteConnectionProfileRequest(proto.Message): @@ -405,8 +491,14 @@ class DeleteConnectionProfileRequest(proto.Message): (00000000-0000-0000-0000-000000000000). """ - name = proto.Field(proto.STRING, number=1,) - request_id = proto.Field(proto.STRING, number=2,) + name = proto.Field( + proto.STRING, + number=1, + ) + request_id = proto.Field( + proto.STRING, + number=2, + ) class ListStreamsRequest(proto.Message): @@ -434,11 +526,26 @@ class ListStreamsRequest(proto.Message): Order by fields for the result. """ - parent = proto.Field(proto.STRING, number=1,) - page_size = proto.Field(proto.INT32, number=2,) - page_token = proto.Field(proto.STRING, number=3,) - filter = proto.Field(proto.STRING, number=4,) - order_by = proto.Field(proto.STRING, number=5,) + parent = proto.Field( + proto.STRING, + number=1, + ) + page_size = proto.Field( + proto.INT32, + number=2, + ) + page_token = proto.Field( + proto.STRING, + number=3, + ) + filter = proto.Field( + proto.STRING, + number=4, + ) + order_by = proto.Field( + proto.STRING, + number=5, + ) class ListStreamsResponse(proto.Message): @@ -460,10 +567,18 @@ def raw_page(self): return self streams = proto.RepeatedField( - proto.MESSAGE, number=1, message=datastream_resources.Stream, + proto.MESSAGE, + number=1, + message=datastream_resources.Stream, + ) + next_page_token = proto.Field( + proto.STRING, + number=2, + ) + unreachable = proto.RepeatedField( + proto.STRING, + number=3, ) - next_page_token = proto.Field(proto.STRING, number=2,) - unreachable = proto.RepeatedField(proto.STRING, number=3,) class GetStreamRequest(proto.Message): @@ -475,7 +590,10 @@ class GetStreamRequest(proto.Message): get. """ - name = proto.Field(proto.STRING, number=1,) + name = proto.Field( + proto.STRING, + number=1, + ) class CreateStreamRequest(proto.Message): @@ -515,12 +633,31 @@ class CreateStreamRequest(proto.Message): validating it. """ - parent = proto.Field(proto.STRING, number=1,) - stream_id = proto.Field(proto.STRING, number=2,) - stream = proto.Field(proto.MESSAGE, number=3, message=datastream_resources.Stream,) - request_id = proto.Field(proto.STRING, number=4,) - validate_only = proto.Field(proto.BOOL, number=5,) - force = proto.Field(proto.BOOL, number=6,) + parent = proto.Field( + proto.STRING, + number=1, + ) + stream_id = proto.Field( + proto.STRING, + number=2, + ) + stream = proto.Field( + proto.MESSAGE, + number=3, + message=datastream_resources.Stream, + ) + request_id = proto.Field( + proto.STRING, + number=4, + ) + validate_only = proto.Field( + proto.BOOL, + number=5, + ) + force = proto.Field( + proto.BOOL, + number=6, + ) class UpdateStreamRequest(proto.Message): @@ -564,12 +701,27 @@ class UpdateStreamRequest(proto.Message): """ update_mask = proto.Field( - proto.MESSAGE, number=1, message=field_mask_pb2.FieldMask, + proto.MESSAGE, + number=1, + message=field_mask_pb2.FieldMask, + ) + stream = proto.Field( + proto.MESSAGE, + number=2, + message=datastream_resources.Stream, + ) + request_id = proto.Field( + proto.STRING, + number=3, + ) + validate_only = proto.Field( + proto.BOOL, + number=4, + ) + force = proto.Field( + proto.BOOL, + number=5, ) - stream = proto.Field(proto.MESSAGE, number=2, message=datastream_resources.Stream,) - request_id = proto.Field(proto.STRING, number=3,) - validate_only = proto.Field(proto.BOOL, number=4,) - force = proto.Field(proto.BOOL, number=5,) class DeleteStreamRequest(proto.Message): @@ -599,8 +751,14 @@ class DeleteStreamRequest(proto.Message): (00000000-0000-0000-0000-000000000000). """ - name = proto.Field(proto.STRING, number=1,) - request_id = proto.Field(proto.STRING, number=2,) + name = proto.Field( + proto.STRING, + number=1, + ) + request_id = proto.Field( + proto.STRING, + number=2, + ) class GetStreamObjectRequest(proto.Message): @@ -612,7 +770,10 @@ class GetStreamObjectRequest(proto.Message): resource to get. """ - name = proto.Field(proto.STRING, number=1,) + name = proto.Field( + proto.STRING, + number=1, + ) class LookupStreamObjectRequest(proto.Message): @@ -628,9 +789,14 @@ class LookupStreamObjectRequest(proto.Message): maps to the stream object. """ - parent = proto.Field(proto.STRING, number=1,) + parent = proto.Field( + proto.STRING, + number=1, + ) source_object_identifier = proto.Field( - proto.MESSAGE, number=2, message=datastream_resources.SourceObjectIdentifier, + proto.MESSAGE, + number=2, + message=datastream_resources.SourceObjectIdentifier, ) @@ -644,7 +810,10 @@ class StartBackfillJobRequest(proto.Message): resource to start a backfill job for. """ - object_ = proto.Field(proto.STRING, number=1,) + object_ = proto.Field( + proto.STRING, + number=1, + ) class StartBackfillJobResponse(proto.Message): @@ -658,7 +827,9 @@ class StartBackfillJobResponse(proto.Message): """ object_ = proto.Field( - proto.MESSAGE, number=1, message=datastream_resources.StreamObject, + proto.MESSAGE, + number=1, + message=datastream_resources.StreamObject, ) @@ -672,7 +843,10 @@ class StopBackfillJobRequest(proto.Message): resource to stop the backfill job for. """ - object_ = proto.Field(proto.STRING, number=1,) + object_ = proto.Field( + proto.STRING, + number=1, + ) class StopBackfillJobResponse(proto.Message): @@ -686,7 +860,9 @@ class StopBackfillJobResponse(proto.Message): """ object_ = proto.Field( - proto.MESSAGE, number=1, message=datastream_resources.StreamObject, + proto.MESSAGE, + number=1, + message=datastream_resources.StreamObject, ) @@ -711,9 +887,18 @@ class ListStreamObjectsRequest(proto.Message): provided the page token. """ - parent = proto.Field(proto.STRING, number=1,) - page_size = proto.Field(proto.INT32, number=2,) - page_token = proto.Field(proto.STRING, number=3,) + parent = proto.Field( + proto.STRING, + number=1, + ) + page_size = proto.Field( + proto.INT32, + number=2, + ) + page_token = proto.Field( + proto.STRING, + number=3, + ) class ListStreamObjectsResponse(proto.Message): @@ -732,9 +917,14 @@ def raw_page(self): return self stream_objects = proto.RepeatedField( - proto.MESSAGE, number=1, message=datastream_resources.StreamObject, + proto.MESSAGE, + number=1, + message=datastream_resources.StreamObject, + ) + next_page_token = proto.Field( + proto.STRING, + number=2, ) - next_page_token = proto.Field(proto.STRING, number=2,) class OperationMetadata(proto.Message): @@ -770,15 +960,40 @@ class OperationMetadata(proto.Message): if there are any. """ - create_time = proto.Field(proto.MESSAGE, number=1, message=timestamp_pb2.Timestamp,) - end_time = proto.Field(proto.MESSAGE, number=2, message=timestamp_pb2.Timestamp,) - target = proto.Field(proto.STRING, number=3,) - verb = proto.Field(proto.STRING, number=4,) - status_message = proto.Field(proto.STRING, number=5,) - requested_cancellation = proto.Field(proto.BOOL, number=6,) - api_version = proto.Field(proto.STRING, number=7,) + create_time = proto.Field( + proto.MESSAGE, + number=1, + message=timestamp_pb2.Timestamp, + ) + end_time = proto.Field( + proto.MESSAGE, + number=2, + message=timestamp_pb2.Timestamp, + ) + target = proto.Field( + proto.STRING, + number=3, + ) + verb = proto.Field( + proto.STRING, + number=4, + ) + status_message = proto.Field( + proto.STRING, + number=5, + ) + requested_cancellation = proto.Field( + proto.BOOL, + number=6, + ) + api_version = proto.Field( + proto.STRING, + number=7, + ) validation_result = proto.Field( - proto.MESSAGE, number=8, message=datastream_resources.ValidationResult, + proto.MESSAGE, + number=8, + message=datastream_resources.ValidationResult, ) @@ -815,12 +1030,23 @@ class CreatePrivateConnectionRequest(proto.Message): (00000000-0000-0000-0000-000000000000). """ - parent = proto.Field(proto.STRING, number=1,) - private_connection_id = proto.Field(proto.STRING, number=2,) + parent = proto.Field( + proto.STRING, + number=1, + ) + private_connection_id = proto.Field( + proto.STRING, + number=2, + ) private_connection = proto.Field( - proto.MESSAGE, number=3, message=datastream_resources.PrivateConnection, + proto.MESSAGE, + number=3, + message=datastream_resources.PrivateConnection, + ) + request_id = proto.Field( + proto.STRING, + number=4, ) - request_id = proto.Field(proto.STRING, number=4,) class ListPrivateConnectionsRequest(proto.Message): @@ -850,11 +1076,26 @@ class ListPrivateConnectionsRequest(proto.Message): Order by fields for the result. """ - parent = proto.Field(proto.STRING, number=1,) - page_size = proto.Field(proto.INT32, number=2,) - page_token = proto.Field(proto.STRING, number=3,) - filter = proto.Field(proto.STRING, number=4,) - order_by = proto.Field(proto.STRING, number=5,) + parent = proto.Field( + proto.STRING, + number=1, + ) + page_size = proto.Field( + proto.INT32, + number=2, + ) + page_token = proto.Field( + proto.STRING, + number=3, + ) + filter = proto.Field( + proto.STRING, + number=4, + ) + order_by = proto.Field( + proto.STRING, + number=5, + ) class ListPrivateConnectionsResponse(proto.Message): @@ -877,10 +1118,18 @@ def raw_page(self): return self private_connections = proto.RepeatedField( - proto.MESSAGE, number=1, message=datastream_resources.PrivateConnection, + proto.MESSAGE, + number=1, + message=datastream_resources.PrivateConnection, + ) + next_page_token = proto.Field( + proto.STRING, + number=2, + ) + unreachable = proto.RepeatedField( + proto.STRING, + number=3, ) - next_page_token = proto.Field(proto.STRING, number=2,) - unreachable = proto.RepeatedField(proto.STRING, number=3,) class DeletePrivateConnectionRequest(proto.Message): @@ -914,9 +1163,18 @@ class DeletePrivateConnectionRequest(proto.Message): be deleted. """ - name = proto.Field(proto.STRING, number=1,) - request_id = proto.Field(proto.STRING, number=2,) - force = proto.Field(proto.BOOL, number=3,) + name = proto.Field( + proto.STRING, + number=1, + ) + request_id = proto.Field( + proto.STRING, + number=2, + ) + force = proto.Field( + proto.BOOL, + number=3, + ) class GetPrivateConnectionRequest(proto.Message): @@ -928,7 +1186,10 @@ class GetPrivateConnectionRequest(proto.Message): connectivity configuration to get. """ - name = proto.Field(proto.STRING, number=1,) + name = proto.Field( + proto.STRING, + number=1, + ) class CreateRouteRequest(proto.Message): @@ -962,10 +1223,23 @@ class CreateRouteRequest(proto.Message): (00000000-0000-0000-0000-000000000000). """ - parent = proto.Field(proto.STRING, number=1,) - route_id = proto.Field(proto.STRING, number=2,) - route = proto.Field(proto.MESSAGE, number=3, message=datastream_resources.Route,) - request_id = proto.Field(proto.STRING, number=4,) + parent = proto.Field( + proto.STRING, + number=1, + ) + route_id = proto.Field( + proto.STRING, + number=2, + ) + route = proto.Field( + proto.MESSAGE, + number=3, + message=datastream_resources.Route, + ) + request_id = proto.Field( + proto.STRING, + number=4, + ) class ListRoutesRequest(proto.Message): @@ -994,11 +1268,26 @@ class ListRoutesRequest(proto.Message): Order by fields for the result. """ - parent = proto.Field(proto.STRING, number=1,) - page_size = proto.Field(proto.INT32, number=2,) - page_token = proto.Field(proto.STRING, number=3,) - filter = proto.Field(proto.STRING, number=4,) - order_by = proto.Field(proto.STRING, number=5,) + parent = proto.Field( + proto.STRING, + number=1, + ) + page_size = proto.Field( + proto.INT32, + number=2, + ) + page_token = proto.Field( + proto.STRING, + number=3, + ) + filter = proto.Field( + proto.STRING, + number=4, + ) + order_by = proto.Field( + proto.STRING, + number=5, + ) class ListRoutesResponse(proto.Message): @@ -1020,10 +1309,18 @@ def raw_page(self): return self routes = proto.RepeatedField( - proto.MESSAGE, number=1, message=datastream_resources.Route, + proto.MESSAGE, + number=1, + message=datastream_resources.Route, + ) + next_page_token = proto.Field( + proto.STRING, + number=2, + ) + unreachable = proto.RepeatedField( + proto.STRING, + number=3, ) - next_page_token = proto.Field(proto.STRING, number=2,) - unreachable = proto.RepeatedField(proto.STRING, number=3,) class DeleteRouteRequest(proto.Message): @@ -1053,8 +1350,14 @@ class DeleteRouteRequest(proto.Message): (00000000-0000-0000-0000-000000000000). """ - name = proto.Field(proto.STRING, number=1,) - request_id = proto.Field(proto.STRING, number=2,) + name = proto.Field( + proto.STRING, + number=1, + ) + request_id = proto.Field( + proto.STRING, + number=2, + ) class GetRouteRequest(proto.Message): @@ -1066,7 +1369,10 @@ class GetRouteRequest(proto.Message): get. """ - name = proto.Field(proto.STRING, number=1,) + name = proto.Field( + proto.STRING, + number=1, + ) __all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/google/cloud/datastream_v1/types/datastream_resources.py b/google/cloud/datastream_v1/types/datastream_resources.py index 71eab25..4d17579 100644 --- a/google/cloud/datastream_v1/types/datastream_resources.py +++ b/google/cloud/datastream_v1/types/datastream_resources.py @@ -79,12 +79,31 @@ class OracleProfile(proto.Message): Connection string attributes """ - hostname = proto.Field(proto.STRING, number=1,) - port = proto.Field(proto.INT32, number=2,) - username = proto.Field(proto.STRING, number=3,) - password = proto.Field(proto.STRING, number=4,) - database_service = proto.Field(proto.STRING, number=5,) - connection_attributes = proto.MapField(proto.STRING, proto.STRING, number=6,) + hostname = proto.Field( + proto.STRING, + number=1, + ) + port = proto.Field( + proto.INT32, + number=2, + ) + username = proto.Field( + proto.STRING, + number=3, + ) + password = proto.Field( + proto.STRING, + number=4, + ) + database_service = proto.Field( + proto.STRING, + number=5, + ) + connection_attributes = proto.MapField( + proto.STRING, + proto.STRING, + number=6, + ) class MysqlProfile(proto.Message): @@ -105,11 +124,27 @@ class MysqlProfile(proto.Message): SSL configuration for the MySQL connection. """ - hostname = proto.Field(proto.STRING, number=1,) - port = proto.Field(proto.INT32, number=2,) - username = proto.Field(proto.STRING, number=3,) - password = proto.Field(proto.STRING, number=4,) - ssl_config = proto.Field(proto.MESSAGE, number=5, message="MysqlSslConfig",) + hostname = proto.Field( + proto.STRING, + number=1, + ) + port = proto.Field( + proto.INT32, + number=2, + ) + username = proto.Field( + proto.STRING, + number=3, + ) + password = proto.Field( + proto.STRING, + number=4, + ) + ssl_config = proto.Field( + proto.MESSAGE, + number=5, + message="MysqlSslConfig", + ) class GcsProfile(proto.Message): @@ -123,13 +158,18 @@ class GcsProfile(proto.Message): bucket. """ - bucket = proto.Field(proto.STRING, number=1,) - root_path = proto.Field(proto.STRING, number=2,) + bucket = proto.Field( + proto.STRING, + number=1, + ) + root_path = proto.Field( + proto.STRING, + number=2, + ) class StaticServiceIpConnectivity(proto.Message): - r"""Static IP address connectivity. - """ + r"""Static IP address connectivity.""" class ForwardSshTunnelConnectivity(proto.Message): @@ -159,11 +199,28 @@ class ForwardSshTunnelConnectivity(proto.Message): This field is a member of `oneof`_ ``authentication_method``. """ - hostname = proto.Field(proto.STRING, number=1,) - username = proto.Field(proto.STRING, number=2,) - port = proto.Field(proto.INT32, number=3,) - password = proto.Field(proto.STRING, number=100, oneof="authentication_method",) - private_key = proto.Field(proto.STRING, number=101, oneof="authentication_method",) + hostname = proto.Field( + proto.STRING, + number=1, + ) + username = proto.Field( + proto.STRING, + number=2, + ) + port = proto.Field( + proto.INT32, + number=3, + ) + password = proto.Field( + proto.STRING, + number=100, + oneof="authentication_method", + ) + private_key = proto.Field( + proto.STRING, + number=101, + oneof="authentication_method", + ) class VpcPeeringConfig(proto.Message): @@ -180,8 +237,14 @@ class VpcPeeringConfig(proto.Message): /29) """ - vpc = proto.Field(proto.STRING, number=1,) - subnet = proto.Field(proto.STRING, number=2,) + vpc = proto.Field( + proto.STRING, + number=1, + ) + subnet = proto.Field( + proto.STRING, + number=2, + ) class PrivateConnection(proto.Message): @@ -218,15 +281,43 @@ class State(proto.Enum): DELETING = 4 FAILED_TO_DELETE = 5 - name = proto.Field(proto.STRING, number=1,) - create_time = proto.Field(proto.MESSAGE, number=2, message=timestamp_pb2.Timestamp,) - update_time = proto.Field(proto.MESSAGE, number=3, message=timestamp_pb2.Timestamp,) - labels = proto.MapField(proto.STRING, proto.STRING, number=4,) - display_name = proto.Field(proto.STRING, number=5,) - state = proto.Field(proto.ENUM, number=6, enum=State,) - error = proto.Field(proto.MESSAGE, number=7, message="Error",) + name = proto.Field( + proto.STRING, + number=1, + ) + create_time = proto.Field( + proto.MESSAGE, + number=2, + message=timestamp_pb2.Timestamp, + ) + update_time = proto.Field( + proto.MESSAGE, + number=3, + message=timestamp_pb2.Timestamp, + ) + labels = proto.MapField( + proto.STRING, + proto.STRING, + number=4, + ) + display_name = proto.Field( + proto.STRING, + number=5, + ) + state = proto.Field( + proto.ENUM, + number=6, + enum=State, + ) + error = proto.Field( + proto.MESSAGE, + number=7, + message="Error", + ) vpc_peering_config = proto.Field( - proto.MESSAGE, number=100, message="VpcPeeringConfig", + proto.MESSAGE, + number=100, + message="VpcPeeringConfig", ) @@ -240,7 +331,10 @@ class PrivateConnectivity(proto.Message): ``projects/{project}/locations/{location}/privateConnections/{name}`` """ - private_connection = proto.Field(proto.STRING, number=1,) + private_connection = proto.Field( + proto.STRING, + number=1, + ) class Route(proto.Message): @@ -264,13 +358,37 @@ class Route(proto.Message): Destination port for connection """ - name = proto.Field(proto.STRING, number=1,) - create_time = proto.Field(proto.MESSAGE, number=2, message=timestamp_pb2.Timestamp,) - update_time = proto.Field(proto.MESSAGE, number=3, message=timestamp_pb2.Timestamp,) - labels = proto.MapField(proto.STRING, proto.STRING, number=4,) - display_name = proto.Field(proto.STRING, number=5,) - destination_address = proto.Field(proto.STRING, number=6,) - destination_port = proto.Field(proto.INT32, number=7,) + name = proto.Field( + proto.STRING, + number=1, + ) + create_time = proto.Field( + proto.MESSAGE, + number=2, + message=timestamp_pb2.Timestamp, + ) + update_time = proto.Field( + proto.MESSAGE, + number=3, + message=timestamp_pb2.Timestamp, + ) + labels = proto.MapField( + proto.STRING, + proto.STRING, + number=4, + ) + display_name = proto.Field( + proto.STRING, + number=5, + ) + destination_address = proto.Field( + proto.STRING, + number=6, + ) + destination_port = proto.Field( + proto.INT32, + number=7, + ) class MysqlSslConfig(proto.Message): @@ -301,12 +419,30 @@ class MysqlSslConfig(proto.Message): set. """ - client_key = proto.Field(proto.STRING, number=1,) - client_key_set = proto.Field(proto.BOOL, number=2,) - client_certificate = proto.Field(proto.STRING, number=3,) - client_certificate_set = proto.Field(proto.BOOL, number=4,) - ca_certificate = proto.Field(proto.STRING, number=5,) - ca_certificate_set = proto.Field(proto.BOOL, number=6,) + client_key = proto.Field( + proto.STRING, + number=1, + ) + client_key_set = proto.Field( + proto.BOOL, + number=2, + ) + client_certificate = proto.Field( + proto.STRING, + number=3, + ) + client_certificate_set = proto.Field( + proto.BOOL, + number=4, + ) + ca_certificate = proto.Field( + proto.STRING, + number=5, + ) + ca_certificate_set = proto.Field( + proto.BOOL, + number=6, + ) class ConnectionProfile(proto.Message): @@ -358,19 +494,46 @@ class ConnectionProfile(proto.Message): This field is a member of `oneof`_ ``connectivity``. """ - name = proto.Field(proto.STRING, number=1,) - create_time = proto.Field(proto.MESSAGE, number=2, message=timestamp_pb2.Timestamp,) - update_time = proto.Field(proto.MESSAGE, number=3, message=timestamp_pb2.Timestamp,) - labels = proto.MapField(proto.STRING, proto.STRING, number=4,) - display_name = proto.Field(proto.STRING, number=5,) + name = proto.Field( + proto.STRING, + number=1, + ) + create_time = proto.Field( + proto.MESSAGE, + number=2, + message=timestamp_pb2.Timestamp, + ) + update_time = proto.Field( + proto.MESSAGE, + number=3, + message=timestamp_pb2.Timestamp, + ) + labels = proto.MapField( + proto.STRING, + proto.STRING, + number=4, + ) + display_name = proto.Field( + proto.STRING, + number=5, + ) oracle_profile = proto.Field( - proto.MESSAGE, number=100, oneof="profile", message="OracleProfile", + proto.MESSAGE, + number=100, + oneof="profile", + message="OracleProfile", ) gcs_profile = proto.Field( - proto.MESSAGE, number=101, oneof="profile", message="GcsProfile", + proto.MESSAGE, + number=101, + oneof="profile", + message="GcsProfile", ) mysql_profile = proto.Field( - proto.MESSAGE, number=102, oneof="profile", message="MysqlProfile", + proto.MESSAGE, + number=102, + oneof="profile", + message="MysqlProfile", ) static_service_ip_connectivity = proto.Field( proto.MESSAGE, @@ -385,7 +548,10 @@ class ConnectionProfile(proto.Message): message="ForwardSshTunnelConnectivity", ) private_connectivity = proto.Field( - proto.MESSAGE, number=202, oneof="connectivity", message="PrivateConnectivity", + proto.MESSAGE, + number=202, + oneof="connectivity", + message="PrivateConnectivity", ) @@ -416,15 +582,42 @@ class OracleColumn(proto.Message): table. """ - column = proto.Field(proto.STRING, number=1,) - data_type = proto.Field(proto.STRING, number=2,) - length = proto.Field(proto.INT32, number=3,) - precision = proto.Field(proto.INT32, number=4,) - scale = proto.Field(proto.INT32, number=5,) - encoding = proto.Field(proto.STRING, number=6,) - primary_key = proto.Field(proto.BOOL, number=7,) - nullable = proto.Field(proto.BOOL, number=8,) - ordinal_position = proto.Field(proto.INT32, number=9,) + column = proto.Field( + proto.STRING, + number=1, + ) + data_type = proto.Field( + proto.STRING, + number=2, + ) + length = proto.Field( + proto.INT32, + number=3, + ) + precision = proto.Field( + proto.INT32, + number=4, + ) + scale = proto.Field( + proto.INT32, + number=5, + ) + encoding = proto.Field( + proto.STRING, + number=6, + ) + primary_key = proto.Field( + proto.BOOL, + number=7, + ) + nullable = proto.Field( + proto.BOOL, + number=8, + ) + ordinal_position = proto.Field( + proto.INT32, + number=9, + ) class OracleTable(proto.Message): @@ -439,9 +632,14 @@ class OracleTable(proto.Message): lists, includes/excludes everything. """ - table = proto.Field(proto.STRING, number=1,) + table = proto.Field( + proto.STRING, + number=1, + ) oracle_columns = proto.RepeatedField( - proto.MESSAGE, number=2, message="OracleColumn", + proto.MESSAGE, + number=2, + message="OracleColumn", ) @@ -455,8 +653,15 @@ class OracleSchema(proto.Message): Tables in the schema. """ - schema = proto.Field(proto.STRING, number=1,) - oracle_tables = proto.RepeatedField(proto.MESSAGE, number=2, message="OracleTable",) + schema = proto.Field( + proto.STRING, + number=1, + ) + oracle_tables = proto.RepeatedField( + proto.MESSAGE, + number=2, + message="OracleTable", + ) class OracleRdbms(proto.Message): @@ -469,7 +674,9 @@ class OracleRdbms(proto.Message): """ oracle_schemas = proto.RepeatedField( - proto.MESSAGE, number=1, message="OracleSchema", + proto.MESSAGE, + number=1, + message="OracleSchema", ) @@ -483,8 +690,16 @@ class OracleSourceConfig(proto.Message): Oracle objects to exclude from the stream. """ - include_objects = proto.Field(proto.MESSAGE, number=1, message="OracleRdbms",) - exclude_objects = proto.Field(proto.MESSAGE, number=2, message="OracleRdbms",) + include_objects = proto.Field( + proto.MESSAGE, + number=1, + message="OracleRdbms", + ) + exclude_objects = proto.Field( + proto.MESSAGE, + number=2, + message="OracleRdbms", + ) class MysqlColumn(proto.Message): @@ -512,13 +727,34 @@ class MysqlColumn(proto.Message): table. """ - column = proto.Field(proto.STRING, number=1,) - data_type = proto.Field(proto.STRING, number=2,) - length = proto.Field(proto.INT32, number=3,) - collation = proto.Field(proto.STRING, number=4,) - primary_key = proto.Field(proto.BOOL, number=5,) - nullable = proto.Field(proto.BOOL, number=6,) - ordinal_position = proto.Field(proto.INT32, number=7,) + column = proto.Field( + proto.STRING, + number=1, + ) + data_type = proto.Field( + proto.STRING, + number=2, + ) + length = proto.Field( + proto.INT32, + number=3, + ) + collation = proto.Field( + proto.STRING, + number=4, + ) + primary_key = proto.Field( + proto.BOOL, + number=5, + ) + nullable = proto.Field( + proto.BOOL, + number=6, + ) + ordinal_position = proto.Field( + proto.INT32, + number=7, + ) class MysqlTable(proto.Message): @@ -533,8 +769,15 @@ class MysqlTable(proto.Message): lists, includes/excludes everything. """ - table = proto.Field(proto.STRING, number=1,) - mysql_columns = proto.RepeatedField(proto.MESSAGE, number=2, message="MysqlColumn",) + table = proto.Field( + proto.STRING, + number=1, + ) + mysql_columns = proto.RepeatedField( + proto.MESSAGE, + number=2, + message="MysqlColumn", + ) class MysqlDatabase(proto.Message): @@ -547,8 +790,15 @@ class MysqlDatabase(proto.Message): Tables in the database. """ - database = proto.Field(proto.STRING, number=1,) - mysql_tables = proto.RepeatedField(proto.MESSAGE, number=2, message="MysqlTable",) + database = proto.Field( + proto.STRING, + number=1, + ) + mysql_tables = proto.RepeatedField( + proto.MESSAGE, + number=2, + message="MysqlTable", + ) class MysqlRdbms(proto.Message): @@ -560,7 +810,9 @@ class MysqlRdbms(proto.Message): """ mysql_databases = proto.RepeatedField( - proto.MESSAGE, number=1, message="MysqlDatabase", + proto.MESSAGE, + number=1, + message="MysqlDatabase", ) @@ -574,8 +826,16 @@ class MysqlSourceConfig(proto.Message): MySQL objects to exclude from the stream. """ - include_objects = proto.Field(proto.MESSAGE, number=1, message="MysqlRdbms",) - exclude_objects = proto.Field(proto.MESSAGE, number=2, message="MysqlRdbms",) + include_objects = proto.Field( + proto.MESSAGE, + number=1, + message="MysqlRdbms", + ) + exclude_objects = proto.Field( + proto.MESSAGE, + number=2, + message="MysqlRdbms", + ) class SourceConfig(proto.Message): @@ -602,7 +862,10 @@ class SourceConfig(proto.Message): This field is a member of `oneof`_ ``source_stream_config``. """ - source_connection_profile = proto.Field(proto.STRING, number=1,) + source_connection_profile = proto.Field( + proto.STRING, + number=1, + ) oracle_source_config = proto.Field( proto.MESSAGE, number=100, @@ -618,8 +881,7 @@ class SourceConfig(proto.Message): class AvroFileFormat(proto.Message): - r"""AVRO file format configuration. - """ + r"""AVRO file format configuration.""" class JsonFileFormat(proto.Message): @@ -644,8 +906,16 @@ class JsonCompression(proto.Enum): NO_COMPRESSION = 1 GZIP = 2 - schema_file_format = proto.Field(proto.ENUM, number=1, enum=SchemaFileFormat,) - compression = proto.Field(proto.ENUM, number=2, enum=JsonCompression,) + schema_file_format = proto.Field( + proto.ENUM, + number=1, + enum=SchemaFileFormat, + ) + compression = proto.Field( + proto.ENUM, + number=2, + enum=JsonCompression, + ) class GcsDestinationConfig(proto.Message): @@ -679,16 +949,30 @@ class GcsDestinationConfig(proto.Message): This field is a member of `oneof`_ ``file_format``. """ - path = proto.Field(proto.STRING, number=1,) - file_rotation_mb = proto.Field(proto.INT32, number=2,) + path = proto.Field( + proto.STRING, + number=1, + ) + file_rotation_mb = proto.Field( + proto.INT32, + number=2, + ) file_rotation_interval = proto.Field( - proto.MESSAGE, number=3, message=duration_pb2.Duration, + proto.MESSAGE, + number=3, + message=duration_pb2.Duration, ) avro_file_format = proto.Field( - proto.MESSAGE, number=100, oneof="file_format", message="AvroFileFormat", + proto.MESSAGE, + number=100, + oneof="file_format", + message="AvroFileFormat", ) json_file_format = proto.Field( - proto.MESSAGE, number=101, oneof="file_format", message="JsonFileFormat", + proto.MESSAGE, + number=101, + oneof="file_format", + message="JsonFileFormat", ) @@ -708,7 +992,10 @@ class DestinationConfig(proto.Message): This field is a member of `oneof`_ ``destination_stream_config``. """ - destination_connection_profile = proto.Field(proto.STRING, number=1,) + destination_connection_profile = proto.Field( + proto.STRING, + number=1, + ) gcs_destination_config = proto.Field( proto.MESSAGE, number=100, @@ -807,10 +1094,16 @@ class BackfillAllStrategy(proto.Message): """ oracle_excluded_objects = proto.Field( - proto.MESSAGE, number=1, oneof="excluded_objects", message="OracleRdbms", + proto.MESSAGE, + number=1, + oneof="excluded_objects", + message="OracleRdbms", ) mysql_excluded_objects = proto.Field( - proto.MESSAGE, number=2, oneof="excluded_objects", message="MysqlRdbms", + proto.MESSAGE, + number=2, + oneof="excluded_objects", + message="MysqlRdbms", ) class BackfillNoneStrategy(proto.Message): @@ -819,16 +1112,44 @@ class BackfillNoneStrategy(proto.Message): """ - name = proto.Field(proto.STRING, number=1,) - create_time = proto.Field(proto.MESSAGE, number=2, message=timestamp_pb2.Timestamp,) - update_time = proto.Field(proto.MESSAGE, number=3, message=timestamp_pb2.Timestamp,) - labels = proto.MapField(proto.STRING, proto.STRING, number=4,) - display_name = proto.Field(proto.STRING, number=5,) - source_config = proto.Field(proto.MESSAGE, number=6, message="SourceConfig",) + name = proto.Field( + proto.STRING, + number=1, + ) + create_time = proto.Field( + proto.MESSAGE, + number=2, + message=timestamp_pb2.Timestamp, + ) + update_time = proto.Field( + proto.MESSAGE, + number=3, + message=timestamp_pb2.Timestamp, + ) + labels = proto.MapField( + proto.STRING, + proto.STRING, + number=4, + ) + display_name = proto.Field( + proto.STRING, + number=5, + ) + source_config = proto.Field( + proto.MESSAGE, + number=6, + message="SourceConfig", + ) destination_config = proto.Field( - proto.MESSAGE, number=7, message="DestinationConfig", + proto.MESSAGE, + number=7, + message="DestinationConfig", + ) + state = proto.Field( + proto.ENUM, + number=8, + enum=State, ) - state = proto.Field(proto.ENUM, number=8, enum=State,) backfill_all = proto.Field( proto.MESSAGE, number=101, @@ -841,9 +1162,15 @@ class BackfillNoneStrategy(proto.Message): oneof="backfill_strategy", message=BackfillNoneStrategy, ) - errors = proto.RepeatedField(proto.MESSAGE, number=9, message="Error",) + errors = proto.RepeatedField( + proto.MESSAGE, + number=9, + message="Error", + ) customer_managed_encryption_key = proto.Field( - proto.STRING, number=10, optional=True, + proto.STRING, + number=10, + optional=True, ) @@ -869,14 +1196,38 @@ class StreamObject(proto.Message): The object identifier in the data source. """ - name = proto.Field(proto.STRING, number=1,) - create_time = proto.Field(proto.MESSAGE, number=2, message=timestamp_pb2.Timestamp,) - update_time = proto.Field(proto.MESSAGE, number=3, message=timestamp_pb2.Timestamp,) - display_name = proto.Field(proto.STRING, number=5,) - errors = proto.RepeatedField(proto.MESSAGE, number=6, message="Error",) - backfill_job = proto.Field(proto.MESSAGE, number=7, message="BackfillJob",) + name = proto.Field( + proto.STRING, + number=1, + ) + create_time = proto.Field( + proto.MESSAGE, + number=2, + message=timestamp_pb2.Timestamp, + ) + update_time = proto.Field( + proto.MESSAGE, + number=3, + message=timestamp_pb2.Timestamp, + ) + display_name = proto.Field( + proto.STRING, + number=5, + ) + errors = proto.RepeatedField( + proto.MESSAGE, + number=6, + message="Error", + ) + backfill_job = proto.Field( + proto.MESSAGE, + number=7, + message="BackfillJob", + ) source_object = proto.Field( - proto.MESSAGE, number=8, message="SourceObjectIdentifier", + proto.MESSAGE, + number=8, + message="SourceObjectIdentifier", ) @@ -911,8 +1262,14 @@ class OracleObjectIdentifier(proto.Message): Required. The table name. """ - schema = proto.Field(proto.STRING, number=1,) - table = proto.Field(proto.STRING, number=2,) + schema = proto.Field( + proto.STRING, + number=1, + ) + table = proto.Field( + proto.STRING, + number=2, + ) class MysqlObjectIdentifier(proto.Message): r"""Mysql data source object identifier. @@ -924,8 +1281,14 @@ class MysqlObjectIdentifier(proto.Message): Required. The table name. """ - database = proto.Field(proto.STRING, number=1,) - table = proto.Field(proto.STRING, number=2,) + database = proto.Field( + proto.STRING, + number=1, + ) + table = proto.Field( + proto.STRING, + number=2, + ) oracle_identifier = proto.Field( proto.MESSAGE, @@ -975,15 +1338,31 @@ class Trigger(proto.Enum): AUTOMATIC = 1 MANUAL = 2 - state = proto.Field(proto.ENUM, number=1, enum=State,) - trigger = proto.Field(proto.ENUM, number=2, enum=Trigger,) + state = proto.Field( + proto.ENUM, + number=1, + enum=State, + ) + trigger = proto.Field( + proto.ENUM, + number=2, + enum=Trigger, + ) last_start_time = proto.Field( - proto.MESSAGE, number=3, message=timestamp_pb2.Timestamp, + proto.MESSAGE, + number=3, + message=timestamp_pb2.Timestamp, ) last_end_time = proto.Field( - proto.MESSAGE, number=4, message=timestamp_pb2.Timestamp, + proto.MESSAGE, + number=4, + message=timestamp_pb2.Timestamp, + ) + errors = proto.RepeatedField( + proto.MESSAGE, + number=5, + message="Error", ) - errors = proto.RepeatedField(proto.MESSAGE, number=5, message="Error",) class Error(proto.Message): @@ -1006,11 +1385,28 @@ class Error(proto.Message): Additional information about the error. """ - reason = proto.Field(proto.STRING, number=1,) - error_uuid = proto.Field(proto.STRING, number=2,) - message = proto.Field(proto.STRING, number=3,) - error_time = proto.Field(proto.MESSAGE, number=4, message=timestamp_pb2.Timestamp,) - details = proto.MapField(proto.STRING, proto.STRING, number=5,) + reason = proto.Field( + proto.STRING, + number=1, + ) + error_uuid = proto.Field( + proto.STRING, + number=2, + ) + message = proto.Field( + proto.STRING, + number=3, + ) + error_time = proto.Field( + proto.MESSAGE, + number=4, + message=timestamp_pb2.Timestamp, + ) + details = proto.MapField( + proto.STRING, + proto.STRING, + number=5, + ) class ValidationResult(proto.Message): @@ -1022,7 +1418,11 @@ class ValidationResult(proto.Message): as well as not executed validations). """ - validations = proto.RepeatedField(proto.MESSAGE, number=1, message="Validation",) + validations = proto.RepeatedField( + proto.MESSAGE, + number=1, + message="Validation", + ) class Validation(proto.Message): @@ -1046,10 +1446,24 @@ class State(proto.Enum): FAILED = 2 PASSED = 3 - description = proto.Field(proto.STRING, number=1,) - state = proto.Field(proto.ENUM, number=2, enum=State,) - message = proto.RepeatedField(proto.MESSAGE, number=3, message="ValidationMessage",) - code = proto.Field(proto.STRING, number=4,) + description = proto.Field( + proto.STRING, + number=1, + ) + state = proto.Field( + proto.ENUM, + number=2, + enum=State, + ) + message = proto.RepeatedField( + proto.MESSAGE, + number=3, + message="ValidationMessage", + ) + code = proto.Field( + proto.STRING, + number=4, + ) class ValidationMessage(proto.Message): @@ -1073,10 +1487,24 @@ class Level(proto.Enum): WARNING = 1 ERROR = 2 - message = proto.Field(proto.STRING, number=1,) - level = proto.Field(proto.ENUM, number=2, enum=Level,) - metadata = proto.MapField(proto.STRING, proto.STRING, number=3,) - code = proto.Field(proto.STRING, number=4,) + message = proto.Field( + proto.STRING, + number=1, + ) + level = proto.Field( + proto.ENUM, + number=2, + enum=Level, + ) + metadata = proto.MapField( + proto.STRING, + proto.STRING, + number=3, + ) + code = proto.Field( + proto.STRING, + number=4, + ) __all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/google/cloud/datastream_v1alpha1/services/datastream/async_client.py b/google/cloud/datastream_v1alpha1/services/datastream/async_client.py index e9e829c..870277c 100644 --- a/google/cloud/datastream_v1alpha1/services/datastream/async_client.py +++ b/google/cloud/datastream_v1alpha1/services/datastream/async_client.py @@ -300,12 +300,20 @@ def sample_list_connection_profiles(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # This method is paged; wrap the response in a pager, which provides # an `__aiter__` convenience method. response = pagers.ListConnectionProfilesAsyncPager( - method=rpc, request=request, response=response, metadata=metadata, + method=rpc, + request=request, + response=response, + metadata=metadata, ) # Done; return the response. @@ -395,7 +403,12 @@ def sample_get_connection_profile(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -521,7 +534,12 @@ def sample_create_connection_profile(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Wrap the response in an operation future. response = operation_async.from_gapic( @@ -650,7 +668,12 @@ def sample_update_connection_profile(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Wrap the response in an operation future. response = operation_async.from_gapic( @@ -764,7 +787,12 @@ def sample_delete_connection_profile(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Wrap the response in an operation future. response = operation_async.from_gapic( @@ -852,7 +880,12 @@ def sample_discover_connection_profile(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -945,12 +978,20 @@ def sample_list_streams(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # This method is paged; wrap the response in a pager, which provides # an `__aiter__` convenience method. response = pagers.ListStreamsAsyncPager( - method=rpc, request=request, response=response, metadata=metadata, + method=rpc, + request=request, + response=response, + metadata=metadata, ) # Done; return the response. @@ -1038,7 +1079,12 @@ def sample_get_stream(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -1158,7 +1204,12 @@ def sample_create_stream(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Wrap the response in an operation future. response = operation_async.from_gapic( @@ -1284,7 +1335,12 @@ def sample_update_stream(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Wrap the response in an operation future. response = operation_async.from_gapic( @@ -1398,7 +1454,12 @@ def sample_delete_stream(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Wrap the response in an operation future. response = operation_async.from_gapic( @@ -1482,7 +1543,12 @@ def sample_fetch_errors(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Wrap the response in an operation future. response = operation_async.from_gapic( @@ -1588,12 +1654,20 @@ def sample_fetch_static_ips(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # This method is paged; wrap the response in a pager, which provides # an `__aiter__` convenience method. response = pagers.FetchStaticIpsAsyncPager( - method=rpc, request=request, response=response, metadata=metadata, + method=rpc, + request=request, + response=response, + metadata=metadata, ) # Done; return the response. @@ -1716,7 +1790,12 @@ def sample_create_private_connection(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Wrap the response in an operation future. response = operation_async.from_gapic( @@ -1817,7 +1896,12 @@ def sample_get_private_connection(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -1911,12 +1995,20 @@ def sample_list_private_connections(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # This method is paged; wrap the response in a pager, which provides # an `__aiter__` convenience method. response = pagers.ListPrivateConnectionsAsyncPager( - method=rpc, request=request, response=response, metadata=metadata, + method=rpc, + request=request, + response=response, + metadata=metadata, ) # Done; return the response. @@ -2025,7 +2117,12 @@ def sample_delete_private_connection(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Wrap the response in an operation future. response = operation_async.from_gapic( @@ -2155,7 +2252,12 @@ def sample_create_route(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Wrap the response in an operation future. response = operation_async.from_gapic( @@ -2254,7 +2356,12 @@ def sample_get_route(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -2348,12 +2455,20 @@ def sample_list_routes(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # This method is paged; wrap the response in a pager, which provides # an `__aiter__` convenience method. response = pagers.ListRoutesAsyncPager( - method=rpc, request=request, response=response, metadata=metadata, + method=rpc, + request=request, + response=response, + metadata=metadata, ) # Done; return the response. @@ -2460,7 +2575,12 @@ def sample_delete_route(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Wrap the response in an operation future. response = operation_async.from_gapic( diff --git a/google/cloud/datastream_v1alpha1/services/datastream/client.py b/google/cloud/datastream_v1alpha1/services/datastream/client.py index 09df963..a042a5d 100644 --- a/google/cloud/datastream_v1alpha1/services/datastream/client.py +++ b/google/cloud/datastream_v1alpha1/services/datastream/client.py @@ -59,7 +59,10 @@ class DatastreamClientMeta(type): _transport_registry["grpc"] = DatastreamGrpcTransport _transport_registry["grpc_asyncio"] = DatastreamGrpcAsyncIOTransport - def get_transport_class(cls, label: str = None,) -> Type[DatastreamTransport]: + def get_transport_class( + cls, + label: str = None, + ) -> Type[DatastreamTransport]: """Returns an appropriate transport class. Args: @@ -165,11 +168,15 @@ def transport(self) -> DatastreamTransport: @staticmethod def connection_profile_path( - project: str, location: str, connection_profile: str, + project: str, + location: str, + connection_profile: str, ) -> str: """Returns a fully-qualified connection_profile string.""" return "projects/{project}/locations/{location}/connectionProfiles/{connection_profile}".format( - project=project, location=location, connection_profile=connection_profile, + project=project, + location=location, + connection_profile=connection_profile, ) @staticmethod @@ -183,11 +190,15 @@ def parse_connection_profile_path(path: str) -> Dict[str, str]: @staticmethod def private_connection_path( - project: str, location: str, private_connection: str, + project: str, + location: str, + private_connection: str, ) -> str: """Returns a fully-qualified private_connection string.""" return "projects/{project}/locations/{location}/privateConnections/{private_connection}".format( - project=project, location=location, private_connection=private_connection, + project=project, + location=location, + private_connection=private_connection, ) @staticmethod @@ -201,7 +212,10 @@ def parse_private_connection_path(path: str) -> Dict[str, str]: @staticmethod def route_path( - project: str, location: str, private_connection: str, route: str, + project: str, + location: str, + private_connection: str, + route: str, ) -> str: """Returns a fully-qualified route string.""" return "projects/{project}/locations/{location}/privateConnections/{private_connection}/routes/{route}".format( @@ -221,10 +235,16 @@ def parse_route_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def stream_path(project: str, location: str, stream: str,) -> str: + def stream_path( + project: str, + location: str, + stream: str, + ) -> str: """Returns a fully-qualified stream string.""" return "projects/{project}/locations/{location}/streams/{stream}".format( - project=project, location=location, stream=stream, + project=project, + location=location, + stream=stream, ) @staticmethod @@ -237,7 +257,9 @@ def parse_stream_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def common_billing_account_path(billing_account: str,) -> str: + def common_billing_account_path( + billing_account: str, + ) -> str: """Returns a fully-qualified billing_account string.""" return "billingAccounts/{billing_account}".format( billing_account=billing_account, @@ -250,9 +272,13 @@ def parse_common_billing_account_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def common_folder_path(folder: str,) -> str: + def common_folder_path( + folder: str, + ) -> str: """Returns a fully-qualified folder string.""" - return "folders/{folder}".format(folder=folder,) + return "folders/{folder}".format( + folder=folder, + ) @staticmethod def parse_common_folder_path(path: str) -> Dict[str, str]: @@ -261,9 +287,13 @@ def parse_common_folder_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def common_organization_path(organization: str,) -> str: + def common_organization_path( + organization: str, + ) -> str: """Returns a fully-qualified organization string.""" - return "organizations/{organization}".format(organization=organization,) + return "organizations/{organization}".format( + organization=organization, + ) @staticmethod def parse_common_organization_path(path: str) -> Dict[str, str]: @@ -272,9 +302,13 @@ def parse_common_organization_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def common_project_path(project: str,) -> str: + def common_project_path( + project: str, + ) -> str: """Returns a fully-qualified project string.""" - return "projects/{project}".format(project=project,) + return "projects/{project}".format( + project=project, + ) @staticmethod def parse_common_project_path(path: str) -> Dict[str, str]: @@ -283,10 +317,14 @@ def parse_common_project_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def common_location_path(project: str, location: str,) -> str: + def common_location_path( + project: str, + location: str, + ) -> str: """Returns a fully-qualified location string.""" return "projects/{project}/locations/{location}".format( - project=project, location=location, + project=project, + location=location, ) @staticmethod @@ -548,12 +586,20 @@ def sample_list_connection_profiles(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # This method is paged; wrap the response in a pager, which provides # an `__iter__` convenience method. response = pagers.ListConnectionProfilesPager( - method=rpc, request=request, response=response, metadata=metadata, + method=rpc, + request=request, + response=response, + metadata=metadata, ) # Done; return the response. @@ -643,7 +689,12 @@ def sample_get_connection_profile(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -771,7 +822,12 @@ def sample_create_connection_profile(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Wrap the response in an operation future. response = operation.from_gapic( @@ -902,7 +958,12 @@ def sample_update_connection_profile(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Wrap the response in an operation future. response = operation.from_gapic( @@ -1018,7 +1079,12 @@ def sample_delete_connection_profile(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Wrap the response in an operation future. response = operation.from_gapic( @@ -1109,7 +1175,12 @@ def sample_discover_connection_profile(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -1202,12 +1273,20 @@ def sample_list_streams(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # This method is paged; wrap the response in a pager, which provides # an `__iter__` convenience method. response = pagers.ListStreamsPager( - method=rpc, request=request, response=response, metadata=metadata, + method=rpc, + request=request, + response=response, + metadata=metadata, ) # Done; return the response. @@ -1295,7 +1374,12 @@ def sample_get_stream(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -1415,7 +1499,12 @@ def sample_create_stream(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Wrap the response in an operation future. response = operation.from_gapic( @@ -1541,7 +1630,12 @@ def sample_update_stream(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Wrap the response in an operation future. response = operation.from_gapic( @@ -1655,7 +1749,12 @@ def sample_delete_stream(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Wrap the response in an operation future. response = operation.from_gapic( @@ -1740,7 +1839,12 @@ def sample_fetch_errors(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Wrap the response in an operation future. response = operation.from_gapic( @@ -1846,12 +1950,20 @@ def sample_fetch_static_ips(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # This method is paged; wrap the response in a pager, which provides # an `__iter__` convenience method. response = pagers.FetchStaticIpsPager( - method=rpc, request=request, response=response, metadata=metadata, + method=rpc, + request=request, + response=response, + metadata=metadata, ) # Done; return the response. @@ -1976,7 +2088,12 @@ def sample_create_private_connection(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Wrap the response in an operation future. response = operation.from_gapic( @@ -2077,7 +2194,12 @@ def sample_get_private_connection(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -2171,12 +2293,20 @@ def sample_list_private_connections(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # This method is paged; wrap the response in a pager, which provides # an `__iter__` convenience method. response = pagers.ListPrivateConnectionsPager( - method=rpc, request=request, response=response, metadata=metadata, + method=rpc, + request=request, + response=response, + metadata=metadata, ) # Done; return the response. @@ -2287,7 +2417,12 @@ def sample_delete_private_connection(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Wrap the response in an operation future. response = operation.from_gapic( @@ -2417,7 +2552,12 @@ def sample_create_route(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Wrap the response in an operation future. response = operation.from_gapic( @@ -2516,7 +2656,12 @@ def sample_get_route(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -2610,12 +2755,20 @@ def sample_list_routes(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # This method is paged; wrap the response in a pager, which provides # an `__iter__` convenience method. response = pagers.ListRoutesPager( - method=rpc, request=request, response=response, metadata=metadata, + method=rpc, + request=request, + response=response, + metadata=metadata, ) # Done; return the response. @@ -2722,7 +2875,12 @@ def sample_delete_route(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Wrap the response in an operation future. response = operation.from_gapic( diff --git a/google/cloud/datastream_v1alpha1/services/datastream/transports/base.py b/google/cloud/datastream_v1alpha1/services/datastream/transports/base.py index 37457e4..08831d3 100644 --- a/google/cloud/datastream_v1alpha1/services/datastream/transports/base.py +++ b/google/cloud/datastream_v1alpha1/services/datastream/transports/base.py @@ -154,25 +154,39 @@ def _prep_wrapped_messages(self, client_info): client_info=client_info, ), self.list_streams: gapic_v1.method.wrap_method( - self.list_streams, default_timeout=None, client_info=client_info, + self.list_streams, + default_timeout=None, + client_info=client_info, ), self.get_stream: gapic_v1.method.wrap_method( - self.get_stream, default_timeout=None, client_info=client_info, + self.get_stream, + default_timeout=None, + client_info=client_info, ), self.create_stream: gapic_v1.method.wrap_method( - self.create_stream, default_timeout=60.0, client_info=client_info, + self.create_stream, + default_timeout=60.0, + client_info=client_info, ), self.update_stream: gapic_v1.method.wrap_method( - self.update_stream, default_timeout=60.0, client_info=client_info, + self.update_stream, + default_timeout=60.0, + client_info=client_info, ), self.delete_stream: gapic_v1.method.wrap_method( - self.delete_stream, default_timeout=60.0, client_info=client_info, + self.delete_stream, + default_timeout=60.0, + client_info=client_info, ), self.fetch_errors: gapic_v1.method.wrap_method( - self.fetch_errors, default_timeout=None, client_info=client_info, + self.fetch_errors, + default_timeout=None, + client_info=client_info, ), self.fetch_static_ips: gapic_v1.method.wrap_method( - self.fetch_static_ips, default_timeout=None, client_info=client_info, + self.fetch_static_ips, + default_timeout=None, + client_info=client_info, ), self.create_private_connection: gapic_v1.method.wrap_method( self.create_private_connection, @@ -195,25 +209,33 @@ def _prep_wrapped_messages(self, client_info): client_info=client_info, ), self.create_route: gapic_v1.method.wrap_method( - self.create_route, default_timeout=60.0, client_info=client_info, + self.create_route, + default_timeout=60.0, + client_info=client_info, ), self.get_route: gapic_v1.method.wrap_method( - self.get_route, default_timeout=None, client_info=client_info, + self.get_route, + default_timeout=None, + client_info=client_info, ), self.list_routes: gapic_v1.method.wrap_method( - self.list_routes, default_timeout=None, client_info=client_info, + self.list_routes, + default_timeout=None, + client_info=client_info, ), self.delete_route: gapic_v1.method.wrap_method( - self.delete_route, default_timeout=60.0, client_info=client_info, + self.delete_route, + default_timeout=60.0, + client_info=client_info, ), } def close(self): """Closes resources associated with the transport. - .. warning:: - Only call this method if the transport is NOT shared - with other clients - this may cause errors in other clients! + .. warning:: + Only call this method if the transport is NOT shared + with other clients - this may cause errors in other clients! """ raise NotImplementedError() diff --git a/google/cloud/datastream_v1alpha1/services/datastream/transports/grpc.py b/google/cloud/datastream_v1alpha1/services/datastream/transports/grpc.py index 6bfd130..4348b59 100644 --- a/google/cloud/datastream_v1alpha1/services/datastream/transports/grpc.py +++ b/google/cloud/datastream_v1alpha1/services/datastream/transports/grpc.py @@ -228,8 +228,7 @@ def create_channel( @property def grpc_channel(self) -> grpc.Channel: - """Return the channel designed to connect to this service. - """ + """Return the channel designed to connect to this service.""" return self._grpc_channel @property diff --git a/google/cloud/datastream_v1alpha1/types/datastream.py b/google/cloud/datastream_v1alpha1/types/datastream.py index 327eb74..24348c7 100644 --- a/google/cloud/datastream_v1alpha1/types/datastream.py +++ b/google/cloud/datastream_v1alpha1/types/datastream.py @@ -101,16 +101,31 @@ class DiscoverConnectionProfileRequest(proto.Message): This field is a member of `oneof`_ ``data_object``. """ - parent = proto.Field(proto.STRING, number=1,) + parent = proto.Field( + proto.STRING, + number=1, + ) connection_profile = proto.Field( proto.MESSAGE, number=200, oneof="target", message=datastream_resources.ConnectionProfile, ) - connection_profile_name = proto.Field(proto.STRING, number=201, oneof="target",) - recursive = proto.Field(proto.BOOL, number=3, oneof="depth",) - recursion_depth = proto.Field(proto.INT32, number=4, oneof="depth",) + connection_profile_name = proto.Field( + proto.STRING, + number=201, + oneof="target", + ) + recursive = proto.Field( + proto.BOOL, + number=3, + oneof="depth", + ) + recursion_depth = proto.Field( + proto.INT32, + number=4, + oneof="depth", + ) oracle_rdbms = proto.Field( proto.MESSAGE, number=100, @@ -175,9 +190,18 @@ class FetchStaticIpsRequest(proto.Message): call. will likely not be specified. """ - name = proto.Field(proto.STRING, number=1,) - page_size = proto.Field(proto.INT32, number=2,) - page_token = proto.Field(proto.STRING, number=3,) + name = proto.Field( + proto.STRING, + number=1, + ) + page_size = proto.Field( + proto.INT32, + number=2, + ) + page_token = proto.Field( + proto.STRING, + number=3, + ) class FetchStaticIpsResponse(proto.Message): @@ -196,8 +220,14 @@ class FetchStaticIpsResponse(proto.Message): def raw_page(self): return self - static_ips = proto.RepeatedField(proto.STRING, number=1,) - next_page_token = proto.Field(proto.STRING, number=2,) + static_ips = proto.RepeatedField( + proto.STRING, + number=1, + ) + next_page_token = proto.Field( + proto.STRING, + number=2, + ) class FetchErrorsRequest(proto.Message): @@ -209,7 +239,10 @@ class FetchErrorsRequest(proto.Message): fetch any errors. """ - stream = proto.Field(proto.STRING, number=1,) + stream = proto.Field( + proto.STRING, + number=1, + ) class FetchErrorsResponse(proto.Message): @@ -221,7 +254,9 @@ class FetchErrorsResponse(proto.Message): """ errors = proto.RepeatedField( - proto.MESSAGE, number=1, message=datastream_resources.Error, + proto.MESSAGE, + number=1, + message=datastream_resources.Error, ) @@ -251,11 +286,26 @@ class ListConnectionProfilesRequest(proto.Message): Order by fields for the result. """ - parent = proto.Field(proto.STRING, number=1,) - page_size = proto.Field(proto.INT32, number=2,) - page_token = proto.Field(proto.STRING, number=3,) - filter = proto.Field(proto.STRING, number=4,) - order_by = proto.Field(proto.STRING, number=5,) + parent = proto.Field( + proto.STRING, + number=1, + ) + page_size = proto.Field( + proto.INT32, + number=2, + ) + page_token = proto.Field( + proto.STRING, + number=3, + ) + filter = proto.Field( + proto.STRING, + number=4, + ) + order_by = proto.Field( + proto.STRING, + number=5, + ) class ListConnectionProfilesResponse(proto.Message): @@ -277,10 +327,18 @@ def raw_page(self): return self connection_profiles = proto.RepeatedField( - proto.MESSAGE, number=1, message=datastream_resources.ConnectionProfile, + proto.MESSAGE, + number=1, + message=datastream_resources.ConnectionProfile, + ) + next_page_token = proto.Field( + proto.STRING, + number=2, + ) + unreachable = proto.RepeatedField( + proto.STRING, + number=3, ) - next_page_token = proto.Field(proto.STRING, number=2,) - unreachable = proto.RepeatedField(proto.STRING, number=3,) class GetConnectionProfileRequest(proto.Message): @@ -292,7 +350,10 @@ class GetConnectionProfileRequest(proto.Message): resource to get. """ - name = proto.Field(proto.STRING, number=1,) + name = proto.Field( + proto.STRING, + number=1, + ) class CreateConnectionProfileRequest(proto.Message): @@ -327,12 +388,23 @@ class CreateConnectionProfileRequest(proto.Message): (00000000-0000-0000-0000-000000000000). """ - parent = proto.Field(proto.STRING, number=1,) - connection_profile_id = proto.Field(proto.STRING, number=2,) + parent = proto.Field( + proto.STRING, + number=1, + ) + connection_profile_id = proto.Field( + proto.STRING, + number=2, + ) connection_profile = proto.Field( - proto.MESSAGE, number=3, message=datastream_resources.ConnectionProfile, + proto.MESSAGE, + number=3, + message=datastream_resources.ConnectionProfile, + ) + request_id = proto.Field( + proto.STRING, + number=4, ) - request_id = proto.Field(proto.STRING, number=4,) class UpdateConnectionProfileRequest(proto.Message): @@ -369,12 +441,19 @@ class UpdateConnectionProfileRequest(proto.Message): """ update_mask = proto.Field( - proto.MESSAGE, number=1, message=field_mask_pb2.FieldMask, + proto.MESSAGE, + number=1, + message=field_mask_pb2.FieldMask, ) connection_profile = proto.Field( - proto.MESSAGE, number=2, message=datastream_resources.ConnectionProfile, + proto.MESSAGE, + number=2, + message=datastream_resources.ConnectionProfile, + ) + request_id = proto.Field( + proto.STRING, + number=3, ) - request_id = proto.Field(proto.STRING, number=3,) class DeleteConnectionProfileRequest(proto.Message): @@ -404,8 +483,14 @@ class DeleteConnectionProfileRequest(proto.Message): (00000000-0000-0000-0000-000000000000). """ - name = proto.Field(proto.STRING, number=1,) - request_id = proto.Field(proto.STRING, number=2,) + name = proto.Field( + proto.STRING, + number=1, + ) + request_id = proto.Field( + proto.STRING, + number=2, + ) class ListStreamsRequest(proto.Message): @@ -433,11 +518,26 @@ class ListStreamsRequest(proto.Message): Order by fields for the result. """ - parent = proto.Field(proto.STRING, number=1,) - page_size = proto.Field(proto.INT32, number=2,) - page_token = proto.Field(proto.STRING, number=3,) - filter = proto.Field(proto.STRING, number=4,) - order_by = proto.Field(proto.STRING, number=5,) + parent = proto.Field( + proto.STRING, + number=1, + ) + page_size = proto.Field( + proto.INT32, + number=2, + ) + page_token = proto.Field( + proto.STRING, + number=3, + ) + filter = proto.Field( + proto.STRING, + number=4, + ) + order_by = proto.Field( + proto.STRING, + number=5, + ) class ListStreamsResponse(proto.Message): @@ -459,10 +559,18 @@ def raw_page(self): return self streams = proto.RepeatedField( - proto.MESSAGE, number=1, message=datastream_resources.Stream, + proto.MESSAGE, + number=1, + message=datastream_resources.Stream, + ) + next_page_token = proto.Field( + proto.STRING, + number=2, + ) + unreachable = proto.RepeatedField( + proto.STRING, + number=3, ) - next_page_token = proto.Field(proto.STRING, number=2,) - unreachable = proto.RepeatedField(proto.STRING, number=3,) class GetStreamRequest(proto.Message): @@ -474,7 +582,10 @@ class GetStreamRequest(proto.Message): get. """ - name = proto.Field(proto.STRING, number=1,) + name = proto.Field( + proto.STRING, + number=1, + ) class CreateStreamRequest(proto.Message): @@ -514,12 +625,31 @@ class CreateStreamRequest(proto.Message): validating it. """ - parent = proto.Field(proto.STRING, number=1,) - stream_id = proto.Field(proto.STRING, number=2,) - stream = proto.Field(proto.MESSAGE, number=3, message=datastream_resources.Stream,) - request_id = proto.Field(proto.STRING, number=4,) - validate_only = proto.Field(proto.BOOL, number=5,) - force = proto.Field(proto.BOOL, number=6,) + parent = proto.Field( + proto.STRING, + number=1, + ) + stream_id = proto.Field( + proto.STRING, + number=2, + ) + stream = proto.Field( + proto.MESSAGE, + number=3, + message=datastream_resources.Stream, + ) + request_id = proto.Field( + proto.STRING, + number=4, + ) + validate_only = proto.Field( + proto.BOOL, + number=5, + ) + force = proto.Field( + proto.BOOL, + number=6, + ) class UpdateStreamRequest(proto.Message): @@ -563,12 +693,27 @@ class UpdateStreamRequest(proto.Message): """ update_mask = proto.Field( - proto.MESSAGE, number=1, message=field_mask_pb2.FieldMask, + proto.MESSAGE, + number=1, + message=field_mask_pb2.FieldMask, + ) + stream = proto.Field( + proto.MESSAGE, + number=2, + message=datastream_resources.Stream, + ) + request_id = proto.Field( + proto.STRING, + number=3, + ) + validate_only = proto.Field( + proto.BOOL, + number=4, + ) + force = proto.Field( + proto.BOOL, + number=5, ) - stream = proto.Field(proto.MESSAGE, number=2, message=datastream_resources.Stream,) - request_id = proto.Field(proto.STRING, number=3,) - validate_only = proto.Field(proto.BOOL, number=4,) - force = proto.Field(proto.BOOL, number=5,) class DeleteStreamRequest(proto.Message): @@ -598,8 +743,14 @@ class DeleteStreamRequest(proto.Message): (00000000-0000-0000-0000-000000000000). """ - name = proto.Field(proto.STRING, number=1,) - request_id = proto.Field(proto.STRING, number=2,) + name = proto.Field( + proto.STRING, + number=1, + ) + request_id = proto.Field( + proto.STRING, + number=2, + ) class OperationMetadata(proto.Message): @@ -635,15 +786,40 @@ class OperationMetadata(proto.Message): if there are any. """ - create_time = proto.Field(proto.MESSAGE, number=1, message=timestamp_pb2.Timestamp,) - end_time = proto.Field(proto.MESSAGE, number=2, message=timestamp_pb2.Timestamp,) - target = proto.Field(proto.STRING, number=3,) - verb = proto.Field(proto.STRING, number=4,) - status_message = proto.Field(proto.STRING, number=5,) - requested_cancellation = proto.Field(proto.BOOL, number=6,) - api_version = proto.Field(proto.STRING, number=7,) + create_time = proto.Field( + proto.MESSAGE, + number=1, + message=timestamp_pb2.Timestamp, + ) + end_time = proto.Field( + proto.MESSAGE, + number=2, + message=timestamp_pb2.Timestamp, + ) + target = proto.Field( + proto.STRING, + number=3, + ) + verb = proto.Field( + proto.STRING, + number=4, + ) + status_message = proto.Field( + proto.STRING, + number=5, + ) + requested_cancellation = proto.Field( + proto.BOOL, + number=6, + ) + api_version = proto.Field( + proto.STRING, + number=7, + ) validation_result = proto.Field( - proto.MESSAGE, number=8, message=datastream_resources.ValidationResult, + proto.MESSAGE, + number=8, + message=datastream_resources.ValidationResult, ) @@ -680,12 +856,23 @@ class CreatePrivateConnectionRequest(proto.Message): (00000000-0000-0000-0000-000000000000). """ - parent = proto.Field(proto.STRING, number=1,) - private_connection_id = proto.Field(proto.STRING, number=2,) + parent = proto.Field( + proto.STRING, + number=1, + ) + private_connection_id = proto.Field( + proto.STRING, + number=2, + ) private_connection = proto.Field( - proto.MESSAGE, number=3, message=datastream_resources.PrivateConnection, + proto.MESSAGE, + number=3, + message=datastream_resources.PrivateConnection, + ) + request_id = proto.Field( + proto.STRING, + number=4, ) - request_id = proto.Field(proto.STRING, number=4,) class ListPrivateConnectionsRequest(proto.Message): @@ -715,11 +902,26 @@ class ListPrivateConnectionsRequest(proto.Message): Order by fields for the result. """ - parent = proto.Field(proto.STRING, number=1,) - page_size = proto.Field(proto.INT32, number=2,) - page_token = proto.Field(proto.STRING, number=3,) - filter = proto.Field(proto.STRING, number=4,) - order_by = proto.Field(proto.STRING, number=5,) + parent = proto.Field( + proto.STRING, + number=1, + ) + page_size = proto.Field( + proto.INT32, + number=2, + ) + page_token = proto.Field( + proto.STRING, + number=3, + ) + filter = proto.Field( + proto.STRING, + number=4, + ) + order_by = proto.Field( + proto.STRING, + number=5, + ) class ListPrivateConnectionsResponse(proto.Message): @@ -741,10 +943,18 @@ def raw_page(self): return self private_connections = proto.RepeatedField( - proto.MESSAGE, number=1, message=datastream_resources.PrivateConnection, + proto.MESSAGE, + number=1, + message=datastream_resources.PrivateConnection, + ) + next_page_token = proto.Field( + proto.STRING, + number=2, + ) + unreachable = proto.RepeatedField( + proto.STRING, + number=3, ) - next_page_token = proto.Field(proto.STRING, number=2,) - unreachable = proto.RepeatedField(proto.STRING, number=3,) class DeletePrivateConnectionRequest(proto.Message): @@ -778,9 +988,18 @@ class DeletePrivateConnectionRequest(proto.Message): be deleted. """ - name = proto.Field(proto.STRING, number=1,) - request_id = proto.Field(proto.STRING, number=2,) - force = proto.Field(proto.BOOL, number=3,) + name = proto.Field( + proto.STRING, + number=1, + ) + request_id = proto.Field( + proto.STRING, + number=2, + ) + force = proto.Field( + proto.BOOL, + number=3, + ) class GetPrivateConnectionRequest(proto.Message): @@ -792,7 +1011,10 @@ class GetPrivateConnectionRequest(proto.Message): connectivity configuration to get. """ - name = proto.Field(proto.STRING, number=1,) + name = proto.Field( + proto.STRING, + number=1, + ) class CreateRouteRequest(proto.Message): @@ -826,10 +1048,23 @@ class CreateRouteRequest(proto.Message): (00000000-0000-0000-0000-000000000000). """ - parent = proto.Field(proto.STRING, number=1,) - route_id = proto.Field(proto.STRING, number=2,) - route = proto.Field(proto.MESSAGE, number=3, message=datastream_resources.Route,) - request_id = proto.Field(proto.STRING, number=4,) + parent = proto.Field( + proto.STRING, + number=1, + ) + route_id = proto.Field( + proto.STRING, + number=2, + ) + route = proto.Field( + proto.MESSAGE, + number=3, + message=datastream_resources.Route, + ) + request_id = proto.Field( + proto.STRING, + number=4, + ) class ListRoutesRequest(proto.Message): @@ -858,11 +1093,26 @@ class ListRoutesRequest(proto.Message): Order by fields for the result. """ - parent = proto.Field(proto.STRING, number=1,) - page_size = proto.Field(proto.INT32, number=2,) - page_token = proto.Field(proto.STRING, number=3,) - filter = proto.Field(proto.STRING, number=4,) - order_by = proto.Field(proto.STRING, number=5,) + parent = proto.Field( + proto.STRING, + number=1, + ) + page_size = proto.Field( + proto.INT32, + number=2, + ) + page_token = proto.Field( + proto.STRING, + number=3, + ) + filter = proto.Field( + proto.STRING, + number=4, + ) + order_by = proto.Field( + proto.STRING, + number=5, + ) class ListRoutesResponse(proto.Message): @@ -884,10 +1134,18 @@ def raw_page(self): return self routes = proto.RepeatedField( - proto.MESSAGE, number=1, message=datastream_resources.Route, + proto.MESSAGE, + number=1, + message=datastream_resources.Route, + ) + next_page_token = proto.Field( + proto.STRING, + number=2, + ) + unreachable = proto.RepeatedField( + proto.STRING, + number=3, ) - next_page_token = proto.Field(proto.STRING, number=2,) - unreachable = proto.RepeatedField(proto.STRING, number=3,) class DeleteRouteRequest(proto.Message): @@ -917,8 +1175,14 @@ class DeleteRouteRequest(proto.Message): (00000000-0000-0000-0000-000000000000). """ - name = proto.Field(proto.STRING, number=1,) - request_id = proto.Field(proto.STRING, number=2,) + name = proto.Field( + proto.STRING, + number=1, + ) + request_id = proto.Field( + proto.STRING, + number=2, + ) class GetRouteRequest(proto.Message): @@ -930,7 +1194,10 @@ class GetRouteRequest(proto.Message): get. """ - name = proto.Field(proto.STRING, number=1,) + name = proto.Field( + proto.STRING, + number=1, + ) __all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/google/cloud/datastream_v1alpha1/types/datastream_resources.py b/google/cloud/datastream_v1alpha1/types/datastream_resources.py index b6c2f08..1e0ab45 100644 --- a/google/cloud/datastream_v1alpha1/types/datastream_resources.py +++ b/google/cloud/datastream_v1alpha1/types/datastream_resources.py @@ -93,12 +93,31 @@ class OracleProfile(proto.Message): Connection string attributes """ - hostname = proto.Field(proto.STRING, number=1,) - port = proto.Field(proto.INT32, number=2,) - username = proto.Field(proto.STRING, number=3,) - password = proto.Field(proto.STRING, number=4,) - database_service = proto.Field(proto.STRING, number=5,) - connection_attributes = proto.MapField(proto.STRING, proto.STRING, number=6,) + hostname = proto.Field( + proto.STRING, + number=1, + ) + port = proto.Field( + proto.INT32, + number=2, + ) + username = proto.Field( + proto.STRING, + number=3, + ) + password = proto.Field( + proto.STRING, + number=4, + ) + database_service = proto.Field( + proto.STRING, + number=5, + ) + connection_attributes = proto.MapField( + proto.STRING, + proto.STRING, + number=6, + ) class MysqlProfile(proto.Message): @@ -119,11 +138,27 @@ class MysqlProfile(proto.Message): SSL configuration for the MySQL connection. """ - hostname = proto.Field(proto.STRING, number=1,) - port = proto.Field(proto.INT32, number=2,) - username = proto.Field(proto.STRING, number=3,) - password = proto.Field(proto.STRING, number=4,) - ssl_config = proto.Field(proto.MESSAGE, number=5, message="MysqlSslConfig",) + hostname = proto.Field( + proto.STRING, + number=1, + ) + port = proto.Field( + proto.INT32, + number=2, + ) + username = proto.Field( + proto.STRING, + number=3, + ) + password = proto.Field( + proto.STRING, + number=4, + ) + ssl_config = proto.Field( + proto.MESSAGE, + number=5, + message="MysqlSslConfig", + ) class GcsProfile(proto.Message): @@ -138,18 +173,22 @@ class GcsProfile(proto.Message): bucket. """ - bucket_name = proto.Field(proto.STRING, number=1,) - root_path = proto.Field(proto.STRING, number=2,) + bucket_name = proto.Field( + proto.STRING, + number=1, + ) + root_path = proto.Field( + proto.STRING, + number=2, + ) class NoConnectivitySettings(proto.Message): - r"""No connectivity settings. - """ + r"""No connectivity settings.""" class StaticServiceIpConnectivity(proto.Message): - r"""Static IP address connectivity. - """ + r"""Static IP address connectivity.""" class ForwardSshTunnelConnectivity(proto.Message): @@ -179,11 +218,28 @@ class ForwardSshTunnelConnectivity(proto.Message): This field is a member of `oneof`_ ``authentication_method``. """ - hostname = proto.Field(proto.STRING, number=1,) - username = proto.Field(proto.STRING, number=2,) - port = proto.Field(proto.INT32, number=3,) - password = proto.Field(proto.STRING, number=100, oneof="authentication_method",) - private_key = proto.Field(proto.STRING, number=101, oneof="authentication_method",) + hostname = proto.Field( + proto.STRING, + number=1, + ) + username = proto.Field( + proto.STRING, + number=2, + ) + port = proto.Field( + proto.INT32, + number=3, + ) + password = proto.Field( + proto.STRING, + number=100, + oneof="authentication_method", + ) + private_key = proto.Field( + proto.STRING, + number=101, + oneof="authentication_method", + ) class VpcPeeringConfig(proto.Message): @@ -199,8 +255,14 @@ class VpcPeeringConfig(proto.Message): /29) """ - vpc_name = proto.Field(proto.STRING, number=1,) - subnet = proto.Field(proto.STRING, number=2,) + vpc_name = proto.Field( + proto.STRING, + number=1, + ) + subnet = proto.Field( + proto.STRING, + number=2, + ) class PrivateConnection(proto.Message): @@ -235,15 +297,43 @@ class State(proto.Enum): CREATED = 2 FAILED = 3 - name = proto.Field(proto.STRING, number=1,) - create_time = proto.Field(proto.MESSAGE, number=2, message=timestamp_pb2.Timestamp,) - update_time = proto.Field(proto.MESSAGE, number=3, message=timestamp_pb2.Timestamp,) - labels = proto.MapField(proto.STRING, proto.STRING, number=4,) - display_name = proto.Field(proto.STRING, number=5,) - state = proto.Field(proto.ENUM, number=6, enum=State,) - error = proto.Field(proto.MESSAGE, number=7, message="Error",) + name = proto.Field( + proto.STRING, + number=1, + ) + create_time = proto.Field( + proto.MESSAGE, + number=2, + message=timestamp_pb2.Timestamp, + ) + update_time = proto.Field( + proto.MESSAGE, + number=3, + message=timestamp_pb2.Timestamp, + ) + labels = proto.MapField( + proto.STRING, + proto.STRING, + number=4, + ) + display_name = proto.Field( + proto.STRING, + number=5, + ) + state = proto.Field( + proto.ENUM, + number=6, + enum=State, + ) + error = proto.Field( + proto.MESSAGE, + number=7, + message="Error", + ) vpc_peering_config = proto.Field( - proto.MESSAGE, number=100, message="VpcPeeringConfig", + proto.MESSAGE, + number=100, + message="VpcPeeringConfig", ) @@ -255,7 +345,10 @@ class PrivateConnectivity(proto.Message): """ - private_connection_name = proto.Field(proto.STRING, number=1,) + private_connection_name = proto.Field( + proto.STRING, + number=1, + ) class Route(proto.Message): @@ -280,13 +373,37 @@ class Route(proto.Message): Destination port for connection """ - name = proto.Field(proto.STRING, number=1,) - create_time = proto.Field(proto.MESSAGE, number=2, message=timestamp_pb2.Timestamp,) - update_time = proto.Field(proto.MESSAGE, number=3, message=timestamp_pb2.Timestamp,) - labels = proto.MapField(proto.STRING, proto.STRING, number=4,) - display_name = proto.Field(proto.STRING, number=5,) - destination_address = proto.Field(proto.STRING, number=6,) - destination_port = proto.Field(proto.INT32, number=7,) + name = proto.Field( + proto.STRING, + number=1, + ) + create_time = proto.Field( + proto.MESSAGE, + number=2, + message=timestamp_pb2.Timestamp, + ) + update_time = proto.Field( + proto.MESSAGE, + number=3, + message=timestamp_pb2.Timestamp, + ) + labels = proto.MapField( + proto.STRING, + proto.STRING, + number=4, + ) + display_name = proto.Field( + proto.STRING, + number=5, + ) + destination_address = proto.Field( + proto.STRING, + number=6, + ) + destination_port = proto.Field( + proto.INT32, + number=7, + ) class MysqlSslConfig(proto.Message): @@ -317,12 +434,30 @@ class MysqlSslConfig(proto.Message): set. """ - client_key = proto.Field(proto.STRING, number=11,) - client_key_set = proto.Field(proto.BOOL, number=12,) - client_certificate = proto.Field(proto.STRING, number=13,) - client_certificate_set = proto.Field(proto.BOOL, number=14,) - ca_certificate = proto.Field(proto.STRING, number=15,) - ca_certificate_set = proto.Field(proto.BOOL, number=16,) + client_key = proto.Field( + proto.STRING, + number=11, + ) + client_key_set = proto.Field( + proto.BOOL, + number=12, + ) + client_certificate = proto.Field( + proto.STRING, + number=13, + ) + client_certificate_set = proto.Field( + proto.BOOL, + number=14, + ) + ca_certificate = proto.Field( + proto.STRING, + number=15, + ) + ca_certificate_set = proto.Field( + proto.BOOL, + number=16, + ) class ConnectionProfile(proto.Message): @@ -377,19 +512,46 @@ class ConnectionProfile(proto.Message): This field is a member of `oneof`_ ``connectivity``. """ - name = proto.Field(proto.STRING, number=1,) - create_time = proto.Field(proto.MESSAGE, number=2, message=timestamp_pb2.Timestamp,) - update_time = proto.Field(proto.MESSAGE, number=3, message=timestamp_pb2.Timestamp,) - labels = proto.MapField(proto.STRING, proto.STRING, number=4,) - display_name = proto.Field(proto.STRING, number=5,) + name = proto.Field( + proto.STRING, + number=1, + ) + create_time = proto.Field( + proto.MESSAGE, + number=2, + message=timestamp_pb2.Timestamp, + ) + update_time = proto.Field( + proto.MESSAGE, + number=3, + message=timestamp_pb2.Timestamp, + ) + labels = proto.MapField( + proto.STRING, + proto.STRING, + number=4, + ) + display_name = proto.Field( + proto.STRING, + number=5, + ) oracle_profile = proto.Field( - proto.MESSAGE, number=100, oneof="profile", message="OracleProfile", + proto.MESSAGE, + number=100, + oneof="profile", + message="OracleProfile", ) gcs_profile = proto.Field( - proto.MESSAGE, number=101, oneof="profile", message="GcsProfile", + proto.MESSAGE, + number=101, + oneof="profile", + message="GcsProfile", ) mysql_profile = proto.Field( - proto.MESSAGE, number=102, oneof="profile", message="MysqlProfile", + proto.MESSAGE, + number=102, + oneof="profile", + message="MysqlProfile", ) no_connectivity = proto.Field( proto.MESSAGE, @@ -410,7 +572,10 @@ class ConnectionProfile(proto.Message): message="ForwardSshTunnelConnectivity", ) private_connectivity = proto.Field( - proto.MESSAGE, number=203, oneof="connectivity", message="PrivateConnectivity", + proto.MESSAGE, + number=203, + oneof="connectivity", + message="PrivateConnectivity", ) @@ -441,15 +606,42 @@ class OracleColumn(proto.Message): table. """ - column_name = proto.Field(proto.STRING, number=1,) - data_type = proto.Field(proto.STRING, number=2,) - length = proto.Field(proto.INT32, number=3,) - precision = proto.Field(proto.INT32, number=4,) - scale = proto.Field(proto.INT32, number=5,) - encoding = proto.Field(proto.STRING, number=6,) - primary_key = proto.Field(proto.BOOL, number=7,) - nullable = proto.Field(proto.BOOL, number=8,) - ordinal_position = proto.Field(proto.INT32, number=9,) + column_name = proto.Field( + proto.STRING, + number=1, + ) + data_type = proto.Field( + proto.STRING, + number=2, + ) + length = proto.Field( + proto.INT32, + number=3, + ) + precision = proto.Field( + proto.INT32, + number=4, + ) + scale = proto.Field( + proto.INT32, + number=5, + ) + encoding = proto.Field( + proto.STRING, + number=6, + ) + primary_key = proto.Field( + proto.BOOL, + number=7, + ) + nullable = proto.Field( + proto.BOOL, + number=8, + ) + ordinal_position = proto.Field( + proto.INT32, + number=9, + ) class OracleTable(proto.Message): @@ -464,9 +656,14 @@ class OracleTable(proto.Message): lists, includes/excludes everything. """ - table_name = proto.Field(proto.STRING, number=1,) + table_name = proto.Field( + proto.STRING, + number=1, + ) oracle_columns = proto.RepeatedField( - proto.MESSAGE, number=2, message="OracleColumn", + proto.MESSAGE, + number=2, + message="OracleColumn", ) @@ -480,8 +677,15 @@ class OracleSchema(proto.Message): Tables in the schema. """ - schema_name = proto.Field(proto.STRING, number=1,) - oracle_tables = proto.RepeatedField(proto.MESSAGE, number=2, message="OracleTable",) + schema_name = proto.Field( + proto.STRING, + number=1, + ) + oracle_tables = proto.RepeatedField( + proto.MESSAGE, + number=2, + message="OracleTable", + ) class OracleRdbms(proto.Message): @@ -494,7 +698,9 @@ class OracleRdbms(proto.Message): """ oracle_schemas = proto.RepeatedField( - proto.MESSAGE, number=1, message="OracleSchema", + proto.MESSAGE, + number=1, + message="OracleSchema", ) @@ -508,8 +714,16 @@ class OracleSourceConfig(proto.Message): Oracle objects to exclude from the stream. """ - allowlist = proto.Field(proto.MESSAGE, number=1, message="OracleRdbms",) - rejectlist = proto.Field(proto.MESSAGE, number=2, message="OracleRdbms",) + allowlist = proto.Field( + proto.MESSAGE, + number=1, + message="OracleRdbms", + ) + rejectlist = proto.Field( + proto.MESSAGE, + number=2, + message="OracleRdbms", + ) class MysqlColumn(proto.Message): @@ -537,13 +751,34 @@ class MysqlColumn(proto.Message): table. """ - column_name = proto.Field(proto.STRING, number=1,) - data_type = proto.Field(proto.STRING, number=2,) - length = proto.Field(proto.INT32, number=3,) - collation = proto.Field(proto.STRING, number=4,) - primary_key = proto.Field(proto.BOOL, number=5,) - nullable = proto.Field(proto.BOOL, number=6,) - ordinal_position = proto.Field(proto.INT32, number=7,) + column_name = proto.Field( + proto.STRING, + number=1, + ) + data_type = proto.Field( + proto.STRING, + number=2, + ) + length = proto.Field( + proto.INT32, + number=3, + ) + collation = proto.Field( + proto.STRING, + number=4, + ) + primary_key = proto.Field( + proto.BOOL, + number=5, + ) + nullable = proto.Field( + proto.BOOL, + number=6, + ) + ordinal_position = proto.Field( + proto.INT32, + number=7, + ) class MysqlTable(proto.Message): @@ -558,8 +793,15 @@ class MysqlTable(proto.Message): lists, includes/excludes everything. """ - table_name = proto.Field(proto.STRING, number=1,) - mysql_columns = proto.RepeatedField(proto.MESSAGE, number=2, message="MysqlColumn",) + table_name = proto.Field( + proto.STRING, + number=1, + ) + mysql_columns = proto.RepeatedField( + proto.MESSAGE, + number=2, + message="MysqlColumn", + ) class MysqlDatabase(proto.Message): @@ -572,8 +814,15 @@ class MysqlDatabase(proto.Message): Tables in the database. """ - database_name = proto.Field(proto.STRING, number=1,) - mysql_tables = proto.RepeatedField(proto.MESSAGE, number=2, message="MysqlTable",) + database_name = proto.Field( + proto.STRING, + number=1, + ) + mysql_tables = proto.RepeatedField( + proto.MESSAGE, + number=2, + message="MysqlTable", + ) class MysqlRdbms(proto.Message): @@ -585,7 +834,9 @@ class MysqlRdbms(proto.Message): """ mysql_databases = proto.RepeatedField( - proto.MESSAGE, number=1, message="MysqlDatabase", + proto.MESSAGE, + number=1, + message="MysqlDatabase", ) @@ -599,8 +850,16 @@ class MysqlSourceConfig(proto.Message): MySQL objects to exclude from the stream. """ - allowlist = proto.Field(proto.MESSAGE, number=1, message="MysqlRdbms",) - rejectlist = proto.Field(proto.MESSAGE, number=2, message="MysqlRdbms",) + allowlist = proto.Field( + proto.MESSAGE, + number=1, + message="MysqlRdbms", + ) + rejectlist = proto.Field( + proto.MESSAGE, + number=2, + message="MysqlRdbms", + ) class SourceConfig(proto.Message): @@ -627,7 +886,10 @@ class SourceConfig(proto.Message): This field is a member of `oneof`_ ``source_stream_config``. """ - source_connection_profile_name = proto.Field(proto.STRING, number=1,) + source_connection_profile_name = proto.Field( + proto.STRING, + number=1, + ) oracle_source_config = proto.Field( proto.MESSAGE, number=100, @@ -643,8 +905,7 @@ class SourceConfig(proto.Message): class AvroFileFormat(proto.Message): - r"""AVRO file format configuration. - """ + r"""AVRO file format configuration.""" class JsonFileFormat(proto.Message): @@ -663,8 +924,16 @@ class JsonCompression(proto.Enum): NO_COMPRESSION = 1 GZIP = 2 - schema_file_format = proto.Field(proto.ENUM, number=1, enum="SchemaFileFormat",) - compression = proto.Field(proto.ENUM, number=2, enum=JsonCompression,) + schema_file_format = proto.Field( + proto.ENUM, + number=1, + enum="SchemaFileFormat", + ) + compression = proto.Field( + proto.ENUM, + number=2, + enum=JsonCompression, + ) class GcsDestinationConfig(proto.Message): @@ -701,17 +970,35 @@ class GcsDestinationConfig(proto.Message): This field is a member of `oneof`_ ``file_format``. """ - path = proto.Field(proto.STRING, number=1,) - gcs_file_format = proto.Field(proto.ENUM, number=2, enum="GcsFileFormat",) - file_rotation_mb = proto.Field(proto.INT32, number=3,) + path = proto.Field( + proto.STRING, + number=1, + ) + gcs_file_format = proto.Field( + proto.ENUM, + number=2, + enum="GcsFileFormat", + ) + file_rotation_mb = proto.Field( + proto.INT32, + number=3, + ) file_rotation_interval = proto.Field( - proto.MESSAGE, number=4, message=duration_pb2.Duration, + proto.MESSAGE, + number=4, + message=duration_pb2.Duration, ) avro_file_format = proto.Field( - proto.MESSAGE, number=100, oneof="file_format", message="AvroFileFormat", + proto.MESSAGE, + number=100, + oneof="file_format", + message="AvroFileFormat", ) json_file_format = proto.Field( - proto.MESSAGE, number=101, oneof="file_format", message="JsonFileFormat", + proto.MESSAGE, + number=101, + oneof="file_format", + message="JsonFileFormat", ) @@ -729,7 +1016,10 @@ class DestinationConfig(proto.Message): This field is a member of `oneof`_ ``destination_stream_config``. """ - destination_connection_profile_name = proto.Field(proto.STRING, number=1,) + destination_connection_profile_name = proto.Field( + proto.STRING, + number=1, + ) gcs_destination_config = proto.Field( proto.MESSAGE, number=100, @@ -819,10 +1109,16 @@ class BackfillAllStrategy(proto.Message): """ oracle_excluded_objects = proto.Field( - proto.MESSAGE, number=1, oneof="excluded_objects", message="OracleRdbms", + proto.MESSAGE, + number=1, + oneof="excluded_objects", + message="OracleRdbms", ) mysql_excluded_objects = proto.Field( - proto.MESSAGE, number=2, oneof="excluded_objects", message="MysqlRdbms", + proto.MESSAGE, + number=2, + oneof="excluded_objects", + message="MysqlRdbms", ) class BackfillNoneStrategy(proto.Message): @@ -831,16 +1127,44 @@ class BackfillNoneStrategy(proto.Message): """ - name = proto.Field(proto.STRING, number=1,) - create_time = proto.Field(proto.MESSAGE, number=2, message=timestamp_pb2.Timestamp,) - update_time = proto.Field(proto.MESSAGE, number=3, message=timestamp_pb2.Timestamp,) - labels = proto.MapField(proto.STRING, proto.STRING, number=4,) - display_name = proto.Field(proto.STRING, number=5,) - source_config = proto.Field(proto.MESSAGE, number=6, message="SourceConfig",) + name = proto.Field( + proto.STRING, + number=1, + ) + create_time = proto.Field( + proto.MESSAGE, + number=2, + message=timestamp_pb2.Timestamp, + ) + update_time = proto.Field( + proto.MESSAGE, + number=3, + message=timestamp_pb2.Timestamp, + ) + labels = proto.MapField( + proto.STRING, + proto.STRING, + number=4, + ) + display_name = proto.Field( + proto.STRING, + number=5, + ) + source_config = proto.Field( + proto.MESSAGE, + number=6, + message="SourceConfig", + ) destination_config = proto.Field( - proto.MESSAGE, number=7, message="DestinationConfig", + proto.MESSAGE, + number=7, + message="DestinationConfig", + ) + state = proto.Field( + proto.ENUM, + number=8, + enum=State, ) - state = proto.Field(proto.ENUM, number=8, enum=State,) backfill_all = proto.Field( proto.MESSAGE, number=101, @@ -853,7 +1177,11 @@ class BackfillNoneStrategy(proto.Message): oneof="backfill_strategy", message=BackfillNoneStrategy, ) - errors = proto.RepeatedField(proto.MESSAGE, number=9, message="Error",) + errors = proto.RepeatedField( + proto.MESSAGE, + number=9, + message="Error", + ) class Error(proto.Message): @@ -876,11 +1204,28 @@ class Error(proto.Message): Additional information about the error. """ - reason = proto.Field(proto.STRING, number=1,) - error_uuid = proto.Field(proto.STRING, number=2,) - message = proto.Field(proto.STRING, number=3,) - error_time = proto.Field(proto.MESSAGE, number=4, message=timestamp_pb2.Timestamp,) - details = proto.MapField(proto.STRING, proto.STRING, number=5,) + reason = proto.Field( + proto.STRING, + number=1, + ) + error_uuid = proto.Field( + proto.STRING, + number=2, + ) + message = proto.Field( + proto.STRING, + number=3, + ) + error_time = proto.Field( + proto.MESSAGE, + number=4, + message=timestamp_pb2.Timestamp, + ) + details = proto.MapField( + proto.STRING, + proto.STRING, + number=5, + ) class ValidationResult(proto.Message): @@ -892,7 +1237,11 @@ class ValidationResult(proto.Message): as well as not executed validations). """ - validations = proto.RepeatedField(proto.MESSAGE, number=1, message="Validation",) + validations = proto.RepeatedField( + proto.MESSAGE, + number=1, + message="Validation", + ) class Validation(proto.Message): @@ -916,10 +1265,24 @@ class Status(proto.Enum): FAILED = 2 PASSED = 3 - description = proto.Field(proto.STRING, number=1,) - status = proto.Field(proto.ENUM, number=2, enum=Status,) - message = proto.RepeatedField(proto.MESSAGE, number=3, message="ValidationMessage",) - code = proto.Field(proto.STRING, number=4,) + description = proto.Field( + proto.STRING, + number=1, + ) + status = proto.Field( + proto.ENUM, + number=2, + enum=Status, + ) + message = proto.RepeatedField( + proto.MESSAGE, + number=3, + message="ValidationMessage", + ) + code = proto.Field( + proto.STRING, + number=4, + ) class ValidationMessage(proto.Message): @@ -943,10 +1306,24 @@ class Level(proto.Enum): WARNING = 1 ERROR = 2 - message = proto.Field(proto.STRING, number=1,) - level = proto.Field(proto.ENUM, number=2, enum=Level,) - metadata = proto.MapField(proto.STRING, proto.STRING, number=3,) - code = proto.Field(proto.STRING, number=4,) + message = proto.Field( + proto.STRING, + number=1, + ) + level = proto.Field( + proto.ENUM, + number=2, + enum=Level, + ) + metadata = proto.MapField( + proto.STRING, + proto.STRING, + number=3, + ) + code = proto.Field( + proto.STRING, + number=4, + ) __all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/noxfile.py b/noxfile.py index 2a2001c..3addb4e 100644 --- a/noxfile.py +++ b/noxfile.py @@ -24,7 +24,7 @@ import nox -BLACK_VERSION = "black==19.10b0" +BLACK_VERSION = "black==22.3.0" BLACK_PATHS = ["docs", "google", "tests", "noxfile.py", "setup.py"] DEFAULT_PYTHON_VERSION = "3.8" @@ -57,7 +57,9 @@ def lint(session): """ session.install("flake8", BLACK_VERSION) session.run( - "black", "--check", *BLACK_PATHS, + "black", + "--check", + *BLACK_PATHS, ) session.run("flake8", "google", "tests") @@ -67,7 +69,8 @@ def blacken(session): """Run black. Format code to uniform standard.""" session.install(BLACK_VERSION) session.run( - "black", *BLACK_PATHS, + "black", + *BLACK_PATHS, ) diff --git a/tests/unit/gapic/datastream_v1/test_datastream.py b/tests/unit/gapic/datastream_v1/test_datastream.py index ce7fc66..5e1e7fd 100644 --- a/tests/unit/gapic/datastream_v1/test_datastream.py +++ b/tests/unit/gapic/datastream_v1/test_datastream.py @@ -90,7 +90,13 @@ def test__get_default_mtls_endpoint(): assert DatastreamClient._get_default_mtls_endpoint(non_googleapi) == non_googleapi -@pytest.mark.parametrize("client_class", [DatastreamClient, DatastreamAsyncClient,]) +@pytest.mark.parametrize( + "client_class", + [ + DatastreamClient, + DatastreamAsyncClient, + ], +) def test_datastream_client_from_service_account_info(client_class): creds = ga_credentials.AnonymousCredentials() with mock.patch.object( @@ -130,7 +136,13 @@ def test_datastream_client_service_account_always_use_jwt( use_jwt.assert_not_called() -@pytest.mark.parametrize("client_class", [DatastreamClient, DatastreamAsyncClient,]) +@pytest.mark.parametrize( + "client_class", + [ + DatastreamClient, + DatastreamAsyncClient, + ], +) def test_datastream_client_from_service_account_file(client_class): creds = ga_credentials.AnonymousCredentials() with mock.patch.object( @@ -485,7 +497,9 @@ def test_datastream_client_client_options_scopes( client_class, transport_class, transport_name ): # Check the case scopes are provided. - options = client_options.ClientOptions(scopes=["1", "2"],) + options = client_options.ClientOptions( + scopes=["1", "2"], + ) with mock.patch.object(transport_class, "__init__") as patched: patched.return_value = None client = client_class(client_options=options, transport=transport_name) @@ -614,11 +628,16 @@ def test_datastream_client_create_channel_credentials_file( @pytest.mark.parametrize( - "request_type", [datastream.ListConnectionProfilesRequest, dict,] + "request_type", + [ + datastream.ListConnectionProfilesRequest, + dict, + ], ) def test_list_connection_profiles(request_type, transport: str = "grpc"): client = DatastreamClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -631,7 +650,8 @@ def test_list_connection_profiles(request_type, transport: str = "grpc"): ) as call: # Designate an appropriate return value for the call. call.return_value = datastream.ListConnectionProfilesResponse( - next_page_token="next_page_token_value", unreachable=["unreachable_value"], + next_page_token="next_page_token_value", + unreachable=["unreachable_value"], ) response = client.list_connection_profiles(request) @@ -650,7 +670,8 @@ def test_list_connection_profiles_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = DatastreamClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -669,7 +690,8 @@ async def test_list_connection_profiles_async( request_type=datastream.ListConnectionProfilesRequest, ): client = DatastreamAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -706,7 +728,9 @@ async def test_list_connection_profiles_async_from_dict(): def test_list_connection_profiles_field_headers(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -728,12 +752,17 @@ def test_list_connection_profiles_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_list_connection_profiles_field_headers_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -757,11 +786,16 @@ async def test_list_connection_profiles_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] def test_list_connection_profiles_flattened(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -771,7 +805,9 @@ def test_list_connection_profiles_flattened(): call.return_value = datastream.ListConnectionProfilesResponse() # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.list_connection_profiles(parent="parent_value",) + client.list_connection_profiles( + parent="parent_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -783,19 +819,24 @@ def test_list_connection_profiles_flattened(): def test_list_connection_profiles_flattened_error(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.list_connection_profiles( - datastream.ListConnectionProfilesRequest(), parent="parent_value", + datastream.ListConnectionProfilesRequest(), + parent="parent_value", ) @pytest.mark.asyncio async def test_list_connection_profiles_flattened_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -809,7 +850,9 @@ async def test_list_connection_profiles_flattened_async(): ) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.list_connection_profiles(parent="parent_value",) + response = await client.list_connection_profiles( + parent="parent_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -822,19 +865,23 @@ async def test_list_connection_profiles_flattened_async(): @pytest.mark.asyncio async def test_list_connection_profiles_flattened_error_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): await client.list_connection_profiles( - datastream.ListConnectionProfilesRequest(), parent="parent_value", + datastream.ListConnectionProfilesRequest(), + parent="parent_value", ) def test_list_connection_profiles_pager(transport_name: str = "grpc"): client = DatastreamClient( - credentials=ga_credentials.AnonymousCredentials, transport=transport_name, + credentials=ga_credentials.AnonymousCredentials, + transport=transport_name, ) # Mock the actual call within the gRPC stub, and fake the request. @@ -852,10 +899,13 @@ def test_list_connection_profiles_pager(transport_name: str = "grpc"): next_page_token="abc", ), datastream.ListConnectionProfilesResponse( - connection_profiles=[], next_page_token="def", + connection_profiles=[], + next_page_token="def", ), datastream.ListConnectionProfilesResponse( - connection_profiles=[datastream_resources.ConnectionProfile(),], + connection_profiles=[ + datastream_resources.ConnectionProfile(), + ], next_page_token="ghi", ), datastream.ListConnectionProfilesResponse( @@ -884,7 +934,8 @@ def test_list_connection_profiles_pager(transport_name: str = "grpc"): def test_list_connection_profiles_pages(transport_name: str = "grpc"): client = DatastreamClient( - credentials=ga_credentials.AnonymousCredentials, transport=transport_name, + credentials=ga_credentials.AnonymousCredentials, + transport=transport_name, ) # Mock the actual call within the gRPC stub, and fake the request. @@ -902,10 +953,13 @@ def test_list_connection_profiles_pages(transport_name: str = "grpc"): next_page_token="abc", ), datastream.ListConnectionProfilesResponse( - connection_profiles=[], next_page_token="def", + connection_profiles=[], + next_page_token="def", ), datastream.ListConnectionProfilesResponse( - connection_profiles=[datastream_resources.ConnectionProfile(),], + connection_profiles=[ + datastream_resources.ConnectionProfile(), + ], next_page_token="ghi", ), datastream.ListConnectionProfilesResponse( @@ -923,7 +977,9 @@ def test_list_connection_profiles_pages(transport_name: str = "grpc"): @pytest.mark.asyncio async def test_list_connection_profiles_async_pager(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials,) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -942,10 +998,13 @@ async def test_list_connection_profiles_async_pager(): next_page_token="abc", ), datastream.ListConnectionProfilesResponse( - connection_profiles=[], next_page_token="def", + connection_profiles=[], + next_page_token="def", ), datastream.ListConnectionProfilesResponse( - connection_profiles=[datastream_resources.ConnectionProfile(),], + connection_profiles=[ + datastream_resources.ConnectionProfile(), + ], next_page_token="ghi", ), datastream.ListConnectionProfilesResponse( @@ -956,7 +1015,9 @@ async def test_list_connection_profiles_async_pager(): ), RuntimeError, ) - async_pager = await client.list_connection_profiles(request={},) + async_pager = await client.list_connection_profiles( + request={}, + ) assert async_pager.next_page_token == "abc" responses = [] async for response in async_pager: @@ -970,7 +1031,9 @@ async def test_list_connection_profiles_async_pager(): @pytest.mark.asyncio async def test_list_connection_profiles_async_pages(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials,) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -989,10 +1052,13 @@ async def test_list_connection_profiles_async_pages(): next_page_token="abc", ), datastream.ListConnectionProfilesResponse( - connection_profiles=[], next_page_token="def", + connection_profiles=[], + next_page_token="def", ), datastream.ListConnectionProfilesResponse( - connection_profiles=[datastream_resources.ConnectionProfile(),], + connection_profiles=[ + datastream_resources.ConnectionProfile(), + ], next_page_token="ghi", ), datastream.ListConnectionProfilesResponse( @@ -1011,11 +1077,16 @@ async def test_list_connection_profiles_async_pages(): @pytest.mark.parametrize( - "request_type", [datastream.GetConnectionProfileRequest, dict,] + "request_type", + [ + datastream.GetConnectionProfileRequest, + dict, + ], ) def test_get_connection_profile(request_type, transport: str = "grpc"): client = DatastreamClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1052,7 +1123,8 @@ def test_get_connection_profile_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = DatastreamClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1070,7 +1142,8 @@ async def test_get_connection_profile_async( transport: str = "grpc_asyncio", request_type=datastream.GetConnectionProfileRequest ): client = DatastreamAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1084,7 +1157,8 @@ async def test_get_connection_profile_async( # Designate an appropriate return value for the call. call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( datastream_resources.ConnectionProfile( - name="name_value", display_name="display_name_value", + name="name_value", + display_name="display_name_value", ) ) response = await client.get_connection_profile(request) @@ -1106,7 +1180,9 @@ async def test_get_connection_profile_async_from_dict(): def test_get_connection_profile_field_headers(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -1128,12 +1204,17 @@ def test_get_connection_profile_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_get_connection_profile_field_headers_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -1157,11 +1238,16 @@ async def test_get_connection_profile_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] def test_get_connection_profile_flattened(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1171,7 +1257,9 @@ def test_get_connection_profile_flattened(): call.return_value = datastream_resources.ConnectionProfile() # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.get_connection_profile(name="name_value",) + client.get_connection_profile( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -1183,19 +1271,24 @@ def test_get_connection_profile_flattened(): def test_get_connection_profile_flattened_error(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.get_connection_profile( - datastream.GetConnectionProfileRequest(), name="name_value", + datastream.GetConnectionProfileRequest(), + name="name_value", ) @pytest.mark.asyncio async def test_get_connection_profile_flattened_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1209,7 +1302,9 @@ async def test_get_connection_profile_flattened_async(): ) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.get_connection_profile(name="name_value",) + response = await client.get_connection_profile( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -1222,22 +1317,30 @@ async def test_get_connection_profile_flattened_async(): @pytest.mark.asyncio async def test_get_connection_profile_flattened_error_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): await client.get_connection_profile( - datastream.GetConnectionProfileRequest(), name="name_value", + datastream.GetConnectionProfileRequest(), + name="name_value", ) @pytest.mark.parametrize( - "request_type", [datastream.CreateConnectionProfileRequest, dict,] + "request_type", + [ + datastream.CreateConnectionProfileRequest, + dict, + ], ) def test_create_connection_profile(request_type, transport: str = "grpc"): client = DatastreamClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1265,7 +1368,8 @@ def test_create_connection_profile_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = DatastreamClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1284,7 +1388,8 @@ async def test_create_connection_profile_async( request_type=datastream.CreateConnectionProfileRequest, ): client = DatastreamAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1316,7 +1421,9 @@ async def test_create_connection_profile_async_from_dict(): def test_create_connection_profile_field_headers(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -1338,12 +1445,17 @@ def test_create_connection_profile_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_create_connection_profile_field_headers_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -1367,11 +1479,16 @@ async def test_create_connection_profile_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] def test_create_connection_profile_flattened(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1405,7 +1522,9 @@ def test_create_connection_profile_flattened(): def test_create_connection_profile_flattened_error(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -1422,7 +1541,9 @@ def test_create_connection_profile_flattened_error(): @pytest.mark.asyncio async def test_create_connection_profile_flattened_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1461,7 +1582,9 @@ async def test_create_connection_profile_flattened_async(): @pytest.mark.asyncio async def test_create_connection_profile_flattened_error_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -1477,11 +1600,16 @@ async def test_create_connection_profile_flattened_error_async(): @pytest.mark.parametrize( - "request_type", [datastream.UpdateConnectionProfileRequest, dict,] + "request_type", + [ + datastream.UpdateConnectionProfileRequest, + dict, + ], ) def test_update_connection_profile(request_type, transport: str = "grpc"): client = DatastreamClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1509,7 +1637,8 @@ def test_update_connection_profile_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = DatastreamClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1528,7 +1657,8 @@ async def test_update_connection_profile_async( request_type=datastream.UpdateConnectionProfileRequest, ): client = DatastreamAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1560,7 +1690,9 @@ async def test_update_connection_profile_async_from_dict(): def test_update_connection_profile_field_headers(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -1590,7 +1722,9 @@ def test_update_connection_profile_field_headers(): @pytest.mark.asyncio async def test_update_connection_profile_field_headers_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -1621,7 +1755,9 @@ async def test_update_connection_profile_field_headers_async(): def test_update_connection_profile_flattened(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1651,7 +1787,9 @@ def test_update_connection_profile_flattened(): def test_update_connection_profile_flattened_error(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -1667,7 +1805,9 @@ def test_update_connection_profile_flattened_error(): @pytest.mark.asyncio async def test_update_connection_profile_flattened_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1702,7 +1842,9 @@ async def test_update_connection_profile_flattened_async(): @pytest.mark.asyncio async def test_update_connection_profile_flattened_error_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -1717,11 +1859,16 @@ async def test_update_connection_profile_flattened_error_async(): @pytest.mark.parametrize( - "request_type", [datastream.DeleteConnectionProfileRequest, dict,] + "request_type", + [ + datastream.DeleteConnectionProfileRequest, + dict, + ], ) def test_delete_connection_profile(request_type, transport: str = "grpc"): client = DatastreamClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1749,7 +1896,8 @@ def test_delete_connection_profile_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = DatastreamClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1768,7 +1916,8 @@ async def test_delete_connection_profile_async( request_type=datastream.DeleteConnectionProfileRequest, ): client = DatastreamAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1800,7 +1949,9 @@ async def test_delete_connection_profile_async_from_dict(): def test_delete_connection_profile_field_headers(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -1822,12 +1973,17 @@ def test_delete_connection_profile_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_delete_connection_profile_field_headers_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -1851,11 +2007,16 @@ async def test_delete_connection_profile_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] def test_delete_connection_profile_flattened(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1865,7 +2026,9 @@ def test_delete_connection_profile_flattened(): call.return_value = operations_pb2.Operation(name="operations/op") # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.delete_connection_profile(name="name_value",) + client.delete_connection_profile( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -1877,19 +2040,24 @@ def test_delete_connection_profile_flattened(): def test_delete_connection_profile_flattened_error(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.delete_connection_profile( - datastream.DeleteConnectionProfileRequest(), name="name_value", + datastream.DeleteConnectionProfileRequest(), + name="name_value", ) @pytest.mark.asyncio async def test_delete_connection_profile_flattened_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1903,7 +2071,9 @@ async def test_delete_connection_profile_flattened_async(): ) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.delete_connection_profile(name="name_value",) + response = await client.delete_connection_profile( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -1916,22 +2086,30 @@ async def test_delete_connection_profile_flattened_async(): @pytest.mark.asyncio async def test_delete_connection_profile_flattened_error_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): await client.delete_connection_profile( - datastream.DeleteConnectionProfileRequest(), name="name_value", + datastream.DeleteConnectionProfileRequest(), + name="name_value", ) @pytest.mark.parametrize( - "request_type", [datastream.DiscoverConnectionProfileRequest, dict,] + "request_type", + [ + datastream.DiscoverConnectionProfileRequest, + dict, + ], ) def test_discover_connection_profile(request_type, transport: str = "grpc"): client = DatastreamClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1965,7 +2143,8 @@ def test_discover_connection_profile_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = DatastreamClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1984,7 +2163,8 @@ async def test_discover_connection_profile_async( request_type=datastream.DiscoverConnectionProfileRequest, ): client = DatastreamAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -2016,7 +2196,9 @@ async def test_discover_connection_profile_async_from_dict(): def test_discover_connection_profile_field_headers(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -2038,12 +2220,17 @@ def test_discover_connection_profile_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_discover_connection_profile_field_headers_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -2067,13 +2254,23 @@ async def test_discover_connection_profile_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] -@pytest.mark.parametrize("request_type", [datastream.ListStreamsRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + datastream.ListStreamsRequest, + dict, + ], +) def test_list_streams(request_type, transport: str = "grpc"): client = DatastreamClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -2084,7 +2281,8 @@ def test_list_streams(request_type, transport: str = "grpc"): with mock.patch.object(type(client.transport.list_streams), "__call__") as call: # Designate an appropriate return value for the call. call.return_value = datastream.ListStreamsResponse( - next_page_token="next_page_token_value", unreachable=["unreachable_value"], + next_page_token="next_page_token_value", + unreachable=["unreachable_value"], ) response = client.list_streams(request) @@ -2103,7 +2301,8 @@ def test_list_streams_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = DatastreamClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2119,7 +2318,8 @@ async def test_list_streams_async( transport: str = "grpc_asyncio", request_type=datastream.ListStreamsRequest ): client = DatastreamAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -2154,7 +2354,9 @@ async def test_list_streams_async_from_dict(): def test_list_streams_field_headers(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -2174,12 +2376,17 @@ def test_list_streams_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_list_streams_field_headers_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -2201,11 +2408,16 @@ async def test_list_streams_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] def test_list_streams_flattened(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_streams), "__call__") as call: @@ -2213,7 +2425,9 @@ def test_list_streams_flattened(): call.return_value = datastream.ListStreamsResponse() # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.list_streams(parent="parent_value",) + client.list_streams( + parent="parent_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -2225,19 +2439,24 @@ def test_list_streams_flattened(): def test_list_streams_flattened_error(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.list_streams( - datastream.ListStreamsRequest(), parent="parent_value", + datastream.ListStreamsRequest(), + parent="parent_value", ) @pytest.mark.asyncio async def test_list_streams_flattened_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_streams), "__call__") as call: @@ -2249,7 +2468,9 @@ async def test_list_streams_flattened_async(): ) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.list_streams(parent="parent_value",) + response = await client.list_streams( + parent="parent_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -2262,19 +2483,23 @@ async def test_list_streams_flattened_async(): @pytest.mark.asyncio async def test_list_streams_flattened_error_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): await client.list_streams( - datastream.ListStreamsRequest(), parent="parent_value", + datastream.ListStreamsRequest(), + parent="parent_value", ) def test_list_streams_pager(transport_name: str = "grpc"): client = DatastreamClient( - credentials=ga_credentials.AnonymousCredentials, transport=transport_name, + credentials=ga_credentials.AnonymousCredentials, + transport=transport_name, ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2289,12 +2514,21 @@ def test_list_streams_pager(transport_name: str = "grpc"): ], next_page_token="abc", ), - datastream.ListStreamsResponse(streams=[], next_page_token="def",), datastream.ListStreamsResponse( - streams=[datastream_resources.Stream(),], next_page_token="ghi", + streams=[], + next_page_token="def", + ), + datastream.ListStreamsResponse( + streams=[ + datastream_resources.Stream(), + ], + next_page_token="ghi", ), datastream.ListStreamsResponse( - streams=[datastream_resources.Stream(), datastream_resources.Stream(),], + streams=[ + datastream_resources.Stream(), + datastream_resources.Stream(), + ], ), RuntimeError, ) @@ -2314,7 +2548,8 @@ def test_list_streams_pager(transport_name: str = "grpc"): def test_list_streams_pages(transport_name: str = "grpc"): client = DatastreamClient( - credentials=ga_credentials.AnonymousCredentials, transport=transport_name, + credentials=ga_credentials.AnonymousCredentials, + transport=transport_name, ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2329,13 +2564,22 @@ def test_list_streams_pages(transport_name: str = "grpc"): ], next_page_token="abc", ), - datastream.ListStreamsResponse(streams=[], next_page_token="def",), datastream.ListStreamsResponse( - streams=[datastream_resources.Stream(),], next_page_token="ghi", + streams=[], + next_page_token="def", ), datastream.ListStreamsResponse( - streams=[datastream_resources.Stream(), datastream_resources.Stream(),], - ), + streams=[ + datastream_resources.Stream(), + ], + next_page_token="ghi", + ), + datastream.ListStreamsResponse( + streams=[ + datastream_resources.Stream(), + datastream_resources.Stream(), + ], + ), RuntimeError, ) pages = list(client.list_streams(request={}).pages) @@ -2345,7 +2589,9 @@ def test_list_streams_pages(transport_name: str = "grpc"): @pytest.mark.asyncio async def test_list_streams_async_pager(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials,) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2361,16 +2607,27 @@ async def test_list_streams_async_pager(): ], next_page_token="abc", ), - datastream.ListStreamsResponse(streams=[], next_page_token="def",), datastream.ListStreamsResponse( - streams=[datastream_resources.Stream(),], next_page_token="ghi", + streams=[], + next_page_token="def", + ), + datastream.ListStreamsResponse( + streams=[ + datastream_resources.Stream(), + ], + next_page_token="ghi", ), datastream.ListStreamsResponse( - streams=[datastream_resources.Stream(), datastream_resources.Stream(),], + streams=[ + datastream_resources.Stream(), + datastream_resources.Stream(), + ], ), RuntimeError, ) - async_pager = await client.list_streams(request={},) + async_pager = await client.list_streams( + request={}, + ) assert async_pager.next_page_token == "abc" responses = [] async for response in async_pager: @@ -2382,7 +2639,9 @@ async def test_list_streams_async_pager(): @pytest.mark.asyncio async def test_list_streams_async_pages(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials,) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2398,12 +2657,21 @@ async def test_list_streams_async_pages(): ], next_page_token="abc", ), - datastream.ListStreamsResponse(streams=[], next_page_token="def",), datastream.ListStreamsResponse( - streams=[datastream_resources.Stream(),], next_page_token="ghi", + streams=[], + next_page_token="def", + ), + datastream.ListStreamsResponse( + streams=[ + datastream_resources.Stream(), + ], + next_page_token="ghi", ), datastream.ListStreamsResponse( - streams=[datastream_resources.Stream(), datastream_resources.Stream(),], + streams=[ + datastream_resources.Stream(), + datastream_resources.Stream(), + ], ), RuntimeError, ) @@ -2414,10 +2682,17 @@ async def test_list_streams_async_pages(): assert page_.raw_page.next_page_token == token -@pytest.mark.parametrize("request_type", [datastream.GetStreamRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + datastream.GetStreamRequest, + dict, + ], +) def test_get_stream(request_type, transport: str = "grpc"): client = DatastreamClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -2462,7 +2737,8 @@ def test_get_stream_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = DatastreamClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2478,7 +2754,8 @@ async def test_get_stream_async( transport: str = "grpc_asyncio", request_type=datastream.GetStreamRequest ): client = DatastreamAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -2520,7 +2797,9 @@ async def test_get_stream_async_from_dict(): def test_get_stream_field_headers(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -2540,12 +2819,17 @@ def test_get_stream_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_get_stream_field_headers_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -2567,11 +2851,16 @@ async def test_get_stream_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] def test_get_stream_flattened(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_stream), "__call__") as call: @@ -2579,7 +2868,9 @@ def test_get_stream_flattened(): call.return_value = datastream_resources.Stream() # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.get_stream(name="name_value",) + client.get_stream( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -2591,19 +2882,24 @@ def test_get_stream_flattened(): def test_get_stream_flattened_error(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.get_stream( - datastream.GetStreamRequest(), name="name_value", + datastream.GetStreamRequest(), + name="name_value", ) @pytest.mark.asyncio async def test_get_stream_flattened_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_stream), "__call__") as call: @@ -2615,7 +2911,9 @@ async def test_get_stream_flattened_async(): ) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.get_stream(name="name_value",) + response = await client.get_stream( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -2628,20 +2926,30 @@ async def test_get_stream_flattened_async(): @pytest.mark.asyncio async def test_get_stream_flattened_error_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): await client.get_stream( - datastream.GetStreamRequest(), name="name_value", + datastream.GetStreamRequest(), + name="name_value", ) -@pytest.mark.parametrize("request_type", [datastream.CreateStreamRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + datastream.CreateStreamRequest, + dict, + ], +) def test_create_stream(request_type, transport: str = "grpc"): client = DatastreamClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -2667,7 +2975,8 @@ def test_create_stream_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = DatastreamClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2683,7 +2992,8 @@ async def test_create_stream_async( transport: str = "grpc_asyncio", request_type=datastream.CreateStreamRequest ): client = DatastreamAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -2713,7 +3023,9 @@ async def test_create_stream_async_from_dict(): def test_create_stream_field_headers(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -2733,12 +3045,17 @@ def test_create_stream_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_create_stream_field_headers_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -2760,11 +3077,16 @@ async def test_create_stream_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] def test_create_stream_flattened(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_stream), "__call__") as call: @@ -2794,7 +3116,9 @@ def test_create_stream_flattened(): def test_create_stream_flattened_error(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -2809,7 +3133,9 @@ def test_create_stream_flattened_error(): @pytest.mark.asyncio async def test_create_stream_flattened_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_stream), "__call__") as call: @@ -2844,7 +3170,9 @@ async def test_create_stream_flattened_async(): @pytest.mark.asyncio async def test_create_stream_flattened_error_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -2857,10 +3185,17 @@ async def test_create_stream_flattened_error_async(): ) -@pytest.mark.parametrize("request_type", [datastream.UpdateStreamRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + datastream.UpdateStreamRequest, + dict, + ], +) def test_update_stream(request_type, transport: str = "grpc"): client = DatastreamClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -2886,7 +3221,8 @@ def test_update_stream_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = DatastreamClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2902,7 +3238,8 @@ async def test_update_stream_async( transport: str = "grpc_asyncio", request_type=datastream.UpdateStreamRequest ): client = DatastreamAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -2932,7 +3269,9 @@ async def test_update_stream_async_from_dict(): def test_update_stream_field_headers(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -2952,12 +3291,17 @@ def test_update_stream_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "stream.name=stream.name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "stream.name=stream.name/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_update_stream_field_headers_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -2979,11 +3323,16 @@ async def test_update_stream_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "stream.name=stream.name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "stream.name=stream.name/value", + ) in kw["metadata"] def test_update_stream_flattened(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_stream), "__call__") as call: @@ -3009,7 +3358,9 @@ def test_update_stream_flattened(): def test_update_stream_flattened_error(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -3023,7 +3374,9 @@ def test_update_stream_flattened_error(): @pytest.mark.asyncio async def test_update_stream_flattened_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_stream), "__call__") as call: @@ -3054,7 +3407,9 @@ async def test_update_stream_flattened_async(): @pytest.mark.asyncio async def test_update_stream_flattened_error_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -3066,10 +3421,17 @@ async def test_update_stream_flattened_error_async(): ) -@pytest.mark.parametrize("request_type", [datastream.DeleteStreamRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + datastream.DeleteStreamRequest, + dict, + ], +) def test_delete_stream(request_type, transport: str = "grpc"): client = DatastreamClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -3095,7 +3457,8 @@ def test_delete_stream_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = DatastreamClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3111,7 +3474,8 @@ async def test_delete_stream_async( transport: str = "grpc_asyncio", request_type=datastream.DeleteStreamRequest ): client = DatastreamAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -3141,7 +3505,9 @@ async def test_delete_stream_async_from_dict(): def test_delete_stream_field_headers(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -3161,12 +3527,17 @@ def test_delete_stream_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_delete_stream_field_headers_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -3188,11 +3559,16 @@ async def test_delete_stream_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] def test_delete_stream_flattened(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_stream), "__call__") as call: @@ -3200,7 +3576,9 @@ def test_delete_stream_flattened(): call.return_value = operations_pb2.Operation(name="operations/op") # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.delete_stream(name="name_value",) + client.delete_stream( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -3212,19 +3590,24 @@ def test_delete_stream_flattened(): def test_delete_stream_flattened_error(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.delete_stream( - datastream.DeleteStreamRequest(), name="name_value", + datastream.DeleteStreamRequest(), + name="name_value", ) @pytest.mark.asyncio async def test_delete_stream_flattened_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_stream), "__call__") as call: @@ -3236,7 +3619,9 @@ async def test_delete_stream_flattened_async(): ) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.delete_stream(name="name_value",) + response = await client.delete_stream( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -3249,20 +3634,30 @@ async def test_delete_stream_flattened_async(): @pytest.mark.asyncio async def test_delete_stream_flattened_error_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): await client.delete_stream( - datastream.DeleteStreamRequest(), name="name_value", + datastream.DeleteStreamRequest(), + name="name_value", ) -@pytest.mark.parametrize("request_type", [datastream.GetStreamObjectRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + datastream.GetStreamObjectRequest, + dict, + ], +) def test_get_stream_object(request_type, transport: str = "grpc"): client = DatastreamClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -3275,7 +3670,8 @@ def test_get_stream_object(request_type, transport: str = "grpc"): ) as call: # Designate an appropriate return value for the call. call.return_value = datastream_resources.StreamObject( - name="name_value", display_name="display_name_value", + name="name_value", + display_name="display_name_value", ) response = client.get_stream_object(request) @@ -3294,7 +3690,8 @@ def test_get_stream_object_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = DatastreamClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3312,7 +3709,8 @@ async def test_get_stream_object_async( transport: str = "grpc_asyncio", request_type=datastream.GetStreamObjectRequest ): client = DatastreamAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -3326,7 +3724,8 @@ async def test_get_stream_object_async( # Designate an appropriate return value for the call. call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( datastream_resources.StreamObject( - name="name_value", display_name="display_name_value", + name="name_value", + display_name="display_name_value", ) ) response = await client.get_stream_object(request) @@ -3348,7 +3747,9 @@ async def test_get_stream_object_async_from_dict(): def test_get_stream_object_field_headers(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -3370,12 +3771,17 @@ def test_get_stream_object_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_get_stream_object_field_headers_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -3399,11 +3805,16 @@ async def test_get_stream_object_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] def test_get_stream_object_flattened(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3413,7 +3824,9 @@ def test_get_stream_object_flattened(): call.return_value = datastream_resources.StreamObject() # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.get_stream_object(name="name_value",) + client.get_stream_object( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -3425,19 +3838,24 @@ def test_get_stream_object_flattened(): def test_get_stream_object_flattened_error(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.get_stream_object( - datastream.GetStreamObjectRequest(), name="name_value", + datastream.GetStreamObjectRequest(), + name="name_value", ) @pytest.mark.asyncio async def test_get_stream_object_flattened_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3451,7 +3869,9 @@ async def test_get_stream_object_flattened_async(): ) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.get_stream_object(name="name_value",) + response = await client.get_stream_object( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -3464,20 +3884,30 @@ async def test_get_stream_object_flattened_async(): @pytest.mark.asyncio async def test_get_stream_object_flattened_error_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): await client.get_stream_object( - datastream.GetStreamObjectRequest(), name="name_value", + datastream.GetStreamObjectRequest(), + name="name_value", ) -@pytest.mark.parametrize("request_type", [datastream.LookupStreamObjectRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + datastream.LookupStreamObjectRequest, + dict, + ], +) def test_lookup_stream_object(request_type, transport: str = "grpc"): client = DatastreamClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -3490,7 +3920,8 @@ def test_lookup_stream_object(request_type, transport: str = "grpc"): ) as call: # Designate an appropriate return value for the call. call.return_value = datastream_resources.StreamObject( - name="name_value", display_name="display_name_value", + name="name_value", + display_name="display_name_value", ) response = client.lookup_stream_object(request) @@ -3509,7 +3940,8 @@ def test_lookup_stream_object_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = DatastreamClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3527,7 +3959,8 @@ async def test_lookup_stream_object_async( transport: str = "grpc_asyncio", request_type=datastream.LookupStreamObjectRequest ): client = DatastreamAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -3541,7 +3974,8 @@ async def test_lookup_stream_object_async( # Designate an appropriate return value for the call. call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( datastream_resources.StreamObject( - name="name_value", display_name="display_name_value", + name="name_value", + display_name="display_name_value", ) ) response = await client.lookup_stream_object(request) @@ -3563,7 +3997,9 @@ async def test_lookup_stream_object_async_from_dict(): def test_lookup_stream_object_field_headers(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -3585,12 +4021,17 @@ def test_lookup_stream_object_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_lookup_stream_object_field_headers_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -3614,13 +4055,23 @@ async def test_lookup_stream_object_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] -@pytest.mark.parametrize("request_type", [datastream.ListStreamObjectsRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + datastream.ListStreamObjectsRequest, + dict, + ], +) def test_list_stream_objects(request_type, transport: str = "grpc"): client = DatastreamClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -3651,7 +4102,8 @@ def test_list_stream_objects_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = DatastreamClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3669,7 +4121,8 @@ async def test_list_stream_objects_async( transport: str = "grpc_asyncio", request_type=datastream.ListStreamObjectsRequest ): client = DatastreamAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -3704,7 +4157,9 @@ async def test_list_stream_objects_async_from_dict(): def test_list_stream_objects_field_headers(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -3726,12 +4181,17 @@ def test_list_stream_objects_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_list_stream_objects_field_headers_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -3755,11 +4215,16 @@ async def test_list_stream_objects_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] def test_list_stream_objects_flattened(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3769,7 +4234,9 @@ def test_list_stream_objects_flattened(): call.return_value = datastream.ListStreamObjectsResponse() # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.list_stream_objects(parent="parent_value",) + client.list_stream_objects( + parent="parent_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -3781,19 +4248,24 @@ def test_list_stream_objects_flattened(): def test_list_stream_objects_flattened_error(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.list_stream_objects( - datastream.ListStreamObjectsRequest(), parent="parent_value", + datastream.ListStreamObjectsRequest(), + parent="parent_value", ) @pytest.mark.asyncio async def test_list_stream_objects_flattened_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3807,7 +4279,9 @@ async def test_list_stream_objects_flattened_async(): ) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.list_stream_objects(parent="parent_value",) + response = await client.list_stream_objects( + parent="parent_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -3820,19 +4294,23 @@ async def test_list_stream_objects_flattened_async(): @pytest.mark.asyncio async def test_list_stream_objects_flattened_error_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): await client.list_stream_objects( - datastream.ListStreamObjectsRequest(), parent="parent_value", + datastream.ListStreamObjectsRequest(), + parent="parent_value", ) def test_list_stream_objects_pager(transport_name: str = "grpc"): client = DatastreamClient( - credentials=ga_credentials.AnonymousCredentials, transport=transport_name, + credentials=ga_credentials.AnonymousCredentials, + transport=transport_name, ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3850,10 +4328,13 @@ def test_list_stream_objects_pager(transport_name: str = "grpc"): next_page_token="abc", ), datastream.ListStreamObjectsResponse( - stream_objects=[], next_page_token="def", + stream_objects=[], + next_page_token="def", ), datastream.ListStreamObjectsResponse( - stream_objects=[datastream_resources.StreamObject(),], + stream_objects=[ + datastream_resources.StreamObject(), + ], next_page_token="ghi", ), datastream.ListStreamObjectsResponse( @@ -3880,7 +4361,8 @@ def test_list_stream_objects_pager(transport_name: str = "grpc"): def test_list_stream_objects_pages(transport_name: str = "grpc"): client = DatastreamClient( - credentials=ga_credentials.AnonymousCredentials, transport=transport_name, + credentials=ga_credentials.AnonymousCredentials, + transport=transport_name, ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3898,10 +4380,13 @@ def test_list_stream_objects_pages(transport_name: str = "grpc"): next_page_token="abc", ), datastream.ListStreamObjectsResponse( - stream_objects=[], next_page_token="def", + stream_objects=[], + next_page_token="def", ), datastream.ListStreamObjectsResponse( - stream_objects=[datastream_resources.StreamObject(),], + stream_objects=[ + datastream_resources.StreamObject(), + ], next_page_token="ghi", ), datastream.ListStreamObjectsResponse( @@ -3919,7 +4404,9 @@ def test_list_stream_objects_pages(transport_name: str = "grpc"): @pytest.mark.asyncio async def test_list_stream_objects_async_pager(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials,) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3938,10 +4425,13 @@ async def test_list_stream_objects_async_pager(): next_page_token="abc", ), datastream.ListStreamObjectsResponse( - stream_objects=[], next_page_token="def", + stream_objects=[], + next_page_token="def", ), datastream.ListStreamObjectsResponse( - stream_objects=[datastream_resources.StreamObject(),], + stream_objects=[ + datastream_resources.StreamObject(), + ], next_page_token="ghi", ), datastream.ListStreamObjectsResponse( @@ -3952,7 +4442,9 @@ async def test_list_stream_objects_async_pager(): ), RuntimeError, ) - async_pager = await client.list_stream_objects(request={},) + async_pager = await client.list_stream_objects( + request={}, + ) assert async_pager.next_page_token == "abc" responses = [] async for response in async_pager: @@ -3964,7 +4456,9 @@ async def test_list_stream_objects_async_pager(): @pytest.mark.asyncio async def test_list_stream_objects_async_pages(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials,) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3983,10 +4477,13 @@ async def test_list_stream_objects_async_pages(): next_page_token="abc", ), datastream.ListStreamObjectsResponse( - stream_objects=[], next_page_token="def", + stream_objects=[], + next_page_token="def", ), datastream.ListStreamObjectsResponse( - stream_objects=[datastream_resources.StreamObject(),], + stream_objects=[ + datastream_resources.StreamObject(), + ], next_page_token="ghi", ), datastream.ListStreamObjectsResponse( @@ -4004,10 +4501,17 @@ async def test_list_stream_objects_async_pages(): assert page_.raw_page.next_page_token == token -@pytest.mark.parametrize("request_type", [datastream.StartBackfillJobRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + datastream.StartBackfillJobRequest, + dict, + ], +) def test_start_backfill_job(request_type, transport: str = "grpc"): client = DatastreamClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -4035,7 +4539,8 @@ def test_start_backfill_job_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = DatastreamClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -4053,7 +4558,8 @@ async def test_start_backfill_job_async( transport: str = "grpc_asyncio", request_type=datastream.StartBackfillJobRequest ): client = DatastreamAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -4085,7 +4591,9 @@ async def test_start_backfill_job_async_from_dict(): def test_start_backfill_job_field_headers(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -4107,12 +4615,17 @@ def test_start_backfill_job_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "object=object/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "object=object/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_start_backfill_job_field_headers_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -4136,11 +4649,16 @@ async def test_start_backfill_job_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "object=object/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "object=object/value", + ) in kw["metadata"] def test_start_backfill_job_flattened(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4150,7 +4668,9 @@ def test_start_backfill_job_flattened(): call.return_value = datastream.StartBackfillJobResponse() # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.start_backfill_job(object_="object__value",) + client.start_backfill_job( + object_="object__value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -4162,19 +4682,24 @@ def test_start_backfill_job_flattened(): def test_start_backfill_job_flattened_error(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.start_backfill_job( - datastream.StartBackfillJobRequest(), object_="object__value", + datastream.StartBackfillJobRequest(), + object_="object__value", ) @pytest.mark.asyncio async def test_start_backfill_job_flattened_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4188,7 +4713,9 @@ async def test_start_backfill_job_flattened_async(): ) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.start_backfill_job(object_="object__value",) + response = await client.start_backfill_job( + object_="object__value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -4201,20 +4728,30 @@ async def test_start_backfill_job_flattened_async(): @pytest.mark.asyncio async def test_start_backfill_job_flattened_error_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): await client.start_backfill_job( - datastream.StartBackfillJobRequest(), object_="object__value", + datastream.StartBackfillJobRequest(), + object_="object__value", ) -@pytest.mark.parametrize("request_type", [datastream.StopBackfillJobRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + datastream.StopBackfillJobRequest, + dict, + ], +) def test_stop_backfill_job(request_type, transport: str = "grpc"): client = DatastreamClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -4242,7 +4779,8 @@ def test_stop_backfill_job_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = DatastreamClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -4260,7 +4798,8 @@ async def test_stop_backfill_job_async( transport: str = "grpc_asyncio", request_type=datastream.StopBackfillJobRequest ): client = DatastreamAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -4292,7 +4831,9 @@ async def test_stop_backfill_job_async_from_dict(): def test_stop_backfill_job_field_headers(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -4314,12 +4855,17 @@ def test_stop_backfill_job_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "object=object/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "object=object/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_stop_backfill_job_field_headers_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -4343,11 +4889,16 @@ async def test_stop_backfill_job_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "object=object/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "object=object/value", + ) in kw["metadata"] def test_stop_backfill_job_flattened(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4357,7 +4908,9 @@ def test_stop_backfill_job_flattened(): call.return_value = datastream.StopBackfillJobResponse() # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.stop_backfill_job(object_="object__value",) + client.stop_backfill_job( + object_="object__value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -4369,19 +4922,24 @@ def test_stop_backfill_job_flattened(): def test_stop_backfill_job_flattened_error(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.stop_backfill_job( - datastream.StopBackfillJobRequest(), object_="object__value", + datastream.StopBackfillJobRequest(), + object_="object__value", ) @pytest.mark.asyncio async def test_stop_backfill_job_flattened_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4395,7 +4953,9 @@ async def test_stop_backfill_job_flattened_async(): ) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.stop_backfill_job(object_="object__value",) + response = await client.stop_backfill_job( + object_="object__value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -4408,20 +4968,30 @@ async def test_stop_backfill_job_flattened_async(): @pytest.mark.asyncio async def test_stop_backfill_job_flattened_error_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): await client.stop_backfill_job( - datastream.StopBackfillJobRequest(), object_="object__value", + datastream.StopBackfillJobRequest(), + object_="object__value", ) -@pytest.mark.parametrize("request_type", [datastream.FetchStaticIpsRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + datastream.FetchStaticIpsRequest, + dict, + ], +) def test_fetch_static_ips(request_type, transport: str = "grpc"): client = DatastreamClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -4432,7 +5002,8 @@ def test_fetch_static_ips(request_type, transport: str = "grpc"): with mock.patch.object(type(client.transport.fetch_static_ips), "__call__") as call: # Designate an appropriate return value for the call. call.return_value = datastream.FetchStaticIpsResponse( - static_ips=["static_ips_value"], next_page_token="next_page_token_value", + static_ips=["static_ips_value"], + next_page_token="next_page_token_value", ) response = client.fetch_static_ips(request) @@ -4451,7 +5022,8 @@ def test_fetch_static_ips_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = DatastreamClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -4467,7 +5039,8 @@ async def test_fetch_static_ips_async( transport: str = "grpc_asyncio", request_type=datastream.FetchStaticIpsRequest ): client = DatastreamAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -4502,7 +5075,9 @@ async def test_fetch_static_ips_async_from_dict(): def test_fetch_static_ips_field_headers(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -4522,12 +5097,17 @@ def test_fetch_static_ips_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_fetch_static_ips_field_headers_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -4549,11 +5129,16 @@ async def test_fetch_static_ips_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] def test_fetch_static_ips_flattened(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.fetch_static_ips), "__call__") as call: @@ -4561,7 +5146,9 @@ def test_fetch_static_ips_flattened(): call.return_value = datastream.FetchStaticIpsResponse() # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.fetch_static_ips(name="name_value",) + client.fetch_static_ips( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -4573,19 +5160,24 @@ def test_fetch_static_ips_flattened(): def test_fetch_static_ips_flattened_error(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.fetch_static_ips( - datastream.FetchStaticIpsRequest(), name="name_value", + datastream.FetchStaticIpsRequest(), + name="name_value", ) @pytest.mark.asyncio async def test_fetch_static_ips_flattened_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.fetch_static_ips), "__call__") as call: @@ -4597,7 +5189,9 @@ async def test_fetch_static_ips_flattened_async(): ) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.fetch_static_ips(name="name_value",) + response = await client.fetch_static_ips( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -4610,19 +5204,23 @@ async def test_fetch_static_ips_flattened_async(): @pytest.mark.asyncio async def test_fetch_static_ips_flattened_error_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): await client.fetch_static_ips( - datastream.FetchStaticIpsRequest(), name="name_value", + datastream.FetchStaticIpsRequest(), + name="name_value", ) def test_fetch_static_ips_pager(transport_name: str = "grpc"): client = DatastreamClient( - credentials=ga_credentials.AnonymousCredentials, transport=transport_name, + credentials=ga_credentials.AnonymousCredentials, + transport=transport_name, ) # Mock the actual call within the gRPC stub, and fake the request. @@ -4630,13 +5228,29 @@ def test_fetch_static_ips_pager(transport_name: str = "grpc"): # Set the response to a series of pages. call.side_effect = ( datastream.FetchStaticIpsResponse( - static_ips=[str(), str(), str(),], next_page_token="abc", + static_ips=[ + str(), + str(), + str(), + ], + next_page_token="abc", + ), + datastream.FetchStaticIpsResponse( + static_ips=[], + next_page_token="def", + ), + datastream.FetchStaticIpsResponse( + static_ips=[ + str(), + ], + next_page_token="ghi", ), - datastream.FetchStaticIpsResponse(static_ips=[], next_page_token="def",), datastream.FetchStaticIpsResponse( - static_ips=[str(),], next_page_token="ghi", + static_ips=[ + str(), + str(), + ], ), - datastream.FetchStaticIpsResponse(static_ips=[str(), str(),],), RuntimeError, ) @@ -4655,7 +5269,8 @@ def test_fetch_static_ips_pager(transport_name: str = "grpc"): def test_fetch_static_ips_pages(transport_name: str = "grpc"): client = DatastreamClient( - credentials=ga_credentials.AnonymousCredentials, transport=transport_name, + credentials=ga_credentials.AnonymousCredentials, + transport=transport_name, ) # Mock the actual call within the gRPC stub, and fake the request. @@ -4663,13 +5278,29 @@ def test_fetch_static_ips_pages(transport_name: str = "grpc"): # Set the response to a series of pages. call.side_effect = ( datastream.FetchStaticIpsResponse( - static_ips=[str(), str(), str(),], next_page_token="abc", + static_ips=[ + str(), + str(), + str(), + ], + next_page_token="abc", + ), + datastream.FetchStaticIpsResponse( + static_ips=[], + next_page_token="def", ), - datastream.FetchStaticIpsResponse(static_ips=[], next_page_token="def",), datastream.FetchStaticIpsResponse( - static_ips=[str(),], next_page_token="ghi", + static_ips=[ + str(), + ], + next_page_token="ghi", + ), + datastream.FetchStaticIpsResponse( + static_ips=[ + str(), + str(), + ], ), - datastream.FetchStaticIpsResponse(static_ips=[str(), str(),],), RuntimeError, ) pages = list(client.fetch_static_ips(request={}).pages) @@ -4679,7 +5310,9 @@ def test_fetch_static_ips_pages(transport_name: str = "grpc"): @pytest.mark.asyncio async def test_fetch_static_ips_async_pager(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials,) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4688,16 +5321,34 @@ async def test_fetch_static_ips_async_pager(): # Set the response to a series of pages. call.side_effect = ( datastream.FetchStaticIpsResponse( - static_ips=[str(), str(), str(),], next_page_token="abc", + static_ips=[ + str(), + str(), + str(), + ], + next_page_token="abc", + ), + datastream.FetchStaticIpsResponse( + static_ips=[], + next_page_token="def", + ), + datastream.FetchStaticIpsResponse( + static_ips=[ + str(), + ], + next_page_token="ghi", ), - datastream.FetchStaticIpsResponse(static_ips=[], next_page_token="def",), datastream.FetchStaticIpsResponse( - static_ips=[str(),], next_page_token="ghi", + static_ips=[ + str(), + str(), + ], ), - datastream.FetchStaticIpsResponse(static_ips=[str(), str(),],), RuntimeError, ) - async_pager = await client.fetch_static_ips(request={},) + async_pager = await client.fetch_static_ips( + request={}, + ) assert async_pager.next_page_token == "abc" responses = [] async for response in async_pager: @@ -4709,7 +5360,9 @@ async def test_fetch_static_ips_async_pager(): @pytest.mark.asyncio async def test_fetch_static_ips_async_pages(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials,) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4718,13 +5371,29 @@ async def test_fetch_static_ips_async_pages(): # Set the response to a series of pages. call.side_effect = ( datastream.FetchStaticIpsResponse( - static_ips=[str(), str(), str(),], next_page_token="abc", + static_ips=[ + str(), + str(), + str(), + ], + next_page_token="abc", + ), + datastream.FetchStaticIpsResponse( + static_ips=[], + next_page_token="def", + ), + datastream.FetchStaticIpsResponse( + static_ips=[ + str(), + ], + next_page_token="ghi", ), - datastream.FetchStaticIpsResponse(static_ips=[], next_page_token="def",), datastream.FetchStaticIpsResponse( - static_ips=[str(),], next_page_token="ghi", + static_ips=[ + str(), + str(), + ], ), - datastream.FetchStaticIpsResponse(static_ips=[str(), str(),],), RuntimeError, ) pages = [] @@ -4735,11 +5404,16 @@ async def test_fetch_static_ips_async_pages(): @pytest.mark.parametrize( - "request_type", [datastream.CreatePrivateConnectionRequest, dict,] + "request_type", + [ + datastream.CreatePrivateConnectionRequest, + dict, + ], ) def test_create_private_connection(request_type, transport: str = "grpc"): client = DatastreamClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -4767,7 +5441,8 @@ def test_create_private_connection_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = DatastreamClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -4786,7 +5461,8 @@ async def test_create_private_connection_async( request_type=datastream.CreatePrivateConnectionRequest, ): client = DatastreamAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -4818,7 +5494,9 @@ async def test_create_private_connection_async_from_dict(): def test_create_private_connection_field_headers(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -4840,12 +5518,17 @@ def test_create_private_connection_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_create_private_connection_field_headers_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -4869,11 +5552,16 @@ async def test_create_private_connection_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] def test_create_private_connection_flattened(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4907,7 +5595,9 @@ def test_create_private_connection_flattened(): def test_create_private_connection_flattened_error(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -4924,7 +5614,9 @@ def test_create_private_connection_flattened_error(): @pytest.mark.asyncio async def test_create_private_connection_flattened_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4963,7 +5655,9 @@ async def test_create_private_connection_flattened_async(): @pytest.mark.asyncio async def test_create_private_connection_flattened_error_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -4979,11 +5673,16 @@ async def test_create_private_connection_flattened_error_async(): @pytest.mark.parametrize( - "request_type", [datastream.GetPrivateConnectionRequest, dict,] + "request_type", + [ + datastream.GetPrivateConnectionRequest, + dict, + ], ) def test_get_private_connection(request_type, transport: str = "grpc"): client = DatastreamClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -5018,7 +5717,8 @@ def test_get_private_connection_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = DatastreamClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -5036,7 +5736,8 @@ async def test_get_private_connection_async( transport: str = "grpc_asyncio", request_type=datastream.GetPrivateConnectionRequest ): client = DatastreamAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -5075,7 +5776,9 @@ async def test_get_private_connection_async_from_dict(): def test_get_private_connection_field_headers(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -5097,12 +5800,17 @@ def test_get_private_connection_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_get_private_connection_field_headers_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -5126,11 +5834,16 @@ async def test_get_private_connection_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] def test_get_private_connection_flattened(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5140,7 +5853,9 @@ def test_get_private_connection_flattened(): call.return_value = datastream_resources.PrivateConnection() # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.get_private_connection(name="name_value",) + client.get_private_connection( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -5152,19 +5867,24 @@ def test_get_private_connection_flattened(): def test_get_private_connection_flattened_error(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.get_private_connection( - datastream.GetPrivateConnectionRequest(), name="name_value", + datastream.GetPrivateConnectionRequest(), + name="name_value", ) @pytest.mark.asyncio async def test_get_private_connection_flattened_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5178,7 +5898,9 @@ async def test_get_private_connection_flattened_async(): ) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.get_private_connection(name="name_value",) + response = await client.get_private_connection( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -5191,22 +5913,30 @@ async def test_get_private_connection_flattened_async(): @pytest.mark.asyncio async def test_get_private_connection_flattened_error_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): await client.get_private_connection( - datastream.GetPrivateConnectionRequest(), name="name_value", + datastream.GetPrivateConnectionRequest(), + name="name_value", ) @pytest.mark.parametrize( - "request_type", [datastream.ListPrivateConnectionsRequest, dict,] + "request_type", + [ + datastream.ListPrivateConnectionsRequest, + dict, + ], ) def test_list_private_connections(request_type, transport: str = "grpc"): client = DatastreamClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -5219,7 +5949,8 @@ def test_list_private_connections(request_type, transport: str = "grpc"): ) as call: # Designate an appropriate return value for the call. call.return_value = datastream.ListPrivateConnectionsResponse( - next_page_token="next_page_token_value", unreachable=["unreachable_value"], + next_page_token="next_page_token_value", + unreachable=["unreachable_value"], ) response = client.list_private_connections(request) @@ -5238,7 +5969,8 @@ def test_list_private_connections_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = DatastreamClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -5257,7 +5989,8 @@ async def test_list_private_connections_async( request_type=datastream.ListPrivateConnectionsRequest, ): client = DatastreamAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -5294,7 +6027,9 @@ async def test_list_private_connections_async_from_dict(): def test_list_private_connections_field_headers(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -5316,12 +6051,17 @@ def test_list_private_connections_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_list_private_connections_field_headers_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -5345,11 +6085,16 @@ async def test_list_private_connections_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] def test_list_private_connections_flattened(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5359,7 +6104,9 @@ def test_list_private_connections_flattened(): call.return_value = datastream.ListPrivateConnectionsResponse() # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.list_private_connections(parent="parent_value",) + client.list_private_connections( + parent="parent_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -5371,19 +6118,24 @@ def test_list_private_connections_flattened(): def test_list_private_connections_flattened_error(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.list_private_connections( - datastream.ListPrivateConnectionsRequest(), parent="parent_value", + datastream.ListPrivateConnectionsRequest(), + parent="parent_value", ) @pytest.mark.asyncio async def test_list_private_connections_flattened_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5397,7 +6149,9 @@ async def test_list_private_connections_flattened_async(): ) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.list_private_connections(parent="parent_value",) + response = await client.list_private_connections( + parent="parent_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -5410,19 +6164,23 @@ async def test_list_private_connections_flattened_async(): @pytest.mark.asyncio async def test_list_private_connections_flattened_error_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): await client.list_private_connections( - datastream.ListPrivateConnectionsRequest(), parent="parent_value", + datastream.ListPrivateConnectionsRequest(), + parent="parent_value", ) def test_list_private_connections_pager(transport_name: str = "grpc"): client = DatastreamClient( - credentials=ga_credentials.AnonymousCredentials, transport=transport_name, + credentials=ga_credentials.AnonymousCredentials, + transport=transport_name, ) # Mock the actual call within the gRPC stub, and fake the request. @@ -5440,10 +6198,13 @@ def test_list_private_connections_pager(transport_name: str = "grpc"): next_page_token="abc", ), datastream.ListPrivateConnectionsResponse( - private_connections=[], next_page_token="def", + private_connections=[], + next_page_token="def", ), datastream.ListPrivateConnectionsResponse( - private_connections=[datastream_resources.PrivateConnection(),], + private_connections=[ + datastream_resources.PrivateConnection(), + ], next_page_token="ghi", ), datastream.ListPrivateConnectionsResponse( @@ -5472,7 +6233,8 @@ def test_list_private_connections_pager(transport_name: str = "grpc"): def test_list_private_connections_pages(transport_name: str = "grpc"): client = DatastreamClient( - credentials=ga_credentials.AnonymousCredentials, transport=transport_name, + credentials=ga_credentials.AnonymousCredentials, + transport=transport_name, ) # Mock the actual call within the gRPC stub, and fake the request. @@ -5490,10 +6252,13 @@ def test_list_private_connections_pages(transport_name: str = "grpc"): next_page_token="abc", ), datastream.ListPrivateConnectionsResponse( - private_connections=[], next_page_token="def", + private_connections=[], + next_page_token="def", ), datastream.ListPrivateConnectionsResponse( - private_connections=[datastream_resources.PrivateConnection(),], + private_connections=[ + datastream_resources.PrivateConnection(), + ], next_page_token="ghi", ), datastream.ListPrivateConnectionsResponse( @@ -5511,7 +6276,9 @@ def test_list_private_connections_pages(transport_name: str = "grpc"): @pytest.mark.asyncio async def test_list_private_connections_async_pager(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials,) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5530,10 +6297,13 @@ async def test_list_private_connections_async_pager(): next_page_token="abc", ), datastream.ListPrivateConnectionsResponse( - private_connections=[], next_page_token="def", + private_connections=[], + next_page_token="def", ), datastream.ListPrivateConnectionsResponse( - private_connections=[datastream_resources.PrivateConnection(),], + private_connections=[ + datastream_resources.PrivateConnection(), + ], next_page_token="ghi", ), datastream.ListPrivateConnectionsResponse( @@ -5544,7 +6314,9 @@ async def test_list_private_connections_async_pager(): ), RuntimeError, ) - async_pager = await client.list_private_connections(request={},) + async_pager = await client.list_private_connections( + request={}, + ) assert async_pager.next_page_token == "abc" responses = [] async for response in async_pager: @@ -5558,7 +6330,9 @@ async def test_list_private_connections_async_pager(): @pytest.mark.asyncio async def test_list_private_connections_async_pages(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials,) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5577,10 +6351,13 @@ async def test_list_private_connections_async_pages(): next_page_token="abc", ), datastream.ListPrivateConnectionsResponse( - private_connections=[], next_page_token="def", + private_connections=[], + next_page_token="def", ), datastream.ListPrivateConnectionsResponse( - private_connections=[datastream_resources.PrivateConnection(),], + private_connections=[ + datastream_resources.PrivateConnection(), + ], next_page_token="ghi", ), datastream.ListPrivateConnectionsResponse( @@ -5599,11 +6376,16 @@ async def test_list_private_connections_async_pages(): @pytest.mark.parametrize( - "request_type", [datastream.DeletePrivateConnectionRequest, dict,] + "request_type", + [ + datastream.DeletePrivateConnectionRequest, + dict, + ], ) def test_delete_private_connection(request_type, transport: str = "grpc"): client = DatastreamClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -5631,7 +6413,8 @@ def test_delete_private_connection_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = DatastreamClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -5650,7 +6433,8 @@ async def test_delete_private_connection_async( request_type=datastream.DeletePrivateConnectionRequest, ): client = DatastreamAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -5682,7 +6466,9 @@ async def test_delete_private_connection_async_from_dict(): def test_delete_private_connection_field_headers(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -5704,12 +6490,17 @@ def test_delete_private_connection_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_delete_private_connection_field_headers_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -5733,11 +6524,16 @@ async def test_delete_private_connection_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] def test_delete_private_connection_flattened(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5747,7 +6543,9 @@ def test_delete_private_connection_flattened(): call.return_value = operations_pb2.Operation(name="operations/op") # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.delete_private_connection(name="name_value",) + client.delete_private_connection( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -5759,19 +6557,24 @@ def test_delete_private_connection_flattened(): def test_delete_private_connection_flattened_error(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.delete_private_connection( - datastream.DeletePrivateConnectionRequest(), name="name_value", + datastream.DeletePrivateConnectionRequest(), + name="name_value", ) @pytest.mark.asyncio async def test_delete_private_connection_flattened_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5785,7 +6588,9 @@ async def test_delete_private_connection_flattened_async(): ) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.delete_private_connection(name="name_value",) + response = await client.delete_private_connection( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -5798,20 +6603,30 @@ async def test_delete_private_connection_flattened_async(): @pytest.mark.asyncio async def test_delete_private_connection_flattened_error_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): await client.delete_private_connection( - datastream.DeletePrivateConnectionRequest(), name="name_value", + datastream.DeletePrivateConnectionRequest(), + name="name_value", ) -@pytest.mark.parametrize("request_type", [datastream.CreateRouteRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + datastream.CreateRouteRequest, + dict, + ], +) def test_create_route(request_type, transport: str = "grpc"): client = DatastreamClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -5837,7 +6652,8 @@ def test_create_route_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = DatastreamClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -5853,7 +6669,8 @@ async def test_create_route_async( transport: str = "grpc_asyncio", request_type=datastream.CreateRouteRequest ): client = DatastreamAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -5883,7 +6700,9 @@ async def test_create_route_async_from_dict(): def test_create_route_field_headers(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -5903,12 +6722,17 @@ def test_create_route_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_create_route_field_headers_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -5930,11 +6754,16 @@ async def test_create_route_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] def test_create_route_flattened(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_route), "__call__") as call: @@ -5964,7 +6793,9 @@ def test_create_route_flattened(): def test_create_route_flattened_error(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -5979,7 +6810,9 @@ def test_create_route_flattened_error(): @pytest.mark.asyncio async def test_create_route_flattened_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_route), "__call__") as call: @@ -6014,7 +6847,9 @@ async def test_create_route_flattened_async(): @pytest.mark.asyncio async def test_create_route_flattened_error_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -6027,10 +6862,17 @@ async def test_create_route_flattened_error_async(): ) -@pytest.mark.parametrize("request_type", [datastream.GetRouteRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + datastream.GetRouteRequest, + dict, + ], +) def test_get_route(request_type, transport: str = "grpc"): client = DatastreamClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -6065,7 +6907,8 @@ def test_get_route_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = DatastreamClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -6081,7 +6924,8 @@ async def test_get_route_async( transport: str = "grpc_asyncio", request_type=datastream.GetRouteRequest ): client = DatastreamAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -6120,7 +6964,9 @@ async def test_get_route_async_from_dict(): def test_get_route_field_headers(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -6140,12 +6986,17 @@ def test_get_route_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_get_route_field_headers_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -6167,11 +7018,16 @@ async def test_get_route_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] def test_get_route_flattened(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_route), "__call__") as call: @@ -6179,7 +7035,9 @@ def test_get_route_flattened(): call.return_value = datastream_resources.Route() # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.get_route(name="name_value",) + client.get_route( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -6191,19 +7049,24 @@ def test_get_route_flattened(): def test_get_route_flattened_error(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.get_route( - datastream.GetRouteRequest(), name="name_value", + datastream.GetRouteRequest(), + name="name_value", ) @pytest.mark.asyncio async def test_get_route_flattened_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_route), "__call__") as call: @@ -6215,7 +7078,9 @@ async def test_get_route_flattened_async(): ) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.get_route(name="name_value",) + response = await client.get_route( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -6228,20 +7093,30 @@ async def test_get_route_flattened_async(): @pytest.mark.asyncio async def test_get_route_flattened_error_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): await client.get_route( - datastream.GetRouteRequest(), name="name_value", + datastream.GetRouteRequest(), + name="name_value", ) -@pytest.mark.parametrize("request_type", [datastream.ListRoutesRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + datastream.ListRoutesRequest, + dict, + ], +) def test_list_routes(request_type, transport: str = "grpc"): client = DatastreamClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -6252,7 +7127,8 @@ def test_list_routes(request_type, transport: str = "grpc"): with mock.patch.object(type(client.transport.list_routes), "__call__") as call: # Designate an appropriate return value for the call. call.return_value = datastream.ListRoutesResponse( - next_page_token="next_page_token_value", unreachable=["unreachable_value"], + next_page_token="next_page_token_value", + unreachable=["unreachable_value"], ) response = client.list_routes(request) @@ -6271,7 +7147,8 @@ def test_list_routes_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = DatastreamClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -6287,7 +7164,8 @@ async def test_list_routes_async( transport: str = "grpc_asyncio", request_type=datastream.ListRoutesRequest ): client = DatastreamAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -6322,7 +7200,9 @@ async def test_list_routes_async_from_dict(): def test_list_routes_field_headers(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -6342,12 +7222,17 @@ def test_list_routes_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_list_routes_field_headers_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -6369,11 +7254,16 @@ async def test_list_routes_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] def test_list_routes_flattened(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_routes), "__call__") as call: @@ -6381,7 +7271,9 @@ def test_list_routes_flattened(): call.return_value = datastream.ListRoutesResponse() # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.list_routes(parent="parent_value",) + client.list_routes( + parent="parent_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -6393,19 +7285,24 @@ def test_list_routes_flattened(): def test_list_routes_flattened_error(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.list_routes( - datastream.ListRoutesRequest(), parent="parent_value", + datastream.ListRoutesRequest(), + parent="parent_value", ) @pytest.mark.asyncio async def test_list_routes_flattened_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_routes), "__call__") as call: @@ -6417,7 +7314,9 @@ async def test_list_routes_flattened_async(): ) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.list_routes(parent="parent_value",) + response = await client.list_routes( + parent="parent_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -6430,19 +7329,23 @@ async def test_list_routes_flattened_async(): @pytest.mark.asyncio async def test_list_routes_flattened_error_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): await client.list_routes( - datastream.ListRoutesRequest(), parent="parent_value", + datastream.ListRoutesRequest(), + parent="parent_value", ) def test_list_routes_pager(transport_name: str = "grpc"): client = DatastreamClient( - credentials=ga_credentials.AnonymousCredentials, transport=transport_name, + credentials=ga_credentials.AnonymousCredentials, + transport=transport_name, ) # Mock the actual call within the gRPC stub, and fake the request. @@ -6457,12 +7360,21 @@ def test_list_routes_pager(transport_name: str = "grpc"): ], next_page_token="abc", ), - datastream.ListRoutesResponse(routes=[], next_page_token="def",), datastream.ListRoutesResponse( - routes=[datastream_resources.Route(),], next_page_token="ghi", + routes=[], + next_page_token="def", + ), + datastream.ListRoutesResponse( + routes=[ + datastream_resources.Route(), + ], + next_page_token="ghi", ), datastream.ListRoutesResponse( - routes=[datastream_resources.Route(), datastream_resources.Route(),], + routes=[ + datastream_resources.Route(), + datastream_resources.Route(), + ], ), RuntimeError, ) @@ -6482,7 +7394,8 @@ def test_list_routes_pager(transport_name: str = "grpc"): def test_list_routes_pages(transport_name: str = "grpc"): client = DatastreamClient( - credentials=ga_credentials.AnonymousCredentials, transport=transport_name, + credentials=ga_credentials.AnonymousCredentials, + transport=transport_name, ) # Mock the actual call within the gRPC stub, and fake the request. @@ -6497,12 +7410,21 @@ def test_list_routes_pages(transport_name: str = "grpc"): ], next_page_token="abc", ), - datastream.ListRoutesResponse(routes=[], next_page_token="def",), datastream.ListRoutesResponse( - routes=[datastream_resources.Route(),], next_page_token="ghi", + routes=[], + next_page_token="def", + ), + datastream.ListRoutesResponse( + routes=[ + datastream_resources.Route(), + ], + next_page_token="ghi", ), datastream.ListRoutesResponse( - routes=[datastream_resources.Route(), datastream_resources.Route(),], + routes=[ + datastream_resources.Route(), + datastream_resources.Route(), + ], ), RuntimeError, ) @@ -6513,7 +7435,9 @@ def test_list_routes_pages(transport_name: str = "grpc"): @pytest.mark.asyncio async def test_list_routes_async_pager(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials,) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -6529,16 +7453,27 @@ async def test_list_routes_async_pager(): ], next_page_token="abc", ), - datastream.ListRoutesResponse(routes=[], next_page_token="def",), datastream.ListRoutesResponse( - routes=[datastream_resources.Route(),], next_page_token="ghi", + routes=[], + next_page_token="def", + ), + datastream.ListRoutesResponse( + routes=[ + datastream_resources.Route(), + ], + next_page_token="ghi", ), datastream.ListRoutesResponse( - routes=[datastream_resources.Route(), datastream_resources.Route(),], + routes=[ + datastream_resources.Route(), + datastream_resources.Route(), + ], ), RuntimeError, ) - async_pager = await client.list_routes(request={},) + async_pager = await client.list_routes( + request={}, + ) assert async_pager.next_page_token == "abc" responses = [] async for response in async_pager: @@ -6550,7 +7485,9 @@ async def test_list_routes_async_pager(): @pytest.mark.asyncio async def test_list_routes_async_pages(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials,) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -6566,12 +7503,21 @@ async def test_list_routes_async_pages(): ], next_page_token="abc", ), - datastream.ListRoutesResponse(routes=[], next_page_token="def",), datastream.ListRoutesResponse( - routes=[datastream_resources.Route(),], next_page_token="ghi", + routes=[], + next_page_token="def", + ), + datastream.ListRoutesResponse( + routes=[ + datastream_resources.Route(), + ], + next_page_token="ghi", ), datastream.ListRoutesResponse( - routes=[datastream_resources.Route(), datastream_resources.Route(),], + routes=[ + datastream_resources.Route(), + datastream_resources.Route(), + ], ), RuntimeError, ) @@ -6582,10 +7528,17 @@ async def test_list_routes_async_pages(): assert page_.raw_page.next_page_token == token -@pytest.mark.parametrize("request_type", [datastream.DeleteRouteRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + datastream.DeleteRouteRequest, + dict, + ], +) def test_delete_route(request_type, transport: str = "grpc"): client = DatastreamClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -6611,7 +7564,8 @@ def test_delete_route_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = DatastreamClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -6627,7 +7581,8 @@ async def test_delete_route_async( transport: str = "grpc_asyncio", request_type=datastream.DeleteRouteRequest ): client = DatastreamAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -6657,7 +7612,9 @@ async def test_delete_route_async_from_dict(): def test_delete_route_field_headers(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -6677,12 +7634,17 @@ def test_delete_route_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_delete_route_field_headers_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -6704,11 +7666,16 @@ async def test_delete_route_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] def test_delete_route_flattened(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_route), "__call__") as call: @@ -6716,7 +7683,9 @@ def test_delete_route_flattened(): call.return_value = operations_pb2.Operation(name="operations/op") # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.delete_route(name="name_value",) + client.delete_route( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -6728,19 +7697,24 @@ def test_delete_route_flattened(): def test_delete_route_flattened_error(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.delete_route( - datastream.DeleteRouteRequest(), name="name_value", + datastream.DeleteRouteRequest(), + name="name_value", ) @pytest.mark.asyncio async def test_delete_route_flattened_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_route), "__call__") as call: @@ -6752,7 +7726,9 @@ async def test_delete_route_flattened_async(): ) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.delete_route(name="name_value",) + response = await client.delete_route( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -6765,13 +7741,16 @@ async def test_delete_route_flattened_async(): @pytest.mark.asyncio async def test_delete_route_flattened_error_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): await client.delete_route( - datastream.DeleteRouteRequest(), name="name_value", + datastream.DeleteRouteRequest(), + name="name_value", ) @@ -6782,7 +7761,8 @@ def test_credentials_transport_error(): ) with pytest.raises(ValueError): client = DatastreamClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # It is an error to provide a credentials file and a transport instance. @@ -6802,7 +7782,10 @@ def test_credentials_transport_error(): options = client_options.ClientOptions() options.api_key = "api_key" with pytest.raises(ValueError): - client = DatastreamClient(client_options=options, transport=transport,) + client = DatastreamClient( + client_options=options, + transport=transport, + ) # It is an error to provide an api_key and a credential. options = mock.Mock() @@ -6818,7 +7801,8 @@ def test_credentials_transport_error(): ) with pytest.raises(ValueError): client = DatastreamClient( - client_options={"scopes": ["1", "2"]}, transport=transport, + client_options={"scopes": ["1", "2"]}, + transport=transport, ) @@ -6848,7 +7832,10 @@ def test_transport_get_channel(): @pytest.mark.parametrize( "transport_class", - [transports.DatastreamGrpcTransport, transports.DatastreamGrpcAsyncIOTransport,], + [ + transports.DatastreamGrpcTransport, + transports.DatastreamGrpcAsyncIOTransport, + ], ) def test_transport_adc(transport_class): # Test default credentials are used if not provided. @@ -6860,8 +7847,13 @@ def test_transport_adc(transport_class): def test_transport_grpc_default(): # A client should use the gRPC transport by default. - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) - assert isinstance(client.transport, transports.DatastreamGrpcTransport,) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + assert isinstance( + client.transport, + transports.DatastreamGrpcTransport, + ) def test_datastream_base_transport_error(): @@ -6935,7 +7927,8 @@ def test_datastream_base_transport_with_credentials_file(): Transport.return_value = None load_creds.return_value = (ga_credentials.AnonymousCredentials(), None) transport = transports.DatastreamTransport( - credentials_file="credentials.json", quota_project_id="octopus", + credentials_file="credentials.json", + quota_project_id="octopus", ) load_creds.assert_called_once_with( "credentials.json", @@ -6970,7 +7963,10 @@ def test_datastream_auth_adc(): @pytest.mark.parametrize( "transport_class", - [transports.DatastreamGrpcTransport, transports.DatastreamGrpcAsyncIOTransport,], + [ + transports.DatastreamGrpcTransport, + transports.DatastreamGrpcAsyncIOTransport, + ], ) def test_datastream_transport_auth_adc(transport_class): # If credentials and host are not provided, the transport class should use @@ -7087,7 +8083,8 @@ def test_datastream_grpc_transport_channel(): # Check that channel is used if provided. transport = transports.DatastreamGrpcTransport( - host="squid.clam.whelk", channel=channel, + host="squid.clam.whelk", + channel=channel, ) assert transport.grpc_channel == channel assert transport._host == "squid.clam.whelk:443" @@ -7099,7 +8096,8 @@ def test_datastream_grpc_asyncio_transport_channel(): # Check that channel is used if provided. transport = transports.DatastreamGrpcAsyncIOTransport( - host="squid.clam.whelk", channel=channel, + host="squid.clam.whelk", + channel=channel, ) assert transport.grpc_channel == channel assert transport._host == "squid.clam.whelk:443" @@ -7200,12 +8198,16 @@ def test_datastream_transport_channel_mtls_with_adc(transport_class): def test_datastream_grpc_lro_client(): client = DatastreamClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) transport = client.transport # Ensure that we have a api-core operations client. - assert isinstance(transport.operations_client, operations_v1.OperationsClient,) + assert isinstance( + transport.operations_client, + operations_v1.OperationsClient, + ) # Ensure that subsequent calls to the property send the exact same object. assert transport.operations_client is transport.operations_client @@ -7213,12 +8215,16 @@ def test_datastream_grpc_lro_client(): def test_datastream_grpc_lro_async_client(): client = DatastreamAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc_asyncio", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc_asyncio", ) transport = client.transport # Ensure that we have a api-core operations client. - assert isinstance(transport.operations_client, operations_v1.OperationsAsyncClient,) + assert isinstance( + transport.operations_client, + operations_v1.OperationsAsyncClient, + ) # Ensure that subsequent calls to the property send the exact same object. assert transport.operations_client is transport.operations_client @@ -7229,7 +8235,9 @@ def test_connection_profile_path(): location = "clam" connection_profile = "whelk" expected = "projects/{project}/locations/{location}/connectionProfiles/{connection_profile}".format( - project=project, location=location, connection_profile=connection_profile, + project=project, + location=location, + connection_profile=connection_profile, ) actual = DatastreamClient.connection_profile_path( project, location, connection_profile @@ -7254,7 +8262,8 @@ def test_networks_path(): project = "cuttlefish" network = "mussel" expected = "projects/{project}/global/networks/{network}".format( - project=project, network=network, + project=project, + network=network, ) actual = DatastreamClient.networks_path(project, network) assert expected == actual @@ -7277,7 +8286,9 @@ def test_private_connection_path(): location = "abalone" private_connection = "squid" expected = "projects/{project}/locations/{location}/privateConnections/{private_connection}".format( - project=project, location=location, private_connection=private_connection, + project=project, + location=location, + private_connection=private_connection, ) actual = DatastreamClient.private_connection_path( project, location, private_connection @@ -7332,7 +8343,9 @@ def test_stream_path(): location = "clam" stream = "whelk" expected = "projects/{project}/locations/{location}/streams/{stream}".format( - project=project, location=location, stream=stream, + project=project, + location=location, + stream=stream, ) actual = DatastreamClient.stream_path(project, location, stream) assert expected == actual @@ -7357,7 +8370,10 @@ def test_stream_object_path(): stream = "winkle" object = "nautilus" expected = "projects/{project}/locations/{location}/streams/{stream}/objects/{object}".format( - project=project, location=location, stream=stream, object=object, + project=project, + location=location, + stream=stream, + object=object, ) actual = DatastreamClient.stream_object_path(project, location, stream, object) assert expected == actual @@ -7399,7 +8415,9 @@ def test_parse_common_billing_account_path(): def test_common_folder_path(): folder = "oyster" - expected = "folders/{folder}".format(folder=folder,) + expected = "folders/{folder}".format( + folder=folder, + ) actual = DatastreamClient.common_folder_path(folder) assert expected == actual @@ -7417,7 +8435,9 @@ def test_parse_common_folder_path(): def test_common_organization_path(): organization = "cuttlefish" - expected = "organizations/{organization}".format(organization=organization,) + expected = "organizations/{organization}".format( + organization=organization, + ) actual = DatastreamClient.common_organization_path(organization) assert expected == actual @@ -7435,7 +8455,9 @@ def test_parse_common_organization_path(): def test_common_project_path(): project = "winkle" - expected = "projects/{project}".format(project=project,) + expected = "projects/{project}".format( + project=project, + ) actual = DatastreamClient.common_project_path(project) assert expected == actual @@ -7455,7 +8477,8 @@ def test_common_location_path(): project = "scallop" location = "abalone" expected = "projects/{project}/locations/{location}".format( - project=project, location=location, + project=project, + location=location, ) actual = DatastreamClient.common_location_path(project, location) assert expected == actual @@ -7480,7 +8503,8 @@ def test_client_with_default_client_info(): transports.DatastreamTransport, "_prep_wrapped_messages" ) as prep: client = DatastreamClient( - credentials=ga_credentials.AnonymousCredentials(), client_info=client_info, + credentials=ga_credentials.AnonymousCredentials(), + client_info=client_info, ) prep.assert_called_once_with(client_info) @@ -7489,7 +8513,8 @@ def test_client_with_default_client_info(): ) as prep: transport_class = DatastreamClient.get_transport_class() transport = transport_class( - credentials=ga_credentials.AnonymousCredentials(), client_info=client_info, + credentials=ga_credentials.AnonymousCredentials(), + client_info=client_info, ) prep.assert_called_once_with(client_info) @@ -7497,7 +8522,8 @@ def test_client_with_default_client_info(): @pytest.mark.asyncio async def test_transport_close_async(): client = DatastreamAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc_asyncio", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc_asyncio", ) with mock.patch.object( type(getattr(client.transport, "grpc_channel")), "close" diff --git a/tests/unit/gapic/datastream_v1alpha1/test_datastream.py b/tests/unit/gapic/datastream_v1alpha1/test_datastream.py index e714883..7c0789e 100644 --- a/tests/unit/gapic/datastream_v1alpha1/test_datastream.py +++ b/tests/unit/gapic/datastream_v1alpha1/test_datastream.py @@ -90,7 +90,13 @@ def test__get_default_mtls_endpoint(): assert DatastreamClient._get_default_mtls_endpoint(non_googleapi) == non_googleapi -@pytest.mark.parametrize("client_class", [DatastreamClient, DatastreamAsyncClient,]) +@pytest.mark.parametrize( + "client_class", + [ + DatastreamClient, + DatastreamAsyncClient, + ], +) def test_datastream_client_from_service_account_info(client_class): creds = ga_credentials.AnonymousCredentials() with mock.patch.object( @@ -130,7 +136,13 @@ def test_datastream_client_service_account_always_use_jwt( use_jwt.assert_not_called() -@pytest.mark.parametrize("client_class", [DatastreamClient, DatastreamAsyncClient,]) +@pytest.mark.parametrize( + "client_class", + [ + DatastreamClient, + DatastreamAsyncClient, + ], +) def test_datastream_client_from_service_account_file(client_class): creds = ga_credentials.AnonymousCredentials() with mock.patch.object( @@ -485,7 +497,9 @@ def test_datastream_client_client_options_scopes( client_class, transport_class, transport_name ): # Check the case scopes are provided. - options = client_options.ClientOptions(scopes=["1", "2"],) + options = client_options.ClientOptions( + scopes=["1", "2"], + ) with mock.patch.object(transport_class, "__init__") as patched: patched.return_value = None client = client_class(client_options=options, transport=transport_name) @@ -614,11 +628,16 @@ def test_datastream_client_create_channel_credentials_file( @pytest.mark.parametrize( - "request_type", [datastream.ListConnectionProfilesRequest, dict,] + "request_type", + [ + datastream.ListConnectionProfilesRequest, + dict, + ], ) def test_list_connection_profiles(request_type, transport: str = "grpc"): client = DatastreamClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -631,7 +650,8 @@ def test_list_connection_profiles(request_type, transport: str = "grpc"): ) as call: # Designate an appropriate return value for the call. call.return_value = datastream.ListConnectionProfilesResponse( - next_page_token="next_page_token_value", unreachable=["unreachable_value"], + next_page_token="next_page_token_value", + unreachable=["unreachable_value"], ) response = client.list_connection_profiles(request) @@ -650,7 +670,8 @@ def test_list_connection_profiles_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = DatastreamClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -669,7 +690,8 @@ async def test_list_connection_profiles_async( request_type=datastream.ListConnectionProfilesRequest, ): client = DatastreamAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -706,7 +728,9 @@ async def test_list_connection_profiles_async_from_dict(): def test_list_connection_profiles_field_headers(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -728,12 +752,17 @@ def test_list_connection_profiles_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_list_connection_profiles_field_headers_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -757,11 +786,16 @@ async def test_list_connection_profiles_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] def test_list_connection_profiles_flattened(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -771,7 +805,9 @@ def test_list_connection_profiles_flattened(): call.return_value = datastream.ListConnectionProfilesResponse() # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.list_connection_profiles(parent="parent_value",) + client.list_connection_profiles( + parent="parent_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -783,19 +819,24 @@ def test_list_connection_profiles_flattened(): def test_list_connection_profiles_flattened_error(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.list_connection_profiles( - datastream.ListConnectionProfilesRequest(), parent="parent_value", + datastream.ListConnectionProfilesRequest(), + parent="parent_value", ) @pytest.mark.asyncio async def test_list_connection_profiles_flattened_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -809,7 +850,9 @@ async def test_list_connection_profiles_flattened_async(): ) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.list_connection_profiles(parent="parent_value",) + response = await client.list_connection_profiles( + parent="parent_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -822,19 +865,23 @@ async def test_list_connection_profiles_flattened_async(): @pytest.mark.asyncio async def test_list_connection_profiles_flattened_error_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): await client.list_connection_profiles( - datastream.ListConnectionProfilesRequest(), parent="parent_value", + datastream.ListConnectionProfilesRequest(), + parent="parent_value", ) def test_list_connection_profiles_pager(transport_name: str = "grpc"): client = DatastreamClient( - credentials=ga_credentials.AnonymousCredentials, transport=transport_name, + credentials=ga_credentials.AnonymousCredentials, + transport=transport_name, ) # Mock the actual call within the gRPC stub, and fake the request. @@ -852,10 +899,13 @@ def test_list_connection_profiles_pager(transport_name: str = "grpc"): next_page_token="abc", ), datastream.ListConnectionProfilesResponse( - connection_profiles=[], next_page_token="def", + connection_profiles=[], + next_page_token="def", ), datastream.ListConnectionProfilesResponse( - connection_profiles=[datastream_resources.ConnectionProfile(),], + connection_profiles=[ + datastream_resources.ConnectionProfile(), + ], next_page_token="ghi", ), datastream.ListConnectionProfilesResponse( @@ -884,7 +934,8 @@ def test_list_connection_profiles_pager(transport_name: str = "grpc"): def test_list_connection_profiles_pages(transport_name: str = "grpc"): client = DatastreamClient( - credentials=ga_credentials.AnonymousCredentials, transport=transport_name, + credentials=ga_credentials.AnonymousCredentials, + transport=transport_name, ) # Mock the actual call within the gRPC stub, and fake the request. @@ -902,10 +953,13 @@ def test_list_connection_profiles_pages(transport_name: str = "grpc"): next_page_token="abc", ), datastream.ListConnectionProfilesResponse( - connection_profiles=[], next_page_token="def", + connection_profiles=[], + next_page_token="def", ), datastream.ListConnectionProfilesResponse( - connection_profiles=[datastream_resources.ConnectionProfile(),], + connection_profiles=[ + datastream_resources.ConnectionProfile(), + ], next_page_token="ghi", ), datastream.ListConnectionProfilesResponse( @@ -923,7 +977,9 @@ def test_list_connection_profiles_pages(transport_name: str = "grpc"): @pytest.mark.asyncio async def test_list_connection_profiles_async_pager(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials,) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -942,10 +998,13 @@ async def test_list_connection_profiles_async_pager(): next_page_token="abc", ), datastream.ListConnectionProfilesResponse( - connection_profiles=[], next_page_token="def", + connection_profiles=[], + next_page_token="def", ), datastream.ListConnectionProfilesResponse( - connection_profiles=[datastream_resources.ConnectionProfile(),], + connection_profiles=[ + datastream_resources.ConnectionProfile(), + ], next_page_token="ghi", ), datastream.ListConnectionProfilesResponse( @@ -956,7 +1015,9 @@ async def test_list_connection_profiles_async_pager(): ), RuntimeError, ) - async_pager = await client.list_connection_profiles(request={},) + async_pager = await client.list_connection_profiles( + request={}, + ) assert async_pager.next_page_token == "abc" responses = [] async for response in async_pager: @@ -970,7 +1031,9 @@ async def test_list_connection_profiles_async_pager(): @pytest.mark.asyncio async def test_list_connection_profiles_async_pages(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials,) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -989,10 +1052,13 @@ async def test_list_connection_profiles_async_pages(): next_page_token="abc", ), datastream.ListConnectionProfilesResponse( - connection_profiles=[], next_page_token="def", + connection_profiles=[], + next_page_token="def", ), datastream.ListConnectionProfilesResponse( - connection_profiles=[datastream_resources.ConnectionProfile(),], + connection_profiles=[ + datastream_resources.ConnectionProfile(), + ], next_page_token="ghi", ), datastream.ListConnectionProfilesResponse( @@ -1011,11 +1077,16 @@ async def test_list_connection_profiles_async_pages(): @pytest.mark.parametrize( - "request_type", [datastream.GetConnectionProfileRequest, dict,] + "request_type", + [ + datastream.GetConnectionProfileRequest, + dict, + ], ) def test_get_connection_profile(request_type, transport: str = "grpc"): client = DatastreamClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1052,7 +1123,8 @@ def test_get_connection_profile_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = DatastreamClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1070,7 +1142,8 @@ async def test_get_connection_profile_async( transport: str = "grpc_asyncio", request_type=datastream.GetConnectionProfileRequest ): client = DatastreamAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1084,7 +1157,8 @@ async def test_get_connection_profile_async( # Designate an appropriate return value for the call. call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( datastream_resources.ConnectionProfile( - name="name_value", display_name="display_name_value", + name="name_value", + display_name="display_name_value", ) ) response = await client.get_connection_profile(request) @@ -1106,7 +1180,9 @@ async def test_get_connection_profile_async_from_dict(): def test_get_connection_profile_field_headers(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -1128,12 +1204,17 @@ def test_get_connection_profile_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_get_connection_profile_field_headers_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -1157,11 +1238,16 @@ async def test_get_connection_profile_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] def test_get_connection_profile_flattened(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1171,7 +1257,9 @@ def test_get_connection_profile_flattened(): call.return_value = datastream_resources.ConnectionProfile() # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.get_connection_profile(name="name_value",) + client.get_connection_profile( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -1183,19 +1271,24 @@ def test_get_connection_profile_flattened(): def test_get_connection_profile_flattened_error(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.get_connection_profile( - datastream.GetConnectionProfileRequest(), name="name_value", + datastream.GetConnectionProfileRequest(), + name="name_value", ) @pytest.mark.asyncio async def test_get_connection_profile_flattened_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1209,7 +1302,9 @@ async def test_get_connection_profile_flattened_async(): ) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.get_connection_profile(name="name_value",) + response = await client.get_connection_profile( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -1222,22 +1317,30 @@ async def test_get_connection_profile_flattened_async(): @pytest.mark.asyncio async def test_get_connection_profile_flattened_error_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): await client.get_connection_profile( - datastream.GetConnectionProfileRequest(), name="name_value", + datastream.GetConnectionProfileRequest(), + name="name_value", ) @pytest.mark.parametrize( - "request_type", [datastream.CreateConnectionProfileRequest, dict,] + "request_type", + [ + datastream.CreateConnectionProfileRequest, + dict, + ], ) def test_create_connection_profile(request_type, transport: str = "grpc"): client = DatastreamClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1265,7 +1368,8 @@ def test_create_connection_profile_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = DatastreamClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1284,7 +1388,8 @@ async def test_create_connection_profile_async( request_type=datastream.CreateConnectionProfileRequest, ): client = DatastreamAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1316,7 +1421,9 @@ async def test_create_connection_profile_async_from_dict(): def test_create_connection_profile_field_headers(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -1338,12 +1445,17 @@ def test_create_connection_profile_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_create_connection_profile_field_headers_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -1367,11 +1479,16 @@ async def test_create_connection_profile_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] def test_create_connection_profile_flattened(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1405,7 +1522,9 @@ def test_create_connection_profile_flattened(): def test_create_connection_profile_flattened_error(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -1422,7 +1541,9 @@ def test_create_connection_profile_flattened_error(): @pytest.mark.asyncio async def test_create_connection_profile_flattened_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1461,7 +1582,9 @@ async def test_create_connection_profile_flattened_async(): @pytest.mark.asyncio async def test_create_connection_profile_flattened_error_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -1477,11 +1600,16 @@ async def test_create_connection_profile_flattened_error_async(): @pytest.mark.parametrize( - "request_type", [datastream.UpdateConnectionProfileRequest, dict,] + "request_type", + [ + datastream.UpdateConnectionProfileRequest, + dict, + ], ) def test_update_connection_profile(request_type, transport: str = "grpc"): client = DatastreamClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1509,7 +1637,8 @@ def test_update_connection_profile_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = DatastreamClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1528,7 +1657,8 @@ async def test_update_connection_profile_async( request_type=datastream.UpdateConnectionProfileRequest, ): client = DatastreamAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1560,7 +1690,9 @@ async def test_update_connection_profile_async_from_dict(): def test_update_connection_profile_field_headers(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -1590,7 +1722,9 @@ def test_update_connection_profile_field_headers(): @pytest.mark.asyncio async def test_update_connection_profile_field_headers_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -1621,7 +1755,9 @@ async def test_update_connection_profile_field_headers_async(): def test_update_connection_profile_flattened(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1651,7 +1787,9 @@ def test_update_connection_profile_flattened(): def test_update_connection_profile_flattened_error(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -1667,7 +1805,9 @@ def test_update_connection_profile_flattened_error(): @pytest.mark.asyncio async def test_update_connection_profile_flattened_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1702,7 +1842,9 @@ async def test_update_connection_profile_flattened_async(): @pytest.mark.asyncio async def test_update_connection_profile_flattened_error_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -1717,11 +1859,16 @@ async def test_update_connection_profile_flattened_error_async(): @pytest.mark.parametrize( - "request_type", [datastream.DeleteConnectionProfileRequest, dict,] + "request_type", + [ + datastream.DeleteConnectionProfileRequest, + dict, + ], ) def test_delete_connection_profile(request_type, transport: str = "grpc"): client = DatastreamClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1749,7 +1896,8 @@ def test_delete_connection_profile_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = DatastreamClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1768,7 +1916,8 @@ async def test_delete_connection_profile_async( request_type=datastream.DeleteConnectionProfileRequest, ): client = DatastreamAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1800,7 +1949,9 @@ async def test_delete_connection_profile_async_from_dict(): def test_delete_connection_profile_field_headers(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -1822,12 +1973,17 @@ def test_delete_connection_profile_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_delete_connection_profile_field_headers_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -1851,11 +2007,16 @@ async def test_delete_connection_profile_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] def test_delete_connection_profile_flattened(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1865,7 +2026,9 @@ def test_delete_connection_profile_flattened(): call.return_value = operations_pb2.Operation(name="operations/op") # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.delete_connection_profile(name="name_value",) + client.delete_connection_profile( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -1877,19 +2040,24 @@ def test_delete_connection_profile_flattened(): def test_delete_connection_profile_flattened_error(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.delete_connection_profile( - datastream.DeleteConnectionProfileRequest(), name="name_value", + datastream.DeleteConnectionProfileRequest(), + name="name_value", ) @pytest.mark.asyncio async def test_delete_connection_profile_flattened_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1903,7 +2071,9 @@ async def test_delete_connection_profile_flattened_async(): ) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.delete_connection_profile(name="name_value",) + response = await client.delete_connection_profile( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -1916,22 +2086,30 @@ async def test_delete_connection_profile_flattened_async(): @pytest.mark.asyncio async def test_delete_connection_profile_flattened_error_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): await client.delete_connection_profile( - datastream.DeleteConnectionProfileRequest(), name="name_value", + datastream.DeleteConnectionProfileRequest(), + name="name_value", ) @pytest.mark.parametrize( - "request_type", [datastream.DiscoverConnectionProfileRequest, dict,] + "request_type", + [ + datastream.DiscoverConnectionProfileRequest, + dict, + ], ) def test_discover_connection_profile(request_type, transport: str = "grpc"): client = DatastreamClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1965,7 +2143,8 @@ def test_discover_connection_profile_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = DatastreamClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1984,7 +2163,8 @@ async def test_discover_connection_profile_async( request_type=datastream.DiscoverConnectionProfileRequest, ): client = DatastreamAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -2016,7 +2196,9 @@ async def test_discover_connection_profile_async_from_dict(): def test_discover_connection_profile_field_headers(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -2038,12 +2220,17 @@ def test_discover_connection_profile_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_discover_connection_profile_field_headers_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -2067,13 +2254,23 @@ async def test_discover_connection_profile_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] -@pytest.mark.parametrize("request_type", [datastream.ListStreamsRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + datastream.ListStreamsRequest, + dict, + ], +) def test_list_streams(request_type, transport: str = "grpc"): client = DatastreamClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -2084,7 +2281,8 @@ def test_list_streams(request_type, transport: str = "grpc"): with mock.patch.object(type(client.transport.list_streams), "__call__") as call: # Designate an appropriate return value for the call. call.return_value = datastream.ListStreamsResponse( - next_page_token="next_page_token_value", unreachable=["unreachable_value"], + next_page_token="next_page_token_value", + unreachable=["unreachable_value"], ) response = client.list_streams(request) @@ -2103,7 +2301,8 @@ def test_list_streams_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = DatastreamClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2119,7 +2318,8 @@ async def test_list_streams_async( transport: str = "grpc_asyncio", request_type=datastream.ListStreamsRequest ): client = DatastreamAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -2154,7 +2354,9 @@ async def test_list_streams_async_from_dict(): def test_list_streams_field_headers(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -2174,12 +2376,17 @@ def test_list_streams_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_list_streams_field_headers_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -2201,11 +2408,16 @@ async def test_list_streams_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] def test_list_streams_flattened(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_streams), "__call__") as call: @@ -2213,7 +2425,9 @@ def test_list_streams_flattened(): call.return_value = datastream.ListStreamsResponse() # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.list_streams(parent="parent_value",) + client.list_streams( + parent="parent_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -2225,19 +2439,24 @@ def test_list_streams_flattened(): def test_list_streams_flattened_error(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.list_streams( - datastream.ListStreamsRequest(), parent="parent_value", + datastream.ListStreamsRequest(), + parent="parent_value", ) @pytest.mark.asyncio async def test_list_streams_flattened_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_streams), "__call__") as call: @@ -2249,7 +2468,9 @@ async def test_list_streams_flattened_async(): ) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.list_streams(parent="parent_value",) + response = await client.list_streams( + parent="parent_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -2262,19 +2483,23 @@ async def test_list_streams_flattened_async(): @pytest.mark.asyncio async def test_list_streams_flattened_error_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): await client.list_streams( - datastream.ListStreamsRequest(), parent="parent_value", + datastream.ListStreamsRequest(), + parent="parent_value", ) def test_list_streams_pager(transport_name: str = "grpc"): client = DatastreamClient( - credentials=ga_credentials.AnonymousCredentials, transport=transport_name, + credentials=ga_credentials.AnonymousCredentials, + transport=transport_name, ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2289,12 +2514,21 @@ def test_list_streams_pager(transport_name: str = "grpc"): ], next_page_token="abc", ), - datastream.ListStreamsResponse(streams=[], next_page_token="def",), datastream.ListStreamsResponse( - streams=[datastream_resources.Stream(),], next_page_token="ghi", + streams=[], + next_page_token="def", + ), + datastream.ListStreamsResponse( + streams=[ + datastream_resources.Stream(), + ], + next_page_token="ghi", ), datastream.ListStreamsResponse( - streams=[datastream_resources.Stream(), datastream_resources.Stream(),], + streams=[ + datastream_resources.Stream(), + datastream_resources.Stream(), + ], ), RuntimeError, ) @@ -2314,7 +2548,8 @@ def test_list_streams_pager(transport_name: str = "grpc"): def test_list_streams_pages(transport_name: str = "grpc"): client = DatastreamClient( - credentials=ga_credentials.AnonymousCredentials, transport=transport_name, + credentials=ga_credentials.AnonymousCredentials, + transport=transport_name, ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2329,15 +2564,24 @@ def test_list_streams_pages(transport_name: str = "grpc"): ], next_page_token="abc", ), - datastream.ListStreamsResponse(streams=[], next_page_token="def",), datastream.ListStreamsResponse( - streams=[datastream_resources.Stream(),], next_page_token="ghi", + streams=[], + next_page_token="def", ), datastream.ListStreamsResponse( - streams=[datastream_resources.Stream(), datastream_resources.Stream(),], - ), - RuntimeError, - ) + streams=[ + datastream_resources.Stream(), + ], + next_page_token="ghi", + ), + datastream.ListStreamsResponse( + streams=[ + datastream_resources.Stream(), + datastream_resources.Stream(), + ], + ), + RuntimeError, + ) pages = list(client.list_streams(request={}).pages) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -2345,7 +2589,9 @@ def test_list_streams_pages(transport_name: str = "grpc"): @pytest.mark.asyncio async def test_list_streams_async_pager(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials,) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2361,16 +2607,27 @@ async def test_list_streams_async_pager(): ], next_page_token="abc", ), - datastream.ListStreamsResponse(streams=[], next_page_token="def",), datastream.ListStreamsResponse( - streams=[datastream_resources.Stream(),], next_page_token="ghi", + streams=[], + next_page_token="def", ), datastream.ListStreamsResponse( - streams=[datastream_resources.Stream(), datastream_resources.Stream(),], + streams=[ + datastream_resources.Stream(), + ], + next_page_token="ghi", + ), + datastream.ListStreamsResponse( + streams=[ + datastream_resources.Stream(), + datastream_resources.Stream(), + ], ), RuntimeError, ) - async_pager = await client.list_streams(request={},) + async_pager = await client.list_streams( + request={}, + ) assert async_pager.next_page_token == "abc" responses = [] async for response in async_pager: @@ -2382,7 +2639,9 @@ async def test_list_streams_async_pager(): @pytest.mark.asyncio async def test_list_streams_async_pages(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials,) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2398,12 +2657,21 @@ async def test_list_streams_async_pages(): ], next_page_token="abc", ), - datastream.ListStreamsResponse(streams=[], next_page_token="def",), datastream.ListStreamsResponse( - streams=[datastream_resources.Stream(),], next_page_token="ghi", + streams=[], + next_page_token="def", ), datastream.ListStreamsResponse( - streams=[datastream_resources.Stream(), datastream_resources.Stream(),], + streams=[ + datastream_resources.Stream(), + ], + next_page_token="ghi", + ), + datastream.ListStreamsResponse( + streams=[ + datastream_resources.Stream(), + datastream_resources.Stream(), + ], ), RuntimeError, ) @@ -2414,10 +2682,17 @@ async def test_list_streams_async_pages(): assert page_.raw_page.next_page_token == token -@pytest.mark.parametrize("request_type", [datastream.GetStreamRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + datastream.GetStreamRequest, + dict, + ], +) def test_get_stream(request_type, transport: str = "grpc"): client = DatastreamClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -2459,7 +2734,8 @@ def test_get_stream_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = DatastreamClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2475,7 +2751,8 @@ async def test_get_stream_async( transport: str = "grpc_asyncio", request_type=datastream.GetStreamRequest ): client = DatastreamAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -2512,7 +2789,9 @@ async def test_get_stream_async_from_dict(): def test_get_stream_field_headers(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -2532,12 +2811,17 @@ def test_get_stream_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_get_stream_field_headers_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -2559,11 +2843,16 @@ async def test_get_stream_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] def test_get_stream_flattened(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_stream), "__call__") as call: @@ -2571,7 +2860,9 @@ def test_get_stream_flattened(): call.return_value = datastream_resources.Stream() # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.get_stream(name="name_value",) + client.get_stream( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -2583,19 +2874,24 @@ def test_get_stream_flattened(): def test_get_stream_flattened_error(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.get_stream( - datastream.GetStreamRequest(), name="name_value", + datastream.GetStreamRequest(), + name="name_value", ) @pytest.mark.asyncio async def test_get_stream_flattened_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_stream), "__call__") as call: @@ -2607,7 +2903,9 @@ async def test_get_stream_flattened_async(): ) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.get_stream(name="name_value",) + response = await client.get_stream( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -2620,20 +2918,30 @@ async def test_get_stream_flattened_async(): @pytest.mark.asyncio async def test_get_stream_flattened_error_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): await client.get_stream( - datastream.GetStreamRequest(), name="name_value", + datastream.GetStreamRequest(), + name="name_value", ) -@pytest.mark.parametrize("request_type", [datastream.CreateStreamRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + datastream.CreateStreamRequest, + dict, + ], +) def test_create_stream(request_type, transport: str = "grpc"): client = DatastreamClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -2659,7 +2967,8 @@ def test_create_stream_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = DatastreamClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2675,7 +2984,8 @@ async def test_create_stream_async( transport: str = "grpc_asyncio", request_type=datastream.CreateStreamRequest ): client = DatastreamAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -2705,7 +3015,9 @@ async def test_create_stream_async_from_dict(): def test_create_stream_field_headers(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -2725,12 +3037,17 @@ def test_create_stream_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_create_stream_field_headers_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -2752,11 +3069,16 @@ async def test_create_stream_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] def test_create_stream_flattened(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_stream), "__call__") as call: @@ -2786,7 +3108,9 @@ def test_create_stream_flattened(): def test_create_stream_flattened_error(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -2801,7 +3125,9 @@ def test_create_stream_flattened_error(): @pytest.mark.asyncio async def test_create_stream_flattened_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_stream), "__call__") as call: @@ -2836,7 +3162,9 @@ async def test_create_stream_flattened_async(): @pytest.mark.asyncio async def test_create_stream_flattened_error_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -2849,10 +3177,17 @@ async def test_create_stream_flattened_error_async(): ) -@pytest.mark.parametrize("request_type", [datastream.UpdateStreamRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + datastream.UpdateStreamRequest, + dict, + ], +) def test_update_stream(request_type, transport: str = "grpc"): client = DatastreamClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -2878,7 +3213,8 @@ def test_update_stream_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = DatastreamClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2894,7 +3230,8 @@ async def test_update_stream_async( transport: str = "grpc_asyncio", request_type=datastream.UpdateStreamRequest ): client = DatastreamAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -2924,7 +3261,9 @@ async def test_update_stream_async_from_dict(): def test_update_stream_field_headers(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -2944,12 +3283,17 @@ def test_update_stream_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "stream.name=stream.name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "stream.name=stream.name/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_update_stream_field_headers_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -2971,11 +3315,16 @@ async def test_update_stream_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "stream.name=stream.name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "stream.name=stream.name/value", + ) in kw["metadata"] def test_update_stream_flattened(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_stream), "__call__") as call: @@ -3001,7 +3350,9 @@ def test_update_stream_flattened(): def test_update_stream_flattened_error(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -3015,7 +3366,9 @@ def test_update_stream_flattened_error(): @pytest.mark.asyncio async def test_update_stream_flattened_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_stream), "__call__") as call: @@ -3046,7 +3399,9 @@ async def test_update_stream_flattened_async(): @pytest.mark.asyncio async def test_update_stream_flattened_error_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -3058,10 +3413,17 @@ async def test_update_stream_flattened_error_async(): ) -@pytest.mark.parametrize("request_type", [datastream.DeleteStreamRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + datastream.DeleteStreamRequest, + dict, + ], +) def test_delete_stream(request_type, transport: str = "grpc"): client = DatastreamClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -3087,7 +3449,8 @@ def test_delete_stream_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = DatastreamClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3103,7 +3466,8 @@ async def test_delete_stream_async( transport: str = "grpc_asyncio", request_type=datastream.DeleteStreamRequest ): client = DatastreamAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -3133,7 +3497,9 @@ async def test_delete_stream_async_from_dict(): def test_delete_stream_field_headers(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -3153,12 +3519,17 @@ def test_delete_stream_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_delete_stream_field_headers_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -3180,11 +3551,16 @@ async def test_delete_stream_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] def test_delete_stream_flattened(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_stream), "__call__") as call: @@ -3192,7 +3568,9 @@ def test_delete_stream_flattened(): call.return_value = operations_pb2.Operation(name="operations/op") # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.delete_stream(name="name_value",) + client.delete_stream( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -3204,19 +3582,24 @@ def test_delete_stream_flattened(): def test_delete_stream_flattened_error(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.delete_stream( - datastream.DeleteStreamRequest(), name="name_value", + datastream.DeleteStreamRequest(), + name="name_value", ) @pytest.mark.asyncio async def test_delete_stream_flattened_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_stream), "__call__") as call: @@ -3228,7 +3611,9 @@ async def test_delete_stream_flattened_async(): ) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.delete_stream(name="name_value",) + response = await client.delete_stream( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -3241,20 +3626,30 @@ async def test_delete_stream_flattened_async(): @pytest.mark.asyncio async def test_delete_stream_flattened_error_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): await client.delete_stream( - datastream.DeleteStreamRequest(), name="name_value", + datastream.DeleteStreamRequest(), + name="name_value", ) -@pytest.mark.parametrize("request_type", [datastream.FetchErrorsRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + datastream.FetchErrorsRequest, + dict, + ], +) def test_fetch_errors(request_type, transport: str = "grpc"): client = DatastreamClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -3280,7 +3675,8 @@ def test_fetch_errors_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = DatastreamClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3296,7 +3692,8 @@ async def test_fetch_errors_async( transport: str = "grpc_asyncio", request_type=datastream.FetchErrorsRequest ): client = DatastreamAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -3326,7 +3723,9 @@ async def test_fetch_errors_async_from_dict(): def test_fetch_errors_field_headers(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -3346,12 +3745,17 @@ def test_fetch_errors_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "stream=stream/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "stream=stream/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_fetch_errors_field_headers_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -3373,13 +3777,23 @@ async def test_fetch_errors_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "stream=stream/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "stream=stream/value", + ) in kw["metadata"] -@pytest.mark.parametrize("request_type", [datastream.FetchStaticIpsRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + datastream.FetchStaticIpsRequest, + dict, + ], +) def test_fetch_static_ips(request_type, transport: str = "grpc"): client = DatastreamClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -3390,7 +3804,8 @@ def test_fetch_static_ips(request_type, transport: str = "grpc"): with mock.patch.object(type(client.transport.fetch_static_ips), "__call__") as call: # Designate an appropriate return value for the call. call.return_value = datastream.FetchStaticIpsResponse( - static_ips=["static_ips_value"], next_page_token="next_page_token_value", + static_ips=["static_ips_value"], + next_page_token="next_page_token_value", ) response = client.fetch_static_ips(request) @@ -3409,7 +3824,8 @@ def test_fetch_static_ips_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = DatastreamClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3425,7 +3841,8 @@ async def test_fetch_static_ips_async( transport: str = "grpc_asyncio", request_type=datastream.FetchStaticIpsRequest ): client = DatastreamAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -3460,7 +3877,9 @@ async def test_fetch_static_ips_async_from_dict(): def test_fetch_static_ips_field_headers(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -3480,12 +3899,17 @@ def test_fetch_static_ips_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_fetch_static_ips_field_headers_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -3507,11 +3931,16 @@ async def test_fetch_static_ips_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] def test_fetch_static_ips_flattened(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.fetch_static_ips), "__call__") as call: @@ -3519,7 +3948,9 @@ def test_fetch_static_ips_flattened(): call.return_value = datastream.FetchStaticIpsResponse() # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.fetch_static_ips(name="name_value",) + client.fetch_static_ips( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -3531,19 +3962,24 @@ def test_fetch_static_ips_flattened(): def test_fetch_static_ips_flattened_error(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.fetch_static_ips( - datastream.FetchStaticIpsRequest(), name="name_value", + datastream.FetchStaticIpsRequest(), + name="name_value", ) @pytest.mark.asyncio async def test_fetch_static_ips_flattened_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.fetch_static_ips), "__call__") as call: @@ -3555,7 +3991,9 @@ async def test_fetch_static_ips_flattened_async(): ) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.fetch_static_ips(name="name_value",) + response = await client.fetch_static_ips( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -3568,19 +4006,23 @@ async def test_fetch_static_ips_flattened_async(): @pytest.mark.asyncio async def test_fetch_static_ips_flattened_error_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): await client.fetch_static_ips( - datastream.FetchStaticIpsRequest(), name="name_value", + datastream.FetchStaticIpsRequest(), + name="name_value", ) def test_fetch_static_ips_pager(transport_name: str = "grpc"): client = DatastreamClient( - credentials=ga_credentials.AnonymousCredentials, transport=transport_name, + credentials=ga_credentials.AnonymousCredentials, + transport=transport_name, ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3588,13 +4030,29 @@ def test_fetch_static_ips_pager(transport_name: str = "grpc"): # Set the response to a series of pages. call.side_effect = ( datastream.FetchStaticIpsResponse( - static_ips=[str(), str(), str(),], next_page_token="abc", + static_ips=[ + str(), + str(), + str(), + ], + next_page_token="abc", + ), + datastream.FetchStaticIpsResponse( + static_ips=[], + next_page_token="def", ), - datastream.FetchStaticIpsResponse(static_ips=[], next_page_token="def",), datastream.FetchStaticIpsResponse( - static_ips=[str(),], next_page_token="ghi", + static_ips=[ + str(), + ], + next_page_token="ghi", + ), + datastream.FetchStaticIpsResponse( + static_ips=[ + str(), + str(), + ], ), - datastream.FetchStaticIpsResponse(static_ips=[str(), str(),],), RuntimeError, ) @@ -3613,7 +4071,8 @@ def test_fetch_static_ips_pager(transport_name: str = "grpc"): def test_fetch_static_ips_pages(transport_name: str = "grpc"): client = DatastreamClient( - credentials=ga_credentials.AnonymousCredentials, transport=transport_name, + credentials=ga_credentials.AnonymousCredentials, + transport=transport_name, ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3621,13 +4080,29 @@ def test_fetch_static_ips_pages(transport_name: str = "grpc"): # Set the response to a series of pages. call.side_effect = ( datastream.FetchStaticIpsResponse( - static_ips=[str(), str(), str(),], next_page_token="abc", + static_ips=[ + str(), + str(), + str(), + ], + next_page_token="abc", + ), + datastream.FetchStaticIpsResponse( + static_ips=[], + next_page_token="def", + ), + datastream.FetchStaticIpsResponse( + static_ips=[ + str(), + ], + next_page_token="ghi", ), - datastream.FetchStaticIpsResponse(static_ips=[], next_page_token="def",), datastream.FetchStaticIpsResponse( - static_ips=[str(),], next_page_token="ghi", + static_ips=[ + str(), + str(), + ], ), - datastream.FetchStaticIpsResponse(static_ips=[str(), str(),],), RuntimeError, ) pages = list(client.fetch_static_ips(request={}).pages) @@ -3637,7 +4112,9 @@ def test_fetch_static_ips_pages(transport_name: str = "grpc"): @pytest.mark.asyncio async def test_fetch_static_ips_async_pager(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials,) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3646,16 +4123,34 @@ async def test_fetch_static_ips_async_pager(): # Set the response to a series of pages. call.side_effect = ( datastream.FetchStaticIpsResponse( - static_ips=[str(), str(), str(),], next_page_token="abc", + static_ips=[ + str(), + str(), + str(), + ], + next_page_token="abc", ), - datastream.FetchStaticIpsResponse(static_ips=[], next_page_token="def",), datastream.FetchStaticIpsResponse( - static_ips=[str(),], next_page_token="ghi", + static_ips=[], + next_page_token="def", + ), + datastream.FetchStaticIpsResponse( + static_ips=[ + str(), + ], + next_page_token="ghi", + ), + datastream.FetchStaticIpsResponse( + static_ips=[ + str(), + str(), + ], ), - datastream.FetchStaticIpsResponse(static_ips=[str(), str(),],), RuntimeError, ) - async_pager = await client.fetch_static_ips(request={},) + async_pager = await client.fetch_static_ips( + request={}, + ) assert async_pager.next_page_token == "abc" responses = [] async for response in async_pager: @@ -3667,7 +4162,9 @@ async def test_fetch_static_ips_async_pager(): @pytest.mark.asyncio async def test_fetch_static_ips_async_pages(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials,) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3676,13 +4173,29 @@ async def test_fetch_static_ips_async_pages(): # Set the response to a series of pages. call.side_effect = ( datastream.FetchStaticIpsResponse( - static_ips=[str(), str(), str(),], next_page_token="abc", + static_ips=[ + str(), + str(), + str(), + ], + next_page_token="abc", + ), + datastream.FetchStaticIpsResponse( + static_ips=[], + next_page_token="def", + ), + datastream.FetchStaticIpsResponse( + static_ips=[ + str(), + ], + next_page_token="ghi", ), - datastream.FetchStaticIpsResponse(static_ips=[], next_page_token="def",), datastream.FetchStaticIpsResponse( - static_ips=[str(),], next_page_token="ghi", + static_ips=[ + str(), + str(), + ], ), - datastream.FetchStaticIpsResponse(static_ips=[str(), str(),],), RuntimeError, ) pages = [] @@ -3693,11 +4206,16 @@ async def test_fetch_static_ips_async_pages(): @pytest.mark.parametrize( - "request_type", [datastream.CreatePrivateConnectionRequest, dict,] + "request_type", + [ + datastream.CreatePrivateConnectionRequest, + dict, + ], ) def test_create_private_connection(request_type, transport: str = "grpc"): client = DatastreamClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -3725,7 +4243,8 @@ def test_create_private_connection_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = DatastreamClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3744,7 +4263,8 @@ async def test_create_private_connection_async( request_type=datastream.CreatePrivateConnectionRequest, ): client = DatastreamAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -3776,7 +4296,9 @@ async def test_create_private_connection_async_from_dict(): def test_create_private_connection_field_headers(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -3798,12 +4320,17 @@ def test_create_private_connection_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_create_private_connection_field_headers_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -3827,11 +4354,16 @@ async def test_create_private_connection_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] def test_create_private_connection_flattened(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3865,7 +4397,9 @@ def test_create_private_connection_flattened(): def test_create_private_connection_flattened_error(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -3882,7 +4416,9 @@ def test_create_private_connection_flattened_error(): @pytest.mark.asyncio async def test_create_private_connection_flattened_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3921,7 +4457,9 @@ async def test_create_private_connection_flattened_async(): @pytest.mark.asyncio async def test_create_private_connection_flattened_error_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -3937,11 +4475,16 @@ async def test_create_private_connection_flattened_error_async(): @pytest.mark.parametrize( - "request_type", [datastream.GetPrivateConnectionRequest, dict,] + "request_type", + [ + datastream.GetPrivateConnectionRequest, + dict, + ], ) def test_get_private_connection(request_type, transport: str = "grpc"): client = DatastreamClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -3976,7 +4519,8 @@ def test_get_private_connection_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = DatastreamClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3994,7 +4538,8 @@ async def test_get_private_connection_async( transport: str = "grpc_asyncio", request_type=datastream.GetPrivateConnectionRequest ): client = DatastreamAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -4033,7 +4578,9 @@ async def test_get_private_connection_async_from_dict(): def test_get_private_connection_field_headers(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -4055,12 +4602,17 @@ def test_get_private_connection_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_get_private_connection_field_headers_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -4084,11 +4636,16 @@ async def test_get_private_connection_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] def test_get_private_connection_flattened(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4098,7 +4655,9 @@ def test_get_private_connection_flattened(): call.return_value = datastream_resources.PrivateConnection() # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.get_private_connection(name="name_value",) + client.get_private_connection( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -4110,19 +4669,24 @@ def test_get_private_connection_flattened(): def test_get_private_connection_flattened_error(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.get_private_connection( - datastream.GetPrivateConnectionRequest(), name="name_value", + datastream.GetPrivateConnectionRequest(), + name="name_value", ) @pytest.mark.asyncio async def test_get_private_connection_flattened_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4136,7 +4700,9 @@ async def test_get_private_connection_flattened_async(): ) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.get_private_connection(name="name_value",) + response = await client.get_private_connection( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -4149,22 +4715,30 @@ async def test_get_private_connection_flattened_async(): @pytest.mark.asyncio async def test_get_private_connection_flattened_error_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): await client.get_private_connection( - datastream.GetPrivateConnectionRequest(), name="name_value", + datastream.GetPrivateConnectionRequest(), + name="name_value", ) @pytest.mark.parametrize( - "request_type", [datastream.ListPrivateConnectionsRequest, dict,] + "request_type", + [ + datastream.ListPrivateConnectionsRequest, + dict, + ], ) def test_list_private_connections(request_type, transport: str = "grpc"): client = DatastreamClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -4177,7 +4751,8 @@ def test_list_private_connections(request_type, transport: str = "grpc"): ) as call: # Designate an appropriate return value for the call. call.return_value = datastream.ListPrivateConnectionsResponse( - next_page_token="next_page_token_value", unreachable=["unreachable_value"], + next_page_token="next_page_token_value", + unreachable=["unreachable_value"], ) response = client.list_private_connections(request) @@ -4196,7 +4771,8 @@ def test_list_private_connections_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = DatastreamClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -4215,7 +4791,8 @@ async def test_list_private_connections_async( request_type=datastream.ListPrivateConnectionsRequest, ): client = DatastreamAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -4252,7 +4829,9 @@ async def test_list_private_connections_async_from_dict(): def test_list_private_connections_field_headers(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -4274,12 +4853,17 @@ def test_list_private_connections_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_list_private_connections_field_headers_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -4303,11 +4887,16 @@ async def test_list_private_connections_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] def test_list_private_connections_flattened(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4317,7 +4906,9 @@ def test_list_private_connections_flattened(): call.return_value = datastream.ListPrivateConnectionsResponse() # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.list_private_connections(parent="parent_value",) + client.list_private_connections( + parent="parent_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -4329,19 +4920,24 @@ def test_list_private_connections_flattened(): def test_list_private_connections_flattened_error(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.list_private_connections( - datastream.ListPrivateConnectionsRequest(), parent="parent_value", + datastream.ListPrivateConnectionsRequest(), + parent="parent_value", ) @pytest.mark.asyncio async def test_list_private_connections_flattened_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4355,7 +4951,9 @@ async def test_list_private_connections_flattened_async(): ) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.list_private_connections(parent="parent_value",) + response = await client.list_private_connections( + parent="parent_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -4368,19 +4966,23 @@ async def test_list_private_connections_flattened_async(): @pytest.mark.asyncio async def test_list_private_connections_flattened_error_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): await client.list_private_connections( - datastream.ListPrivateConnectionsRequest(), parent="parent_value", + datastream.ListPrivateConnectionsRequest(), + parent="parent_value", ) def test_list_private_connections_pager(transport_name: str = "grpc"): client = DatastreamClient( - credentials=ga_credentials.AnonymousCredentials, transport=transport_name, + credentials=ga_credentials.AnonymousCredentials, + transport=transport_name, ) # Mock the actual call within the gRPC stub, and fake the request. @@ -4398,10 +5000,13 @@ def test_list_private_connections_pager(transport_name: str = "grpc"): next_page_token="abc", ), datastream.ListPrivateConnectionsResponse( - private_connections=[], next_page_token="def", + private_connections=[], + next_page_token="def", ), datastream.ListPrivateConnectionsResponse( - private_connections=[datastream_resources.PrivateConnection(),], + private_connections=[ + datastream_resources.PrivateConnection(), + ], next_page_token="ghi", ), datastream.ListPrivateConnectionsResponse( @@ -4430,7 +5035,8 @@ def test_list_private_connections_pager(transport_name: str = "grpc"): def test_list_private_connections_pages(transport_name: str = "grpc"): client = DatastreamClient( - credentials=ga_credentials.AnonymousCredentials, transport=transport_name, + credentials=ga_credentials.AnonymousCredentials, + transport=transport_name, ) # Mock the actual call within the gRPC stub, and fake the request. @@ -4448,10 +5054,13 @@ def test_list_private_connections_pages(transport_name: str = "grpc"): next_page_token="abc", ), datastream.ListPrivateConnectionsResponse( - private_connections=[], next_page_token="def", + private_connections=[], + next_page_token="def", ), datastream.ListPrivateConnectionsResponse( - private_connections=[datastream_resources.PrivateConnection(),], + private_connections=[ + datastream_resources.PrivateConnection(), + ], next_page_token="ghi", ), datastream.ListPrivateConnectionsResponse( @@ -4469,7 +5078,9 @@ def test_list_private_connections_pages(transport_name: str = "grpc"): @pytest.mark.asyncio async def test_list_private_connections_async_pager(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials,) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4488,10 +5099,13 @@ async def test_list_private_connections_async_pager(): next_page_token="abc", ), datastream.ListPrivateConnectionsResponse( - private_connections=[], next_page_token="def", + private_connections=[], + next_page_token="def", ), datastream.ListPrivateConnectionsResponse( - private_connections=[datastream_resources.PrivateConnection(),], + private_connections=[ + datastream_resources.PrivateConnection(), + ], next_page_token="ghi", ), datastream.ListPrivateConnectionsResponse( @@ -4502,7 +5116,9 @@ async def test_list_private_connections_async_pager(): ), RuntimeError, ) - async_pager = await client.list_private_connections(request={},) + async_pager = await client.list_private_connections( + request={}, + ) assert async_pager.next_page_token == "abc" responses = [] async for response in async_pager: @@ -4516,7 +5132,9 @@ async def test_list_private_connections_async_pager(): @pytest.mark.asyncio async def test_list_private_connections_async_pages(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials,) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4535,10 +5153,13 @@ async def test_list_private_connections_async_pages(): next_page_token="abc", ), datastream.ListPrivateConnectionsResponse( - private_connections=[], next_page_token="def", + private_connections=[], + next_page_token="def", ), datastream.ListPrivateConnectionsResponse( - private_connections=[datastream_resources.PrivateConnection(),], + private_connections=[ + datastream_resources.PrivateConnection(), + ], next_page_token="ghi", ), datastream.ListPrivateConnectionsResponse( @@ -4557,11 +5178,16 @@ async def test_list_private_connections_async_pages(): @pytest.mark.parametrize( - "request_type", [datastream.DeletePrivateConnectionRequest, dict,] + "request_type", + [ + datastream.DeletePrivateConnectionRequest, + dict, + ], ) def test_delete_private_connection(request_type, transport: str = "grpc"): client = DatastreamClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -4589,7 +5215,8 @@ def test_delete_private_connection_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = DatastreamClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -4608,7 +5235,8 @@ async def test_delete_private_connection_async( request_type=datastream.DeletePrivateConnectionRequest, ): client = DatastreamAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -4640,7 +5268,9 @@ async def test_delete_private_connection_async_from_dict(): def test_delete_private_connection_field_headers(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -4662,12 +5292,17 @@ def test_delete_private_connection_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_delete_private_connection_field_headers_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -4691,11 +5326,16 @@ async def test_delete_private_connection_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] def test_delete_private_connection_flattened(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4705,7 +5345,9 @@ def test_delete_private_connection_flattened(): call.return_value = operations_pb2.Operation(name="operations/op") # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.delete_private_connection(name="name_value",) + client.delete_private_connection( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -4717,19 +5359,24 @@ def test_delete_private_connection_flattened(): def test_delete_private_connection_flattened_error(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.delete_private_connection( - datastream.DeletePrivateConnectionRequest(), name="name_value", + datastream.DeletePrivateConnectionRequest(), + name="name_value", ) @pytest.mark.asyncio async def test_delete_private_connection_flattened_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4743,7 +5390,9 @@ async def test_delete_private_connection_flattened_async(): ) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.delete_private_connection(name="name_value",) + response = await client.delete_private_connection( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -4756,20 +5405,30 @@ async def test_delete_private_connection_flattened_async(): @pytest.mark.asyncio async def test_delete_private_connection_flattened_error_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): await client.delete_private_connection( - datastream.DeletePrivateConnectionRequest(), name="name_value", + datastream.DeletePrivateConnectionRequest(), + name="name_value", ) -@pytest.mark.parametrize("request_type", [datastream.CreateRouteRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + datastream.CreateRouteRequest, + dict, + ], +) def test_create_route(request_type, transport: str = "grpc"): client = DatastreamClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -4795,7 +5454,8 @@ def test_create_route_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = DatastreamClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -4811,7 +5471,8 @@ async def test_create_route_async( transport: str = "grpc_asyncio", request_type=datastream.CreateRouteRequest ): client = DatastreamAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -4841,7 +5502,9 @@ async def test_create_route_async_from_dict(): def test_create_route_field_headers(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -4861,12 +5524,17 @@ def test_create_route_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_create_route_field_headers_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -4888,11 +5556,16 @@ async def test_create_route_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] def test_create_route_flattened(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_route), "__call__") as call: @@ -4922,7 +5595,9 @@ def test_create_route_flattened(): def test_create_route_flattened_error(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -4937,7 +5612,9 @@ def test_create_route_flattened_error(): @pytest.mark.asyncio async def test_create_route_flattened_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_route), "__call__") as call: @@ -4972,7 +5649,9 @@ async def test_create_route_flattened_async(): @pytest.mark.asyncio async def test_create_route_flattened_error_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -4985,10 +5664,17 @@ async def test_create_route_flattened_error_async(): ) -@pytest.mark.parametrize("request_type", [datastream.GetRouteRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + datastream.GetRouteRequest, + dict, + ], +) def test_get_route(request_type, transport: str = "grpc"): client = DatastreamClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -5023,7 +5709,8 @@ def test_get_route_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = DatastreamClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -5039,7 +5726,8 @@ async def test_get_route_async( transport: str = "grpc_asyncio", request_type=datastream.GetRouteRequest ): client = DatastreamAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -5078,7 +5766,9 @@ async def test_get_route_async_from_dict(): def test_get_route_field_headers(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -5098,12 +5788,17 @@ def test_get_route_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_get_route_field_headers_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -5125,11 +5820,16 @@ async def test_get_route_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] def test_get_route_flattened(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_route), "__call__") as call: @@ -5137,7 +5837,9 @@ def test_get_route_flattened(): call.return_value = datastream_resources.Route() # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.get_route(name="name_value",) + client.get_route( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -5149,19 +5851,24 @@ def test_get_route_flattened(): def test_get_route_flattened_error(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.get_route( - datastream.GetRouteRequest(), name="name_value", + datastream.GetRouteRequest(), + name="name_value", ) @pytest.mark.asyncio async def test_get_route_flattened_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_route), "__call__") as call: @@ -5173,7 +5880,9 @@ async def test_get_route_flattened_async(): ) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.get_route(name="name_value",) + response = await client.get_route( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -5186,20 +5895,30 @@ async def test_get_route_flattened_async(): @pytest.mark.asyncio async def test_get_route_flattened_error_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): await client.get_route( - datastream.GetRouteRequest(), name="name_value", + datastream.GetRouteRequest(), + name="name_value", ) -@pytest.mark.parametrize("request_type", [datastream.ListRoutesRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + datastream.ListRoutesRequest, + dict, + ], +) def test_list_routes(request_type, transport: str = "grpc"): client = DatastreamClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -5210,7 +5929,8 @@ def test_list_routes(request_type, transport: str = "grpc"): with mock.patch.object(type(client.transport.list_routes), "__call__") as call: # Designate an appropriate return value for the call. call.return_value = datastream.ListRoutesResponse( - next_page_token="next_page_token_value", unreachable=["unreachable_value"], + next_page_token="next_page_token_value", + unreachable=["unreachable_value"], ) response = client.list_routes(request) @@ -5229,7 +5949,8 @@ def test_list_routes_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = DatastreamClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -5245,7 +5966,8 @@ async def test_list_routes_async( transport: str = "grpc_asyncio", request_type=datastream.ListRoutesRequest ): client = DatastreamAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -5280,7 +6002,9 @@ async def test_list_routes_async_from_dict(): def test_list_routes_field_headers(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -5300,12 +6024,17 @@ def test_list_routes_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_list_routes_field_headers_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -5327,11 +6056,16 @@ async def test_list_routes_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] def test_list_routes_flattened(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_routes), "__call__") as call: @@ -5339,7 +6073,9 @@ def test_list_routes_flattened(): call.return_value = datastream.ListRoutesResponse() # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.list_routes(parent="parent_value",) + client.list_routes( + parent="parent_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -5351,19 +6087,24 @@ def test_list_routes_flattened(): def test_list_routes_flattened_error(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.list_routes( - datastream.ListRoutesRequest(), parent="parent_value", + datastream.ListRoutesRequest(), + parent="parent_value", ) @pytest.mark.asyncio async def test_list_routes_flattened_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_routes), "__call__") as call: @@ -5375,7 +6116,9 @@ async def test_list_routes_flattened_async(): ) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.list_routes(parent="parent_value",) + response = await client.list_routes( + parent="parent_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -5388,19 +6131,23 @@ async def test_list_routes_flattened_async(): @pytest.mark.asyncio async def test_list_routes_flattened_error_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): await client.list_routes( - datastream.ListRoutesRequest(), parent="parent_value", + datastream.ListRoutesRequest(), + parent="parent_value", ) def test_list_routes_pager(transport_name: str = "grpc"): client = DatastreamClient( - credentials=ga_credentials.AnonymousCredentials, transport=transport_name, + credentials=ga_credentials.AnonymousCredentials, + transport=transport_name, ) # Mock the actual call within the gRPC stub, and fake the request. @@ -5415,12 +6162,21 @@ def test_list_routes_pager(transport_name: str = "grpc"): ], next_page_token="abc", ), - datastream.ListRoutesResponse(routes=[], next_page_token="def",), datastream.ListRoutesResponse( - routes=[datastream_resources.Route(),], next_page_token="ghi", + routes=[], + next_page_token="def", + ), + datastream.ListRoutesResponse( + routes=[ + datastream_resources.Route(), + ], + next_page_token="ghi", ), datastream.ListRoutesResponse( - routes=[datastream_resources.Route(), datastream_resources.Route(),], + routes=[ + datastream_resources.Route(), + datastream_resources.Route(), + ], ), RuntimeError, ) @@ -5440,7 +6196,8 @@ def test_list_routes_pager(transport_name: str = "grpc"): def test_list_routes_pages(transport_name: str = "grpc"): client = DatastreamClient( - credentials=ga_credentials.AnonymousCredentials, transport=transport_name, + credentials=ga_credentials.AnonymousCredentials, + transport=transport_name, ) # Mock the actual call within the gRPC stub, and fake the request. @@ -5455,12 +6212,21 @@ def test_list_routes_pages(transport_name: str = "grpc"): ], next_page_token="abc", ), - datastream.ListRoutesResponse(routes=[], next_page_token="def",), datastream.ListRoutesResponse( - routes=[datastream_resources.Route(),], next_page_token="ghi", + routes=[], + next_page_token="def", ), datastream.ListRoutesResponse( - routes=[datastream_resources.Route(), datastream_resources.Route(),], + routes=[ + datastream_resources.Route(), + ], + next_page_token="ghi", + ), + datastream.ListRoutesResponse( + routes=[ + datastream_resources.Route(), + datastream_resources.Route(), + ], ), RuntimeError, ) @@ -5471,7 +6237,9 @@ def test_list_routes_pages(transport_name: str = "grpc"): @pytest.mark.asyncio async def test_list_routes_async_pager(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials,) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5487,16 +6255,27 @@ async def test_list_routes_async_pager(): ], next_page_token="abc", ), - datastream.ListRoutesResponse(routes=[], next_page_token="def",), datastream.ListRoutesResponse( - routes=[datastream_resources.Route(),], next_page_token="ghi", + routes=[], + next_page_token="def", + ), + datastream.ListRoutesResponse( + routes=[ + datastream_resources.Route(), + ], + next_page_token="ghi", ), datastream.ListRoutesResponse( - routes=[datastream_resources.Route(), datastream_resources.Route(),], + routes=[ + datastream_resources.Route(), + datastream_resources.Route(), + ], ), RuntimeError, ) - async_pager = await client.list_routes(request={},) + async_pager = await client.list_routes( + request={}, + ) assert async_pager.next_page_token == "abc" responses = [] async for response in async_pager: @@ -5508,7 +6287,9 @@ async def test_list_routes_async_pager(): @pytest.mark.asyncio async def test_list_routes_async_pages(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials,) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5524,12 +6305,21 @@ async def test_list_routes_async_pages(): ], next_page_token="abc", ), - datastream.ListRoutesResponse(routes=[], next_page_token="def",), datastream.ListRoutesResponse( - routes=[datastream_resources.Route(),], next_page_token="ghi", + routes=[], + next_page_token="def", + ), + datastream.ListRoutesResponse( + routes=[ + datastream_resources.Route(), + ], + next_page_token="ghi", ), datastream.ListRoutesResponse( - routes=[datastream_resources.Route(), datastream_resources.Route(),], + routes=[ + datastream_resources.Route(), + datastream_resources.Route(), + ], ), RuntimeError, ) @@ -5540,10 +6330,17 @@ async def test_list_routes_async_pages(): assert page_.raw_page.next_page_token == token -@pytest.mark.parametrize("request_type", [datastream.DeleteRouteRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + datastream.DeleteRouteRequest, + dict, + ], +) def test_delete_route(request_type, transport: str = "grpc"): client = DatastreamClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -5569,7 +6366,8 @@ def test_delete_route_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = DatastreamClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -5585,7 +6383,8 @@ async def test_delete_route_async( transport: str = "grpc_asyncio", request_type=datastream.DeleteRouteRequest ): client = DatastreamAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -5615,7 +6414,9 @@ async def test_delete_route_async_from_dict(): def test_delete_route_field_headers(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -5635,12 +6436,17 @@ def test_delete_route_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_delete_route_field_headers_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -5662,11 +6468,16 @@ async def test_delete_route_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] def test_delete_route_flattened(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_route), "__call__") as call: @@ -5674,7 +6485,9 @@ def test_delete_route_flattened(): call.return_value = operations_pb2.Operation(name="operations/op") # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.delete_route(name="name_value",) + client.delete_route( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -5686,19 +6499,24 @@ def test_delete_route_flattened(): def test_delete_route_flattened_error(): - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.delete_route( - datastream.DeleteRouteRequest(), name="name_value", + datastream.DeleteRouteRequest(), + name="name_value", ) @pytest.mark.asyncio async def test_delete_route_flattened_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_route), "__call__") as call: @@ -5710,7 +6528,9 @@ async def test_delete_route_flattened_async(): ) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.delete_route(name="name_value",) + response = await client.delete_route( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -5723,13 +6543,16 @@ async def test_delete_route_flattened_async(): @pytest.mark.asyncio async def test_delete_route_flattened_error_async(): - client = DatastreamAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DatastreamAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): await client.delete_route( - datastream.DeleteRouteRequest(), name="name_value", + datastream.DeleteRouteRequest(), + name="name_value", ) @@ -5740,7 +6563,8 @@ def test_credentials_transport_error(): ) with pytest.raises(ValueError): client = DatastreamClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # It is an error to provide a credentials file and a transport instance. @@ -5760,7 +6584,10 @@ def test_credentials_transport_error(): options = client_options.ClientOptions() options.api_key = "api_key" with pytest.raises(ValueError): - client = DatastreamClient(client_options=options, transport=transport,) + client = DatastreamClient( + client_options=options, + transport=transport, + ) # It is an error to provide an api_key and a credential. options = mock.Mock() @@ -5776,7 +6603,8 @@ def test_credentials_transport_error(): ) with pytest.raises(ValueError): client = DatastreamClient( - client_options={"scopes": ["1", "2"]}, transport=transport, + client_options={"scopes": ["1", "2"]}, + transport=transport, ) @@ -5806,7 +6634,10 @@ def test_transport_get_channel(): @pytest.mark.parametrize( "transport_class", - [transports.DatastreamGrpcTransport, transports.DatastreamGrpcAsyncIOTransport,], + [ + transports.DatastreamGrpcTransport, + transports.DatastreamGrpcAsyncIOTransport, + ], ) def test_transport_adc(transport_class): # Test default credentials are used if not provided. @@ -5818,8 +6649,13 @@ def test_transport_adc(transport_class): def test_transport_grpc_default(): # A client should use the gRPC transport by default. - client = DatastreamClient(credentials=ga_credentials.AnonymousCredentials(),) - assert isinstance(client.transport, transports.DatastreamGrpcTransport,) + client = DatastreamClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + assert isinstance( + client.transport, + transports.DatastreamGrpcTransport, + ) def test_datastream_base_transport_error(): @@ -5889,7 +6725,8 @@ def test_datastream_base_transport_with_credentials_file(): Transport.return_value = None load_creds.return_value = (ga_credentials.AnonymousCredentials(), None) transport = transports.DatastreamTransport( - credentials_file="credentials.json", quota_project_id="octopus", + credentials_file="credentials.json", + quota_project_id="octopus", ) load_creds.assert_called_once_with( "credentials.json", @@ -5924,7 +6761,10 @@ def test_datastream_auth_adc(): @pytest.mark.parametrize( "transport_class", - [transports.DatastreamGrpcTransport, transports.DatastreamGrpcAsyncIOTransport,], + [ + transports.DatastreamGrpcTransport, + transports.DatastreamGrpcAsyncIOTransport, + ], ) def test_datastream_transport_auth_adc(transport_class): # If credentials and host are not provided, the transport class should use @@ -6041,7 +6881,8 @@ def test_datastream_grpc_transport_channel(): # Check that channel is used if provided. transport = transports.DatastreamGrpcTransport( - host="squid.clam.whelk", channel=channel, + host="squid.clam.whelk", + channel=channel, ) assert transport.grpc_channel == channel assert transport._host == "squid.clam.whelk:443" @@ -6053,7 +6894,8 @@ def test_datastream_grpc_asyncio_transport_channel(): # Check that channel is used if provided. transport = transports.DatastreamGrpcAsyncIOTransport( - host="squid.clam.whelk", channel=channel, + host="squid.clam.whelk", + channel=channel, ) assert transport.grpc_channel == channel assert transport._host == "squid.clam.whelk:443" @@ -6154,12 +6996,16 @@ def test_datastream_transport_channel_mtls_with_adc(transport_class): def test_datastream_grpc_lro_client(): client = DatastreamClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) transport = client.transport # Ensure that we have a api-core operations client. - assert isinstance(transport.operations_client, operations_v1.OperationsClient,) + assert isinstance( + transport.operations_client, + operations_v1.OperationsClient, + ) # Ensure that subsequent calls to the property send the exact same object. assert transport.operations_client is transport.operations_client @@ -6167,12 +7013,16 @@ def test_datastream_grpc_lro_client(): def test_datastream_grpc_lro_async_client(): client = DatastreamAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc_asyncio", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc_asyncio", ) transport = client.transport # Ensure that we have a api-core operations client. - assert isinstance(transport.operations_client, operations_v1.OperationsAsyncClient,) + assert isinstance( + transport.operations_client, + operations_v1.OperationsAsyncClient, + ) # Ensure that subsequent calls to the property send the exact same object. assert transport.operations_client is transport.operations_client @@ -6183,7 +7033,9 @@ def test_connection_profile_path(): location = "clam" connection_profile = "whelk" expected = "projects/{project}/locations/{location}/connectionProfiles/{connection_profile}".format( - project=project, location=location, connection_profile=connection_profile, + project=project, + location=location, + connection_profile=connection_profile, ) actual = DatastreamClient.connection_profile_path( project, location, connection_profile @@ -6209,7 +7061,9 @@ def test_private_connection_path(): location = "mussel" private_connection = "winkle" expected = "projects/{project}/locations/{location}/privateConnections/{private_connection}".format( - project=project, location=location, private_connection=private_connection, + project=project, + location=location, + private_connection=private_connection, ) actual = DatastreamClient.private_connection_path( project, location, private_connection @@ -6264,7 +7118,9 @@ def test_stream_path(): location = "nautilus" stream = "scallop" expected = "projects/{project}/locations/{location}/streams/{stream}".format( - project=project, location=location, stream=stream, + project=project, + location=location, + stream=stream, ) actual = DatastreamClient.stream_path(project, location, stream) assert expected == actual @@ -6305,7 +7161,9 @@ def test_parse_common_billing_account_path(): def test_common_folder_path(): folder = "oyster" - expected = "folders/{folder}".format(folder=folder,) + expected = "folders/{folder}".format( + folder=folder, + ) actual = DatastreamClient.common_folder_path(folder) assert expected == actual @@ -6323,7 +7181,9 @@ def test_parse_common_folder_path(): def test_common_organization_path(): organization = "cuttlefish" - expected = "organizations/{organization}".format(organization=organization,) + expected = "organizations/{organization}".format( + organization=organization, + ) actual = DatastreamClient.common_organization_path(organization) assert expected == actual @@ -6341,7 +7201,9 @@ def test_parse_common_organization_path(): def test_common_project_path(): project = "winkle" - expected = "projects/{project}".format(project=project,) + expected = "projects/{project}".format( + project=project, + ) actual = DatastreamClient.common_project_path(project) assert expected == actual @@ -6361,7 +7223,8 @@ def test_common_location_path(): project = "scallop" location = "abalone" expected = "projects/{project}/locations/{location}".format( - project=project, location=location, + project=project, + location=location, ) actual = DatastreamClient.common_location_path(project, location) assert expected == actual @@ -6386,7 +7249,8 @@ def test_client_with_default_client_info(): transports.DatastreamTransport, "_prep_wrapped_messages" ) as prep: client = DatastreamClient( - credentials=ga_credentials.AnonymousCredentials(), client_info=client_info, + credentials=ga_credentials.AnonymousCredentials(), + client_info=client_info, ) prep.assert_called_once_with(client_info) @@ -6395,7 +7259,8 @@ def test_client_with_default_client_info(): ) as prep: transport_class = DatastreamClient.get_transport_class() transport = transport_class( - credentials=ga_credentials.AnonymousCredentials(), client_info=client_info, + credentials=ga_credentials.AnonymousCredentials(), + client_info=client_info, ) prep.assert_called_once_with(client_info) @@ -6403,7 +7268,8 @@ def test_client_with_default_client_info(): @pytest.mark.asyncio async def test_transport_close_async(): client = DatastreamAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc_asyncio", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc_asyncio", ) with mock.patch.object( type(getattr(client.transport, "grpc_channel")), "close" From 6edea0e11ff8c0bc3bf3eaafbe198f7fe93a4a01 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 30 Mar 2022 17:04:17 +0000 Subject: [PATCH 03/15] chore(python): add E231 to .flake8 ignore list (#82) Source-Link: https://github.com/googleapis/synthtool/commit/7ff4aad2ec5af0380e8bd6da1fa06eaadf24ec81 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:462782b0b492346b2d9099aaff52206dd30bc8e031ea97082e6facecc2373244 --- .flake8 | 2 +- .github/.OwlBot.lock.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.flake8 b/.flake8 index 29227d4..2e43874 100644 --- a/.flake8 +++ b/.flake8 @@ -16,7 +16,7 @@ # Generated by synthtool. DO NOT EDIT! [flake8] -ignore = E203, E266, E501, W503 +ignore = E203, E231, E266, E501, W503 exclude = # Exclude generated code. **/proto/** diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 87dd006..9e0a935 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,4 +13,4 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest - digest: sha256:7cffbc10910c3ab1b852c05114a08d374c195a81cdec1d4a67a1d129331d0bfe + digest: sha256:462782b0b492346b2d9099aaff52206dd30bc8e031ea97082e6facecc2373244 From fb24826b196baf7d913c41931e7c661b59915e21 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 1 Apr 2022 00:34:11 +0000 Subject: [PATCH 04/15] chore(python): update .pre-commit-config.yaml to use black==22.3.0 (#83) Source-Link: https://github.com/googleapis/synthtool/commit/7804ade3daae0d66649bee8df6c55484c6580b8d Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:eede5672562a32821444a8e803fb984a6f61f2237ea3de229d2de24453f4ae7d --- .github/.OwlBot.lock.yaml | 3 ++- .pre-commit-config.yaml | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 9e0a935..22cc254 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,4 +13,5 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest - digest: sha256:462782b0b492346b2d9099aaff52206dd30bc8e031ea97082e6facecc2373244 + digest: sha256:eede5672562a32821444a8e803fb984a6f61f2237ea3de229d2de24453f4ae7d +# created: 2022-03-30T23:44:26.560599165Z diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 62eb5a7..46d2371 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -22,7 +22,7 @@ repos: - id: end-of-file-fixer - id: check-yaml - repo: https://github.com/psf/black - rev: 19.10b0 + rev: 22.3.0 hooks: - id: black - repo: https://gitlab.com/pycqa/flake8 From d3a911d42bc014fa6f6f99a75028e383225ea32e Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 1 Apr 2022 02:12:16 +0000 Subject: [PATCH 05/15] chore(python): Enable size-label bot (#84) Source-Link: https://github.com/googleapis/synthtool/commit/06e82790dd719a165ad32b8a06f8f6ec3e3cae0f Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:b3500c053313dc34e07b1632ba9e4e589f4f77036a7cf39e1fe8906811ae0fce --- .github/.OwlBot.lock.yaml | 4 ++-- .github/auto-label.yaml | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 .github/auto-label.yaml diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 22cc254..58a0b15 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,5 +13,5 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest - digest: sha256:eede5672562a32821444a8e803fb984a6f61f2237ea3de229d2de24453f4ae7d -# created: 2022-03-30T23:44:26.560599165Z + digest: sha256:b3500c053313dc34e07b1632ba9e4e589f4f77036a7cf39e1fe8906811ae0fce +# created: 2022-04-01T01:42:03.609279246Z diff --git a/.github/auto-label.yaml b/.github/auto-label.yaml new file mode 100644 index 0000000..09c8d73 --- /dev/null +++ b/.github/auto-label.yaml @@ -0,0 +1,2 @@ +requestsize: + enabled: true From 13a4eafd2f31aa9106d54a13bf5a470d1130a8a4 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 1 Apr 2022 19:44:22 +0000 Subject: [PATCH 06/15] chore(python): refactor unit / system test dependency install (#85) Source-Link: https://github.com/googleapis/synthtool/commit/993985f0fc4b37152e588f0549bcbdaf34666023 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:1894490910e891a385484514b22eb5133578897eb5b3c380e6d8ad475c6647cd --- .github/.OwlBot.lock.yaml | 4 +- noxfile.py | 105 ++++++++++++++++++++++++++++++-------- 2 files changed, 87 insertions(+), 22 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 58a0b15..fa57622 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,5 +13,5 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest - digest: sha256:b3500c053313dc34e07b1632ba9e4e589f4f77036a7cf39e1fe8906811ae0fce -# created: 2022-04-01T01:42:03.609279246Z + digest: sha256:1894490910e891a385484514b22eb5133578897eb5b3c380e6d8ad475c6647cd +# created: 2022-04-01T15:48:07.524222836Z diff --git a/noxfile.py b/noxfile.py index 3addb4e..6ee5e8a 100644 --- a/noxfile.py +++ b/noxfile.py @@ -20,16 +20,40 @@ import os import pathlib import shutil +import warnings import nox - BLACK_VERSION = "black==22.3.0" BLACK_PATHS = ["docs", "google", "tests", "noxfile.py", "setup.py"] DEFAULT_PYTHON_VERSION = "3.8" -SYSTEM_TEST_PYTHON_VERSIONS = ["3.8"] + UNIT_TEST_PYTHON_VERSIONS = ["3.6", "3.7", "3.8", "3.9", "3.10"] +UNIT_TEST_STANDARD_DEPENDENCIES = [ + "mock", + "asyncmock", + "pytest", + "pytest-cov", + "pytest-asyncio", +] +UNIT_TEST_EXTERNAL_DEPENDENCIES = [] +UNIT_TEST_LOCAL_DEPENDENCIES = [] +UNIT_TEST_DEPENDENCIES = [] +UNIT_TEST_EXTRAS = [] +UNIT_TEST_EXTRAS_BY_PYTHON = {} + +SYSTEM_TEST_PYTHON_VERSIONS = ["3.8"] +SYSTEM_TEST_STANDARD_DEPENDENCIES = [ + "mock", + "pytest", + "google-cloud-testutils", +] +SYSTEM_TEST_EXTERNAL_DEPENDENCIES = [] +SYSTEM_TEST_LOCAL_DEPENDENCIES = [] +SYSTEM_TEST_DEPENDENCIES = [] +SYSTEM_TEST_EXTRAS = [] +SYSTEM_TEST_EXTRAS_BY_PYTHON = {} CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute() @@ -81,23 +105,41 @@ def lint_setup_py(session): session.run("python", "setup.py", "check", "--restructuredtext", "--strict") +def install_unittest_dependencies(session, *constraints): + standard_deps = UNIT_TEST_STANDARD_DEPENDENCIES + UNIT_TEST_DEPENDENCIES + session.install(*standard_deps, *constraints) + + if UNIT_TEST_EXTERNAL_DEPENDENCIES: + warnings.warn( + "'unit_test_external_dependencies' is deprecated. Instead, please " + "use 'unit_test_dependencies' or 'unit_test_local_dependencies'.", + DeprecationWarning, + ) + session.install(*UNIT_TEST_EXTERNAL_DEPENDENCIES, *constraints) + + if UNIT_TEST_LOCAL_DEPENDENCIES: + session.install(*UNIT_TEST_LOCAL_DEPENDENCIES, *constraints) + + if UNIT_TEST_EXTRAS_BY_PYTHON: + extras = UNIT_TEST_EXTRAS_BY_PYTHON.get(session.python, []) + elif UNIT_TEST_EXTRAS: + extras = UNIT_TEST_EXTRAS + else: + extras = [] + + if extras: + session.install("-e", f".[{','.join(extras)}]", *constraints) + else: + session.install("-e", ".", *constraints) + + def default(session): # Install all test dependencies, then install this package in-place. constraints_path = str( CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}.txt" ) - session.install( - "mock", - "asyncmock", - "pytest", - "pytest-cov", - "pytest-asyncio", - "-c", - constraints_path, - ) - - session.install("-e", ".", "-c", constraints_path) + install_unittest_dependencies(session, "-c", constraints_path) # Run py.test against the unit tests. session.run( @@ -121,6 +163,35 @@ def unit(session): default(session) +def install_systemtest_dependencies(session, *constraints): + + # Use pre-release gRPC for system tests. + session.install("--pre", "grpcio") + + session.install(*SYSTEM_TEST_STANDARD_DEPENDENCIES, *constraints) + + if SYSTEM_TEST_EXTERNAL_DEPENDENCIES: + session.install(*SYSTEM_TEST_EXTERNAL_DEPENDENCIES, *constraints) + + if SYSTEM_TEST_LOCAL_DEPENDENCIES: + session.install("-e", *SYSTEM_TEST_LOCAL_DEPENDENCIES, *constraints) + + if SYSTEM_TEST_DEPENDENCIES: + session.install("-e", *SYSTEM_TEST_DEPENDENCIES, *constraints) + + if SYSTEM_TEST_EXTRAS_BY_PYTHON: + extras = SYSTEM_TEST_EXTRAS_BY_PYTHON.get(session.python, []) + elif SYSTEM_TEST_EXTRAS: + extras = SYSTEM_TEST_EXTRAS + else: + extras = [] + + if extras: + session.install("-e", f".[{','.join(extras)}]", *constraints) + else: + session.install("-e", ".", *constraints) + + @nox.session(python=SYSTEM_TEST_PYTHON_VERSIONS) def system(session): """Run the system test suite.""" @@ -143,13 +214,7 @@ def system(session): if not system_test_exists and not system_test_folder_exists: session.skip("System tests were not found") - # Use pre-release gRPC for system tests. - session.install("--pre", "grpcio") - - # Install all test dependencies, then install this package into the - # virtualenv's dist-packages. - session.install("mock", "pytest", "google-cloud-testutils", "-c", constraints_path) - session.install("-e", ".", "-c", constraints_path) + install_systemtest_dependencies(session, "-c", constraints_path) # Run py.test against the system tests. if system_test_exists: From fda521e991b7e8c0b64236afd08ea791898b3e4b Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 6 Apr 2022 10:46:11 +0000 Subject: [PATCH 07/15] chore(python): add license header to auto-label.yaml (#86) Source-Link: https://github.com/googleapis/synthtool/commit/eb78c980b52c7c6746d2edb77d9cf7aaa99a2aab Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:8a5d3f6a2e43ed8293f34e06a2f56931d1e88a2694c3bb11b15df4eb256ad163 --- .github/.OwlBot.lock.yaml | 4 ++-- .github/auto-label.yaml | 13 +++++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index fa57622..bc893c9 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,5 +13,5 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest - digest: sha256:1894490910e891a385484514b22eb5133578897eb5b3c380e6d8ad475c6647cd -# created: 2022-04-01T15:48:07.524222836Z + digest: sha256:8a5d3f6a2e43ed8293f34e06a2f56931d1e88a2694c3bb11b15df4eb256ad163 +# created: 2022-04-06T10:30:21.687684602Z diff --git a/.github/auto-label.yaml b/.github/auto-label.yaml index 09c8d73..41bff0b 100644 --- a/.github/auto-label.yaml +++ b/.github/auto-label.yaml @@ -1,2 +1,15 @@ +# Copyright 2022 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. requestsize: enabled: true From cb7249d165c28d6c4005313759282ce4f78966c8 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Mon, 11 Apr 2022 23:50:10 +0000 Subject: [PATCH 08/15] chore: Use gapic-generator-python 0.65.0 (#89) - [ ] Regenerate this pull request now. PiperOrigin-RevId: 440970084 Source-Link: https://github.com/googleapis/googleapis/commit/5e0a3d57254ab9857ccac77fc6ffade7b69a2dc7 Source-Link: https://github.com/googleapis/googleapis-gen/commit/b0c628a3fade768f225d76992791ea1ba2a881be Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYjBjNjI4YTNmYWRlNzY4ZjIyNWQ3Njk5Mjc5MWVhMWJhMmE4ODFiZSJ9 docs: fix type in docstring for map fields --- .../services/datastream/async_client.py | 20 +--- .../services/datastream/client.py | 20 +--- .../services/datastream/transports/base.py | 5 + .../services/datastream/transports/grpc.py | 4 + .../types/datastream_resources.py | 14 +-- .../services/datastream/async_client.py | 17 +-- .../services/datastream/client.py | 17 +-- .../services/datastream/transports/base.py | 5 + .../services/datastream/transports/grpc.py | 4 + .../types/datastream_resources.py | 14 +-- .../gapic/datastream_v1/test_datastream.py | 111 +++++++++++++----- .../datastream_v1alpha1/test_datastream.py | 105 ++++++++++++----- 12 files changed, 196 insertions(+), 140 deletions(-) diff --git a/google/cloud/datastream_v1/services/datastream/async_client.py b/google/cloud/datastream_v1/services/datastream/async_client.py index f7e91f3..8305f36 100644 --- a/google/cloud/datastream_v1/services/datastream/async_client.py +++ b/google/cloud/datastream_v1/services/datastream/async_client.py @@ -16,7 +16,7 @@ from collections import OrderedDict import functools import re -from typing import Dict, Optional, Sequence, Tuple, Type, Union +from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union import pkg_resources from google.api_core.client_options import ClientOptions @@ -228,7 +228,6 @@ async def list_connection_profiles( r"""Use this method to list connection profiles created in a project and location. - .. code-block:: python from google.cloud import datastream_v1 @@ -338,7 +337,6 @@ async def get_connection_profile( r"""Use this method to get details about a connection profile. - .. code-block:: python from google.cloud import datastream_v1 @@ -438,7 +436,6 @@ async def create_connection_profile( r"""Use this method to create a connection profile in a project and location. - .. code-block:: python from google.cloud import datastream_v1 @@ -577,7 +574,6 @@ async def update_connection_profile( r"""Use this method to update the parameters of a connection profile. - .. code-block:: python from google.cloud import datastream_v1 @@ -832,7 +828,6 @@ async def discover_connection_profile( returns children data objects of a parent data object that's optionally supplied in the request. - .. code-block:: python from google.cloud import datastream_v1 @@ -915,7 +910,6 @@ async def list_streams( r"""Use this method to list streams in a project and location. - .. code-block:: python from google.cloud import datastream_v1 @@ -1255,7 +1249,6 @@ async def update_stream( r"""Use this method to update the configuration of a stream. - .. code-block:: python from google.cloud import datastream_v1 @@ -1602,7 +1595,6 @@ async def lookup_stream_object( r"""Use this method to look up a stream object by its source object identifier. - .. code-block:: python from google.cloud import datastream_v1 @@ -1683,7 +1675,6 @@ async def list_stream_objects( r"""Use this method to list the objects of a specific stream. - .. code-block:: python from google.cloud import datastream_v1 @@ -1793,7 +1784,6 @@ async def start_backfill_job( r"""Use this method to start a backfill job for the specified stream object. - .. code-block:: python from google.cloud import datastream_v1 @@ -1892,7 +1882,6 @@ async def stop_backfill_job( r"""Use this method to stop a backfill job for the specified stream object. - .. code-block:: python from google.cloud import datastream_v1 @@ -1990,7 +1979,6 @@ async def fetch_static_ips( r"""The FetchStaticIps API call exposes the static IP addresses used by Datastream. - .. code-block:: python from google.cloud import datastream_v1 @@ -2103,7 +2091,6 @@ async def create_private_connection( r"""Use this method to create a private connectivity configuration. - .. code-block:: python from google.cloud import datastream_v1 @@ -2237,7 +2224,6 @@ async def get_private_connection( r"""Use this method to get details about a private connectivity configuration. - .. code-block:: python from google.cloud import datastream_v1 @@ -2336,7 +2322,6 @@ async def list_private_connections( r"""Use this method to list private connectivity configurations in a project and location. - .. code-block:: python from google.cloud import datastream_v1 @@ -2447,7 +2432,6 @@ async def delete_private_connection( r"""Use this method to delete a private connectivity configuration. - .. code-block:: python from google.cloud import datastream_v1 @@ -2571,7 +2555,6 @@ async def create_route( r"""Use this method to create a route for a private connectivity configuration in a project and location. - .. code-block:: python from google.cloud import datastream_v1 @@ -2799,7 +2782,6 @@ async def list_routes( r"""Use this method to list routes created for a private connectivity configuration in a project and location. - .. code-block:: python from google.cloud import datastream_v1 diff --git a/google/cloud/datastream_v1/services/datastream/client.py b/google/cloud/datastream_v1/services/datastream/client.py index 8bab25a..851421d 100644 --- a/google/cloud/datastream_v1/services/datastream/client.py +++ b/google/cloud/datastream_v1/services/datastream/client.py @@ -16,7 +16,7 @@ from collections import OrderedDict import os import re -from typing import Dict, Optional, Sequence, Tuple, Type, Union +from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union import pkg_resources from google.api_core import client_options as client_options_lib @@ -553,7 +553,6 @@ def list_connection_profiles( r"""Use this method to list connection profiles created in a project and location. - .. code-block:: python from google.cloud import datastream_v1 @@ -663,7 +662,6 @@ def get_connection_profile( r"""Use this method to get details about a connection profile. - .. code-block:: python from google.cloud import datastream_v1 @@ -763,7 +761,6 @@ def create_connection_profile( r"""Use this method to create a connection profile in a project and location. - .. code-block:: python from google.cloud import datastream_v1 @@ -904,7 +901,6 @@ def update_connection_profile( r"""Use this method to update the parameters of a connection profile. - .. code-block:: python from google.cloud import datastream_v1 @@ -1163,7 +1159,6 @@ def discover_connection_profile( returns children data objects of a parent data object that's optionally supplied in the request. - .. code-block:: python from google.cloud import datastream_v1 @@ -1249,7 +1244,6 @@ def list_streams( r"""Use this method to list streams in a project and location. - .. code-block:: python from google.cloud import datastream_v1 @@ -1589,7 +1583,6 @@ def update_stream( r"""Use this method to update the configuration of a stream. - .. code-block:: python from google.cloud import datastream_v1 @@ -1936,7 +1929,6 @@ def lookup_stream_object( r"""Use this method to look up a stream object by its source object identifier. - .. code-block:: python from google.cloud import datastream_v1 @@ -2018,7 +2010,6 @@ def list_stream_objects( r"""Use this method to list the objects of a specific stream. - .. code-block:: python from google.cloud import datastream_v1 @@ -2128,7 +2119,6 @@ def start_backfill_job( r"""Use this method to start a backfill job for the specified stream object. - .. code-block:: python from google.cloud import datastream_v1 @@ -2227,7 +2217,6 @@ def stop_backfill_job( r"""Use this method to stop a backfill job for the specified stream object. - .. code-block:: python from google.cloud import datastream_v1 @@ -2325,7 +2314,6 @@ def fetch_static_ips( r"""The FetchStaticIps API call exposes the static IP addresses used by Datastream. - .. code-block:: python from google.cloud import datastream_v1 @@ -2438,7 +2426,6 @@ def create_private_connection( r"""Use this method to create a private connectivity configuration. - .. code-block:: python from google.cloud import datastream_v1 @@ -2574,7 +2561,6 @@ def get_private_connection( r"""Use this method to get details about a private connectivity configuration. - .. code-block:: python from google.cloud import datastream_v1 @@ -2673,7 +2659,6 @@ def list_private_connections( r"""Use this method to list private connectivity configurations in a project and location. - .. code-block:: python from google.cloud import datastream_v1 @@ -2784,7 +2769,6 @@ def delete_private_connection( r"""Use this method to delete a private connectivity configuration. - .. code-block:: python from google.cloud import datastream_v1 @@ -2910,7 +2894,6 @@ def create_route( r"""Use this method to create a route for a private connectivity configuration in a project and location. - .. code-block:: python from google.cloud import datastream_v1 @@ -3138,7 +3121,6 @@ def list_routes( r"""Use this method to list routes created for a private connectivity configuration in a project and location. - .. code-block:: python from google.cloud import datastream_v1 diff --git a/google/cloud/datastream_v1/services/datastream/transports/base.py b/google/cloud/datastream_v1/services/datastream/transports/base.py index 8034d62..004e778 100644 --- a/google/cloud/datastream_v1/services/datastream/transports/base.py +++ b/google/cloud/datastream_v1/services/datastream/transports/base.py @@ -83,6 +83,7 @@ def __init__( always_use_jwt_access (Optional[bool]): Whether self signed JWT should be used for service account credentials. """ + # Save the hostname. Default to port 443 (HTTPS) if none is specified. if ":" not in host: host += ":443" @@ -524,5 +525,9 @@ def delete_route( ]: raise NotImplementedError() + @property + def kind(self) -> str: + raise NotImplementedError() + __all__ = ("DatastreamTransport",) diff --git a/google/cloud/datastream_v1/services/datastream/transports/grpc.py b/google/cloud/datastream_v1/services/datastream/transports/grpc.py index 58201b4..80ea09e 100644 --- a/google/cloud/datastream_v1/services/datastream/transports/grpc.py +++ b/google/cloud/datastream_v1/services/datastream/transports/grpc.py @@ -954,5 +954,9 @@ def delete_route( def close(self): self.grpc_channel.close() + @property + def kind(self) -> str: + return "grpc" + __all__ = ("DatastreamGrpcTransport",) diff --git a/google/cloud/datastream_v1/types/datastream_resources.py b/google/cloud/datastream_v1/types/datastream_resources.py index 4d17579..756110b 100644 --- a/google/cloud/datastream_v1/types/datastream_resources.py +++ b/google/cloud/datastream_v1/types/datastream_resources.py @@ -75,7 +75,7 @@ class OracleProfile(proto.Message): Required. Password for the Oracle connection. database_service (str): Required. Database for the Oracle connection. - connection_attributes (Sequence[google.cloud.datastream_v1.types.OracleProfile.ConnectionAttributesEntry]): + connection_attributes (Mapping[str, str]): Connection string attributes """ @@ -258,7 +258,7 @@ class PrivateConnection(proto.Message): Output only. The create time of the resource. update_time (google.protobuf.timestamp_pb2.Timestamp): Output only. The update time of the resource. - labels (Sequence[google.cloud.datastream_v1.types.PrivateConnection.LabelsEntry]): + labels (Mapping[str, str]): Labels. display_name (str): Required. Display name. @@ -348,7 +348,7 @@ class Route(proto.Message): Output only. The create time of the resource. update_time (google.protobuf.timestamp_pb2.Timestamp): Output only. The update time of the resource. - labels (Sequence[google.cloud.datastream_v1.types.Route.LabelsEntry]): + labels (Mapping[str, str]): Labels. display_name (str): Required. Display name. @@ -463,7 +463,7 @@ class ConnectionProfile(proto.Message): Output only. The create time of the resource. update_time (google.protobuf.timestamp_pb2.Timestamp): Output only. The update time of the resource. - labels (Sequence[google.cloud.datastream_v1.types.ConnectionProfile.LabelsEntry]): + labels (Mapping[str, str]): Labels. display_name (str): Required. Display name. @@ -1023,7 +1023,7 @@ class Stream(proto.Message): update_time (google.protobuf.timestamp_pb2.Timestamp): Output only. The last update time of the stream. - labels (Sequence[google.cloud.datastream_v1.types.Stream.LabelsEntry]): + labels (Mapping[str, str]): Labels. display_name (str): Required. Display name. @@ -1381,7 +1381,7 @@ class Error(proto.Message): the error that occurred. error_time (google.protobuf.timestamp_pb2.Timestamp): The time when the error occurred. - details (Sequence[google.cloud.datastream_v1.types.Error.DetailsEntry]): + details (Mapping[str, str]): Additional information about the error. """ @@ -1474,7 +1474,7 @@ class ValidationMessage(proto.Message): The result of the validation. level (google.cloud.datastream_v1.types.ValidationMessage.Level): Message severity level (warning or error). - metadata (Sequence[google.cloud.datastream_v1.types.ValidationMessage.MetadataEntry]): + metadata (Mapping[str, str]): Additional metadata related to the result. code (str): A custom code identifying this specific diff --git a/google/cloud/datastream_v1alpha1/services/datastream/async_client.py b/google/cloud/datastream_v1alpha1/services/datastream/async_client.py index 870277c..4c44571 100644 --- a/google/cloud/datastream_v1alpha1/services/datastream/async_client.py +++ b/google/cloud/datastream_v1alpha1/services/datastream/async_client.py @@ -16,7 +16,7 @@ from collections import OrderedDict import functools import re -from typing import Dict, Optional, Sequence, Tuple, Type, Union +from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union import pkg_resources from google.api_core.client_options import ClientOptions @@ -224,7 +224,6 @@ async def list_connection_profiles( r"""Use this method to list connection profiles created in a project and location. - .. code-block:: python from google.cloud import datastream_v1alpha1 @@ -331,7 +330,6 @@ async def get_connection_profile( r"""Use this method to get details about a connection profile. - .. code-block:: python from google.cloud import datastream_v1alpha1 @@ -427,7 +425,6 @@ async def create_connection_profile( r"""Use this method to create a connection profile in a project and location. - .. code-block:: python from google.cloud import datastream_v1alpha1 @@ -565,7 +562,6 @@ async def update_connection_profile( r"""Use this method to update the parameters of a connection profile. - .. code-block:: python from google.cloud import datastream_v1alpha1 @@ -819,7 +815,6 @@ async def discover_connection_profile( returns children data objects under a parent data object that's optionally supplied in the request. - .. code-block:: python from google.cloud import datastream_v1alpha1 @@ -902,7 +897,6 @@ async def list_streams( r"""Use this method to list streams in a project and location. - .. code-block:: python from google.cloud import datastream_v1alpha1 @@ -1235,7 +1229,6 @@ async def update_stream( r"""Use this method to update the configuration of a stream. - .. code-block:: python from google.cloud import datastream_v1alpha1 @@ -1483,7 +1476,6 @@ async def fetch_errors( r"""Use this method to fetch any errors associated with a stream. - .. code-block:: python from google.cloud import datastream_v1alpha1 @@ -1575,7 +1567,6 @@ async def fetch_static_ips( children data objects under a parent data object that's optionally supplied in the request. - .. code-block:: python from google.cloud import datastream_v1alpha1 @@ -1687,7 +1678,6 @@ async def create_private_connection( r"""Use this method to create a private connectivity configuration. - .. code-block:: python from google.cloud import datastream_v1alpha1 @@ -1820,7 +1810,6 @@ async def get_private_connection( r"""Use this method to get details about a private connectivity configuration. - .. code-block:: python from google.cloud import datastream_v1alpha1 @@ -1918,7 +1907,6 @@ async def list_private_connections( r"""Use this method to list private connectivity configurations in a project and location. - .. code-block:: python from google.cloud import datastream_v1alpha1 @@ -2026,7 +2014,6 @@ async def delete_private_connection( r"""Use this method to delete a private connectivity configuration. - .. code-block:: python from google.cloud import datastream_v1alpha1 @@ -2149,7 +2136,6 @@ async def create_route( r"""Use this method to create a route for a private connectivity in a project and location. - .. code-block:: python from google.cloud import datastream_v1alpha1 @@ -2378,7 +2364,6 @@ async def list_routes( r"""Use this method to list routes created for a private connectivity in a project and location. - .. code-block:: python from google.cloud import datastream_v1alpha1 diff --git a/google/cloud/datastream_v1alpha1/services/datastream/client.py b/google/cloud/datastream_v1alpha1/services/datastream/client.py index a042a5d..c78110e 100644 --- a/google/cloud/datastream_v1alpha1/services/datastream/client.py +++ b/google/cloud/datastream_v1alpha1/services/datastream/client.py @@ -16,7 +16,7 @@ from collections import OrderedDict import os import re -from typing import Dict, Optional, Sequence, Tuple, Type, Union +from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union import pkg_resources from google.api_core import client_options as client_options_lib @@ -510,7 +510,6 @@ def list_connection_profiles( r"""Use this method to list connection profiles created in a project and location. - .. code-block:: python from google.cloud import datastream_v1alpha1 @@ -617,7 +616,6 @@ def get_connection_profile( r"""Use this method to get details about a connection profile. - .. code-block:: python from google.cloud import datastream_v1alpha1 @@ -713,7 +711,6 @@ def create_connection_profile( r"""Use this method to create a connection profile in a project and location. - .. code-block:: python from google.cloud import datastream_v1alpha1 @@ -853,7 +850,6 @@ def update_connection_profile( r"""Use this method to update the parameters of a connection profile. - .. code-block:: python from google.cloud import datastream_v1alpha1 @@ -1111,7 +1107,6 @@ def discover_connection_profile( returns children data objects under a parent data object that's optionally supplied in the request. - .. code-block:: python from google.cloud import datastream_v1alpha1 @@ -1197,7 +1192,6 @@ def list_streams( r"""Use this method to list streams in a project and location. - .. code-block:: python from google.cloud import datastream_v1alpha1 @@ -1530,7 +1524,6 @@ def update_stream( r"""Use this method to update the configuration of a stream. - .. code-block:: python from google.cloud import datastream_v1alpha1 @@ -1778,7 +1771,6 @@ def fetch_errors( r"""Use this method to fetch any errors associated with a stream. - .. code-block:: python from google.cloud import datastream_v1alpha1 @@ -1871,7 +1863,6 @@ def fetch_static_ips( children data objects under a parent data object that's optionally supplied in the request. - .. code-block:: python from google.cloud import datastream_v1alpha1 @@ -1983,7 +1974,6 @@ def create_private_connection( r"""Use this method to create a private connectivity configuration. - .. code-block:: python from google.cloud import datastream_v1alpha1 @@ -2118,7 +2108,6 @@ def get_private_connection( r"""Use this method to get details about a private connectivity configuration. - .. code-block:: python from google.cloud import datastream_v1alpha1 @@ -2216,7 +2205,6 @@ def list_private_connections( r"""Use this method to list private connectivity configurations in a project and location. - .. code-block:: python from google.cloud import datastream_v1alpha1 @@ -2324,7 +2312,6 @@ def delete_private_connection( r"""Use this method to delete a private connectivity configuration. - .. code-block:: python from google.cloud import datastream_v1alpha1 @@ -2449,7 +2436,6 @@ def create_route( r"""Use this method to create a route for a private connectivity in a project and location. - .. code-block:: python from google.cloud import datastream_v1alpha1 @@ -2678,7 +2664,6 @@ def list_routes( r"""Use this method to list routes created for a private connectivity in a project and location. - .. code-block:: python from google.cloud import datastream_v1alpha1 diff --git a/google/cloud/datastream_v1alpha1/services/datastream/transports/base.py b/google/cloud/datastream_v1alpha1/services/datastream/transports/base.py index 08831d3..2e98a48 100644 --- a/google/cloud/datastream_v1alpha1/services/datastream/transports/base.py +++ b/google/cloud/datastream_v1alpha1/services/datastream/transports/base.py @@ -83,6 +83,7 @@ def __init__( always_use_jwt_access (Optional[bool]): Whether self signed JWT should be used for service account credentials. """ + # Save the hostname. Default to port 443 (HTTPS) if none is specified. if ":" not in host: host += ":443" @@ -453,5 +454,9 @@ def delete_route( ]: raise NotImplementedError() + @property + def kind(self) -> str: + raise NotImplementedError() + __all__ = ("DatastreamTransport",) diff --git a/google/cloud/datastream_v1alpha1/services/datastream/transports/grpc.py b/google/cloud/datastream_v1alpha1/services/datastream/transports/grpc.py index 4348b59..4d09aa4 100644 --- a/google/cloud/datastream_v1alpha1/services/datastream/transports/grpc.py +++ b/google/cloud/datastream_v1alpha1/services/datastream/transports/grpc.py @@ -839,5 +839,9 @@ def delete_route( def close(self): self.grpc_channel.close() + @property + def kind(self) -> str: + return "grpc" + __all__ = ("DatastreamGrpcTransport",) diff --git a/google/cloud/datastream_v1alpha1/types/datastream_resources.py b/google/cloud/datastream_v1alpha1/types/datastream_resources.py index 1e0ab45..7e5d70b 100644 --- a/google/cloud/datastream_v1alpha1/types/datastream_resources.py +++ b/google/cloud/datastream_v1alpha1/types/datastream_resources.py @@ -89,7 +89,7 @@ class OracleProfile(proto.Message): Required. Password for the Oracle connection. database_service (str): Required. Database for the Oracle connection. - connection_attributes (Sequence[google.cloud.datastream_v1alpha1.types.OracleProfile.ConnectionAttributesEntry]): + connection_attributes (Mapping[str, str]): Connection string attributes """ @@ -276,7 +276,7 @@ class PrivateConnection(proto.Message): Output only. The create time of the resource. update_time (google.protobuf.timestamp_pb2.Timestamp): Output only. The update time of the resource. - labels (Sequence[google.cloud.datastream_v1alpha1.types.PrivateConnection.LabelsEntry]): + labels (Mapping[str, str]): Labels. display_name (str): Required. Display name. @@ -363,7 +363,7 @@ class Route(proto.Message): Output only. The create time of the resource. update_time (google.protobuf.timestamp_pb2.Timestamp): Output only. The update time of the resource. - labels (Sequence[google.cloud.datastream_v1alpha1.types.Route.LabelsEntry]): + labels (Mapping[str, str]): Labels. display_name (str): Required. Display name. @@ -477,7 +477,7 @@ class ConnectionProfile(proto.Message): Output only. The create time of the resource. update_time (google.protobuf.timestamp_pb2.Timestamp): Output only. The update time of the resource. - labels (Sequence[google.cloud.datastream_v1alpha1.types.ConnectionProfile.LabelsEntry]): + labels (Mapping[str, str]): Labels. display_name (str): Required. Display name. @@ -1046,7 +1046,7 @@ class Stream(proto.Message): update_time (google.protobuf.timestamp_pb2.Timestamp): Output only. The last update time of the stream. - labels (Sequence[google.cloud.datastream_v1alpha1.types.Stream.LabelsEntry]): + labels (Mapping[str, str]): Labels. display_name (str): Required. Display name. @@ -1200,7 +1200,7 @@ class Error(proto.Message): the error that occurred. error_time (google.protobuf.timestamp_pb2.Timestamp): The time when the error occurred. - details (Sequence[google.cloud.datastream_v1alpha1.types.Error.DetailsEntry]): + details (Mapping[str, str]): Additional information about the error. """ @@ -1293,7 +1293,7 @@ class ValidationMessage(proto.Message): The result of the validation. level (google.cloud.datastream_v1alpha1.types.ValidationMessage.Level): Message severity level (warning or error). - metadata (Sequence[google.cloud.datastream_v1alpha1.types.ValidationMessage.MetadataEntry]): + metadata (Mapping[str, str]): Additional metadata related to the result. code (str): A custom code identifying this specific diff --git a/tests/unit/gapic/datastream_v1/test_datastream.py b/tests/unit/gapic/datastream_v1/test_datastream.py index 5e1e7fd..a9ec6ea 100644 --- a/tests/unit/gapic/datastream_v1/test_datastream.py +++ b/tests/unit/gapic/datastream_v1/test_datastream.py @@ -91,24 +91,24 @@ def test__get_default_mtls_endpoint(): @pytest.mark.parametrize( - "client_class", + "client_class,transport_name", [ - DatastreamClient, - DatastreamAsyncClient, + (DatastreamClient, "grpc"), + (DatastreamAsyncClient, "grpc_asyncio"), ], ) -def test_datastream_client_from_service_account_info(client_class): +def test_datastream_client_from_service_account_info(client_class, transport_name): creds = ga_credentials.AnonymousCredentials() with mock.patch.object( service_account.Credentials, "from_service_account_info" ) as factory: factory.return_value = creds info = {"valid": True} - client = client_class.from_service_account_info(info) + client = client_class.from_service_account_info(info, transport=transport_name) assert client.transport._credentials == creds assert isinstance(client, client_class) - assert client.transport._host == "datastream.googleapis.com:443" + assert client.transport._host == ("datastream.googleapis.com:443") @pytest.mark.parametrize( @@ -137,27 +137,31 @@ def test_datastream_client_service_account_always_use_jwt( @pytest.mark.parametrize( - "client_class", + "client_class,transport_name", [ - DatastreamClient, - DatastreamAsyncClient, + (DatastreamClient, "grpc"), + (DatastreamAsyncClient, "grpc_asyncio"), ], ) -def test_datastream_client_from_service_account_file(client_class): +def test_datastream_client_from_service_account_file(client_class, transport_name): creds = ga_credentials.AnonymousCredentials() with mock.patch.object( service_account.Credentials, "from_service_account_file" ) as factory: factory.return_value = creds - client = client_class.from_service_account_file("dummy/file/path.json") + client = client_class.from_service_account_file( + "dummy/file/path.json", transport=transport_name + ) assert client.transport._credentials == creds assert isinstance(client, client_class) - client = client_class.from_service_account_json("dummy/file/path.json") + client = client_class.from_service_account_json( + "dummy/file/path.json", transport=transport_name + ) assert client.transport._credentials == creds assert isinstance(client, client_class) - assert client.transport._host == "datastream.googleapis.com:443" + assert client.transport._host == ("datastream.googleapis.com:443") def test_datastream_client_get_transport_class(): @@ -1020,7 +1024,7 @@ async def test_list_connection_profiles_async_pager(): ) assert async_pager.next_page_token == "abc" responses = [] - async for response in async_pager: + async for response in async_pager: # pragma: no branch responses.append(response) assert len(responses) == 6 @@ -1070,7 +1074,9 @@ async def test_list_connection_profiles_async_pages(): RuntimeError, ) pages = [] - async for page_ in (await client.list_connection_profiles(request={})).pages: + async for page_ in ( + await client.list_connection_profiles(request={}) + ).pages: # pragma: no branch pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -2630,7 +2636,7 @@ async def test_list_streams_async_pager(): ) assert async_pager.next_page_token == "abc" responses = [] - async for response in async_pager: + async for response in async_pager: # pragma: no branch responses.append(response) assert len(responses) == 6 @@ -2676,7 +2682,9 @@ async def test_list_streams_async_pages(): RuntimeError, ) pages = [] - async for page_ in (await client.list_streams(request={})).pages: + async for page_ in ( + await client.list_streams(request={}) + ).pages: # pragma: no branch pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -4447,7 +4455,7 @@ async def test_list_stream_objects_async_pager(): ) assert async_pager.next_page_token == "abc" responses = [] - async for response in async_pager: + async for response in async_pager: # pragma: no branch responses.append(response) assert len(responses) == 6 @@ -4495,7 +4503,9 @@ async def test_list_stream_objects_async_pages(): RuntimeError, ) pages = [] - async for page_ in (await client.list_stream_objects(request={})).pages: + async for page_ in ( + await client.list_stream_objects(request={}) + ).pages: # pragma: no branch pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -5351,7 +5361,7 @@ async def test_fetch_static_ips_async_pager(): ) assert async_pager.next_page_token == "abc" responses = [] - async for response in async_pager: + async for response in async_pager: # pragma: no branch responses.append(response) assert len(responses) == 6 @@ -5397,7 +5407,9 @@ async def test_fetch_static_ips_async_pages(): RuntimeError, ) pages = [] - async for page_ in (await client.fetch_static_ips(request={})).pages: + async for page_ in ( + await client.fetch_static_ips(request={}) + ).pages: # pragma: no branch pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -6319,7 +6331,7 @@ async def test_list_private_connections_async_pager(): ) assert async_pager.next_page_token == "abc" responses = [] - async for response in async_pager: + async for response in async_pager: # pragma: no branch responses.append(response) assert len(responses) == 6 @@ -6369,7 +6381,9 @@ async def test_list_private_connections_async_pages(): RuntimeError, ) pages = [] - async for page_ in (await client.list_private_connections(request={})).pages: + async for page_ in ( + await client.list_private_connections(request={}) + ).pages: # pragma: no branch pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -7476,7 +7490,7 @@ async def test_list_routes_async_pager(): ) assert async_pager.next_page_token == "abc" responses = [] - async for response in async_pager: + async for response in async_pager: # pragma: no branch responses.append(response) assert len(responses) == 6 @@ -7522,7 +7536,9 @@ async def test_list_routes_async_pages(): RuntimeError, ) pages = [] - async for page_ in (await client.list_routes(request={})).pages: + async for page_ in ( + await client.list_routes(request={}) + ).pages: # pragma: no branch pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -7845,6 +7861,19 @@ def test_transport_adc(transport_class): adc.assert_called_once() +@pytest.mark.parametrize( + "transport_name", + [ + "grpc", + ], +) +def test_transport_kind(transport_name): + transport = DatastreamClient.get_transport_class(transport_name)( + credentials=ga_credentials.AnonymousCredentials(), + ) + assert transport.kind == transport_name + + def test_transport_grpc_default(): # A client should use the gRPC transport by default. client = DatastreamClient( @@ -7916,6 +7945,14 @@ def test_datastream_base_transport(): with pytest.raises(NotImplementedError): transport.operations_client + # Catch all for all remaining methods and properties + remainder = [ + "kind", + ] + for r in remainder: + with pytest.raises(NotImplementedError): + getattr(transport, r)() + def test_datastream_base_transport_with_credentials_file(): # Instantiate the base transport with a credentials file @@ -8058,24 +8095,40 @@ def test_datastream_grpc_transport_client_cert_source_for_mtls(transport_class): ) -def test_datastream_host_no_port(): +@pytest.mark.parametrize( + "transport_name", + [ + "grpc", + "grpc_asyncio", + ], +) +def test_datastream_host_no_port(transport_name): client = DatastreamClient( credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions( api_endpoint="datastream.googleapis.com" ), + transport=transport_name, ) - assert client.transport._host == "datastream.googleapis.com:443" + assert client.transport._host == ("datastream.googleapis.com:443") -def test_datastream_host_with_port(): +@pytest.mark.parametrize( + "transport_name", + [ + "grpc", + "grpc_asyncio", + ], +) +def test_datastream_host_with_port(transport_name): client = DatastreamClient( credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions( api_endpoint="datastream.googleapis.com:8000" ), + transport=transport_name, ) - assert client.transport._host == "datastream.googleapis.com:8000" + assert client.transport._host == ("datastream.googleapis.com:8000") def test_datastream_grpc_transport_channel(): diff --git a/tests/unit/gapic/datastream_v1alpha1/test_datastream.py b/tests/unit/gapic/datastream_v1alpha1/test_datastream.py index 7c0789e..68679cd 100644 --- a/tests/unit/gapic/datastream_v1alpha1/test_datastream.py +++ b/tests/unit/gapic/datastream_v1alpha1/test_datastream.py @@ -91,24 +91,24 @@ def test__get_default_mtls_endpoint(): @pytest.mark.parametrize( - "client_class", + "client_class,transport_name", [ - DatastreamClient, - DatastreamAsyncClient, + (DatastreamClient, "grpc"), + (DatastreamAsyncClient, "grpc_asyncio"), ], ) -def test_datastream_client_from_service_account_info(client_class): +def test_datastream_client_from_service_account_info(client_class, transport_name): creds = ga_credentials.AnonymousCredentials() with mock.patch.object( service_account.Credentials, "from_service_account_info" ) as factory: factory.return_value = creds info = {"valid": True} - client = client_class.from_service_account_info(info) + client = client_class.from_service_account_info(info, transport=transport_name) assert client.transport._credentials == creds assert isinstance(client, client_class) - assert client.transport._host == "datastream.googleapis.com:443" + assert client.transport._host == ("datastream.googleapis.com:443") @pytest.mark.parametrize( @@ -137,27 +137,31 @@ def test_datastream_client_service_account_always_use_jwt( @pytest.mark.parametrize( - "client_class", + "client_class,transport_name", [ - DatastreamClient, - DatastreamAsyncClient, + (DatastreamClient, "grpc"), + (DatastreamAsyncClient, "grpc_asyncio"), ], ) -def test_datastream_client_from_service_account_file(client_class): +def test_datastream_client_from_service_account_file(client_class, transport_name): creds = ga_credentials.AnonymousCredentials() with mock.patch.object( service_account.Credentials, "from_service_account_file" ) as factory: factory.return_value = creds - client = client_class.from_service_account_file("dummy/file/path.json") + client = client_class.from_service_account_file( + "dummy/file/path.json", transport=transport_name + ) assert client.transport._credentials == creds assert isinstance(client, client_class) - client = client_class.from_service_account_json("dummy/file/path.json") + client = client_class.from_service_account_json( + "dummy/file/path.json", transport=transport_name + ) assert client.transport._credentials == creds assert isinstance(client, client_class) - assert client.transport._host == "datastream.googleapis.com:443" + assert client.transport._host == ("datastream.googleapis.com:443") def test_datastream_client_get_transport_class(): @@ -1020,7 +1024,7 @@ async def test_list_connection_profiles_async_pager(): ) assert async_pager.next_page_token == "abc" responses = [] - async for response in async_pager: + async for response in async_pager: # pragma: no branch responses.append(response) assert len(responses) == 6 @@ -1070,7 +1074,9 @@ async def test_list_connection_profiles_async_pages(): RuntimeError, ) pages = [] - async for page_ in (await client.list_connection_profiles(request={})).pages: + async for page_ in ( + await client.list_connection_profiles(request={}) + ).pages: # pragma: no branch pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -2630,7 +2636,7 @@ async def test_list_streams_async_pager(): ) assert async_pager.next_page_token == "abc" responses = [] - async for response in async_pager: + async for response in async_pager: # pragma: no branch responses.append(response) assert len(responses) == 6 @@ -2676,7 +2682,9 @@ async def test_list_streams_async_pages(): RuntimeError, ) pages = [] - async for page_ in (await client.list_streams(request={})).pages: + async for page_ in ( + await client.list_streams(request={}) + ).pages: # pragma: no branch pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -4153,7 +4161,7 @@ async def test_fetch_static_ips_async_pager(): ) assert async_pager.next_page_token == "abc" responses = [] - async for response in async_pager: + async for response in async_pager: # pragma: no branch responses.append(response) assert len(responses) == 6 @@ -4199,7 +4207,9 @@ async def test_fetch_static_ips_async_pages(): RuntimeError, ) pages = [] - async for page_ in (await client.fetch_static_ips(request={})).pages: + async for page_ in ( + await client.fetch_static_ips(request={}) + ).pages: # pragma: no branch pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -5121,7 +5131,7 @@ async def test_list_private_connections_async_pager(): ) assert async_pager.next_page_token == "abc" responses = [] - async for response in async_pager: + async for response in async_pager: # pragma: no branch responses.append(response) assert len(responses) == 6 @@ -5171,7 +5181,9 @@ async def test_list_private_connections_async_pages(): RuntimeError, ) pages = [] - async for page_ in (await client.list_private_connections(request={})).pages: + async for page_ in ( + await client.list_private_connections(request={}) + ).pages: # pragma: no branch pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -6278,7 +6290,7 @@ async def test_list_routes_async_pager(): ) assert async_pager.next_page_token == "abc" responses = [] - async for response in async_pager: + async for response in async_pager: # pragma: no branch responses.append(response) assert len(responses) == 6 @@ -6324,7 +6336,9 @@ async def test_list_routes_async_pages(): RuntimeError, ) pages = [] - async for page_ in (await client.list_routes(request={})).pages: + async for page_ in ( + await client.list_routes(request={}) + ).pages: # pragma: no branch pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -6647,6 +6661,19 @@ def test_transport_adc(transport_class): adc.assert_called_once() +@pytest.mark.parametrize( + "transport_name", + [ + "grpc", + ], +) +def test_transport_kind(transport_name): + transport = DatastreamClient.get_transport_class(transport_name)( + credentials=ga_credentials.AnonymousCredentials(), + ) + assert transport.kind == transport_name + + def test_transport_grpc_default(): # A client should use the gRPC transport by default. client = DatastreamClient( @@ -6714,6 +6741,14 @@ def test_datastream_base_transport(): with pytest.raises(NotImplementedError): transport.operations_client + # Catch all for all remaining methods and properties + remainder = [ + "kind", + ] + for r in remainder: + with pytest.raises(NotImplementedError): + getattr(transport, r)() + def test_datastream_base_transport_with_credentials_file(): # Instantiate the base transport with a credentials file @@ -6856,24 +6891,40 @@ def test_datastream_grpc_transport_client_cert_source_for_mtls(transport_class): ) -def test_datastream_host_no_port(): +@pytest.mark.parametrize( + "transport_name", + [ + "grpc", + "grpc_asyncio", + ], +) +def test_datastream_host_no_port(transport_name): client = DatastreamClient( credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions( api_endpoint="datastream.googleapis.com" ), + transport=transport_name, ) - assert client.transport._host == "datastream.googleapis.com:443" + assert client.transport._host == ("datastream.googleapis.com:443") -def test_datastream_host_with_port(): +@pytest.mark.parametrize( + "transport_name", + [ + "grpc", + "grpc_asyncio", + ], +) +def test_datastream_host_with_port(transport_name): client = DatastreamClient( credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions( api_endpoint="datastream.googleapis.com:8000" ), + transport=transport_name, ) - assert client.transport._host == "datastream.googleapis.com:8000" + assert client.transport._host == ("datastream.googleapis.com:8000") def test_datastream_grpc_transport_channel(): From afb46ef8df12cd9d812a11c04fb827809d9e6e8d Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 13 Apr 2022 20:50:06 -0400 Subject: [PATCH 09/15] chore: use gapic-generator-python 0.65.1 (#91) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: use gapic-generator-python 0.65.1 PiperOrigin-RevId: 441524537 Source-Link: https://github.com/googleapis/googleapis/commit/2a273915b3f70fe86c9d2a75470a0b83e48d0abf Source-Link: https://github.com/googleapis/googleapis-gen/commit/ab6756a48c89b5bcb9fb73443cb8e55d574f4643 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYWI2NzU2YTQ4Yzg5YjViY2I5ZmI3MzQ0M2NiOGU1NWQ1NzRmNDY0MyJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- .../snippet_metadata_datastream_v1.json | 2074 ++++++++++++++++- .../snippet_metadata_datastream_v1alpha1.json | 1754 +++++++++++++- 2 files changed, 3644 insertions(+), 184 deletions(-) diff --git a/samples/generated_samples/snippet_metadata_datastream_v1.json b/samples/generated_samples/snippet_metadata_datastream_v1.json index 41ce403..4d5a54b 100644 --- a/samples/generated_samples/snippet_metadata_datastream_v1.json +++ b/samples/generated_samples/snippet_metadata_datastream_v1.json @@ -1,16 +1,69 @@ { + "clientLibrary": { + "apis": [ + { + "id": "google.cloud.datastream.v1", + "version": "v1" + } + ], + "language": "PYTHON", + "name": "google-cloud-datastream" + }, "snippets": [ { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.datastream_v1.DatastreamAsyncClient", + "shortName": "DatastreamAsyncClient" + }, + "fullName": "google.cloud.datastream_v1.DatastreamAsyncClient.create_connection_profile", "method": { + "fullName": "google.cloud.datastream.v1.Datastream.CreateConnectionProfile", "service": { + "fullName": "google.cloud.datastream.v1.Datastream", "shortName": "Datastream" }, "shortName": "CreateConnectionProfile" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.datastream_v1.types.CreateConnectionProfileRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "connection_profile", + "type": "google.cloud.datastream_v1.types.ConnectionProfile" + }, + { + "name": "connection_profile_id", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.api_core.operation_async.AsyncOperation", + "shortName": "create_connection_profile" }, + "description": "Sample for CreateConnectionProfile", "file": "datastream_v1_generated_datastream_create_connection_profile_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "datastream_v1_generated_Datastream_CreateConnectionProfile_async", "segments": [ { @@ -43,18 +96,62 @@ "start": 55, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "datastream_v1_generated_datastream_create_connection_profile_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.datastream_v1.DatastreamClient", + "shortName": "DatastreamClient" + }, + "fullName": "google.cloud.datastream_v1.DatastreamClient.create_connection_profile", "method": { + "fullName": "google.cloud.datastream.v1.Datastream.CreateConnectionProfile", "service": { + "fullName": "google.cloud.datastream.v1.Datastream", "shortName": "Datastream" }, "shortName": "CreateConnectionProfile" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.datastream_v1.types.CreateConnectionProfileRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "connection_profile", + "type": "google.cloud.datastream_v1.types.ConnectionProfile" + }, + { + "name": "connection_profile_id", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.api_core.operation.Operation", + "shortName": "create_connection_profile" }, + "description": "Sample for CreateConnectionProfile", "file": "datastream_v1_generated_datastream_create_connection_profile_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "datastream_v1_generated_Datastream_CreateConnectionProfile_sync", "segments": [ { @@ -87,19 +184,63 @@ "start": 55, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "datastream_v1_generated_datastream_create_connection_profile_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.datastream_v1.DatastreamAsyncClient", + "shortName": "DatastreamAsyncClient" + }, + "fullName": "google.cloud.datastream_v1.DatastreamAsyncClient.create_private_connection", "method": { + "fullName": "google.cloud.datastream.v1.Datastream.CreatePrivateConnection", "service": { + "fullName": "google.cloud.datastream.v1.Datastream", "shortName": "Datastream" }, "shortName": "CreatePrivateConnection" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.datastream_v1.types.CreatePrivateConnectionRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "private_connection", + "type": "google.cloud.datastream_v1.types.PrivateConnection" + }, + { + "name": "private_connection_id", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.api_core.operation_async.AsyncOperation", + "shortName": "create_private_connection" }, + "description": "Sample for CreatePrivateConnection", "file": "datastream_v1_generated_datastream_create_private_connection_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "datastream_v1_generated_Datastream_CreatePrivateConnection_async", "segments": [ { @@ -132,18 +273,62 @@ "start": 51, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "datastream_v1_generated_datastream_create_private_connection_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.datastream_v1.DatastreamClient", + "shortName": "DatastreamClient" + }, + "fullName": "google.cloud.datastream_v1.DatastreamClient.create_private_connection", "method": { + "fullName": "google.cloud.datastream.v1.Datastream.CreatePrivateConnection", "service": { + "fullName": "google.cloud.datastream.v1.Datastream", "shortName": "Datastream" }, "shortName": "CreatePrivateConnection" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.datastream_v1.types.CreatePrivateConnectionRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "private_connection", + "type": "google.cloud.datastream_v1.types.PrivateConnection" + }, + { + "name": "private_connection_id", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.api_core.operation.Operation", + "shortName": "create_private_connection" }, + "description": "Sample for CreatePrivateConnection", "file": "datastream_v1_generated_datastream_create_private_connection_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "datastream_v1_generated_Datastream_CreatePrivateConnection_sync", "segments": [ { @@ -176,19 +361,63 @@ "start": 51, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "datastream_v1_generated_datastream_create_private_connection_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.datastream_v1.DatastreamAsyncClient", + "shortName": "DatastreamAsyncClient" + }, + "fullName": "google.cloud.datastream_v1.DatastreamAsyncClient.create_route", "method": { + "fullName": "google.cloud.datastream.v1.Datastream.CreateRoute", "service": { + "fullName": "google.cloud.datastream.v1.Datastream", "shortName": "Datastream" }, "shortName": "CreateRoute" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.datastream_v1.types.CreateRouteRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "route", + "type": "google.cloud.datastream_v1.types.Route" + }, + { + "name": "route_id", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.api_core.operation_async.AsyncOperation", + "shortName": "create_route" }, + "description": "Sample for CreateRoute", "file": "datastream_v1_generated_datastream_create_route_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "datastream_v1_generated_Datastream_CreateRoute_async", "segments": [ { @@ -221,18 +450,62 @@ "start": 52, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "datastream_v1_generated_datastream_create_route_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.datastream_v1.DatastreamClient", + "shortName": "DatastreamClient" + }, + "fullName": "google.cloud.datastream_v1.DatastreamClient.create_route", "method": { + "fullName": "google.cloud.datastream.v1.Datastream.CreateRoute", "service": { + "fullName": "google.cloud.datastream.v1.Datastream", "shortName": "Datastream" }, "shortName": "CreateRoute" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.datastream_v1.types.CreateRouteRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "route", + "type": "google.cloud.datastream_v1.types.Route" + }, + { + "name": "route_id", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.api_core.operation.Operation", + "shortName": "create_route" }, + "description": "Sample for CreateRoute", "file": "datastream_v1_generated_datastream_create_route_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "datastream_v1_generated_Datastream_CreateRoute_sync", "segments": [ { @@ -265,19 +538,63 @@ "start": 52, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "datastream_v1_generated_datastream_create_route_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.datastream_v1.DatastreamAsyncClient", + "shortName": "DatastreamAsyncClient" + }, + "fullName": "google.cloud.datastream_v1.DatastreamAsyncClient.create_stream", "method": { + "fullName": "google.cloud.datastream.v1.Datastream.CreateStream", "service": { + "fullName": "google.cloud.datastream.v1.Datastream", "shortName": "Datastream" }, "shortName": "CreateStream" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.datastream_v1.types.CreateStreamRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "stream", + "type": "google.cloud.datastream_v1.types.Stream" + }, + { + "name": "stream_id", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.api_core.operation_async.AsyncOperation", + "shortName": "create_stream" }, + "description": "Sample for CreateStream", "file": "datastream_v1_generated_datastream_create_stream_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "datastream_v1_generated_Datastream_CreateStream_async", "segments": [ { @@ -310,18 +627,62 @@ "start": 53, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "datastream_v1_generated_datastream_create_stream_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.datastream_v1.DatastreamClient", + "shortName": "DatastreamClient" + }, + "fullName": "google.cloud.datastream_v1.DatastreamClient.create_stream", "method": { + "fullName": "google.cloud.datastream.v1.Datastream.CreateStream", "service": { + "fullName": "google.cloud.datastream.v1.Datastream", "shortName": "Datastream" }, "shortName": "CreateStream" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.datastream_v1.types.CreateStreamRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "stream", + "type": "google.cloud.datastream_v1.types.Stream" + }, + { + "name": "stream_id", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.api_core.operation.Operation", + "shortName": "create_stream" }, + "description": "Sample for CreateStream", "file": "datastream_v1_generated_datastream_create_stream_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "datastream_v1_generated_Datastream_CreateStream_sync", "segments": [ { @@ -354,19 +715,55 @@ "start": 53, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "datastream_v1_generated_datastream_create_stream_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.datastream_v1.DatastreamAsyncClient", + "shortName": "DatastreamAsyncClient" + }, + "fullName": "google.cloud.datastream_v1.DatastreamAsyncClient.delete_connection_profile", "method": { + "fullName": "google.cloud.datastream.v1.Datastream.DeleteConnectionProfile", "service": { + "fullName": "google.cloud.datastream.v1.Datastream", "shortName": "Datastream" }, "shortName": "DeleteConnectionProfile" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.datastream_v1.types.DeleteConnectionProfileRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.api_core.operation_async.AsyncOperation", + "shortName": "delete_connection_profile" }, + "description": "Sample for DeleteConnectionProfile", "file": "datastream_v1_generated_datastream_delete_connection_profile_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "datastream_v1_generated_Datastream_DeleteConnectionProfile_async", "segments": [ { @@ -399,18 +796,54 @@ "start": 46, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "datastream_v1_generated_datastream_delete_connection_profile_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.datastream_v1.DatastreamClient", + "shortName": "DatastreamClient" + }, + "fullName": "google.cloud.datastream_v1.DatastreamClient.delete_connection_profile", "method": { + "fullName": "google.cloud.datastream.v1.Datastream.DeleteConnectionProfile", "service": { + "fullName": "google.cloud.datastream.v1.Datastream", "shortName": "Datastream" }, "shortName": "DeleteConnectionProfile" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.datastream_v1.types.DeleteConnectionProfileRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.api_core.operation.Operation", + "shortName": "delete_connection_profile" }, + "description": "Sample for DeleteConnectionProfile", "file": "datastream_v1_generated_datastream_delete_connection_profile_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "datastream_v1_generated_Datastream_DeleteConnectionProfile_sync", "segments": [ { @@ -443,19 +876,55 @@ "start": 46, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "datastream_v1_generated_datastream_delete_connection_profile_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.datastream_v1.DatastreamAsyncClient", + "shortName": "DatastreamAsyncClient" + }, + "fullName": "google.cloud.datastream_v1.DatastreamAsyncClient.delete_private_connection", "method": { + "fullName": "google.cloud.datastream.v1.Datastream.DeletePrivateConnection", "service": { + "fullName": "google.cloud.datastream.v1.Datastream", "shortName": "Datastream" }, "shortName": "DeletePrivateConnection" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.datastream_v1.types.DeletePrivateConnectionRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.api_core.operation_async.AsyncOperation", + "shortName": "delete_private_connection" }, + "description": "Sample for DeletePrivateConnection", "file": "datastream_v1_generated_datastream_delete_private_connection_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "datastream_v1_generated_Datastream_DeletePrivateConnection_async", "segments": [ { @@ -488,18 +957,54 @@ "start": 46, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "datastream_v1_generated_datastream_delete_private_connection_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.datastream_v1.DatastreamClient", + "shortName": "DatastreamClient" + }, + "fullName": "google.cloud.datastream_v1.DatastreamClient.delete_private_connection", "method": { + "fullName": "google.cloud.datastream.v1.Datastream.DeletePrivateConnection", "service": { + "fullName": "google.cloud.datastream.v1.Datastream", "shortName": "Datastream" }, "shortName": "DeletePrivateConnection" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.datastream_v1.types.DeletePrivateConnectionRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.api_core.operation.Operation", + "shortName": "delete_private_connection" }, + "description": "Sample for DeletePrivateConnection", "file": "datastream_v1_generated_datastream_delete_private_connection_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "datastream_v1_generated_Datastream_DeletePrivateConnection_sync", "segments": [ { @@ -532,19 +1037,55 @@ "start": 46, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "datastream_v1_generated_datastream_delete_private_connection_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.datastream_v1.DatastreamAsyncClient", + "shortName": "DatastreamAsyncClient" + }, + "fullName": "google.cloud.datastream_v1.DatastreamAsyncClient.delete_route", "method": { + "fullName": "google.cloud.datastream.v1.Datastream.DeleteRoute", "service": { + "fullName": "google.cloud.datastream.v1.Datastream", "shortName": "Datastream" }, "shortName": "DeleteRoute" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.datastream_v1.types.DeleteRouteRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.api_core.operation_async.AsyncOperation", + "shortName": "delete_route" }, + "description": "Sample for DeleteRoute", "file": "datastream_v1_generated_datastream_delete_route_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "datastream_v1_generated_Datastream_DeleteRoute_async", "segments": [ { @@ -577,18 +1118,54 @@ "start": 46, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "datastream_v1_generated_datastream_delete_route_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.datastream_v1.DatastreamClient", + "shortName": "DatastreamClient" + }, + "fullName": "google.cloud.datastream_v1.DatastreamClient.delete_route", "method": { + "fullName": "google.cloud.datastream.v1.Datastream.DeleteRoute", "service": { + "fullName": "google.cloud.datastream.v1.Datastream", "shortName": "Datastream" }, "shortName": "DeleteRoute" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.datastream_v1.types.DeleteRouteRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.api_core.operation.Operation", + "shortName": "delete_route" }, + "description": "Sample for DeleteRoute", "file": "datastream_v1_generated_datastream_delete_route_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "datastream_v1_generated_Datastream_DeleteRoute_sync", "segments": [ { @@ -621,19 +1198,55 @@ "start": 46, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "datastream_v1_generated_datastream_delete_route_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.datastream_v1.DatastreamAsyncClient", + "shortName": "DatastreamAsyncClient" + }, + "fullName": "google.cloud.datastream_v1.DatastreamAsyncClient.delete_stream", "method": { + "fullName": "google.cloud.datastream.v1.Datastream.DeleteStream", "service": { + "fullName": "google.cloud.datastream.v1.Datastream", "shortName": "Datastream" }, "shortName": "DeleteStream" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.datastream_v1.types.DeleteStreamRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.api_core.operation_async.AsyncOperation", + "shortName": "delete_stream" }, + "description": "Sample for DeleteStream", "file": "datastream_v1_generated_datastream_delete_stream_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "datastream_v1_generated_Datastream_DeleteStream_async", "segments": [ { @@ -666,18 +1279,54 @@ "start": 46, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "datastream_v1_generated_datastream_delete_stream_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.datastream_v1.DatastreamClient", + "shortName": "DatastreamClient" + }, + "fullName": "google.cloud.datastream_v1.DatastreamClient.delete_stream", "method": { + "fullName": "google.cloud.datastream.v1.Datastream.DeleteStream", "service": { + "fullName": "google.cloud.datastream.v1.Datastream", "shortName": "Datastream" }, "shortName": "DeleteStream" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.datastream_v1.types.DeleteStreamRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.api_core.operation.Operation", + "shortName": "delete_stream" }, + "description": "Sample for DeleteStream", "file": "datastream_v1_generated_datastream_delete_stream_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "datastream_v1_generated_Datastream_DeleteStream_sync", "segments": [ { @@ -710,19 +1359,51 @@ "start": 46, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "datastream_v1_generated_datastream_delete_stream_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.datastream_v1.DatastreamAsyncClient", + "shortName": "DatastreamAsyncClient" + }, + "fullName": "google.cloud.datastream_v1.DatastreamAsyncClient.discover_connection_profile", "method": { + "fullName": "google.cloud.datastream.v1.Datastream.DiscoverConnectionProfile", "service": { + "fullName": "google.cloud.datastream.v1.Datastream", "shortName": "Datastream" }, "shortName": "DiscoverConnectionProfile" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.datastream_v1.types.DiscoverConnectionProfileRequest" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.datastream_v1.types.DiscoverConnectionProfileResponse", + "shortName": "discover_connection_profile" }, + "description": "Sample for DiscoverConnectionProfile", "file": "datastream_v1_generated_datastream_discover_connection_profile_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "datastream_v1_generated_Datastream_DiscoverConnectionProfile_async", "segments": [ { @@ -755,18 +1436,50 @@ "start": 51, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "datastream_v1_generated_datastream_discover_connection_profile_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.datastream_v1.DatastreamClient", + "shortName": "DatastreamClient" + }, + "fullName": "google.cloud.datastream_v1.DatastreamClient.discover_connection_profile", "method": { + "fullName": "google.cloud.datastream.v1.Datastream.DiscoverConnectionProfile", "service": { + "fullName": "google.cloud.datastream.v1.Datastream", "shortName": "Datastream" }, "shortName": "DiscoverConnectionProfile" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.datastream_v1.types.DiscoverConnectionProfileRequest" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.datastream_v1.types.DiscoverConnectionProfileResponse", + "shortName": "discover_connection_profile" }, + "description": "Sample for DiscoverConnectionProfile", "file": "datastream_v1_generated_datastream_discover_connection_profile_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "datastream_v1_generated_Datastream_DiscoverConnectionProfile_sync", "segments": [ { @@ -799,19 +1512,55 @@ "start": 51, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "datastream_v1_generated_datastream_discover_connection_profile_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.datastream_v1.DatastreamAsyncClient", + "shortName": "DatastreamAsyncClient" + }, + "fullName": "google.cloud.datastream_v1.DatastreamAsyncClient.fetch_static_ips", "method": { + "fullName": "google.cloud.datastream.v1.Datastream.FetchStaticIps", "service": { + "fullName": "google.cloud.datastream.v1.Datastream", "shortName": "Datastream" }, "shortName": "FetchStaticIps" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.datastream_v1.types.FetchStaticIpsRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.datastream_v1.services.datastream.pagers.FetchStaticIpsAsyncPager", + "shortName": "fetch_static_ips" }, + "description": "Sample for FetchStaticIps", "file": "datastream_v1_generated_datastream_fetch_static_ips_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "datastream_v1_generated_Datastream_FetchStaticIps_async", "segments": [ { @@ -844,18 +1593,54 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "datastream_v1_generated_datastream_fetch_static_ips_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.datastream_v1.DatastreamClient", + "shortName": "DatastreamClient" + }, + "fullName": "google.cloud.datastream_v1.DatastreamClient.fetch_static_ips", "method": { + "fullName": "google.cloud.datastream.v1.Datastream.FetchStaticIps", "service": { + "fullName": "google.cloud.datastream.v1.Datastream", "shortName": "Datastream" }, "shortName": "FetchStaticIps" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.datastream_v1.types.FetchStaticIpsRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.datastream_v1.services.datastream.pagers.FetchStaticIpsPager", + "shortName": "fetch_static_ips" }, + "description": "Sample for FetchStaticIps", "file": "datastream_v1_generated_datastream_fetch_static_ips_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "datastream_v1_generated_Datastream_FetchStaticIps_sync", "segments": [ { @@ -888,19 +1673,55 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "datastream_v1_generated_datastream_fetch_static_ips_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.datastream_v1.DatastreamAsyncClient", + "shortName": "DatastreamAsyncClient" + }, + "fullName": "google.cloud.datastream_v1.DatastreamAsyncClient.get_connection_profile", "method": { + "fullName": "google.cloud.datastream.v1.Datastream.GetConnectionProfile", "service": { + "fullName": "google.cloud.datastream.v1.Datastream", "shortName": "Datastream" }, "shortName": "GetConnectionProfile" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.datastream_v1.types.GetConnectionProfileRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.datastream_v1.types.ConnectionProfile", + "shortName": "get_connection_profile" }, + "description": "Sample for GetConnectionProfile", "file": "datastream_v1_generated_datastream_get_connection_profile_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "datastream_v1_generated_Datastream_GetConnectionProfile_async", "segments": [ { @@ -933,18 +1754,54 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "datastream_v1_generated_datastream_get_connection_profile_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.datastream_v1.DatastreamClient", + "shortName": "DatastreamClient" + }, + "fullName": "google.cloud.datastream_v1.DatastreamClient.get_connection_profile", "method": { + "fullName": "google.cloud.datastream.v1.Datastream.GetConnectionProfile", "service": { + "fullName": "google.cloud.datastream.v1.Datastream", "shortName": "Datastream" }, "shortName": "GetConnectionProfile" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.datastream_v1.types.GetConnectionProfileRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.datastream_v1.types.ConnectionProfile", + "shortName": "get_connection_profile" }, + "description": "Sample for GetConnectionProfile", "file": "datastream_v1_generated_datastream_get_connection_profile_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "datastream_v1_generated_Datastream_GetConnectionProfile_sync", "segments": [ { @@ -977,19 +1834,55 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "datastream_v1_generated_datastream_get_connection_profile_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.datastream_v1.DatastreamAsyncClient", + "shortName": "DatastreamAsyncClient" + }, + "fullName": "google.cloud.datastream_v1.DatastreamAsyncClient.get_private_connection", "method": { + "fullName": "google.cloud.datastream.v1.Datastream.GetPrivateConnection", "service": { + "fullName": "google.cloud.datastream.v1.Datastream", "shortName": "Datastream" }, "shortName": "GetPrivateConnection" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.datastream_v1.types.GetPrivateConnectionRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.datastream_v1.types.PrivateConnection", + "shortName": "get_private_connection" }, + "description": "Sample for GetPrivateConnection", "file": "datastream_v1_generated_datastream_get_private_connection_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "datastream_v1_generated_Datastream_GetPrivateConnection_async", "segments": [ { @@ -1022,18 +1915,54 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "datastream_v1_generated_datastream_get_private_connection_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.datastream_v1.DatastreamClient", + "shortName": "DatastreamClient" + }, + "fullName": "google.cloud.datastream_v1.DatastreamClient.get_private_connection", "method": { + "fullName": "google.cloud.datastream.v1.Datastream.GetPrivateConnection", "service": { + "fullName": "google.cloud.datastream.v1.Datastream", "shortName": "Datastream" }, "shortName": "GetPrivateConnection" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.datastream_v1.types.GetPrivateConnectionRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.datastream_v1.types.PrivateConnection", + "shortName": "get_private_connection" }, + "description": "Sample for GetPrivateConnection", "file": "datastream_v1_generated_datastream_get_private_connection_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "datastream_v1_generated_Datastream_GetPrivateConnection_sync", "segments": [ { @@ -1066,19 +1995,55 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "datastream_v1_generated_datastream_get_private_connection_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.datastream_v1.DatastreamAsyncClient", + "shortName": "DatastreamAsyncClient" + }, + "fullName": "google.cloud.datastream_v1.DatastreamAsyncClient.get_route", "method": { + "fullName": "google.cloud.datastream.v1.Datastream.GetRoute", "service": { + "fullName": "google.cloud.datastream.v1.Datastream", "shortName": "Datastream" }, "shortName": "GetRoute" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.datastream_v1.types.GetRouteRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.datastream_v1.types.Route", + "shortName": "get_route" }, + "description": "Sample for GetRoute", "file": "datastream_v1_generated_datastream_get_route_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "datastream_v1_generated_Datastream_GetRoute_async", "segments": [ { @@ -1111,18 +2076,54 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "datastream_v1_generated_datastream_get_route_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.datastream_v1.DatastreamClient", + "shortName": "DatastreamClient" + }, + "fullName": "google.cloud.datastream_v1.DatastreamClient.get_route", "method": { + "fullName": "google.cloud.datastream.v1.Datastream.GetRoute", "service": { + "fullName": "google.cloud.datastream.v1.Datastream", "shortName": "Datastream" }, "shortName": "GetRoute" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.datastream_v1.types.GetRouteRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.datastream_v1.types.Route", + "shortName": "get_route" }, + "description": "Sample for GetRoute", "file": "datastream_v1_generated_datastream_get_route_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "datastream_v1_generated_Datastream_GetRoute_sync", "segments": [ { @@ -1155,19 +2156,55 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "datastream_v1_generated_datastream_get_route_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.datastream_v1.DatastreamAsyncClient", + "shortName": "DatastreamAsyncClient" + }, + "fullName": "google.cloud.datastream_v1.DatastreamAsyncClient.get_stream_object", "method": { + "fullName": "google.cloud.datastream.v1.Datastream.GetStreamObject", "service": { + "fullName": "google.cloud.datastream.v1.Datastream", "shortName": "Datastream" }, "shortName": "GetStreamObject" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.datastream_v1.types.GetStreamObjectRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.datastream_v1.types.StreamObject", + "shortName": "get_stream_object" }, + "description": "Sample for GetStreamObject", "file": "datastream_v1_generated_datastream_get_stream_object_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "datastream_v1_generated_Datastream_GetStreamObject_async", "segments": [ { @@ -1200,18 +2237,54 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "datastream_v1_generated_datastream_get_stream_object_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.datastream_v1.DatastreamClient", + "shortName": "DatastreamClient" + }, + "fullName": "google.cloud.datastream_v1.DatastreamClient.get_stream_object", "method": { + "fullName": "google.cloud.datastream.v1.Datastream.GetStreamObject", "service": { + "fullName": "google.cloud.datastream.v1.Datastream", "shortName": "Datastream" }, "shortName": "GetStreamObject" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.datastream_v1.types.GetStreamObjectRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.datastream_v1.types.StreamObject", + "shortName": "get_stream_object" }, + "description": "Sample for GetStreamObject", "file": "datastream_v1_generated_datastream_get_stream_object_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "datastream_v1_generated_Datastream_GetStreamObject_sync", "segments": [ { @@ -1244,19 +2317,55 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "datastream_v1_generated_datastream_get_stream_object_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.datastream_v1.DatastreamAsyncClient", + "shortName": "DatastreamAsyncClient" + }, + "fullName": "google.cloud.datastream_v1.DatastreamAsyncClient.get_stream", "method": { + "fullName": "google.cloud.datastream.v1.Datastream.GetStream", "service": { + "fullName": "google.cloud.datastream.v1.Datastream", "shortName": "Datastream" }, "shortName": "GetStream" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.datastream_v1.types.GetStreamRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.datastream_v1.types.Stream", + "shortName": "get_stream" }, + "description": "Sample for GetStream", "file": "datastream_v1_generated_datastream_get_stream_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "datastream_v1_generated_Datastream_GetStream_async", "segments": [ { @@ -1289,18 +2398,54 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "datastream_v1_generated_datastream_get_stream_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.datastream_v1.DatastreamClient", + "shortName": "DatastreamClient" + }, + "fullName": "google.cloud.datastream_v1.DatastreamClient.get_stream", "method": { + "fullName": "google.cloud.datastream.v1.Datastream.GetStream", "service": { + "fullName": "google.cloud.datastream.v1.Datastream", "shortName": "Datastream" }, "shortName": "GetStream" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.datastream_v1.types.GetStreamRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.datastream_v1.types.Stream", + "shortName": "get_stream" }, + "description": "Sample for GetStream", "file": "datastream_v1_generated_datastream_get_stream_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "datastream_v1_generated_Datastream_GetStream_sync", "segments": [ { @@ -1333,19 +2478,55 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "datastream_v1_generated_datastream_get_stream_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.datastream_v1.DatastreamAsyncClient", + "shortName": "DatastreamAsyncClient" + }, + "fullName": "google.cloud.datastream_v1.DatastreamAsyncClient.list_connection_profiles", "method": { + "fullName": "google.cloud.datastream.v1.Datastream.ListConnectionProfiles", "service": { + "fullName": "google.cloud.datastream.v1.Datastream", "shortName": "Datastream" }, "shortName": "ListConnectionProfiles" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.datastream_v1.types.ListConnectionProfilesRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.datastream_v1.services.datastream.pagers.ListConnectionProfilesAsyncPager", + "shortName": "list_connection_profiles" }, + "description": "Sample for ListConnectionProfiles", "file": "datastream_v1_generated_datastream_list_connection_profiles_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "datastream_v1_generated_Datastream_ListConnectionProfiles_async", "segments": [ { @@ -1378,18 +2559,54 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "datastream_v1_generated_datastream_list_connection_profiles_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.datastream_v1.DatastreamClient", + "shortName": "DatastreamClient" + }, + "fullName": "google.cloud.datastream_v1.DatastreamClient.list_connection_profiles", "method": { + "fullName": "google.cloud.datastream.v1.Datastream.ListConnectionProfiles", "service": { + "fullName": "google.cloud.datastream.v1.Datastream", "shortName": "Datastream" }, "shortName": "ListConnectionProfiles" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.datastream_v1.types.ListConnectionProfilesRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.datastream_v1.services.datastream.pagers.ListConnectionProfilesPager", + "shortName": "list_connection_profiles" }, + "description": "Sample for ListConnectionProfiles", "file": "datastream_v1_generated_datastream_list_connection_profiles_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "datastream_v1_generated_Datastream_ListConnectionProfiles_sync", "segments": [ { @@ -1422,19 +2639,55 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "datastream_v1_generated_datastream_list_connection_profiles_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.datastream_v1.DatastreamAsyncClient", + "shortName": "DatastreamAsyncClient" + }, + "fullName": "google.cloud.datastream_v1.DatastreamAsyncClient.list_private_connections", "method": { + "fullName": "google.cloud.datastream.v1.Datastream.ListPrivateConnections", "service": { + "fullName": "google.cloud.datastream.v1.Datastream", "shortName": "Datastream" }, "shortName": "ListPrivateConnections" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.datastream_v1.types.ListPrivateConnectionsRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.datastream_v1.services.datastream.pagers.ListPrivateConnectionsAsyncPager", + "shortName": "list_private_connections" }, + "description": "Sample for ListPrivateConnections", "file": "datastream_v1_generated_datastream_list_private_connections_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "datastream_v1_generated_Datastream_ListPrivateConnections_async", "segments": [ { @@ -1467,18 +2720,54 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "datastream_v1_generated_datastream_list_private_connections_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.datastream_v1.DatastreamClient", + "shortName": "DatastreamClient" + }, + "fullName": "google.cloud.datastream_v1.DatastreamClient.list_private_connections", "method": { + "fullName": "google.cloud.datastream.v1.Datastream.ListPrivateConnections", "service": { + "fullName": "google.cloud.datastream.v1.Datastream", "shortName": "Datastream" }, "shortName": "ListPrivateConnections" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.datastream_v1.types.ListPrivateConnectionsRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.datastream_v1.services.datastream.pagers.ListPrivateConnectionsPager", + "shortName": "list_private_connections" }, + "description": "Sample for ListPrivateConnections", "file": "datastream_v1_generated_datastream_list_private_connections_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "datastream_v1_generated_Datastream_ListPrivateConnections_sync", "segments": [ { @@ -1511,19 +2800,55 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "datastream_v1_generated_datastream_list_private_connections_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.datastream_v1.DatastreamAsyncClient", + "shortName": "DatastreamAsyncClient" + }, + "fullName": "google.cloud.datastream_v1.DatastreamAsyncClient.list_routes", "method": { + "fullName": "google.cloud.datastream.v1.Datastream.ListRoutes", "service": { + "fullName": "google.cloud.datastream.v1.Datastream", "shortName": "Datastream" }, "shortName": "ListRoutes" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.datastream_v1.types.ListRoutesRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.datastream_v1.services.datastream.pagers.ListRoutesAsyncPager", + "shortName": "list_routes" }, + "description": "Sample for ListRoutes", "file": "datastream_v1_generated_datastream_list_routes_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "datastream_v1_generated_Datastream_ListRoutes_async", "segments": [ { @@ -1556,18 +2881,54 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "datastream_v1_generated_datastream_list_routes_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.datastream_v1.DatastreamClient", + "shortName": "DatastreamClient" + }, + "fullName": "google.cloud.datastream_v1.DatastreamClient.list_routes", "method": { + "fullName": "google.cloud.datastream.v1.Datastream.ListRoutes", "service": { + "fullName": "google.cloud.datastream.v1.Datastream", "shortName": "Datastream" }, "shortName": "ListRoutes" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.datastream_v1.types.ListRoutesRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.datastream_v1.services.datastream.pagers.ListRoutesPager", + "shortName": "list_routes" }, + "description": "Sample for ListRoutes", "file": "datastream_v1_generated_datastream_list_routes_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "datastream_v1_generated_Datastream_ListRoutes_sync", "segments": [ { @@ -1600,19 +2961,55 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "datastream_v1_generated_datastream_list_routes_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.datastream_v1.DatastreamAsyncClient", + "shortName": "DatastreamAsyncClient" + }, + "fullName": "google.cloud.datastream_v1.DatastreamAsyncClient.list_stream_objects", "method": { + "fullName": "google.cloud.datastream.v1.Datastream.ListStreamObjects", "service": { + "fullName": "google.cloud.datastream.v1.Datastream", "shortName": "Datastream" }, "shortName": "ListStreamObjects" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.datastream_v1.types.ListStreamObjectsRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.datastream_v1.services.datastream.pagers.ListStreamObjectsAsyncPager", + "shortName": "list_stream_objects" }, + "description": "Sample for ListStreamObjects", "file": "datastream_v1_generated_datastream_list_stream_objects_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "datastream_v1_generated_Datastream_ListStreamObjects_async", "segments": [ { @@ -1645,18 +3042,54 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "datastream_v1_generated_datastream_list_stream_objects_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.datastream_v1.DatastreamClient", + "shortName": "DatastreamClient" + }, + "fullName": "google.cloud.datastream_v1.DatastreamClient.list_stream_objects", "method": { + "fullName": "google.cloud.datastream.v1.Datastream.ListStreamObjects", "service": { + "fullName": "google.cloud.datastream.v1.Datastream", "shortName": "Datastream" }, "shortName": "ListStreamObjects" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.datastream_v1.types.ListStreamObjectsRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.datastream_v1.services.datastream.pagers.ListStreamObjectsPager", + "shortName": "list_stream_objects" }, + "description": "Sample for ListStreamObjects", "file": "datastream_v1_generated_datastream_list_stream_objects_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "datastream_v1_generated_Datastream_ListStreamObjects_sync", "segments": [ { @@ -1689,19 +3122,55 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "datastream_v1_generated_datastream_list_stream_objects_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.datastream_v1.DatastreamAsyncClient", + "shortName": "DatastreamAsyncClient" + }, + "fullName": "google.cloud.datastream_v1.DatastreamAsyncClient.list_streams", "method": { + "fullName": "google.cloud.datastream.v1.Datastream.ListStreams", "service": { + "fullName": "google.cloud.datastream.v1.Datastream", "shortName": "Datastream" }, "shortName": "ListStreams" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.datastream_v1.types.ListStreamsRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.datastream_v1.services.datastream.pagers.ListStreamsAsyncPager", + "shortName": "list_streams" }, + "description": "Sample for ListStreams", "file": "datastream_v1_generated_datastream_list_streams_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "datastream_v1_generated_Datastream_ListStreams_async", "segments": [ { @@ -1734,18 +3203,54 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "datastream_v1_generated_datastream_list_streams_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.datastream_v1.DatastreamClient", + "shortName": "DatastreamClient" + }, + "fullName": "google.cloud.datastream_v1.DatastreamClient.list_streams", "method": { + "fullName": "google.cloud.datastream.v1.Datastream.ListStreams", "service": { + "fullName": "google.cloud.datastream.v1.Datastream", "shortName": "Datastream" }, "shortName": "ListStreams" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.datastream_v1.types.ListStreamsRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.datastream_v1.services.datastream.pagers.ListStreamsPager", + "shortName": "list_streams" }, + "description": "Sample for ListStreams", "file": "datastream_v1_generated_datastream_list_streams_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "datastream_v1_generated_Datastream_ListStreams_sync", "segments": [ { @@ -1778,19 +3283,51 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "datastream_v1_generated_datastream_list_streams_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.datastream_v1.DatastreamAsyncClient", + "shortName": "DatastreamAsyncClient" + }, + "fullName": "google.cloud.datastream_v1.DatastreamAsyncClient.lookup_stream_object", "method": { + "fullName": "google.cloud.datastream.v1.Datastream.LookupStreamObject", "service": { + "fullName": "google.cloud.datastream.v1.Datastream", "shortName": "Datastream" }, "shortName": "LookupStreamObject" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.datastream_v1.types.LookupStreamObjectRequest" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.datastream_v1.types.StreamObject", + "shortName": "lookup_stream_object" }, + "description": "Sample for LookupStreamObject", "file": "datastream_v1_generated_datastream_lookup_stream_object_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "datastream_v1_generated_Datastream_LookupStreamObject_async", "segments": [ { @@ -1823,18 +3360,50 @@ "start": 47, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "datastream_v1_generated_datastream_lookup_stream_object_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.datastream_v1.DatastreamClient", + "shortName": "DatastreamClient" + }, + "fullName": "google.cloud.datastream_v1.DatastreamClient.lookup_stream_object", "method": { + "fullName": "google.cloud.datastream.v1.Datastream.LookupStreamObject", "service": { + "fullName": "google.cloud.datastream.v1.Datastream", "shortName": "Datastream" }, "shortName": "LookupStreamObject" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.datastream_v1.types.LookupStreamObjectRequest" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.datastream_v1.types.StreamObject", + "shortName": "lookup_stream_object" }, + "description": "Sample for LookupStreamObject", "file": "datastream_v1_generated_datastream_lookup_stream_object_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "datastream_v1_generated_Datastream_LookupStreamObject_sync", "segments": [ { @@ -1867,19 +3436,55 @@ "start": 47, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "datastream_v1_generated_datastream_lookup_stream_object_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.datastream_v1.DatastreamAsyncClient", + "shortName": "DatastreamAsyncClient" + }, + "fullName": "google.cloud.datastream_v1.DatastreamAsyncClient.start_backfill_job", "method": { + "fullName": "google.cloud.datastream.v1.Datastream.StartBackfillJob", "service": { + "fullName": "google.cloud.datastream.v1.Datastream", "shortName": "Datastream" }, "shortName": "StartBackfillJob" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.datastream_v1.types.StartBackfillJobRequest" + }, + { + "name": "object_", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.datastream_v1.types.StartBackfillJobResponse", + "shortName": "start_backfill_job" }, + "description": "Sample for StartBackfillJob", "file": "datastream_v1_generated_datastream_start_backfill_job_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "datastream_v1_generated_Datastream_StartBackfillJob_async", "segments": [ { @@ -1912,18 +3517,54 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "datastream_v1_generated_datastream_start_backfill_job_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.datastream_v1.DatastreamClient", + "shortName": "DatastreamClient" + }, + "fullName": "google.cloud.datastream_v1.DatastreamClient.start_backfill_job", "method": { + "fullName": "google.cloud.datastream.v1.Datastream.StartBackfillJob", "service": { + "fullName": "google.cloud.datastream.v1.Datastream", "shortName": "Datastream" }, "shortName": "StartBackfillJob" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.datastream_v1.types.StartBackfillJobRequest" + }, + { + "name": "object_", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.datastream_v1.types.StartBackfillJobResponse", + "shortName": "start_backfill_job" }, + "description": "Sample for StartBackfillJob", "file": "datastream_v1_generated_datastream_start_backfill_job_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "datastream_v1_generated_Datastream_StartBackfillJob_sync", "segments": [ { @@ -1956,19 +3597,55 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "datastream_v1_generated_datastream_start_backfill_job_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.datastream_v1.DatastreamAsyncClient", + "shortName": "DatastreamAsyncClient" + }, + "fullName": "google.cloud.datastream_v1.DatastreamAsyncClient.stop_backfill_job", "method": { + "fullName": "google.cloud.datastream.v1.Datastream.StopBackfillJob", "service": { + "fullName": "google.cloud.datastream.v1.Datastream", "shortName": "Datastream" }, "shortName": "StopBackfillJob" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.datastream_v1.types.StopBackfillJobRequest" + }, + { + "name": "object_", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.datastream_v1.types.StopBackfillJobResponse", + "shortName": "stop_backfill_job" }, + "description": "Sample for StopBackfillJob", "file": "datastream_v1_generated_datastream_stop_backfill_job_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "datastream_v1_generated_Datastream_StopBackfillJob_async", "segments": [ { @@ -2001,18 +3678,54 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "datastream_v1_generated_datastream_stop_backfill_job_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.datastream_v1.DatastreamClient", + "shortName": "DatastreamClient" + }, + "fullName": "google.cloud.datastream_v1.DatastreamClient.stop_backfill_job", "method": { + "fullName": "google.cloud.datastream.v1.Datastream.StopBackfillJob", "service": { + "fullName": "google.cloud.datastream.v1.Datastream", "shortName": "Datastream" }, "shortName": "StopBackfillJob" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.datastream_v1.types.StopBackfillJobRequest" + }, + { + "name": "object_", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.datastream_v1.types.StopBackfillJobResponse", + "shortName": "stop_backfill_job" }, + "description": "Sample for StopBackfillJob", "file": "datastream_v1_generated_datastream_stop_backfill_job_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "datastream_v1_generated_Datastream_StopBackfillJob_sync", "segments": [ { @@ -2045,19 +3758,59 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "datastream_v1_generated_datastream_stop_backfill_job_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.datastream_v1.DatastreamAsyncClient", + "shortName": "DatastreamAsyncClient" + }, + "fullName": "google.cloud.datastream_v1.DatastreamAsyncClient.update_connection_profile", "method": { + "fullName": "google.cloud.datastream.v1.Datastream.UpdateConnectionProfile", "service": { + "fullName": "google.cloud.datastream.v1.Datastream", "shortName": "Datastream" }, "shortName": "UpdateConnectionProfile" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.datastream_v1.types.UpdateConnectionProfileRequest" + }, + { + "name": "connection_profile", + "type": "google.cloud.datastream_v1.types.ConnectionProfile" + }, + { + "name": "update_mask", + "type": "google.protobuf.field_mask_pb2.FieldMask" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.api_core.operation_async.AsyncOperation", + "shortName": "update_connection_profile" }, + "description": "Sample for UpdateConnectionProfile", "file": "datastream_v1_generated_datastream_update_connection_profile_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "datastream_v1_generated_Datastream_UpdateConnectionProfile_async", "segments": [ { @@ -2090,18 +3843,58 @@ "start": 53, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "datastream_v1_generated_datastream_update_connection_profile_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.datastream_v1.DatastreamClient", + "shortName": "DatastreamClient" + }, + "fullName": "google.cloud.datastream_v1.DatastreamClient.update_connection_profile", "method": { + "fullName": "google.cloud.datastream.v1.Datastream.UpdateConnectionProfile", "service": { + "fullName": "google.cloud.datastream.v1.Datastream", "shortName": "Datastream" }, "shortName": "UpdateConnectionProfile" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.datastream_v1.types.UpdateConnectionProfileRequest" + }, + { + "name": "connection_profile", + "type": "google.cloud.datastream_v1.types.ConnectionProfile" + }, + { + "name": "update_mask", + "type": "google.protobuf.field_mask_pb2.FieldMask" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.api_core.operation.Operation", + "shortName": "update_connection_profile" }, + "description": "Sample for UpdateConnectionProfile", "file": "datastream_v1_generated_datastream_update_connection_profile_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "datastream_v1_generated_Datastream_UpdateConnectionProfile_sync", "segments": [ { @@ -2134,19 +3927,59 @@ "start": 53, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "datastream_v1_generated_datastream_update_connection_profile_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.datastream_v1.DatastreamAsyncClient", + "shortName": "DatastreamAsyncClient" + }, + "fullName": "google.cloud.datastream_v1.DatastreamAsyncClient.update_stream", "method": { + "fullName": "google.cloud.datastream.v1.Datastream.UpdateStream", "service": { + "fullName": "google.cloud.datastream.v1.Datastream", "shortName": "Datastream" }, "shortName": "UpdateStream" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.datastream_v1.types.UpdateStreamRequest" + }, + { + "name": "stream", + "type": "google.cloud.datastream_v1.types.Stream" + }, + { + "name": "update_mask", + "type": "google.protobuf.field_mask_pb2.FieldMask" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.api_core.operation_async.AsyncOperation", + "shortName": "update_stream" }, + "description": "Sample for UpdateStream", "file": "datastream_v1_generated_datastream_update_stream_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "datastream_v1_generated_Datastream_UpdateStream_async", "segments": [ { @@ -2179,18 +4012,58 @@ "start": 51, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "datastream_v1_generated_datastream_update_stream_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.datastream_v1.DatastreamClient", + "shortName": "DatastreamClient" + }, + "fullName": "google.cloud.datastream_v1.DatastreamClient.update_stream", "method": { + "fullName": "google.cloud.datastream.v1.Datastream.UpdateStream", "service": { + "fullName": "google.cloud.datastream.v1.Datastream", "shortName": "Datastream" }, "shortName": "UpdateStream" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.datastream_v1.types.UpdateStreamRequest" + }, + { + "name": "stream", + "type": "google.cloud.datastream_v1.types.Stream" + }, + { + "name": "update_mask", + "type": "google.protobuf.field_mask_pb2.FieldMask" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.api_core.operation.Operation", + "shortName": "update_stream" }, + "description": "Sample for UpdateStream", "file": "datastream_v1_generated_datastream_update_stream_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "datastream_v1_generated_Datastream_UpdateStream_sync", "segments": [ { @@ -2223,7 +4096,8 @@ "start": 51, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "datastream_v1_generated_datastream_update_stream_sync.py" } ] } diff --git a/samples/generated_samples/snippet_metadata_datastream_v1alpha1.json b/samples/generated_samples/snippet_metadata_datastream_v1alpha1.json index c68d11b..83dc755 100644 --- a/samples/generated_samples/snippet_metadata_datastream_v1alpha1.json +++ b/samples/generated_samples/snippet_metadata_datastream_v1alpha1.json @@ -1,16 +1,69 @@ { + "clientLibrary": { + "apis": [ + { + "id": "google.cloud.datastream.v1alpha1", + "version": "v1alpha1" + } + ], + "language": "PYTHON", + "name": "google-cloud-datastream" + }, "snippets": [ { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.datastream_v1alpha1.DatastreamAsyncClient", + "shortName": "DatastreamAsyncClient" + }, + "fullName": "google.cloud.datastream_v1alpha1.DatastreamAsyncClient.create_connection_profile", "method": { + "fullName": "google.cloud.datastream.v1alpha1.Datastream.CreateConnectionProfile", "service": { + "fullName": "google.cloud.datastream.v1alpha1.Datastream", "shortName": "Datastream" }, "shortName": "CreateConnectionProfile" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.datastream_v1alpha1.types.CreateConnectionProfileRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "connection_profile", + "type": "google.cloud.datastream_v1alpha1.types.ConnectionProfile" + }, + { + "name": "connection_profile_id", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.api_core.operation_async.AsyncOperation", + "shortName": "create_connection_profile" }, + "description": "Sample for CreateConnectionProfile", "file": "datastream_v1alpha1_generated_datastream_create_connection_profile_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "datastream_v1alpha1_generated_Datastream_CreateConnectionProfile_async", "segments": [ { @@ -43,18 +96,62 @@ "start": 55, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "datastream_v1alpha1_generated_datastream_create_connection_profile_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.datastream_v1alpha1.DatastreamClient", + "shortName": "DatastreamClient" + }, + "fullName": "google.cloud.datastream_v1alpha1.DatastreamClient.create_connection_profile", "method": { + "fullName": "google.cloud.datastream.v1alpha1.Datastream.CreateConnectionProfile", "service": { + "fullName": "google.cloud.datastream.v1alpha1.Datastream", "shortName": "Datastream" }, "shortName": "CreateConnectionProfile" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.datastream_v1alpha1.types.CreateConnectionProfileRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "connection_profile", + "type": "google.cloud.datastream_v1alpha1.types.ConnectionProfile" + }, + { + "name": "connection_profile_id", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.api_core.operation.Operation", + "shortName": "create_connection_profile" }, + "description": "Sample for CreateConnectionProfile", "file": "datastream_v1alpha1_generated_datastream_create_connection_profile_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "datastream_v1alpha1_generated_Datastream_CreateConnectionProfile_sync", "segments": [ { @@ -87,19 +184,63 @@ "start": 55, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "datastream_v1alpha1_generated_datastream_create_connection_profile_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.datastream_v1alpha1.DatastreamAsyncClient", + "shortName": "DatastreamAsyncClient" + }, + "fullName": "google.cloud.datastream_v1alpha1.DatastreamAsyncClient.create_private_connection", "method": { + "fullName": "google.cloud.datastream.v1alpha1.Datastream.CreatePrivateConnection", "service": { + "fullName": "google.cloud.datastream.v1alpha1.Datastream", "shortName": "Datastream" }, "shortName": "CreatePrivateConnection" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.datastream_v1alpha1.types.CreatePrivateConnectionRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "private_connection", + "type": "google.cloud.datastream_v1alpha1.types.PrivateConnection" + }, + { + "name": "private_connection_id", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.api_core.operation_async.AsyncOperation", + "shortName": "create_private_connection" }, + "description": "Sample for CreatePrivateConnection", "file": "datastream_v1alpha1_generated_datastream_create_private_connection_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "datastream_v1alpha1_generated_Datastream_CreatePrivateConnection_async", "segments": [ { @@ -132,18 +273,62 @@ "start": 51, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "datastream_v1alpha1_generated_datastream_create_private_connection_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.datastream_v1alpha1.DatastreamClient", + "shortName": "DatastreamClient" + }, + "fullName": "google.cloud.datastream_v1alpha1.DatastreamClient.create_private_connection", "method": { + "fullName": "google.cloud.datastream.v1alpha1.Datastream.CreatePrivateConnection", "service": { + "fullName": "google.cloud.datastream.v1alpha1.Datastream", "shortName": "Datastream" }, "shortName": "CreatePrivateConnection" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.datastream_v1alpha1.types.CreatePrivateConnectionRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "private_connection", + "type": "google.cloud.datastream_v1alpha1.types.PrivateConnection" + }, + { + "name": "private_connection_id", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.api_core.operation.Operation", + "shortName": "create_private_connection" }, + "description": "Sample for CreatePrivateConnection", "file": "datastream_v1alpha1_generated_datastream_create_private_connection_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "datastream_v1alpha1_generated_Datastream_CreatePrivateConnection_sync", "segments": [ { @@ -176,19 +361,63 @@ "start": 51, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "datastream_v1alpha1_generated_datastream_create_private_connection_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.datastream_v1alpha1.DatastreamAsyncClient", + "shortName": "DatastreamAsyncClient" + }, + "fullName": "google.cloud.datastream_v1alpha1.DatastreamAsyncClient.create_route", "method": { + "fullName": "google.cloud.datastream.v1alpha1.Datastream.CreateRoute", "service": { + "fullName": "google.cloud.datastream.v1alpha1.Datastream", "shortName": "Datastream" }, "shortName": "CreateRoute" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.datastream_v1alpha1.types.CreateRouteRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "route", + "type": "google.cloud.datastream_v1alpha1.types.Route" + }, + { + "name": "route_id", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.api_core.operation_async.AsyncOperation", + "shortName": "create_route" }, + "description": "Sample for CreateRoute", "file": "datastream_v1alpha1_generated_datastream_create_route_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "datastream_v1alpha1_generated_Datastream_CreateRoute_async", "segments": [ { @@ -221,18 +450,62 @@ "start": 52, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "datastream_v1alpha1_generated_datastream_create_route_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.datastream_v1alpha1.DatastreamClient", + "shortName": "DatastreamClient" + }, + "fullName": "google.cloud.datastream_v1alpha1.DatastreamClient.create_route", "method": { + "fullName": "google.cloud.datastream.v1alpha1.Datastream.CreateRoute", "service": { + "fullName": "google.cloud.datastream.v1alpha1.Datastream", "shortName": "Datastream" }, "shortName": "CreateRoute" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.datastream_v1alpha1.types.CreateRouteRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "route", + "type": "google.cloud.datastream_v1alpha1.types.Route" + }, + { + "name": "route_id", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.api_core.operation.Operation", + "shortName": "create_route" }, + "description": "Sample for CreateRoute", "file": "datastream_v1alpha1_generated_datastream_create_route_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "datastream_v1alpha1_generated_Datastream_CreateRoute_sync", "segments": [ { @@ -265,19 +538,63 @@ "start": 52, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "datastream_v1alpha1_generated_datastream_create_route_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.datastream_v1alpha1.DatastreamAsyncClient", + "shortName": "DatastreamAsyncClient" + }, + "fullName": "google.cloud.datastream_v1alpha1.DatastreamAsyncClient.create_stream", "method": { + "fullName": "google.cloud.datastream.v1alpha1.Datastream.CreateStream", "service": { + "fullName": "google.cloud.datastream.v1alpha1.Datastream", "shortName": "Datastream" }, "shortName": "CreateStream" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.datastream_v1alpha1.types.CreateStreamRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "stream", + "type": "google.cloud.datastream_v1alpha1.types.Stream" + }, + { + "name": "stream_id", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.api_core.operation_async.AsyncOperation", + "shortName": "create_stream" }, + "description": "Sample for CreateStream", "file": "datastream_v1alpha1_generated_datastream_create_stream_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "datastream_v1alpha1_generated_Datastream_CreateStream_async", "segments": [ { @@ -310,18 +627,62 @@ "start": 53, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "datastream_v1alpha1_generated_datastream_create_stream_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.datastream_v1alpha1.DatastreamClient", + "shortName": "DatastreamClient" + }, + "fullName": "google.cloud.datastream_v1alpha1.DatastreamClient.create_stream", "method": { + "fullName": "google.cloud.datastream.v1alpha1.Datastream.CreateStream", "service": { + "fullName": "google.cloud.datastream.v1alpha1.Datastream", "shortName": "Datastream" }, "shortName": "CreateStream" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.datastream_v1alpha1.types.CreateStreamRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "stream", + "type": "google.cloud.datastream_v1alpha1.types.Stream" + }, + { + "name": "stream_id", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.api_core.operation.Operation", + "shortName": "create_stream" }, + "description": "Sample for CreateStream", "file": "datastream_v1alpha1_generated_datastream_create_stream_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "datastream_v1alpha1_generated_Datastream_CreateStream_sync", "segments": [ { @@ -354,19 +715,55 @@ "start": 53, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "datastream_v1alpha1_generated_datastream_create_stream_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.datastream_v1alpha1.DatastreamAsyncClient", + "shortName": "DatastreamAsyncClient" + }, + "fullName": "google.cloud.datastream_v1alpha1.DatastreamAsyncClient.delete_connection_profile", "method": { + "fullName": "google.cloud.datastream.v1alpha1.Datastream.DeleteConnectionProfile", "service": { + "fullName": "google.cloud.datastream.v1alpha1.Datastream", "shortName": "Datastream" }, "shortName": "DeleteConnectionProfile" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.datastream_v1alpha1.types.DeleteConnectionProfileRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.api_core.operation_async.AsyncOperation", + "shortName": "delete_connection_profile" }, + "description": "Sample for DeleteConnectionProfile", "file": "datastream_v1alpha1_generated_datastream_delete_connection_profile_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "datastream_v1alpha1_generated_Datastream_DeleteConnectionProfile_async", "segments": [ { @@ -399,18 +796,54 @@ "start": 46, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "datastream_v1alpha1_generated_datastream_delete_connection_profile_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.datastream_v1alpha1.DatastreamClient", + "shortName": "DatastreamClient" + }, + "fullName": "google.cloud.datastream_v1alpha1.DatastreamClient.delete_connection_profile", "method": { + "fullName": "google.cloud.datastream.v1alpha1.Datastream.DeleteConnectionProfile", "service": { + "fullName": "google.cloud.datastream.v1alpha1.Datastream", "shortName": "Datastream" }, "shortName": "DeleteConnectionProfile" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.datastream_v1alpha1.types.DeleteConnectionProfileRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.api_core.operation.Operation", + "shortName": "delete_connection_profile" }, + "description": "Sample for DeleteConnectionProfile", "file": "datastream_v1alpha1_generated_datastream_delete_connection_profile_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "datastream_v1alpha1_generated_Datastream_DeleteConnectionProfile_sync", "segments": [ { @@ -443,19 +876,55 @@ "start": 46, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "datastream_v1alpha1_generated_datastream_delete_connection_profile_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.datastream_v1alpha1.DatastreamAsyncClient", + "shortName": "DatastreamAsyncClient" + }, + "fullName": "google.cloud.datastream_v1alpha1.DatastreamAsyncClient.delete_private_connection", "method": { + "fullName": "google.cloud.datastream.v1alpha1.Datastream.DeletePrivateConnection", "service": { + "fullName": "google.cloud.datastream.v1alpha1.Datastream", "shortName": "Datastream" }, "shortName": "DeletePrivateConnection" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.datastream_v1alpha1.types.DeletePrivateConnectionRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.api_core.operation_async.AsyncOperation", + "shortName": "delete_private_connection" }, + "description": "Sample for DeletePrivateConnection", "file": "datastream_v1alpha1_generated_datastream_delete_private_connection_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "datastream_v1alpha1_generated_Datastream_DeletePrivateConnection_async", "segments": [ { @@ -488,18 +957,54 @@ "start": 46, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "datastream_v1alpha1_generated_datastream_delete_private_connection_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.datastream_v1alpha1.DatastreamClient", + "shortName": "DatastreamClient" + }, + "fullName": "google.cloud.datastream_v1alpha1.DatastreamClient.delete_private_connection", "method": { + "fullName": "google.cloud.datastream.v1alpha1.Datastream.DeletePrivateConnection", "service": { + "fullName": "google.cloud.datastream.v1alpha1.Datastream", "shortName": "Datastream" }, "shortName": "DeletePrivateConnection" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.datastream_v1alpha1.types.DeletePrivateConnectionRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.api_core.operation.Operation", + "shortName": "delete_private_connection" }, + "description": "Sample for DeletePrivateConnection", "file": "datastream_v1alpha1_generated_datastream_delete_private_connection_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "datastream_v1alpha1_generated_Datastream_DeletePrivateConnection_sync", "segments": [ { @@ -532,19 +1037,55 @@ "start": 46, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "datastream_v1alpha1_generated_datastream_delete_private_connection_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.datastream_v1alpha1.DatastreamAsyncClient", + "shortName": "DatastreamAsyncClient" + }, + "fullName": "google.cloud.datastream_v1alpha1.DatastreamAsyncClient.delete_route", "method": { + "fullName": "google.cloud.datastream.v1alpha1.Datastream.DeleteRoute", "service": { + "fullName": "google.cloud.datastream.v1alpha1.Datastream", "shortName": "Datastream" }, "shortName": "DeleteRoute" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.datastream_v1alpha1.types.DeleteRouteRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.api_core.operation_async.AsyncOperation", + "shortName": "delete_route" }, + "description": "Sample for DeleteRoute", "file": "datastream_v1alpha1_generated_datastream_delete_route_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "datastream_v1alpha1_generated_Datastream_DeleteRoute_async", "segments": [ { @@ -577,18 +1118,54 @@ "start": 46, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "datastream_v1alpha1_generated_datastream_delete_route_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.datastream_v1alpha1.DatastreamClient", + "shortName": "DatastreamClient" + }, + "fullName": "google.cloud.datastream_v1alpha1.DatastreamClient.delete_route", "method": { + "fullName": "google.cloud.datastream.v1alpha1.Datastream.DeleteRoute", "service": { + "fullName": "google.cloud.datastream.v1alpha1.Datastream", "shortName": "Datastream" }, "shortName": "DeleteRoute" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.datastream_v1alpha1.types.DeleteRouteRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.api_core.operation.Operation", + "shortName": "delete_route" }, + "description": "Sample for DeleteRoute", "file": "datastream_v1alpha1_generated_datastream_delete_route_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "datastream_v1alpha1_generated_Datastream_DeleteRoute_sync", "segments": [ { @@ -621,19 +1198,55 @@ "start": 46, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "datastream_v1alpha1_generated_datastream_delete_route_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.datastream_v1alpha1.DatastreamAsyncClient", + "shortName": "DatastreamAsyncClient" + }, + "fullName": "google.cloud.datastream_v1alpha1.DatastreamAsyncClient.delete_stream", "method": { + "fullName": "google.cloud.datastream.v1alpha1.Datastream.DeleteStream", "service": { + "fullName": "google.cloud.datastream.v1alpha1.Datastream", "shortName": "Datastream" }, "shortName": "DeleteStream" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.datastream_v1alpha1.types.DeleteStreamRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.api_core.operation_async.AsyncOperation", + "shortName": "delete_stream" }, + "description": "Sample for DeleteStream", "file": "datastream_v1alpha1_generated_datastream_delete_stream_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "datastream_v1alpha1_generated_Datastream_DeleteStream_async", "segments": [ { @@ -666,18 +1279,54 @@ "start": 46, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "datastream_v1alpha1_generated_datastream_delete_stream_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.datastream_v1alpha1.DatastreamClient", + "shortName": "DatastreamClient" + }, + "fullName": "google.cloud.datastream_v1alpha1.DatastreamClient.delete_stream", "method": { + "fullName": "google.cloud.datastream.v1alpha1.Datastream.DeleteStream", "service": { + "fullName": "google.cloud.datastream.v1alpha1.Datastream", "shortName": "Datastream" }, "shortName": "DeleteStream" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.datastream_v1alpha1.types.DeleteStreamRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.api_core.operation.Operation", + "shortName": "delete_stream" }, + "description": "Sample for DeleteStream", "file": "datastream_v1alpha1_generated_datastream_delete_stream_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "datastream_v1alpha1_generated_Datastream_DeleteStream_sync", "segments": [ { @@ -710,19 +1359,51 @@ "start": 46, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "datastream_v1alpha1_generated_datastream_delete_stream_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.datastream_v1alpha1.DatastreamAsyncClient", + "shortName": "DatastreamAsyncClient" + }, + "fullName": "google.cloud.datastream_v1alpha1.DatastreamAsyncClient.discover_connection_profile", "method": { + "fullName": "google.cloud.datastream.v1alpha1.Datastream.DiscoverConnectionProfile", "service": { + "fullName": "google.cloud.datastream.v1alpha1.Datastream", "shortName": "Datastream" }, "shortName": "DiscoverConnectionProfile" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.datastream_v1alpha1.types.DiscoverConnectionProfileRequest" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.datastream_v1alpha1.types.DiscoverConnectionProfileResponse", + "shortName": "discover_connection_profile" }, + "description": "Sample for DiscoverConnectionProfile", "file": "datastream_v1alpha1_generated_datastream_discover_connection_profile_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "datastream_v1alpha1_generated_Datastream_DiscoverConnectionProfile_async", "segments": [ { @@ -755,18 +1436,50 @@ "start": 51, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "datastream_v1alpha1_generated_datastream_discover_connection_profile_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.datastream_v1alpha1.DatastreamClient", + "shortName": "DatastreamClient" + }, + "fullName": "google.cloud.datastream_v1alpha1.DatastreamClient.discover_connection_profile", "method": { + "fullName": "google.cloud.datastream.v1alpha1.Datastream.DiscoverConnectionProfile", "service": { + "fullName": "google.cloud.datastream.v1alpha1.Datastream", "shortName": "Datastream" }, "shortName": "DiscoverConnectionProfile" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.datastream_v1alpha1.types.DiscoverConnectionProfileRequest" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.datastream_v1alpha1.types.DiscoverConnectionProfileResponse", + "shortName": "discover_connection_profile" }, + "description": "Sample for DiscoverConnectionProfile", "file": "datastream_v1alpha1_generated_datastream_discover_connection_profile_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "datastream_v1alpha1_generated_Datastream_DiscoverConnectionProfile_sync", "segments": [ { @@ -799,19 +1512,51 @@ "start": 51, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "datastream_v1alpha1_generated_datastream_discover_connection_profile_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.datastream_v1alpha1.DatastreamAsyncClient", + "shortName": "DatastreamAsyncClient" + }, + "fullName": "google.cloud.datastream_v1alpha1.DatastreamAsyncClient.fetch_errors", "method": { + "fullName": "google.cloud.datastream.v1alpha1.Datastream.FetchErrors", "service": { + "fullName": "google.cloud.datastream.v1alpha1.Datastream", "shortName": "Datastream" }, "shortName": "FetchErrors" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.datastream_v1alpha1.types.FetchErrorsRequest" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.api_core.operation_async.AsyncOperation", + "shortName": "fetch_errors" }, + "description": "Sample for FetchErrors", "file": "datastream_v1alpha1_generated_datastream_fetch_errors_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "datastream_v1alpha1_generated_Datastream_FetchErrors_async", "segments": [ { @@ -844,18 +1589,50 @@ "start": 45, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "datastream_v1alpha1_generated_datastream_fetch_errors_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.datastream_v1alpha1.DatastreamClient", + "shortName": "DatastreamClient" + }, + "fullName": "google.cloud.datastream_v1alpha1.DatastreamClient.fetch_errors", "method": { + "fullName": "google.cloud.datastream.v1alpha1.Datastream.FetchErrors", "service": { + "fullName": "google.cloud.datastream.v1alpha1.Datastream", "shortName": "Datastream" }, "shortName": "FetchErrors" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.datastream_v1alpha1.types.FetchErrorsRequest" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.api_core.operation.Operation", + "shortName": "fetch_errors" }, + "description": "Sample for FetchErrors", "file": "datastream_v1alpha1_generated_datastream_fetch_errors_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "datastream_v1alpha1_generated_Datastream_FetchErrors_sync", "segments": [ { @@ -888,19 +1665,55 @@ "start": 45, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "datastream_v1alpha1_generated_datastream_fetch_errors_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.datastream_v1alpha1.DatastreamAsyncClient", + "shortName": "DatastreamAsyncClient" + }, + "fullName": "google.cloud.datastream_v1alpha1.DatastreamAsyncClient.fetch_static_ips", "method": { + "fullName": "google.cloud.datastream.v1alpha1.Datastream.FetchStaticIps", "service": { + "fullName": "google.cloud.datastream.v1alpha1.Datastream", "shortName": "Datastream" }, "shortName": "FetchStaticIps" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.datastream_v1alpha1.types.FetchStaticIpsRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.datastream_v1alpha1.services.datastream.pagers.FetchStaticIpsAsyncPager", + "shortName": "fetch_static_ips" }, + "description": "Sample for FetchStaticIps", "file": "datastream_v1alpha1_generated_datastream_fetch_static_ips_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "datastream_v1alpha1_generated_Datastream_FetchStaticIps_async", "segments": [ { @@ -933,18 +1746,54 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "datastream_v1alpha1_generated_datastream_fetch_static_ips_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.datastream_v1alpha1.DatastreamClient", + "shortName": "DatastreamClient" + }, + "fullName": "google.cloud.datastream_v1alpha1.DatastreamClient.fetch_static_ips", "method": { + "fullName": "google.cloud.datastream.v1alpha1.Datastream.FetchStaticIps", "service": { + "fullName": "google.cloud.datastream.v1alpha1.Datastream", "shortName": "Datastream" }, "shortName": "FetchStaticIps" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.datastream_v1alpha1.types.FetchStaticIpsRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.datastream_v1alpha1.services.datastream.pagers.FetchStaticIpsPager", + "shortName": "fetch_static_ips" }, + "description": "Sample for FetchStaticIps", "file": "datastream_v1alpha1_generated_datastream_fetch_static_ips_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "datastream_v1alpha1_generated_Datastream_FetchStaticIps_sync", "segments": [ { @@ -977,19 +1826,55 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "datastream_v1alpha1_generated_datastream_fetch_static_ips_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.datastream_v1alpha1.DatastreamAsyncClient", + "shortName": "DatastreamAsyncClient" + }, + "fullName": "google.cloud.datastream_v1alpha1.DatastreamAsyncClient.get_connection_profile", "method": { + "fullName": "google.cloud.datastream.v1alpha1.Datastream.GetConnectionProfile", "service": { + "fullName": "google.cloud.datastream.v1alpha1.Datastream", "shortName": "Datastream" }, "shortName": "GetConnectionProfile" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.datastream_v1alpha1.types.GetConnectionProfileRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.datastream_v1alpha1.types.ConnectionProfile", + "shortName": "get_connection_profile" }, + "description": "Sample for GetConnectionProfile", "file": "datastream_v1alpha1_generated_datastream_get_connection_profile_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "datastream_v1alpha1_generated_Datastream_GetConnectionProfile_async", "segments": [ { @@ -1022,18 +1907,54 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "datastream_v1alpha1_generated_datastream_get_connection_profile_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.datastream_v1alpha1.DatastreamClient", + "shortName": "DatastreamClient" + }, + "fullName": "google.cloud.datastream_v1alpha1.DatastreamClient.get_connection_profile", "method": { + "fullName": "google.cloud.datastream.v1alpha1.Datastream.GetConnectionProfile", "service": { + "fullName": "google.cloud.datastream.v1alpha1.Datastream", "shortName": "Datastream" }, "shortName": "GetConnectionProfile" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.datastream_v1alpha1.types.GetConnectionProfileRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.datastream_v1alpha1.types.ConnectionProfile", + "shortName": "get_connection_profile" }, + "description": "Sample for GetConnectionProfile", "file": "datastream_v1alpha1_generated_datastream_get_connection_profile_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "datastream_v1alpha1_generated_Datastream_GetConnectionProfile_sync", "segments": [ { @@ -1066,19 +1987,55 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "datastream_v1alpha1_generated_datastream_get_connection_profile_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.datastream_v1alpha1.DatastreamAsyncClient", + "shortName": "DatastreamAsyncClient" + }, + "fullName": "google.cloud.datastream_v1alpha1.DatastreamAsyncClient.get_private_connection", "method": { + "fullName": "google.cloud.datastream.v1alpha1.Datastream.GetPrivateConnection", "service": { + "fullName": "google.cloud.datastream.v1alpha1.Datastream", "shortName": "Datastream" }, "shortName": "GetPrivateConnection" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.datastream_v1alpha1.types.GetPrivateConnectionRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.datastream_v1alpha1.types.PrivateConnection", + "shortName": "get_private_connection" }, + "description": "Sample for GetPrivateConnection", "file": "datastream_v1alpha1_generated_datastream_get_private_connection_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "datastream_v1alpha1_generated_Datastream_GetPrivateConnection_async", "segments": [ { @@ -1111,18 +2068,54 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "datastream_v1alpha1_generated_datastream_get_private_connection_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.datastream_v1alpha1.DatastreamClient", + "shortName": "DatastreamClient" + }, + "fullName": "google.cloud.datastream_v1alpha1.DatastreamClient.get_private_connection", "method": { + "fullName": "google.cloud.datastream.v1alpha1.Datastream.GetPrivateConnection", "service": { + "fullName": "google.cloud.datastream.v1alpha1.Datastream", "shortName": "Datastream" }, "shortName": "GetPrivateConnection" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.datastream_v1alpha1.types.GetPrivateConnectionRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.datastream_v1alpha1.types.PrivateConnection", + "shortName": "get_private_connection" }, + "description": "Sample for GetPrivateConnection", "file": "datastream_v1alpha1_generated_datastream_get_private_connection_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "datastream_v1alpha1_generated_Datastream_GetPrivateConnection_sync", "segments": [ { @@ -1155,19 +2148,55 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "datastream_v1alpha1_generated_datastream_get_private_connection_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.datastream_v1alpha1.DatastreamAsyncClient", + "shortName": "DatastreamAsyncClient" + }, + "fullName": "google.cloud.datastream_v1alpha1.DatastreamAsyncClient.get_route", "method": { + "fullName": "google.cloud.datastream.v1alpha1.Datastream.GetRoute", "service": { + "fullName": "google.cloud.datastream.v1alpha1.Datastream", "shortName": "Datastream" }, "shortName": "GetRoute" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.datastream_v1alpha1.types.GetRouteRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.datastream_v1alpha1.types.Route", + "shortName": "get_route" }, + "description": "Sample for GetRoute", "file": "datastream_v1alpha1_generated_datastream_get_route_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "datastream_v1alpha1_generated_Datastream_GetRoute_async", "segments": [ { @@ -1200,18 +2229,54 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "datastream_v1alpha1_generated_datastream_get_route_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.datastream_v1alpha1.DatastreamClient", + "shortName": "DatastreamClient" + }, + "fullName": "google.cloud.datastream_v1alpha1.DatastreamClient.get_route", "method": { + "fullName": "google.cloud.datastream.v1alpha1.Datastream.GetRoute", "service": { + "fullName": "google.cloud.datastream.v1alpha1.Datastream", "shortName": "Datastream" }, "shortName": "GetRoute" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.datastream_v1alpha1.types.GetRouteRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.datastream_v1alpha1.types.Route", + "shortName": "get_route" }, + "description": "Sample for GetRoute", "file": "datastream_v1alpha1_generated_datastream_get_route_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "datastream_v1alpha1_generated_Datastream_GetRoute_sync", "segments": [ { @@ -1244,19 +2309,55 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "datastream_v1alpha1_generated_datastream_get_route_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.datastream_v1alpha1.DatastreamAsyncClient", + "shortName": "DatastreamAsyncClient" + }, + "fullName": "google.cloud.datastream_v1alpha1.DatastreamAsyncClient.get_stream", "method": { + "fullName": "google.cloud.datastream.v1alpha1.Datastream.GetStream", "service": { + "fullName": "google.cloud.datastream.v1alpha1.Datastream", "shortName": "Datastream" }, "shortName": "GetStream" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.datastream_v1alpha1.types.GetStreamRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.datastream_v1alpha1.types.Stream", + "shortName": "get_stream" }, + "description": "Sample for GetStream", "file": "datastream_v1alpha1_generated_datastream_get_stream_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "datastream_v1alpha1_generated_Datastream_GetStream_async", "segments": [ { @@ -1289,18 +2390,54 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "datastream_v1alpha1_generated_datastream_get_stream_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.datastream_v1alpha1.DatastreamClient", + "shortName": "DatastreamClient" + }, + "fullName": "google.cloud.datastream_v1alpha1.DatastreamClient.get_stream", "method": { + "fullName": "google.cloud.datastream.v1alpha1.Datastream.GetStream", "service": { + "fullName": "google.cloud.datastream.v1alpha1.Datastream", "shortName": "Datastream" }, "shortName": "GetStream" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.datastream_v1alpha1.types.GetStreamRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.datastream_v1alpha1.types.Stream", + "shortName": "get_stream" }, + "description": "Sample for GetStream", "file": "datastream_v1alpha1_generated_datastream_get_stream_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "datastream_v1alpha1_generated_Datastream_GetStream_sync", "segments": [ { @@ -1333,19 +2470,55 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "datastream_v1alpha1_generated_datastream_get_stream_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.datastream_v1alpha1.DatastreamAsyncClient", + "shortName": "DatastreamAsyncClient" + }, + "fullName": "google.cloud.datastream_v1alpha1.DatastreamAsyncClient.list_connection_profiles", "method": { + "fullName": "google.cloud.datastream.v1alpha1.Datastream.ListConnectionProfiles", "service": { + "fullName": "google.cloud.datastream.v1alpha1.Datastream", "shortName": "Datastream" }, "shortName": "ListConnectionProfiles" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.datastream_v1alpha1.types.ListConnectionProfilesRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.datastream_v1alpha1.services.datastream.pagers.ListConnectionProfilesAsyncPager", + "shortName": "list_connection_profiles" }, + "description": "Sample for ListConnectionProfiles", "file": "datastream_v1alpha1_generated_datastream_list_connection_profiles_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "datastream_v1alpha1_generated_Datastream_ListConnectionProfiles_async", "segments": [ { @@ -1378,18 +2551,54 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "datastream_v1alpha1_generated_datastream_list_connection_profiles_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.datastream_v1alpha1.DatastreamClient", + "shortName": "DatastreamClient" + }, + "fullName": "google.cloud.datastream_v1alpha1.DatastreamClient.list_connection_profiles", "method": { + "fullName": "google.cloud.datastream.v1alpha1.Datastream.ListConnectionProfiles", "service": { + "fullName": "google.cloud.datastream.v1alpha1.Datastream", "shortName": "Datastream" }, "shortName": "ListConnectionProfiles" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.datastream_v1alpha1.types.ListConnectionProfilesRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.datastream_v1alpha1.services.datastream.pagers.ListConnectionProfilesPager", + "shortName": "list_connection_profiles" }, + "description": "Sample for ListConnectionProfiles", "file": "datastream_v1alpha1_generated_datastream_list_connection_profiles_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "datastream_v1alpha1_generated_Datastream_ListConnectionProfiles_sync", "segments": [ { @@ -1422,19 +2631,55 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "datastream_v1alpha1_generated_datastream_list_connection_profiles_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.datastream_v1alpha1.DatastreamAsyncClient", + "shortName": "DatastreamAsyncClient" + }, + "fullName": "google.cloud.datastream_v1alpha1.DatastreamAsyncClient.list_private_connections", "method": { + "fullName": "google.cloud.datastream.v1alpha1.Datastream.ListPrivateConnections", "service": { + "fullName": "google.cloud.datastream.v1alpha1.Datastream", "shortName": "Datastream" }, "shortName": "ListPrivateConnections" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.datastream_v1alpha1.types.ListPrivateConnectionsRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.datastream_v1alpha1.services.datastream.pagers.ListPrivateConnectionsAsyncPager", + "shortName": "list_private_connections" }, + "description": "Sample for ListPrivateConnections", "file": "datastream_v1alpha1_generated_datastream_list_private_connections_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "datastream_v1alpha1_generated_Datastream_ListPrivateConnections_async", "segments": [ { @@ -1467,18 +2712,54 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "datastream_v1alpha1_generated_datastream_list_private_connections_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.datastream_v1alpha1.DatastreamClient", + "shortName": "DatastreamClient" + }, + "fullName": "google.cloud.datastream_v1alpha1.DatastreamClient.list_private_connections", "method": { + "fullName": "google.cloud.datastream.v1alpha1.Datastream.ListPrivateConnections", "service": { + "fullName": "google.cloud.datastream.v1alpha1.Datastream", "shortName": "Datastream" }, "shortName": "ListPrivateConnections" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.datastream_v1alpha1.types.ListPrivateConnectionsRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.datastream_v1alpha1.services.datastream.pagers.ListPrivateConnectionsPager", + "shortName": "list_private_connections" }, + "description": "Sample for ListPrivateConnections", "file": "datastream_v1alpha1_generated_datastream_list_private_connections_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "datastream_v1alpha1_generated_Datastream_ListPrivateConnections_sync", "segments": [ { @@ -1511,19 +2792,55 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "datastream_v1alpha1_generated_datastream_list_private_connections_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.datastream_v1alpha1.DatastreamAsyncClient", + "shortName": "DatastreamAsyncClient" + }, + "fullName": "google.cloud.datastream_v1alpha1.DatastreamAsyncClient.list_routes", "method": { + "fullName": "google.cloud.datastream.v1alpha1.Datastream.ListRoutes", "service": { + "fullName": "google.cloud.datastream.v1alpha1.Datastream", "shortName": "Datastream" }, "shortName": "ListRoutes" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.datastream_v1alpha1.types.ListRoutesRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.datastream_v1alpha1.services.datastream.pagers.ListRoutesAsyncPager", + "shortName": "list_routes" }, + "description": "Sample for ListRoutes", "file": "datastream_v1alpha1_generated_datastream_list_routes_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "datastream_v1alpha1_generated_Datastream_ListRoutes_async", "segments": [ { @@ -1556,18 +2873,54 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "datastream_v1alpha1_generated_datastream_list_routes_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.datastream_v1alpha1.DatastreamClient", + "shortName": "DatastreamClient" + }, + "fullName": "google.cloud.datastream_v1alpha1.DatastreamClient.list_routes", "method": { + "fullName": "google.cloud.datastream.v1alpha1.Datastream.ListRoutes", "service": { + "fullName": "google.cloud.datastream.v1alpha1.Datastream", "shortName": "Datastream" }, "shortName": "ListRoutes" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.datastream_v1alpha1.types.ListRoutesRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.datastream_v1alpha1.services.datastream.pagers.ListRoutesPager", + "shortName": "list_routes" }, + "description": "Sample for ListRoutes", "file": "datastream_v1alpha1_generated_datastream_list_routes_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "datastream_v1alpha1_generated_Datastream_ListRoutes_sync", "segments": [ { @@ -1600,19 +2953,55 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "datastream_v1alpha1_generated_datastream_list_routes_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.datastream_v1alpha1.DatastreamAsyncClient", + "shortName": "DatastreamAsyncClient" + }, + "fullName": "google.cloud.datastream_v1alpha1.DatastreamAsyncClient.list_streams", "method": { + "fullName": "google.cloud.datastream.v1alpha1.Datastream.ListStreams", "service": { + "fullName": "google.cloud.datastream.v1alpha1.Datastream", "shortName": "Datastream" }, "shortName": "ListStreams" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.datastream_v1alpha1.types.ListStreamsRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.datastream_v1alpha1.services.datastream.pagers.ListStreamsAsyncPager", + "shortName": "list_streams" }, + "description": "Sample for ListStreams", "file": "datastream_v1alpha1_generated_datastream_list_streams_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "datastream_v1alpha1_generated_Datastream_ListStreams_async", "segments": [ { @@ -1645,18 +3034,54 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "datastream_v1alpha1_generated_datastream_list_streams_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.datastream_v1alpha1.DatastreamClient", + "shortName": "DatastreamClient" + }, + "fullName": "google.cloud.datastream_v1alpha1.DatastreamClient.list_streams", "method": { + "fullName": "google.cloud.datastream.v1alpha1.Datastream.ListStreams", "service": { + "fullName": "google.cloud.datastream.v1alpha1.Datastream", "shortName": "Datastream" }, "shortName": "ListStreams" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.datastream_v1alpha1.types.ListStreamsRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.datastream_v1alpha1.services.datastream.pagers.ListStreamsPager", + "shortName": "list_streams" }, + "description": "Sample for ListStreams", "file": "datastream_v1alpha1_generated_datastream_list_streams_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "datastream_v1alpha1_generated_Datastream_ListStreams_sync", "segments": [ { @@ -1689,19 +3114,59 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "datastream_v1alpha1_generated_datastream_list_streams_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.datastream_v1alpha1.DatastreamAsyncClient", + "shortName": "DatastreamAsyncClient" + }, + "fullName": "google.cloud.datastream_v1alpha1.DatastreamAsyncClient.update_connection_profile", "method": { + "fullName": "google.cloud.datastream.v1alpha1.Datastream.UpdateConnectionProfile", "service": { + "fullName": "google.cloud.datastream.v1alpha1.Datastream", "shortName": "Datastream" }, "shortName": "UpdateConnectionProfile" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.datastream_v1alpha1.types.UpdateConnectionProfileRequest" + }, + { + "name": "connection_profile", + "type": "google.cloud.datastream_v1alpha1.types.ConnectionProfile" + }, + { + "name": "update_mask", + "type": "google.protobuf.field_mask_pb2.FieldMask" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.api_core.operation_async.AsyncOperation", + "shortName": "update_connection_profile" }, + "description": "Sample for UpdateConnectionProfile", "file": "datastream_v1alpha1_generated_datastream_update_connection_profile_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "datastream_v1alpha1_generated_Datastream_UpdateConnectionProfile_async", "segments": [ { @@ -1734,18 +3199,58 @@ "start": 53, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "datastream_v1alpha1_generated_datastream_update_connection_profile_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.datastream_v1alpha1.DatastreamClient", + "shortName": "DatastreamClient" + }, + "fullName": "google.cloud.datastream_v1alpha1.DatastreamClient.update_connection_profile", "method": { + "fullName": "google.cloud.datastream.v1alpha1.Datastream.UpdateConnectionProfile", "service": { + "fullName": "google.cloud.datastream.v1alpha1.Datastream", "shortName": "Datastream" }, "shortName": "UpdateConnectionProfile" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.datastream_v1alpha1.types.UpdateConnectionProfileRequest" + }, + { + "name": "connection_profile", + "type": "google.cloud.datastream_v1alpha1.types.ConnectionProfile" + }, + { + "name": "update_mask", + "type": "google.protobuf.field_mask_pb2.FieldMask" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.api_core.operation.Operation", + "shortName": "update_connection_profile" }, + "description": "Sample for UpdateConnectionProfile", "file": "datastream_v1alpha1_generated_datastream_update_connection_profile_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "datastream_v1alpha1_generated_Datastream_UpdateConnectionProfile_sync", "segments": [ { @@ -1778,19 +3283,59 @@ "start": 53, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "datastream_v1alpha1_generated_datastream_update_connection_profile_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.datastream_v1alpha1.DatastreamAsyncClient", + "shortName": "DatastreamAsyncClient" + }, + "fullName": "google.cloud.datastream_v1alpha1.DatastreamAsyncClient.update_stream", "method": { + "fullName": "google.cloud.datastream.v1alpha1.Datastream.UpdateStream", "service": { + "fullName": "google.cloud.datastream.v1alpha1.Datastream", "shortName": "Datastream" }, "shortName": "UpdateStream" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.datastream_v1alpha1.types.UpdateStreamRequest" + }, + { + "name": "stream", + "type": "google.cloud.datastream_v1alpha1.types.Stream" + }, + { + "name": "update_mask", + "type": "google.protobuf.field_mask_pb2.FieldMask" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.api_core.operation_async.AsyncOperation", + "shortName": "update_stream" }, + "description": "Sample for UpdateStream", "file": "datastream_v1alpha1_generated_datastream_update_stream_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "datastream_v1alpha1_generated_Datastream_UpdateStream_async", "segments": [ { @@ -1823,18 +3368,58 @@ "start": 51, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "datastream_v1alpha1_generated_datastream_update_stream_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.datastream_v1alpha1.DatastreamClient", + "shortName": "DatastreamClient" + }, + "fullName": "google.cloud.datastream_v1alpha1.DatastreamClient.update_stream", "method": { + "fullName": "google.cloud.datastream.v1alpha1.Datastream.UpdateStream", "service": { + "fullName": "google.cloud.datastream.v1alpha1.Datastream", "shortName": "Datastream" }, "shortName": "UpdateStream" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.datastream_v1alpha1.types.UpdateStreamRequest" + }, + { + "name": "stream", + "type": "google.cloud.datastream_v1alpha1.types.Stream" + }, + { + "name": "update_mask", + "type": "google.protobuf.field_mask_pb2.FieldMask" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.api_core.operation.Operation", + "shortName": "update_stream" }, + "description": "Sample for UpdateStream", "file": "datastream_v1alpha1_generated_datastream_update_stream_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "datastream_v1alpha1_generated_Datastream_UpdateStream_sync", "segments": [ { @@ -1867,7 +3452,8 @@ "start": 51, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "datastream_v1alpha1_generated_datastream_update_stream_sync.py" } ] } From 38cb90f6bd0aafc77405ec5fb45936508c173d5f Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 20 Apr 2022 20:23:37 -0400 Subject: [PATCH 10/15] chore(python): add nox session to sort python imports (#92) Source-Link: https://github.com/googleapis/synthtool/commit/1b71c10e20de7ed3f97f692f99a0e3399b67049f Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:00c9d764fd1cd56265f12a5ef4b99a0c9e87cf261018099141e2ca5158890416 Co-authored-by: Owl Bot --- .github/.OwlBot.lock.yaml | 4 +- docs/conf.py | 2 +- google/cloud/datastream/__init__.py | 137 ++++++++-------- google/cloud/datastream_v1/__init__.py | 146 +++++++++--------- .../services/datastream/__init__.py | 2 +- .../services/datastream/async_client.py | 15 +- .../services/datastream/client.py | 13 +- .../services/datastream/pagers.py | 7 +- .../datastream/transports/__init__.py | 1 - .../services/datastream/transports/base.py | 12 +- .../services/datastream/transports/grpc.py | 15 +- .../datastream/transports/grpc_asyncio.py | 15 +- .../cloud/datastream_v1/types/datastream.py | 5 +- .../types/datastream_resources.py | 4 +- google/cloud/datastream_v1alpha1/__init__.py | 134 ++++++++-------- .../services/datastream/__init__.py | 2 +- .../services/datastream/async_client.py | 15 +- .../services/datastream/client.py | 13 +- .../services/datastream/pagers.py | 7 +- .../datastream/transports/__init__.py | 1 - .../services/datastream/transports/base.py | 12 +- .../services/datastream/transports/grpc.py | 15 +- .../datastream/transports/grpc_asyncio.py | 15 +- .../datastream_v1alpha1/types/__init__.py | 4 +- .../datastream_v1alpha1/types/datastream.py | 5 +- .../types/datastream_resources.py | 4 +- noxfile.py | 28 +++- setup.py | 1 - .../gapic/datastream_v1/test_datastream.py | 46 +++--- .../datastream_v1alpha1/test_datastream.py | 46 +++--- 30 files changed, 365 insertions(+), 361 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index bc893c9..7c454ab 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,5 +13,5 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest - digest: sha256:8a5d3f6a2e43ed8293f34e06a2f56931d1e88a2694c3bb11b15df4eb256ad163 -# created: 2022-04-06T10:30:21.687684602Z + digest: sha256:00c9d764fd1cd56265f12a5ef4b99a0c9e87cf261018099141e2ca5158890416 +# created: 2022-04-20T23:42:53.970438194Z diff --git a/docs/conf.py b/docs/conf.py index 2654f0d..2255f44 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -24,9 +24,9 @@ # All configuration values have a default; values that are commented out # serve to show the default. -import sys import os import shlex +import sys # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the diff --git a/google/cloud/datastream/__init__.py b/google/cloud/datastream/__init__.py index 8c5ff0b..2127eed 100644 --- a/google/cloud/datastream/__init__.py +++ b/google/cloud/datastream/__init__.py @@ -14,86 +14,83 @@ # limitations under the License. # -from google.cloud.datastream_v1.services.datastream.client import DatastreamClient from google.cloud.datastream_v1.services.datastream.async_client import ( DatastreamAsyncClient, ) - -from google.cloud.datastream_v1.types.datastream import CreateConnectionProfileRequest -from google.cloud.datastream_v1.types.datastream import CreatePrivateConnectionRequest -from google.cloud.datastream_v1.types.datastream import CreateRouteRequest -from google.cloud.datastream_v1.types.datastream import CreateStreamRequest -from google.cloud.datastream_v1.types.datastream import DeleteConnectionProfileRequest -from google.cloud.datastream_v1.types.datastream import DeletePrivateConnectionRequest -from google.cloud.datastream_v1.types.datastream import DeleteRouteRequest -from google.cloud.datastream_v1.types.datastream import DeleteStreamRequest -from google.cloud.datastream_v1.types.datastream import DiscoverConnectionProfileRequest +from google.cloud.datastream_v1.services.datastream.client import DatastreamClient from google.cloud.datastream_v1.types.datastream import ( + CreateConnectionProfileRequest, + CreatePrivateConnectionRequest, + CreateRouteRequest, + CreateStreamRequest, + DeleteConnectionProfileRequest, + DeletePrivateConnectionRequest, + DeleteRouteRequest, + DeleteStreamRequest, + DiscoverConnectionProfileRequest, DiscoverConnectionProfileResponse, + FetchStaticIpsRequest, + FetchStaticIpsResponse, + GetConnectionProfileRequest, + GetPrivateConnectionRequest, + GetRouteRequest, + GetStreamObjectRequest, + GetStreamRequest, + ListConnectionProfilesRequest, + ListConnectionProfilesResponse, + ListPrivateConnectionsRequest, + ListPrivateConnectionsResponse, + ListRoutesRequest, + ListRoutesResponse, + ListStreamObjectsRequest, + ListStreamObjectsResponse, + ListStreamsRequest, + ListStreamsResponse, + LookupStreamObjectRequest, + OperationMetadata, + StartBackfillJobRequest, + StartBackfillJobResponse, + StopBackfillJobRequest, + StopBackfillJobResponse, + UpdateConnectionProfileRequest, + UpdateStreamRequest, ) -from google.cloud.datastream_v1.types.datastream import FetchStaticIpsRequest -from google.cloud.datastream_v1.types.datastream import FetchStaticIpsResponse -from google.cloud.datastream_v1.types.datastream import GetConnectionProfileRequest -from google.cloud.datastream_v1.types.datastream import GetPrivateConnectionRequest -from google.cloud.datastream_v1.types.datastream import GetRouteRequest -from google.cloud.datastream_v1.types.datastream import GetStreamObjectRequest -from google.cloud.datastream_v1.types.datastream import GetStreamRequest -from google.cloud.datastream_v1.types.datastream import ListConnectionProfilesRequest -from google.cloud.datastream_v1.types.datastream import ListConnectionProfilesResponse -from google.cloud.datastream_v1.types.datastream import ListPrivateConnectionsRequest -from google.cloud.datastream_v1.types.datastream import ListPrivateConnectionsResponse -from google.cloud.datastream_v1.types.datastream import ListRoutesRequest -from google.cloud.datastream_v1.types.datastream import ListRoutesResponse -from google.cloud.datastream_v1.types.datastream import ListStreamObjectsRequest -from google.cloud.datastream_v1.types.datastream import ListStreamObjectsResponse -from google.cloud.datastream_v1.types.datastream import ListStreamsRequest -from google.cloud.datastream_v1.types.datastream import ListStreamsResponse -from google.cloud.datastream_v1.types.datastream import LookupStreamObjectRequest -from google.cloud.datastream_v1.types.datastream import OperationMetadata -from google.cloud.datastream_v1.types.datastream import StartBackfillJobRequest -from google.cloud.datastream_v1.types.datastream import StartBackfillJobResponse -from google.cloud.datastream_v1.types.datastream import StopBackfillJobRequest -from google.cloud.datastream_v1.types.datastream import StopBackfillJobResponse -from google.cloud.datastream_v1.types.datastream import UpdateConnectionProfileRequest -from google.cloud.datastream_v1.types.datastream import UpdateStreamRequest -from google.cloud.datastream_v1.types.datastream_resources import AvroFileFormat -from google.cloud.datastream_v1.types.datastream_resources import BackfillJob -from google.cloud.datastream_v1.types.datastream_resources import ConnectionProfile -from google.cloud.datastream_v1.types.datastream_resources import DestinationConfig -from google.cloud.datastream_v1.types.datastream_resources import Error from google.cloud.datastream_v1.types.datastream_resources import ( + AvroFileFormat, + BackfillJob, + ConnectionProfile, + DestinationConfig, + Error, ForwardSshTunnelConnectivity, -) -from google.cloud.datastream_v1.types.datastream_resources import GcsDestinationConfig -from google.cloud.datastream_v1.types.datastream_resources import GcsProfile -from google.cloud.datastream_v1.types.datastream_resources import JsonFileFormat -from google.cloud.datastream_v1.types.datastream_resources import MysqlColumn -from google.cloud.datastream_v1.types.datastream_resources import MysqlDatabase -from google.cloud.datastream_v1.types.datastream_resources import MysqlProfile -from google.cloud.datastream_v1.types.datastream_resources import MysqlRdbms -from google.cloud.datastream_v1.types.datastream_resources import MysqlSourceConfig -from google.cloud.datastream_v1.types.datastream_resources import MysqlSslConfig -from google.cloud.datastream_v1.types.datastream_resources import MysqlTable -from google.cloud.datastream_v1.types.datastream_resources import OracleColumn -from google.cloud.datastream_v1.types.datastream_resources import OracleProfile -from google.cloud.datastream_v1.types.datastream_resources import OracleRdbms -from google.cloud.datastream_v1.types.datastream_resources import OracleSchema -from google.cloud.datastream_v1.types.datastream_resources import OracleSourceConfig -from google.cloud.datastream_v1.types.datastream_resources import OracleTable -from google.cloud.datastream_v1.types.datastream_resources import PrivateConnection -from google.cloud.datastream_v1.types.datastream_resources import PrivateConnectivity -from google.cloud.datastream_v1.types.datastream_resources import Route -from google.cloud.datastream_v1.types.datastream_resources import SourceConfig -from google.cloud.datastream_v1.types.datastream_resources import SourceObjectIdentifier -from google.cloud.datastream_v1.types.datastream_resources import ( + GcsDestinationConfig, + GcsProfile, + JsonFileFormat, + MysqlColumn, + MysqlDatabase, + MysqlProfile, + MysqlRdbms, + MysqlSourceConfig, + MysqlSslConfig, + MysqlTable, + OracleColumn, + OracleProfile, + OracleRdbms, + OracleSchema, + OracleSourceConfig, + OracleTable, + PrivateConnection, + PrivateConnectivity, + Route, + SourceConfig, + SourceObjectIdentifier, StaticServiceIpConnectivity, + Stream, + StreamObject, + Validation, + ValidationMessage, + ValidationResult, + VpcPeeringConfig, ) -from google.cloud.datastream_v1.types.datastream_resources import Stream -from google.cloud.datastream_v1.types.datastream_resources import StreamObject -from google.cloud.datastream_v1.types.datastream_resources import Validation -from google.cloud.datastream_v1.types.datastream_resources import ValidationMessage -from google.cloud.datastream_v1.types.datastream_resources import ValidationResult -from google.cloud.datastream_v1.types.datastream_resources import VpcPeeringConfig __all__ = ( "DatastreamClient", diff --git a/google/cloud/datastream_v1/__init__.py b/google/cloud/datastream_v1/__init__.py index be9f50e..4f92d57 100644 --- a/google/cloud/datastream_v1/__init__.py +++ b/google/cloud/datastream_v1/__init__.py @@ -14,78 +14,80 @@ # limitations under the License. # -from .services.datastream import DatastreamClient -from .services.datastream import DatastreamAsyncClient - -from .types.datastream import CreateConnectionProfileRequest -from .types.datastream import CreatePrivateConnectionRequest -from .types.datastream import CreateRouteRequest -from .types.datastream import CreateStreamRequest -from .types.datastream import DeleteConnectionProfileRequest -from .types.datastream import DeletePrivateConnectionRequest -from .types.datastream import DeleteRouteRequest -from .types.datastream import DeleteStreamRequest -from .types.datastream import DiscoverConnectionProfileRequest -from .types.datastream import DiscoverConnectionProfileResponse -from .types.datastream import FetchStaticIpsRequest -from .types.datastream import FetchStaticIpsResponse -from .types.datastream import GetConnectionProfileRequest -from .types.datastream import GetPrivateConnectionRequest -from .types.datastream import GetRouteRequest -from .types.datastream import GetStreamObjectRequest -from .types.datastream import GetStreamRequest -from .types.datastream import ListConnectionProfilesRequest -from .types.datastream import ListConnectionProfilesResponse -from .types.datastream import ListPrivateConnectionsRequest -from .types.datastream import ListPrivateConnectionsResponse -from .types.datastream import ListRoutesRequest -from .types.datastream import ListRoutesResponse -from .types.datastream import ListStreamObjectsRequest -from .types.datastream import ListStreamObjectsResponse -from .types.datastream import ListStreamsRequest -from .types.datastream import ListStreamsResponse -from .types.datastream import LookupStreamObjectRequest -from .types.datastream import OperationMetadata -from .types.datastream import StartBackfillJobRequest -from .types.datastream import StartBackfillJobResponse -from .types.datastream import StopBackfillJobRequest -from .types.datastream import StopBackfillJobResponse -from .types.datastream import UpdateConnectionProfileRequest -from .types.datastream import UpdateStreamRequest -from .types.datastream_resources import AvroFileFormat -from .types.datastream_resources import BackfillJob -from .types.datastream_resources import ConnectionProfile -from .types.datastream_resources import DestinationConfig -from .types.datastream_resources import Error -from .types.datastream_resources import ForwardSshTunnelConnectivity -from .types.datastream_resources import GcsDestinationConfig -from .types.datastream_resources import GcsProfile -from .types.datastream_resources import JsonFileFormat -from .types.datastream_resources import MysqlColumn -from .types.datastream_resources import MysqlDatabase -from .types.datastream_resources import MysqlProfile -from .types.datastream_resources import MysqlRdbms -from .types.datastream_resources import MysqlSourceConfig -from .types.datastream_resources import MysqlSslConfig -from .types.datastream_resources import MysqlTable -from .types.datastream_resources import OracleColumn -from .types.datastream_resources import OracleProfile -from .types.datastream_resources import OracleRdbms -from .types.datastream_resources import OracleSchema -from .types.datastream_resources import OracleSourceConfig -from .types.datastream_resources import OracleTable -from .types.datastream_resources import PrivateConnection -from .types.datastream_resources import PrivateConnectivity -from .types.datastream_resources import Route -from .types.datastream_resources import SourceConfig -from .types.datastream_resources import SourceObjectIdentifier -from .types.datastream_resources import StaticServiceIpConnectivity -from .types.datastream_resources import Stream -from .types.datastream_resources import StreamObject -from .types.datastream_resources import Validation -from .types.datastream_resources import ValidationMessage -from .types.datastream_resources import ValidationResult -from .types.datastream_resources import VpcPeeringConfig +from .services.datastream import DatastreamAsyncClient, DatastreamClient +from .types.datastream import ( + CreateConnectionProfileRequest, + CreatePrivateConnectionRequest, + CreateRouteRequest, + CreateStreamRequest, + DeleteConnectionProfileRequest, + DeletePrivateConnectionRequest, + DeleteRouteRequest, + DeleteStreamRequest, + DiscoverConnectionProfileRequest, + DiscoverConnectionProfileResponse, + FetchStaticIpsRequest, + FetchStaticIpsResponse, + GetConnectionProfileRequest, + GetPrivateConnectionRequest, + GetRouteRequest, + GetStreamObjectRequest, + GetStreamRequest, + ListConnectionProfilesRequest, + ListConnectionProfilesResponse, + ListPrivateConnectionsRequest, + ListPrivateConnectionsResponse, + ListRoutesRequest, + ListRoutesResponse, + ListStreamObjectsRequest, + ListStreamObjectsResponse, + ListStreamsRequest, + ListStreamsResponse, + LookupStreamObjectRequest, + OperationMetadata, + StartBackfillJobRequest, + StartBackfillJobResponse, + StopBackfillJobRequest, + StopBackfillJobResponse, + UpdateConnectionProfileRequest, + UpdateStreamRequest, +) +from .types.datastream_resources import ( + AvroFileFormat, + BackfillJob, + ConnectionProfile, + DestinationConfig, + Error, + ForwardSshTunnelConnectivity, + GcsDestinationConfig, + GcsProfile, + JsonFileFormat, + MysqlColumn, + MysqlDatabase, + MysqlProfile, + MysqlRdbms, + MysqlSourceConfig, + MysqlSslConfig, + MysqlTable, + OracleColumn, + OracleProfile, + OracleRdbms, + OracleSchema, + OracleSourceConfig, + OracleTable, + PrivateConnection, + PrivateConnectivity, + Route, + SourceConfig, + SourceObjectIdentifier, + StaticServiceIpConnectivity, + Stream, + StreamObject, + Validation, + ValidationMessage, + ValidationResult, + VpcPeeringConfig, +) __all__ = ( "DatastreamAsyncClient", diff --git a/google/cloud/datastream_v1/services/datastream/__init__.py b/google/cloud/datastream_v1/services/datastream/__init__.py index 0e6c29f..2636cbc 100644 --- a/google/cloud/datastream_v1/services/datastream/__init__.py +++ b/google/cloud/datastream_v1/services/datastream/__init__.py @@ -13,8 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # -from .client import DatastreamClient from .async_client import DatastreamAsyncClient +from .client import DatastreamClient __all__ = ( "DatastreamClient", diff --git a/google/cloud/datastream_v1/services/datastream/async_client.py b/google/cloud/datastream_v1/services/datastream/async_client.py index 8305f36..5259734 100644 --- a/google/cloud/datastream_v1/services/datastream/async_client.py +++ b/google/cloud/datastream_v1/services/datastream/async_client.py @@ -17,14 +17,14 @@ import functools import re from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union -import pkg_resources -from google.api_core.client_options import ClientOptions from google.api_core import exceptions as core_exceptions from google.api_core import gapic_v1 from google.api_core import retry as retries +from google.api_core.client_options import ClientOptions from google.auth import credentials as ga_credentials # type: ignore from google.oauth2 import service_account # type: ignore +import pkg_resources try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] @@ -33,15 +33,16 @@ from google.api_core import operation # type: ignore from google.api_core import operation_async # type: ignore -from google.cloud.datastream_v1.services.datastream import pagers -from google.cloud.datastream_v1.types import datastream -from google.cloud.datastream_v1.types import datastream_resources from google.protobuf import empty_pb2 # type: ignore from google.protobuf import field_mask_pb2 # type: ignore from google.protobuf import timestamp_pb2 # type: ignore -from .transports.base import DatastreamTransport, DEFAULT_CLIENT_INFO -from .transports.grpc_asyncio import DatastreamGrpcAsyncIOTransport + +from google.cloud.datastream_v1.services.datastream import pagers +from google.cloud.datastream_v1.types import datastream, datastream_resources + from .client import DatastreamClient +from .transports.base import DEFAULT_CLIENT_INFO, DatastreamTransport +from .transports.grpc_asyncio import DatastreamGrpcAsyncIOTransport class DatastreamAsyncClient: diff --git a/google/cloud/datastream_v1/services/datastream/client.py b/google/cloud/datastream_v1/services/datastream/client.py index 851421d..4711c98 100644 --- a/google/cloud/datastream_v1/services/datastream/client.py +++ b/google/cloud/datastream_v1/services/datastream/client.py @@ -17,17 +17,17 @@ import os import re from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union -import pkg_resources from google.api_core import client_options as client_options_lib from google.api_core import exceptions as core_exceptions from google.api_core import gapic_v1 from google.api_core import retry as retries from google.auth import credentials as ga_credentials # type: ignore +from google.auth.exceptions import MutualTLSChannelError # type: ignore from google.auth.transport import mtls # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore -from google.auth.exceptions import MutualTLSChannelError # type: ignore from google.oauth2 import service_account # type: ignore +import pkg_resources try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] @@ -36,13 +36,14 @@ from google.api_core import operation # type: ignore from google.api_core import operation_async # type: ignore -from google.cloud.datastream_v1.services.datastream import pagers -from google.cloud.datastream_v1.types import datastream -from google.cloud.datastream_v1.types import datastream_resources from google.protobuf import empty_pb2 # type: ignore from google.protobuf import field_mask_pb2 # type: ignore from google.protobuf import timestamp_pb2 # type: ignore -from .transports.base import DatastreamTransport, DEFAULT_CLIENT_INFO + +from google.cloud.datastream_v1.services.datastream import pagers +from google.cloud.datastream_v1.types import datastream, datastream_resources + +from .transports.base import DEFAULT_CLIENT_INFO, DatastreamTransport from .transports.grpc import DatastreamGrpcTransport from .transports.grpc_asyncio import DatastreamGrpcAsyncIOTransport diff --git a/google/cloud/datastream_v1/services/datastream/pagers.py b/google/cloud/datastream_v1/services/datastream/pagers.py index 7617d90..1a3f3e1 100644 --- a/google/cloud/datastream_v1/services/datastream/pagers.py +++ b/google/cloud/datastream_v1/services/datastream/pagers.py @@ -18,14 +18,13 @@ AsyncIterator, Awaitable, Callable, + Iterator, + Optional, Sequence, Tuple, - Optional, - Iterator, ) -from google.cloud.datastream_v1.types import datastream -from google.cloud.datastream_v1.types import datastream_resources +from google.cloud.datastream_v1.types import datastream, datastream_resources class ListConnectionProfilesPager: diff --git a/google/cloud/datastream_v1/services/datastream/transports/__init__.py b/google/cloud/datastream_v1/services/datastream/transports/__init__.py index 8684788..064e682 100644 --- a/google/cloud/datastream_v1/services/datastream/transports/__init__.py +++ b/google/cloud/datastream_v1/services/datastream/transports/__init__.py @@ -20,7 +20,6 @@ from .grpc import DatastreamGrpcTransport from .grpc_asyncio import DatastreamGrpcAsyncIOTransport - # Compile a registry of transports. _transport_registry = OrderedDict() # type: Dict[str, Type[DatastreamTransport]] _transport_registry["grpc"] = DatastreamGrpcTransport diff --git a/google/cloud/datastream_v1/services/datastream/transports/base.py b/google/cloud/datastream_v1/services/datastream/transports/base.py index 004e778..145b55c 100644 --- a/google/cloud/datastream_v1/services/datastream/transports/base.py +++ b/google/cloud/datastream_v1/services/datastream/transports/base.py @@ -15,20 +15,18 @@ # import abc from typing import Awaitable, Callable, Dict, Optional, Sequence, Union -import pkg_resources -import google.auth # type: ignore import google.api_core from google.api_core import exceptions as core_exceptions -from google.api_core import gapic_v1 +from google.api_core import gapic_v1, operations_v1 from google.api_core import retry as retries -from google.api_core import operations_v1 +import google.auth # type: ignore from google.auth import credentials as ga_credentials # type: ignore +from google.longrunning import operations_pb2 # type: ignore from google.oauth2 import service_account # type: ignore +import pkg_resources -from google.cloud.datastream_v1.types import datastream -from google.cloud.datastream_v1.types import datastream_resources -from google.longrunning import operations_pb2 # type: ignore +from google.cloud.datastream_v1.types import datastream, datastream_resources try: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( diff --git a/google/cloud/datastream_v1/services/datastream/transports/grpc.py b/google/cloud/datastream_v1/services/datastream/transports/grpc.py index 80ea09e..5e850e0 100644 --- a/google/cloud/datastream_v1/services/datastream/transports/grpc.py +++ b/google/cloud/datastream_v1/services/datastream/transports/grpc.py @@ -13,22 +13,19 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import warnings from typing import Callable, Dict, Optional, Sequence, Tuple, Union +import warnings -from google.api_core import grpc_helpers -from google.api_core import operations_v1 -from google.api_core import gapic_v1 +from google.api_core import gapic_v1, grpc_helpers, operations_v1 import google.auth # type: ignore from google.auth import credentials as ga_credentials # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore - +from google.longrunning import operations_pb2 # type: ignore import grpc # type: ignore -from google.cloud.datastream_v1.types import datastream -from google.cloud.datastream_v1.types import datastream_resources -from google.longrunning import operations_pb2 # type: ignore -from .base import DatastreamTransport, DEFAULT_CLIENT_INFO +from google.cloud.datastream_v1.types import datastream, datastream_resources + +from .base import DEFAULT_CLIENT_INFO, DatastreamTransport class DatastreamGrpcTransport(DatastreamTransport): diff --git a/google/cloud/datastream_v1/services/datastream/transports/grpc_asyncio.py b/google/cloud/datastream_v1/services/datastream/transports/grpc_asyncio.py index 0e9c610..0cf950c 100644 --- a/google/cloud/datastream_v1/services/datastream/transports/grpc_asyncio.py +++ b/google/cloud/datastream_v1/services/datastream/transports/grpc_asyncio.py @@ -13,22 +13,19 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import warnings from typing import Awaitable, Callable, Dict, Optional, Sequence, Tuple, Union +import warnings -from google.api_core import gapic_v1 -from google.api_core import grpc_helpers_async -from google.api_core import operations_v1 +from google.api_core import gapic_v1, grpc_helpers_async, operations_v1 from google.auth import credentials as ga_credentials # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore - +from google.longrunning import operations_pb2 # type: ignore import grpc # type: ignore from grpc.experimental import aio # type: ignore -from google.cloud.datastream_v1.types import datastream -from google.cloud.datastream_v1.types import datastream_resources -from google.longrunning import operations_pb2 # type: ignore -from .base import DatastreamTransport, DEFAULT_CLIENT_INFO +from google.cloud.datastream_v1.types import datastream, datastream_resources + +from .base import DEFAULT_CLIENT_INFO, DatastreamTransport from .grpc import DatastreamGrpcTransport diff --git a/google/cloud/datastream_v1/types/datastream.py b/google/cloud/datastream_v1/types/datastream.py index 27db130..d1136aa 100644 --- a/google/cloud/datastream_v1/types/datastream.py +++ b/google/cloud/datastream_v1/types/datastream.py @@ -13,12 +13,11 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import proto # type: ignore - -from google.cloud.datastream_v1.types import datastream_resources from google.protobuf import field_mask_pb2 # type: ignore from google.protobuf import timestamp_pb2 # type: ignore +import proto # type: ignore +from google.cloud.datastream_v1.types import datastream_resources __protobuf__ = proto.module( package="google.cloud.datastream.v1", diff --git a/google/cloud/datastream_v1/types/datastream_resources.py b/google/cloud/datastream_v1/types/datastream_resources.py index 756110b..55e3eef 100644 --- a/google/cloud/datastream_v1/types/datastream_resources.py +++ b/google/cloud/datastream_v1/types/datastream_resources.py @@ -13,11 +13,9 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import proto # type: ignore - from google.protobuf import duration_pb2 # type: ignore from google.protobuf import timestamp_pb2 # type: ignore - +import proto # type: ignore __protobuf__ = proto.module( package="google.cloud.datastream.v1", diff --git a/google/cloud/datastream_v1alpha1/__init__.py b/google/cloud/datastream_v1alpha1/__init__.py index e143d2e..f668c28 100644 --- a/google/cloud/datastream_v1alpha1/__init__.py +++ b/google/cloud/datastream_v1alpha1/__init__.py @@ -14,72 +14,74 @@ # limitations under the License. # -from .services.datastream import DatastreamClient -from .services.datastream import DatastreamAsyncClient - -from .types.datastream import CreateConnectionProfileRequest -from .types.datastream import CreatePrivateConnectionRequest -from .types.datastream import CreateRouteRequest -from .types.datastream import CreateStreamRequest -from .types.datastream import DeleteConnectionProfileRequest -from .types.datastream import DeletePrivateConnectionRequest -from .types.datastream import DeleteRouteRequest -from .types.datastream import DeleteStreamRequest -from .types.datastream import DiscoverConnectionProfileRequest -from .types.datastream import DiscoverConnectionProfileResponse -from .types.datastream import FetchErrorsRequest -from .types.datastream import FetchErrorsResponse -from .types.datastream import FetchStaticIpsRequest -from .types.datastream import FetchStaticIpsResponse -from .types.datastream import GetConnectionProfileRequest -from .types.datastream import GetPrivateConnectionRequest -from .types.datastream import GetRouteRequest -from .types.datastream import GetStreamRequest -from .types.datastream import ListConnectionProfilesRequest -from .types.datastream import ListConnectionProfilesResponse -from .types.datastream import ListPrivateConnectionsRequest -from .types.datastream import ListPrivateConnectionsResponse -from .types.datastream import ListRoutesRequest -from .types.datastream import ListRoutesResponse -from .types.datastream import ListStreamsRequest -from .types.datastream import ListStreamsResponse -from .types.datastream import OperationMetadata -from .types.datastream import UpdateConnectionProfileRequest -from .types.datastream import UpdateStreamRequest -from .types.datastream_resources import AvroFileFormat -from .types.datastream_resources import ConnectionProfile -from .types.datastream_resources import DestinationConfig -from .types.datastream_resources import Error -from .types.datastream_resources import ForwardSshTunnelConnectivity -from .types.datastream_resources import GcsDestinationConfig -from .types.datastream_resources import GcsProfile -from .types.datastream_resources import JsonFileFormat -from .types.datastream_resources import MysqlColumn -from .types.datastream_resources import MysqlDatabase -from .types.datastream_resources import MysqlProfile -from .types.datastream_resources import MysqlRdbms -from .types.datastream_resources import MysqlSourceConfig -from .types.datastream_resources import MysqlSslConfig -from .types.datastream_resources import MysqlTable -from .types.datastream_resources import NoConnectivitySettings -from .types.datastream_resources import OracleColumn -from .types.datastream_resources import OracleProfile -from .types.datastream_resources import OracleRdbms -from .types.datastream_resources import OracleSchema -from .types.datastream_resources import OracleSourceConfig -from .types.datastream_resources import OracleTable -from .types.datastream_resources import PrivateConnection -from .types.datastream_resources import PrivateConnectivity -from .types.datastream_resources import Route -from .types.datastream_resources import SourceConfig -from .types.datastream_resources import StaticServiceIpConnectivity -from .types.datastream_resources import Stream -from .types.datastream_resources import Validation -from .types.datastream_resources import ValidationMessage -from .types.datastream_resources import ValidationResult -from .types.datastream_resources import VpcPeeringConfig -from .types.datastream_resources import GcsFileFormat -from .types.datastream_resources import SchemaFileFormat +from .services.datastream import DatastreamAsyncClient, DatastreamClient +from .types.datastream import ( + CreateConnectionProfileRequest, + CreatePrivateConnectionRequest, + CreateRouteRequest, + CreateStreamRequest, + DeleteConnectionProfileRequest, + DeletePrivateConnectionRequest, + DeleteRouteRequest, + DeleteStreamRequest, + DiscoverConnectionProfileRequest, + DiscoverConnectionProfileResponse, + FetchErrorsRequest, + FetchErrorsResponse, + FetchStaticIpsRequest, + FetchStaticIpsResponse, + GetConnectionProfileRequest, + GetPrivateConnectionRequest, + GetRouteRequest, + GetStreamRequest, + ListConnectionProfilesRequest, + ListConnectionProfilesResponse, + ListPrivateConnectionsRequest, + ListPrivateConnectionsResponse, + ListRoutesRequest, + ListRoutesResponse, + ListStreamsRequest, + ListStreamsResponse, + OperationMetadata, + UpdateConnectionProfileRequest, + UpdateStreamRequest, +) +from .types.datastream_resources import ( + AvroFileFormat, + ConnectionProfile, + DestinationConfig, + Error, + ForwardSshTunnelConnectivity, + GcsDestinationConfig, + GcsFileFormat, + GcsProfile, + JsonFileFormat, + MysqlColumn, + MysqlDatabase, + MysqlProfile, + MysqlRdbms, + MysqlSourceConfig, + MysqlSslConfig, + MysqlTable, + NoConnectivitySettings, + OracleColumn, + OracleProfile, + OracleRdbms, + OracleSchema, + OracleSourceConfig, + OracleTable, + PrivateConnection, + PrivateConnectivity, + Route, + SchemaFileFormat, + SourceConfig, + StaticServiceIpConnectivity, + Stream, + Validation, + ValidationMessage, + ValidationResult, + VpcPeeringConfig, +) __all__ = ( "DatastreamAsyncClient", diff --git a/google/cloud/datastream_v1alpha1/services/datastream/__init__.py b/google/cloud/datastream_v1alpha1/services/datastream/__init__.py index 0e6c29f..2636cbc 100644 --- a/google/cloud/datastream_v1alpha1/services/datastream/__init__.py +++ b/google/cloud/datastream_v1alpha1/services/datastream/__init__.py @@ -13,8 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # -from .client import DatastreamClient from .async_client import DatastreamAsyncClient +from .client import DatastreamClient __all__ = ( "DatastreamClient", diff --git a/google/cloud/datastream_v1alpha1/services/datastream/async_client.py b/google/cloud/datastream_v1alpha1/services/datastream/async_client.py index 4c44571..4ba071a 100644 --- a/google/cloud/datastream_v1alpha1/services/datastream/async_client.py +++ b/google/cloud/datastream_v1alpha1/services/datastream/async_client.py @@ -17,14 +17,14 @@ import functools import re from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union -import pkg_resources -from google.api_core.client_options import ClientOptions from google.api_core import exceptions as core_exceptions from google.api_core import gapic_v1 from google.api_core import retry as retries +from google.api_core.client_options import ClientOptions from google.auth import credentials as ga_credentials # type: ignore from google.oauth2 import service_account # type: ignore +import pkg_resources try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] @@ -33,15 +33,16 @@ from google.api_core import operation # type: ignore from google.api_core import operation_async # type: ignore -from google.cloud.datastream_v1alpha1.services.datastream import pagers -from google.cloud.datastream_v1alpha1.types import datastream -from google.cloud.datastream_v1alpha1.types import datastream_resources from google.protobuf import empty_pb2 # type: ignore from google.protobuf import field_mask_pb2 # type: ignore from google.protobuf import timestamp_pb2 # type: ignore -from .transports.base import DatastreamTransport, DEFAULT_CLIENT_INFO -from .transports.grpc_asyncio import DatastreamGrpcAsyncIOTransport + +from google.cloud.datastream_v1alpha1.services.datastream import pagers +from google.cloud.datastream_v1alpha1.types import datastream, datastream_resources + from .client import DatastreamClient +from .transports.base import DEFAULT_CLIENT_INFO, DatastreamTransport +from .transports.grpc_asyncio import DatastreamGrpcAsyncIOTransport class DatastreamAsyncClient: diff --git a/google/cloud/datastream_v1alpha1/services/datastream/client.py b/google/cloud/datastream_v1alpha1/services/datastream/client.py index c78110e..2ebf79e 100644 --- a/google/cloud/datastream_v1alpha1/services/datastream/client.py +++ b/google/cloud/datastream_v1alpha1/services/datastream/client.py @@ -17,17 +17,17 @@ import os import re from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union -import pkg_resources from google.api_core import client_options as client_options_lib from google.api_core import exceptions as core_exceptions from google.api_core import gapic_v1 from google.api_core import retry as retries from google.auth import credentials as ga_credentials # type: ignore +from google.auth.exceptions import MutualTLSChannelError # type: ignore from google.auth.transport import mtls # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore -from google.auth.exceptions import MutualTLSChannelError # type: ignore from google.oauth2 import service_account # type: ignore +import pkg_resources try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] @@ -36,13 +36,14 @@ from google.api_core import operation # type: ignore from google.api_core import operation_async # type: ignore -from google.cloud.datastream_v1alpha1.services.datastream import pagers -from google.cloud.datastream_v1alpha1.types import datastream -from google.cloud.datastream_v1alpha1.types import datastream_resources from google.protobuf import empty_pb2 # type: ignore from google.protobuf import field_mask_pb2 # type: ignore from google.protobuf import timestamp_pb2 # type: ignore -from .transports.base import DatastreamTransport, DEFAULT_CLIENT_INFO + +from google.cloud.datastream_v1alpha1.services.datastream import pagers +from google.cloud.datastream_v1alpha1.types import datastream, datastream_resources + +from .transports.base import DEFAULT_CLIENT_INFO, DatastreamTransport from .transports.grpc import DatastreamGrpcTransport from .transports.grpc_asyncio import DatastreamGrpcAsyncIOTransport diff --git a/google/cloud/datastream_v1alpha1/services/datastream/pagers.py b/google/cloud/datastream_v1alpha1/services/datastream/pagers.py index 68b28f6..4381679 100644 --- a/google/cloud/datastream_v1alpha1/services/datastream/pagers.py +++ b/google/cloud/datastream_v1alpha1/services/datastream/pagers.py @@ -18,14 +18,13 @@ AsyncIterator, Awaitable, Callable, + Iterator, + Optional, Sequence, Tuple, - Optional, - Iterator, ) -from google.cloud.datastream_v1alpha1.types import datastream -from google.cloud.datastream_v1alpha1.types import datastream_resources +from google.cloud.datastream_v1alpha1.types import datastream, datastream_resources class ListConnectionProfilesPager: diff --git a/google/cloud/datastream_v1alpha1/services/datastream/transports/__init__.py b/google/cloud/datastream_v1alpha1/services/datastream/transports/__init__.py index 8684788..064e682 100644 --- a/google/cloud/datastream_v1alpha1/services/datastream/transports/__init__.py +++ b/google/cloud/datastream_v1alpha1/services/datastream/transports/__init__.py @@ -20,7 +20,6 @@ from .grpc import DatastreamGrpcTransport from .grpc_asyncio import DatastreamGrpcAsyncIOTransport - # Compile a registry of transports. _transport_registry = OrderedDict() # type: Dict[str, Type[DatastreamTransport]] _transport_registry["grpc"] = DatastreamGrpcTransport diff --git a/google/cloud/datastream_v1alpha1/services/datastream/transports/base.py b/google/cloud/datastream_v1alpha1/services/datastream/transports/base.py index 2e98a48..6d77a67 100644 --- a/google/cloud/datastream_v1alpha1/services/datastream/transports/base.py +++ b/google/cloud/datastream_v1alpha1/services/datastream/transports/base.py @@ -15,20 +15,18 @@ # import abc from typing import Awaitable, Callable, Dict, Optional, Sequence, Union -import pkg_resources -import google.auth # type: ignore import google.api_core from google.api_core import exceptions as core_exceptions -from google.api_core import gapic_v1 +from google.api_core import gapic_v1, operations_v1 from google.api_core import retry as retries -from google.api_core import operations_v1 +import google.auth # type: ignore from google.auth import credentials as ga_credentials # type: ignore +from google.longrunning import operations_pb2 # type: ignore from google.oauth2 import service_account # type: ignore +import pkg_resources -from google.cloud.datastream_v1alpha1.types import datastream -from google.cloud.datastream_v1alpha1.types import datastream_resources -from google.longrunning import operations_pb2 # type: ignore +from google.cloud.datastream_v1alpha1.types import datastream, datastream_resources try: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( diff --git a/google/cloud/datastream_v1alpha1/services/datastream/transports/grpc.py b/google/cloud/datastream_v1alpha1/services/datastream/transports/grpc.py index 4d09aa4..cdc9ebd 100644 --- a/google/cloud/datastream_v1alpha1/services/datastream/transports/grpc.py +++ b/google/cloud/datastream_v1alpha1/services/datastream/transports/grpc.py @@ -13,22 +13,19 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import warnings from typing import Callable, Dict, Optional, Sequence, Tuple, Union +import warnings -from google.api_core import grpc_helpers -from google.api_core import operations_v1 -from google.api_core import gapic_v1 +from google.api_core import gapic_v1, grpc_helpers, operations_v1 import google.auth # type: ignore from google.auth import credentials as ga_credentials # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore - +from google.longrunning import operations_pb2 # type: ignore import grpc # type: ignore -from google.cloud.datastream_v1alpha1.types import datastream -from google.cloud.datastream_v1alpha1.types import datastream_resources -from google.longrunning import operations_pb2 # type: ignore -from .base import DatastreamTransport, DEFAULT_CLIENT_INFO +from google.cloud.datastream_v1alpha1.types import datastream, datastream_resources + +from .base import DEFAULT_CLIENT_INFO, DatastreamTransport class DatastreamGrpcTransport(DatastreamTransport): diff --git a/google/cloud/datastream_v1alpha1/services/datastream/transports/grpc_asyncio.py b/google/cloud/datastream_v1alpha1/services/datastream/transports/grpc_asyncio.py index d36b5b6..079bb6e 100644 --- a/google/cloud/datastream_v1alpha1/services/datastream/transports/grpc_asyncio.py +++ b/google/cloud/datastream_v1alpha1/services/datastream/transports/grpc_asyncio.py @@ -13,22 +13,19 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import warnings from typing import Awaitable, Callable, Dict, Optional, Sequence, Tuple, Union +import warnings -from google.api_core import gapic_v1 -from google.api_core import grpc_helpers_async -from google.api_core import operations_v1 +from google.api_core import gapic_v1, grpc_helpers_async, operations_v1 from google.auth import credentials as ga_credentials # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore - +from google.longrunning import operations_pb2 # type: ignore import grpc # type: ignore from grpc.experimental import aio # type: ignore -from google.cloud.datastream_v1alpha1.types import datastream -from google.cloud.datastream_v1alpha1.types import datastream_resources -from google.longrunning import operations_pb2 # type: ignore -from .base import DatastreamTransport, DEFAULT_CLIENT_INFO +from google.cloud.datastream_v1alpha1.types import datastream, datastream_resources + +from .base import DEFAULT_CLIENT_INFO, DatastreamTransport from .grpc import DatastreamGrpcTransport diff --git a/google/cloud/datastream_v1alpha1/types/__init__.py b/google/cloud/datastream_v1alpha1/types/__init__.py index bcb6350..c11abd6 100644 --- a/google/cloud/datastream_v1alpha1/types/__init__.py +++ b/google/cloud/datastream_v1alpha1/types/__init__.py @@ -51,6 +51,7 @@ Error, ForwardSshTunnelConnectivity, GcsDestinationConfig, + GcsFileFormat, GcsProfile, JsonFileFormat, MysqlColumn, @@ -70,6 +71,7 @@ PrivateConnection, PrivateConnectivity, Route, + SchemaFileFormat, SourceConfig, StaticServiceIpConnectivity, Stream, @@ -77,8 +79,6 @@ ValidationMessage, ValidationResult, VpcPeeringConfig, - GcsFileFormat, - SchemaFileFormat, ) __all__ = ( diff --git a/google/cloud/datastream_v1alpha1/types/datastream.py b/google/cloud/datastream_v1alpha1/types/datastream.py index 24348c7..30dad6b 100644 --- a/google/cloud/datastream_v1alpha1/types/datastream.py +++ b/google/cloud/datastream_v1alpha1/types/datastream.py @@ -13,12 +13,11 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import proto # type: ignore - -from google.cloud.datastream_v1alpha1.types import datastream_resources from google.protobuf import field_mask_pb2 # type: ignore from google.protobuf import timestamp_pb2 # type: ignore +import proto # type: ignore +from google.cloud.datastream_v1alpha1.types import datastream_resources __protobuf__ = proto.module( package="google.cloud.datastream.v1alpha1", diff --git a/google/cloud/datastream_v1alpha1/types/datastream_resources.py b/google/cloud/datastream_v1alpha1/types/datastream_resources.py index 7e5d70b..5d20a3e 100644 --- a/google/cloud/datastream_v1alpha1/types/datastream_resources.py +++ b/google/cloud/datastream_v1alpha1/types/datastream_resources.py @@ -13,11 +13,9 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import proto # type: ignore - from google.protobuf import duration_pb2 # type: ignore from google.protobuf import timestamp_pb2 # type: ignore - +import proto # type: ignore __protobuf__ = proto.module( package="google.cloud.datastream.v1alpha1", diff --git a/noxfile.py b/noxfile.py index 6ee5e8a..7c1742d 100644 --- a/noxfile.py +++ b/noxfile.py @@ -17,6 +17,7 @@ # Generated by synthtool. DO NOT EDIT! from __future__ import absolute_import + import os import pathlib import shutil @@ -25,7 +26,8 @@ import nox BLACK_VERSION = "black==22.3.0" -BLACK_PATHS = ["docs", "google", "tests", "noxfile.py", "setup.py"] +ISORT_VERSION = "isort==5.10.1" +LINT_PATHS = ["docs", "google", "tests", "noxfile.py", "setup.py"] DEFAULT_PYTHON_VERSION = "3.8" @@ -83,7 +85,7 @@ def lint(session): session.run( "black", "--check", - *BLACK_PATHS, + *LINT_PATHS, ) session.run("flake8", "google", "tests") @@ -94,7 +96,27 @@ def blacken(session): session.install(BLACK_VERSION) session.run( "black", - *BLACK_PATHS, + *LINT_PATHS, + ) + + +@nox.session(python=DEFAULT_PYTHON_VERSION) +def format(session): + """ + Run isort to sort imports. Then run black + to format code to uniform standard. + """ + session.install(BLACK_VERSION, ISORT_VERSION) + # Use the --fss option to sort imports using strict alphabetical order. + # See https://pycqa.github.io/isort/docs/configuration/options.html#force-sort-within-sections + session.run( + "isort", + "--fss", + *LINT_PATHS, + ) + session.run( + "black", + *LINT_PATHS, ) diff --git a/setup.py b/setup.py index 7d33b0b..9d2d0b3 100644 --- a/setup.py +++ b/setup.py @@ -19,7 +19,6 @@ import setuptools - name = "google-cloud-datastream" description = "Datastream client library" version = "1.0.0" diff --git a/tests/unit/gapic/datastream_v1/test_datastream.py b/tests/unit/gapic/datastream_v1/test_datastream.py index a9ec6ea..969534c 100644 --- a/tests/unit/gapic/datastream_v1/test_datastream.py +++ b/tests/unit/gapic/datastream_v1/test_datastream.py @@ -13,40 +13,42 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import os -import mock - -import grpc -from grpc.experimental import aio import math -import pytest -from proto.marshal.rules.dates import DurationRule, TimestampRule - +import os +from google.api_core import ( + future, + gapic_v1, + grpc_helpers, + grpc_helpers_async, + operation, + operations_v1, + path_template, +) from google.api_core import client_options from google.api_core import exceptions as core_exceptions -from google.api_core import future -from google.api_core import gapic_v1 -from google.api_core import grpc_helpers -from google.api_core import grpc_helpers_async -from google.api_core import operation from google.api_core import operation_async # type: ignore -from google.api_core import operations_v1 -from google.api_core import path_template +import google.auth from google.auth import credentials as ga_credentials from google.auth.exceptions import MutualTLSChannelError -from google.cloud.datastream_v1.services.datastream import DatastreamAsyncClient -from google.cloud.datastream_v1.services.datastream import DatastreamClient -from google.cloud.datastream_v1.services.datastream import pagers -from google.cloud.datastream_v1.services.datastream import transports -from google.cloud.datastream_v1.types import datastream -from google.cloud.datastream_v1.types import datastream_resources from google.longrunning import operations_pb2 from google.oauth2 import service_account from google.protobuf import duration_pb2 # type: ignore from google.protobuf import field_mask_pb2 # type: ignore from google.protobuf import timestamp_pb2 # type: ignore -import google.auth +import grpc +from grpc.experimental import aio +import mock +from proto.marshal.rules.dates import DurationRule, TimestampRule +import pytest + +from google.cloud.datastream_v1.services.datastream import ( + DatastreamAsyncClient, + DatastreamClient, + pagers, + transports, +) +from google.cloud.datastream_v1.types import datastream, datastream_resources def client_cert_source_callback(): diff --git a/tests/unit/gapic/datastream_v1alpha1/test_datastream.py b/tests/unit/gapic/datastream_v1alpha1/test_datastream.py index 68679cd..00bde0d 100644 --- a/tests/unit/gapic/datastream_v1alpha1/test_datastream.py +++ b/tests/unit/gapic/datastream_v1alpha1/test_datastream.py @@ -13,40 +13,42 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import os -import mock - -import grpc -from grpc.experimental import aio import math -import pytest -from proto.marshal.rules.dates import DurationRule, TimestampRule - +import os +from google.api_core import ( + future, + gapic_v1, + grpc_helpers, + grpc_helpers_async, + operation, + operations_v1, + path_template, +) from google.api_core import client_options from google.api_core import exceptions as core_exceptions -from google.api_core import future -from google.api_core import gapic_v1 -from google.api_core import grpc_helpers -from google.api_core import grpc_helpers_async -from google.api_core import operation from google.api_core import operation_async # type: ignore -from google.api_core import operations_v1 -from google.api_core import path_template +import google.auth from google.auth import credentials as ga_credentials from google.auth.exceptions import MutualTLSChannelError -from google.cloud.datastream_v1alpha1.services.datastream import DatastreamAsyncClient -from google.cloud.datastream_v1alpha1.services.datastream import DatastreamClient -from google.cloud.datastream_v1alpha1.services.datastream import pagers -from google.cloud.datastream_v1alpha1.services.datastream import transports -from google.cloud.datastream_v1alpha1.types import datastream -from google.cloud.datastream_v1alpha1.types import datastream_resources from google.longrunning import operations_pb2 from google.oauth2 import service_account from google.protobuf import duration_pb2 # type: ignore from google.protobuf import field_mask_pb2 # type: ignore from google.protobuf import timestamp_pb2 # type: ignore -import google.auth +import grpc +from grpc.experimental import aio +import mock +from proto.marshal.rules.dates import DurationRule, TimestampRule +import pytest + +from google.cloud.datastream_v1alpha1.services.datastream import ( + DatastreamAsyncClient, + DatastreamClient, + pagers, + transports, +) +from google.cloud.datastream_v1alpha1.types import datastream, datastream_resources def client_cert_source_callback(): From 6d956fff28e8b7445013de29888428f87cd32c0f Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 21 Apr 2022 13:22:19 -0400 Subject: [PATCH 11/15] chore(python): use ubuntu 22.04 in docs image (#94) Source-Link: https://github.com/googleapis/synthtool/commit/f15cc72fb401b4861cedebb10af74afe428fb1f8 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:bc5eed3804aec2f05fad42aacf973821d9500c174015341f721a984a0825b6fd Co-authored-by: Owl Bot --- .github/.OwlBot.lock.yaml | 4 ++-- .kokoro/docker/docs/Dockerfile | 20 ++++++++++++++++++-- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 7c454ab..64f82d6 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,5 +13,5 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest - digest: sha256:00c9d764fd1cd56265f12a5ef4b99a0c9e87cf261018099141e2ca5158890416 -# created: 2022-04-20T23:42:53.970438194Z + digest: sha256:bc5eed3804aec2f05fad42aacf973821d9500c174015341f721a984a0825b6fd +# created: 2022-04-21T15:43:16.246106921Z diff --git a/.kokoro/docker/docs/Dockerfile b/.kokoro/docker/docs/Dockerfile index 4e1b1fb..238b87b 100644 --- a/.kokoro/docker/docs/Dockerfile +++ b/.kokoro/docker/docs/Dockerfile @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from ubuntu:20.04 +from ubuntu:22.04 ENV DEBIAN_FRONTEND noninteractive @@ -60,8 +60,24 @@ RUN apt-get update \ && rm -rf /var/lib/apt/lists/* \ && rm -f /var/cache/apt/archives/*.deb +###################### Install python 3.8.11 + +# Download python 3.8.11 +RUN wget https://www.python.org/ftp/python/3.8.11/Python-3.8.11.tgz + +# Extract files +RUN tar -xvf Python-3.8.11.tgz + +# Install python 3.8.11 +RUN ./Python-3.8.11/configure --enable-optimizations +RUN make altinstall + +###################### Install pip RUN wget -O /tmp/get-pip.py 'https://bootstrap.pypa.io/get-pip.py' \ - && python3.8 /tmp/get-pip.py \ + && python3 /tmp/get-pip.py \ && rm /tmp/get-pip.py +# Test pip +RUN python3 -m pip + CMD ["python3.8"] From 3ab63d2d4cd77947aa3614c4a3eac99d5fa06768 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 28 Apr 2022 07:23:57 -0400 Subject: [PATCH 12/15] chore: use gapic-generator-python 0.65.2 (#95) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: use gapic-generator-python 0.65.2 PiperOrigin-RevId: 444333013 Source-Link: https://github.com/googleapis/googleapis/commit/f91b6cf82e929280f6562f6110957c654bd9e2e6 Source-Link: https://github.com/googleapis/googleapis-gen/commit/16eb36095c294e712c74a1bf23550817b42174e5 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMTZlYjM2MDk1YzI5NGU3MTJjNzRhMWJmMjM1NTA4MTdiNDIxNzRlNSJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- .../services/datastream/async_client.py | 150 ++++++------- .../services/datastream/async_client.py | 126 +++++------ .../gapic/datastream_v1/test_datastream.py | 212 +++++++++--------- .../datastream_v1alpha1/test_datastream.py | 178 +++++++-------- 4 files changed, 333 insertions(+), 333 deletions(-) diff --git a/google/cloud/datastream_v1/services/datastream/async_client.py b/google/cloud/datastream_v1/services/datastream/async_client.py index 5259734..f8ffe07 100644 --- a/google/cloud/datastream_v1/services/datastream/async_client.py +++ b/google/cloud/datastream_v1/services/datastream/async_client.py @@ -233,9 +233,9 @@ async def list_connection_profiles( from google.cloud import datastream_v1 - def sample_list_connection_profiles(): + async def sample_list_connection_profiles(): # Create a client - client = datastream_v1.DatastreamClient() + client = datastream_v1.DatastreamAsyncClient() # Initialize request argument(s) request = datastream_v1.ListConnectionProfilesRequest( @@ -246,7 +246,7 @@ def sample_list_connection_profiles(): page_result = client.list_connection_profiles(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -342,9 +342,9 @@ async def get_connection_profile( from google.cloud import datastream_v1 - def sample_get_connection_profile(): + async def sample_get_connection_profile(): # Create a client - client = datastream_v1.DatastreamClient() + client = datastream_v1.DatastreamAsyncClient() # Initialize request argument(s) request = datastream_v1.GetConnectionProfileRequest( @@ -352,7 +352,7 @@ def sample_get_connection_profile(): ) # Make the request - response = client.get_connection_profile(request=request) + response = await client.get_connection_profile(request=request) # Handle the response print(response) @@ -441,9 +441,9 @@ async def create_connection_profile( from google.cloud import datastream_v1 - def sample_create_connection_profile(): + async def sample_create_connection_profile(): # Create a client - client = datastream_v1.DatastreamClient() + client = datastream_v1.DatastreamAsyncClient() # Initialize request argument(s) connection_profile = datastream_v1.ConnectionProfile() @@ -464,7 +464,7 @@ def sample_create_connection_profile(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -579,9 +579,9 @@ async def update_connection_profile( from google.cloud import datastream_v1 - def sample_update_connection_profile(): + async def sample_update_connection_profile(): # Create a client - client = datastream_v1.DatastreamClient() + client = datastream_v1.DatastreamAsyncClient() # Initialize request argument(s) connection_profile = datastream_v1.ConnectionProfile() @@ -600,7 +600,7 @@ def sample_update_connection_profile(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -710,9 +710,9 @@ async def delete_connection_profile( from google.cloud import datastream_v1 - def sample_delete_connection_profile(): + async def sample_delete_connection_profile(): # Create a client - client = datastream_v1.DatastreamClient() + client = datastream_v1.DatastreamAsyncClient() # Initialize request argument(s) request = datastream_v1.DeleteConnectionProfileRequest( @@ -724,7 +724,7 @@ def sample_delete_connection_profile(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -833,9 +833,9 @@ async def discover_connection_profile( from google.cloud import datastream_v1 - def sample_discover_connection_profile(): + async def sample_discover_connection_profile(): # Create a client - client = datastream_v1.DatastreamClient() + client = datastream_v1.DatastreamAsyncClient() # Initialize request argument(s) connection_profile = datastream_v1.ConnectionProfile() @@ -852,7 +852,7 @@ def sample_discover_connection_profile(): ) # Make the request - response = client.discover_connection_profile(request=request) + response = await client.discover_connection_profile(request=request) # Handle the response print(response) @@ -915,9 +915,9 @@ async def list_streams( from google.cloud import datastream_v1 - def sample_list_streams(): + async def sample_list_streams(): # Create a client - client = datastream_v1.DatastreamClient() + client = datastream_v1.DatastreamAsyncClient() # Initialize request argument(s) request = datastream_v1.ListStreamsRequest( @@ -928,7 +928,7 @@ def sample_list_streams(): page_result = client.list_streams(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -1021,9 +1021,9 @@ async def get_stream( from google.cloud import datastream_v1 - def sample_get_stream(): + async def sample_get_stream(): # Create a client - client = datastream_v1.DatastreamClient() + client = datastream_v1.DatastreamAsyncClient() # Initialize request argument(s) request = datastream_v1.GetStreamRequest( @@ -1031,7 +1031,7 @@ def sample_get_stream(): ) # Make the request - response = client.get_stream(request=request) + response = await client.get_stream(request=request) # Handle the response print(response) @@ -1118,9 +1118,9 @@ async def create_stream( from google.cloud import datastream_v1 - def sample_create_stream(): + async def sample_create_stream(): # Create a client - client = datastream_v1.DatastreamClient() + client = datastream_v1.DatastreamAsyncClient() # Initialize request argument(s) stream = datastream_v1.Stream() @@ -1139,7 +1139,7 @@ def sample_create_stream(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -1254,9 +1254,9 @@ async def update_stream( from google.cloud import datastream_v1 - def sample_update_stream(): + async def sample_update_stream(): # Create a client - client = datastream_v1.DatastreamClient() + client = datastream_v1.DatastreamAsyncClient() # Initialize request argument(s) stream = datastream_v1.Stream() @@ -1273,7 +1273,7 @@ def sample_update_stream(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -1385,9 +1385,9 @@ async def delete_stream( from google.cloud import datastream_v1 - def sample_delete_stream(): + async def sample_delete_stream(): # Create a client - client = datastream_v1.DatastreamClient() + client = datastream_v1.DatastreamAsyncClient() # Initialize request argument(s) request = datastream_v1.DeleteStreamRequest( @@ -1399,7 +1399,7 @@ def sample_delete_stream(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -1505,9 +1505,9 @@ async def get_stream_object( from google.cloud import datastream_v1 - def sample_get_stream_object(): + async def sample_get_stream_object(): # Create a client - client = datastream_v1.DatastreamClient() + client = datastream_v1.DatastreamAsyncClient() # Initialize request argument(s) request = datastream_v1.GetStreamObjectRequest( @@ -1515,7 +1515,7 @@ def sample_get_stream_object(): ) # Make the request - response = client.get_stream_object(request=request) + response = await client.get_stream_object(request=request) # Handle the response print(response) @@ -1600,9 +1600,9 @@ async def lookup_stream_object( from google.cloud import datastream_v1 - def sample_lookup_stream_object(): + async def sample_lookup_stream_object(): # Create a client - client = datastream_v1.DatastreamClient() + client = datastream_v1.DatastreamAsyncClient() # Initialize request argument(s) source_object_identifier = datastream_v1.SourceObjectIdentifier() @@ -1615,7 +1615,7 @@ def sample_lookup_stream_object(): ) # Make the request - response = client.lookup_stream_object(request=request) + response = await client.lookup_stream_object(request=request) # Handle the response print(response) @@ -1680,9 +1680,9 @@ async def list_stream_objects( from google.cloud import datastream_v1 - def sample_list_stream_objects(): + async def sample_list_stream_objects(): # Create a client - client = datastream_v1.DatastreamClient() + client = datastream_v1.DatastreamAsyncClient() # Initialize request argument(s) request = datastream_v1.ListStreamObjectsRequest( @@ -1693,7 +1693,7 @@ def sample_list_stream_objects(): page_result = client.list_stream_objects(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -1789,9 +1789,9 @@ async def start_backfill_job( from google.cloud import datastream_v1 - def sample_start_backfill_job(): + async def sample_start_backfill_job(): # Create a client - client = datastream_v1.DatastreamClient() + client = datastream_v1.DatastreamAsyncClient() # Initialize request argument(s) request = datastream_v1.StartBackfillJobRequest( @@ -1799,7 +1799,7 @@ def sample_start_backfill_job(): ) # Make the request - response = client.start_backfill_job(request=request) + response = await client.start_backfill_job(request=request) # Handle the response print(response) @@ -1887,9 +1887,9 @@ async def stop_backfill_job( from google.cloud import datastream_v1 - def sample_stop_backfill_job(): + async def sample_stop_backfill_job(): # Create a client - client = datastream_v1.DatastreamClient() + client = datastream_v1.DatastreamAsyncClient() # Initialize request argument(s) request = datastream_v1.StopBackfillJobRequest( @@ -1897,7 +1897,7 @@ def sample_stop_backfill_job(): ) # Make the request - response = client.stop_backfill_job(request=request) + response = await client.stop_backfill_job(request=request) # Handle the response print(response) @@ -1984,9 +1984,9 @@ async def fetch_static_ips( from google.cloud import datastream_v1 - def sample_fetch_static_ips(): + async def sample_fetch_static_ips(): # Create a client - client = datastream_v1.DatastreamClient() + client = datastream_v1.DatastreamAsyncClient() # Initialize request argument(s) request = datastream_v1.FetchStaticIpsRequest( @@ -1997,7 +1997,7 @@ def sample_fetch_static_ips(): page_result = client.fetch_static_ips(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -2096,9 +2096,9 @@ async def create_private_connection( from google.cloud import datastream_v1 - def sample_create_private_connection(): + async def sample_create_private_connection(): # Create a client - client = datastream_v1.DatastreamClient() + client = datastream_v1.DatastreamAsyncClient() # Initialize request argument(s) private_connection = datastream_v1.PrivateConnection() @@ -2115,7 +2115,7 @@ def sample_create_private_connection(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -2229,9 +2229,9 @@ async def get_private_connection( from google.cloud import datastream_v1 - def sample_get_private_connection(): + async def sample_get_private_connection(): # Create a client - client = datastream_v1.DatastreamClient() + client = datastream_v1.DatastreamAsyncClient() # Initialize request argument(s) request = datastream_v1.GetPrivateConnectionRequest( @@ -2239,7 +2239,7 @@ def sample_get_private_connection(): ) # Make the request - response = client.get_private_connection(request=request) + response = await client.get_private_connection(request=request) # Handle the response print(response) @@ -2327,9 +2327,9 @@ async def list_private_connections( from google.cloud import datastream_v1 - def sample_list_private_connections(): + async def sample_list_private_connections(): # Create a client - client = datastream_v1.DatastreamClient() + client = datastream_v1.DatastreamAsyncClient() # Initialize request argument(s) request = datastream_v1.ListPrivateConnectionsRequest( @@ -2340,7 +2340,7 @@ def sample_list_private_connections(): page_result = client.list_private_connections(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -2437,9 +2437,9 @@ async def delete_private_connection( from google.cloud import datastream_v1 - def sample_delete_private_connection(): + async def sample_delete_private_connection(): # Create a client - client = datastream_v1.DatastreamClient() + client = datastream_v1.DatastreamAsyncClient() # Initialize request argument(s) request = datastream_v1.DeletePrivateConnectionRequest( @@ -2451,7 +2451,7 @@ def sample_delete_private_connection(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -2560,9 +2560,9 @@ async def create_route( from google.cloud import datastream_v1 - def sample_create_route(): + async def sample_create_route(): # Create a client - client = datastream_v1.DatastreamClient() + client = datastream_v1.DatastreamAsyncClient() # Initialize request argument(s) route = datastream_v1.Route() @@ -2580,7 +2580,7 @@ def sample_create_route(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -2690,9 +2690,9 @@ async def get_route( from google.cloud import datastream_v1 - def sample_get_route(): + async def sample_get_route(): # Create a client - client = datastream_v1.DatastreamClient() + client = datastream_v1.DatastreamAsyncClient() # Initialize request argument(s) request = datastream_v1.GetRouteRequest( @@ -2700,7 +2700,7 @@ def sample_get_route(): ) # Make the request - response = client.get_route(request=request) + response = await client.get_route(request=request) # Handle the response print(response) @@ -2787,9 +2787,9 @@ async def list_routes( from google.cloud import datastream_v1 - def sample_list_routes(): + async def sample_list_routes(): # Create a client - client = datastream_v1.DatastreamClient() + client = datastream_v1.DatastreamAsyncClient() # Initialize request argument(s) request = datastream_v1.ListRoutesRequest( @@ -2800,7 +2800,7 @@ def sample_list_routes(): page_result = client.list_routes(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -2893,9 +2893,9 @@ async def delete_route( from google.cloud import datastream_v1 - def sample_delete_route(): + async def sample_delete_route(): # Create a client - client = datastream_v1.DatastreamClient() + client = datastream_v1.DatastreamAsyncClient() # Initialize request argument(s) request = datastream_v1.DeleteRouteRequest( @@ -2907,7 +2907,7 @@ def sample_delete_route(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) diff --git a/google/cloud/datastream_v1alpha1/services/datastream/async_client.py b/google/cloud/datastream_v1alpha1/services/datastream/async_client.py index 4ba071a..6a5c270 100644 --- a/google/cloud/datastream_v1alpha1/services/datastream/async_client.py +++ b/google/cloud/datastream_v1alpha1/services/datastream/async_client.py @@ -229,9 +229,9 @@ async def list_connection_profiles( from google.cloud import datastream_v1alpha1 - def sample_list_connection_profiles(): + async def sample_list_connection_profiles(): # Create a client - client = datastream_v1alpha1.DatastreamClient() + client = datastream_v1alpha1.DatastreamAsyncClient() # Initialize request argument(s) request = datastream_v1alpha1.ListConnectionProfilesRequest( @@ -242,7 +242,7 @@ def sample_list_connection_profiles(): page_result = client.list_connection_profiles(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -335,9 +335,9 @@ async def get_connection_profile( from google.cloud import datastream_v1alpha1 - def sample_get_connection_profile(): + async def sample_get_connection_profile(): # Create a client - client = datastream_v1alpha1.DatastreamClient() + client = datastream_v1alpha1.DatastreamAsyncClient() # Initialize request argument(s) request = datastream_v1alpha1.GetConnectionProfileRequest( @@ -345,7 +345,7 @@ def sample_get_connection_profile(): ) # Make the request - response = client.get_connection_profile(request=request) + response = await client.get_connection_profile(request=request) # Handle the response print(response) @@ -430,9 +430,9 @@ async def create_connection_profile( from google.cloud import datastream_v1alpha1 - def sample_create_connection_profile(): + async def sample_create_connection_profile(): # Create a client - client = datastream_v1alpha1.DatastreamClient() + client = datastream_v1alpha1.DatastreamAsyncClient() # Initialize request argument(s) connection_profile = datastream_v1alpha1.ConnectionProfile() @@ -453,7 +453,7 @@ def sample_create_connection_profile(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -567,9 +567,9 @@ async def update_connection_profile( from google.cloud import datastream_v1alpha1 - def sample_update_connection_profile(): + async def sample_update_connection_profile(): # Create a client - client = datastream_v1alpha1.DatastreamClient() + client = datastream_v1alpha1.DatastreamAsyncClient() # Initialize request argument(s) connection_profile = datastream_v1alpha1.ConnectionProfile() @@ -588,7 +588,7 @@ def sample_update_connection_profile(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -698,9 +698,9 @@ async def delete_connection_profile( from google.cloud import datastream_v1alpha1 - def sample_delete_connection_profile(): + async def sample_delete_connection_profile(): # Create a client - client = datastream_v1alpha1.DatastreamClient() + client = datastream_v1alpha1.DatastreamAsyncClient() # Initialize request argument(s) request = datastream_v1alpha1.DeleteConnectionProfileRequest( @@ -712,7 +712,7 @@ def sample_delete_connection_profile(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -820,9 +820,9 @@ async def discover_connection_profile( from google.cloud import datastream_v1alpha1 - def sample_discover_connection_profile(): + async def sample_discover_connection_profile(): # Create a client - client = datastream_v1alpha1.DatastreamClient() + client = datastream_v1alpha1.DatastreamAsyncClient() # Initialize request argument(s) connection_profile = datastream_v1alpha1.ConnectionProfile() @@ -839,7 +839,7 @@ def sample_discover_connection_profile(): ) # Make the request - response = client.discover_connection_profile(request=request) + response = await client.discover_connection_profile(request=request) # Handle the response print(response) @@ -902,9 +902,9 @@ async def list_streams( from google.cloud import datastream_v1alpha1 - def sample_list_streams(): + async def sample_list_streams(): # Create a client - client = datastream_v1alpha1.DatastreamClient() + client = datastream_v1alpha1.DatastreamAsyncClient() # Initialize request argument(s) request = datastream_v1alpha1.ListStreamsRequest( @@ -915,7 +915,7 @@ def sample_list_streams(): page_result = client.list_streams(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -1007,9 +1007,9 @@ async def get_stream( from google.cloud import datastream_v1alpha1 - def sample_get_stream(): + async def sample_get_stream(): # Create a client - client = datastream_v1alpha1.DatastreamClient() + client = datastream_v1alpha1.DatastreamAsyncClient() # Initialize request argument(s) request = datastream_v1alpha1.GetStreamRequest( @@ -1017,7 +1017,7 @@ def sample_get_stream(): ) # Make the request - response = client.get_stream(request=request) + response = await client.get_stream(request=request) # Handle the response print(response) @@ -1101,9 +1101,9 @@ async def create_stream( from google.cloud import datastream_v1alpha1 - def sample_create_stream(): + async def sample_create_stream(): # Create a client - client = datastream_v1alpha1.DatastreamClient() + client = datastream_v1alpha1.DatastreamAsyncClient() # Initialize request argument(s) stream = datastream_v1alpha1.Stream() @@ -1122,7 +1122,7 @@ def sample_create_stream(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -1234,9 +1234,9 @@ async def update_stream( from google.cloud import datastream_v1alpha1 - def sample_update_stream(): + async def sample_update_stream(): # Create a client - client = datastream_v1alpha1.DatastreamClient() + client = datastream_v1alpha1.DatastreamAsyncClient() # Initialize request argument(s) stream = datastream_v1alpha1.Stream() @@ -1253,7 +1253,7 @@ def sample_update_stream(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -1362,9 +1362,9 @@ async def delete_stream( from google.cloud import datastream_v1alpha1 - def sample_delete_stream(): + async def sample_delete_stream(): # Create a client - client = datastream_v1alpha1.DatastreamClient() + client = datastream_v1alpha1.DatastreamAsyncClient() # Initialize request argument(s) request = datastream_v1alpha1.DeleteStreamRequest( @@ -1376,7 +1376,7 @@ def sample_delete_stream(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -1481,9 +1481,9 @@ async def fetch_errors( from google.cloud import datastream_v1alpha1 - def sample_fetch_errors(): + async def sample_fetch_errors(): # Create a client - client = datastream_v1alpha1.DatastreamClient() + client = datastream_v1alpha1.DatastreamAsyncClient() # Initialize request argument(s) request = datastream_v1alpha1.FetchErrorsRequest( @@ -1494,7 +1494,7 @@ def sample_fetch_errors(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -1572,9 +1572,9 @@ async def fetch_static_ips( from google.cloud import datastream_v1alpha1 - def sample_fetch_static_ips(): + async def sample_fetch_static_ips(): # Create a client - client = datastream_v1alpha1.DatastreamClient() + client = datastream_v1alpha1.DatastreamAsyncClient() # Initialize request argument(s) request = datastream_v1alpha1.FetchStaticIpsRequest( @@ -1585,7 +1585,7 @@ def sample_fetch_static_ips(): page_result = client.fetch_static_ips(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -1683,9 +1683,9 @@ async def create_private_connection( from google.cloud import datastream_v1alpha1 - def sample_create_private_connection(): + async def sample_create_private_connection(): # Create a client - client = datastream_v1alpha1.DatastreamClient() + client = datastream_v1alpha1.DatastreamAsyncClient() # Initialize request argument(s) private_connection = datastream_v1alpha1.PrivateConnection() @@ -1702,7 +1702,7 @@ def sample_create_private_connection(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -1815,9 +1815,9 @@ async def get_private_connection( from google.cloud import datastream_v1alpha1 - def sample_get_private_connection(): + async def sample_get_private_connection(): # Create a client - client = datastream_v1alpha1.DatastreamClient() + client = datastream_v1alpha1.DatastreamAsyncClient() # Initialize request argument(s) request = datastream_v1alpha1.GetPrivateConnectionRequest( @@ -1825,7 +1825,7 @@ def sample_get_private_connection(): ) # Make the request - response = client.get_private_connection(request=request) + response = await client.get_private_connection(request=request) # Handle the response print(response) @@ -1912,9 +1912,9 @@ async def list_private_connections( from google.cloud import datastream_v1alpha1 - def sample_list_private_connections(): + async def sample_list_private_connections(): # Create a client - client = datastream_v1alpha1.DatastreamClient() + client = datastream_v1alpha1.DatastreamAsyncClient() # Initialize request argument(s) request = datastream_v1alpha1.ListPrivateConnectionsRequest( @@ -1925,7 +1925,7 @@ def sample_list_private_connections(): page_result = client.list_private_connections(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -2019,9 +2019,9 @@ async def delete_private_connection( from google.cloud import datastream_v1alpha1 - def sample_delete_private_connection(): + async def sample_delete_private_connection(): # Create a client - client = datastream_v1alpha1.DatastreamClient() + client = datastream_v1alpha1.DatastreamAsyncClient() # Initialize request argument(s) request = datastream_v1alpha1.DeletePrivateConnectionRequest( @@ -2033,7 +2033,7 @@ def sample_delete_private_connection(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -2141,9 +2141,9 @@ async def create_route( from google.cloud import datastream_v1alpha1 - def sample_create_route(): + async def sample_create_route(): # Create a client - client = datastream_v1alpha1.DatastreamClient() + client = datastream_v1alpha1.DatastreamAsyncClient() # Initialize request argument(s) route = datastream_v1alpha1.Route() @@ -2161,7 +2161,7 @@ def sample_create_route(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -2272,9 +2272,9 @@ async def get_route( from google.cloud import datastream_v1alpha1 - def sample_get_route(): + async def sample_get_route(): # Create a client - client = datastream_v1alpha1.DatastreamClient() + client = datastream_v1alpha1.DatastreamAsyncClient() # Initialize request argument(s) request = datastream_v1alpha1.GetRouteRequest( @@ -2282,7 +2282,7 @@ def sample_get_route(): ) # Make the request - response = client.get_route(request=request) + response = await client.get_route(request=request) # Handle the response print(response) @@ -2369,9 +2369,9 @@ async def list_routes( from google.cloud import datastream_v1alpha1 - def sample_list_routes(): + async def sample_list_routes(): # Create a client - client = datastream_v1alpha1.DatastreamClient() + client = datastream_v1alpha1.DatastreamAsyncClient() # Initialize request argument(s) request = datastream_v1alpha1.ListRoutesRequest( @@ -2382,7 +2382,7 @@ def sample_list_routes(): page_result = client.list_routes(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -2475,9 +2475,9 @@ async def delete_route( from google.cloud import datastream_v1alpha1 - def sample_delete_route(): + async def sample_delete_route(): # Create a client - client = datastream_v1alpha1.DatastreamClient() + client = datastream_v1alpha1.DatastreamAsyncClient() # Initialize request argument(s) request = datastream_v1alpha1.DeleteRouteRequest( @@ -2489,7 +2489,7 @@ def sample_delete_route(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) diff --git a/tests/unit/gapic/datastream_v1/test_datastream.py b/tests/unit/gapic/datastream_v1/test_datastream.py index 969534c..09e4ffb 100644 --- a/tests/unit/gapic/datastream_v1/test_datastream.py +++ b/tests/unit/gapic/datastream_v1/test_datastream.py @@ -742,7 +742,7 @@ def test_list_connection_profiles_field_headers(): # a field header. Set these to a non-empty value. request = datastream.ListConnectionProfilesRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -760,7 +760,7 @@ def test_list_connection_profiles_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -774,7 +774,7 @@ async def test_list_connection_profiles_field_headers_async(): # a field header. Set these to a non-empty value. request = datastream.ListConnectionProfilesRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -794,7 +794,7 @@ async def test_list_connection_profiles_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -931,7 +931,7 @@ def test_list_connection_profiles_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all( isinstance(i, datastream_resources.ConnectionProfile) for i in results @@ -1196,7 +1196,7 @@ def test_get_connection_profile_field_headers(): # a field header. Set these to a non-empty value. request = datastream.GetConnectionProfileRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1214,7 +1214,7 @@ def test_get_connection_profile_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1228,7 +1228,7 @@ async def test_get_connection_profile_field_headers_async(): # a field header. Set these to a non-empty value. request = datastream.GetConnectionProfileRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1248,7 +1248,7 @@ async def test_get_connection_profile_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1437,7 +1437,7 @@ def test_create_connection_profile_field_headers(): # a field header. Set these to a non-empty value. request = datastream.CreateConnectionProfileRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1455,7 +1455,7 @@ def test_create_connection_profile_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1469,7 +1469,7 @@ async def test_create_connection_profile_field_headers_async(): # a field header. Set these to a non-empty value. request = datastream.CreateConnectionProfileRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1489,7 +1489,7 @@ async def test_create_connection_profile_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1706,7 +1706,7 @@ def test_update_connection_profile_field_headers(): # a field header. Set these to a non-empty value. request = datastream.UpdateConnectionProfileRequest() - request.connection_profile.name = "connection_profile.name/value" + request.connection_profile.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1724,7 +1724,7 @@ def test_update_connection_profile_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "connection_profile.name=connection_profile.name/value", + "connection_profile.name=name_value", ) in kw["metadata"] @@ -1738,7 +1738,7 @@ async def test_update_connection_profile_field_headers_async(): # a field header. Set these to a non-empty value. request = datastream.UpdateConnectionProfileRequest() - request.connection_profile.name = "connection_profile.name/value" + request.connection_profile.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1758,7 +1758,7 @@ async def test_update_connection_profile_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "connection_profile.name=connection_profile.name/value", + "connection_profile.name=name_value", ) in kw["metadata"] @@ -1965,7 +1965,7 @@ def test_delete_connection_profile_field_headers(): # a field header. Set these to a non-empty value. request = datastream.DeleteConnectionProfileRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1983,7 +1983,7 @@ def test_delete_connection_profile_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1997,7 +1997,7 @@ async def test_delete_connection_profile_field_headers_async(): # a field header. Set these to a non-empty value. request = datastream.DeleteConnectionProfileRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2017,7 +2017,7 @@ async def test_delete_connection_profile_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2212,7 +2212,7 @@ def test_discover_connection_profile_field_headers(): # a field header. Set these to a non-empty value. request = datastream.DiscoverConnectionProfileRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2230,7 +2230,7 @@ def test_discover_connection_profile_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -2244,7 +2244,7 @@ async def test_discover_connection_profile_field_headers_async(): # a field header. Set these to a non-empty value. request = datastream.DiscoverConnectionProfileRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2264,7 +2264,7 @@ async def test_discover_connection_profile_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -2370,7 +2370,7 @@ def test_list_streams_field_headers(): # a field header. Set these to a non-empty value. request = datastream.ListStreamsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_streams), "__call__") as call: @@ -2386,7 +2386,7 @@ def test_list_streams_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -2400,7 +2400,7 @@ async def test_list_streams_field_headers_async(): # a field header. Set these to a non-empty value. request = datastream.ListStreamsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_streams), "__call__") as call: @@ -2418,7 +2418,7 @@ async def test_list_streams_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -2549,7 +2549,7 @@ def test_list_streams_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all(isinstance(i, datastream_resources.Stream) for i in results) @@ -2815,7 +2815,7 @@ def test_get_stream_field_headers(): # a field header. Set these to a non-empty value. request = datastream.GetStreamRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_stream), "__call__") as call: @@ -2831,7 +2831,7 @@ def test_get_stream_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2845,7 +2845,7 @@ async def test_get_stream_field_headers_async(): # a field header. Set these to a non-empty value. request = datastream.GetStreamRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_stream), "__call__") as call: @@ -2863,7 +2863,7 @@ async def test_get_stream_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -3041,7 +3041,7 @@ def test_create_stream_field_headers(): # a field header. Set these to a non-empty value. request = datastream.CreateStreamRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_stream), "__call__") as call: @@ -3057,7 +3057,7 @@ def test_create_stream_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -3071,7 +3071,7 @@ async def test_create_stream_field_headers_async(): # a field header. Set these to a non-empty value. request = datastream.CreateStreamRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_stream), "__call__") as call: @@ -3089,7 +3089,7 @@ async def test_create_stream_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -3287,7 +3287,7 @@ def test_update_stream_field_headers(): # a field header. Set these to a non-empty value. request = datastream.UpdateStreamRequest() - request.stream.name = "stream.name/value" + request.stream.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_stream), "__call__") as call: @@ -3303,7 +3303,7 @@ def test_update_stream_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "stream.name=stream.name/value", + "stream.name=name_value", ) in kw["metadata"] @@ -3317,7 +3317,7 @@ async def test_update_stream_field_headers_async(): # a field header. Set these to a non-empty value. request = datastream.UpdateStreamRequest() - request.stream.name = "stream.name/value" + request.stream.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_stream), "__call__") as call: @@ -3335,7 +3335,7 @@ async def test_update_stream_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "stream.name=stream.name/value", + "stream.name=name_value", ) in kw["metadata"] @@ -3523,7 +3523,7 @@ def test_delete_stream_field_headers(): # a field header. Set these to a non-empty value. request = datastream.DeleteStreamRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_stream), "__call__") as call: @@ -3539,7 +3539,7 @@ def test_delete_stream_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -3553,7 +3553,7 @@ async def test_delete_stream_field_headers_async(): # a field header. Set these to a non-empty value. request = datastream.DeleteStreamRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_stream), "__call__") as call: @@ -3571,7 +3571,7 @@ async def test_delete_stream_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -3765,7 +3765,7 @@ def test_get_stream_object_field_headers(): # a field header. Set these to a non-empty value. request = datastream.GetStreamObjectRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3783,7 +3783,7 @@ def test_get_stream_object_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -3797,7 +3797,7 @@ async def test_get_stream_object_field_headers_async(): # a field header. Set these to a non-empty value. request = datastream.GetStreamObjectRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3817,7 +3817,7 @@ async def test_get_stream_object_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -4015,7 +4015,7 @@ def test_lookup_stream_object_field_headers(): # a field header. Set these to a non-empty value. request = datastream.LookupStreamObjectRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4033,7 +4033,7 @@ def test_lookup_stream_object_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -4047,7 +4047,7 @@ async def test_lookup_stream_object_field_headers_async(): # a field header. Set these to a non-empty value. request = datastream.LookupStreamObjectRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4067,7 +4067,7 @@ async def test_lookup_stream_object_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -4175,7 +4175,7 @@ def test_list_stream_objects_field_headers(): # a field header. Set these to a non-empty value. request = datastream.ListStreamObjectsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4193,7 +4193,7 @@ def test_list_stream_objects_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -4207,7 +4207,7 @@ async def test_list_stream_objects_field_headers_async(): # a field header. Set these to a non-empty value. request = datastream.ListStreamObjectsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4227,7 +4227,7 @@ async def test_list_stream_objects_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -4364,7 +4364,7 @@ def test_list_stream_objects_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all(isinstance(i, datastream_resources.StreamObject) for i in results) @@ -4611,7 +4611,7 @@ def test_start_backfill_job_field_headers(): # a field header. Set these to a non-empty value. request = datastream.StartBackfillJobRequest() - request.object_ = "object/value" + request.object_ = "object__value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4629,7 +4629,7 @@ def test_start_backfill_job_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "object=object/value", + "object=object__value", ) in kw["metadata"] @@ -4643,7 +4643,7 @@ async def test_start_backfill_job_field_headers_async(): # a field header. Set these to a non-empty value. request = datastream.StartBackfillJobRequest() - request.object_ = "object/value" + request.object_ = "object__value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4663,7 +4663,7 @@ async def test_start_backfill_job_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "object=object/value", + "object=object__value", ) in kw["metadata"] @@ -4851,7 +4851,7 @@ def test_stop_backfill_job_field_headers(): # a field header. Set these to a non-empty value. request = datastream.StopBackfillJobRequest() - request.object_ = "object/value" + request.object_ = "object__value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4869,7 +4869,7 @@ def test_stop_backfill_job_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "object=object/value", + "object=object__value", ) in kw["metadata"] @@ -4883,7 +4883,7 @@ async def test_stop_backfill_job_field_headers_async(): # a field header. Set these to a non-empty value. request = datastream.StopBackfillJobRequest() - request.object_ = "object/value" + request.object_ = "object__value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4903,7 +4903,7 @@ async def test_stop_backfill_job_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "object=object/value", + "object=object__value", ) in kw["metadata"] @@ -5095,7 +5095,7 @@ def test_fetch_static_ips_field_headers(): # a field header. Set these to a non-empty value. request = datastream.FetchStaticIpsRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.fetch_static_ips), "__call__") as call: @@ -5111,7 +5111,7 @@ def test_fetch_static_ips_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -5125,7 +5125,7 @@ async def test_fetch_static_ips_field_headers_async(): # a field header. Set these to a non-empty value. request = datastream.FetchStaticIpsRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.fetch_static_ips), "__call__") as call: @@ -5143,7 +5143,7 @@ async def test_fetch_static_ips_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -5274,7 +5274,7 @@ def test_fetch_static_ips_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all(isinstance(i, str) for i in results) @@ -5516,7 +5516,7 @@ def test_create_private_connection_field_headers(): # a field header. Set these to a non-empty value. request = datastream.CreatePrivateConnectionRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5534,7 +5534,7 @@ def test_create_private_connection_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -5548,7 +5548,7 @@ async def test_create_private_connection_field_headers_async(): # a field header. Set these to a non-empty value. request = datastream.CreatePrivateConnectionRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5568,7 +5568,7 @@ async def test_create_private_connection_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -5798,7 +5798,7 @@ def test_get_private_connection_field_headers(): # a field header. Set these to a non-empty value. request = datastream.GetPrivateConnectionRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5816,7 +5816,7 @@ def test_get_private_connection_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -5830,7 +5830,7 @@ async def test_get_private_connection_field_headers_async(): # a field header. Set these to a non-empty value. request = datastream.GetPrivateConnectionRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5850,7 +5850,7 @@ async def test_get_private_connection_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -6049,7 +6049,7 @@ def test_list_private_connections_field_headers(): # a field header. Set these to a non-empty value. request = datastream.ListPrivateConnectionsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -6067,7 +6067,7 @@ def test_list_private_connections_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -6081,7 +6081,7 @@ async def test_list_private_connections_field_headers_async(): # a field header. Set these to a non-empty value. request = datastream.ListPrivateConnectionsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -6101,7 +6101,7 @@ async def test_list_private_connections_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -6238,7 +6238,7 @@ def test_list_private_connections_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all( isinstance(i, datastream_resources.PrivateConnection) for i in results @@ -6490,7 +6490,7 @@ def test_delete_private_connection_field_headers(): # a field header. Set these to a non-empty value. request = datastream.DeletePrivateConnectionRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -6508,7 +6508,7 @@ def test_delete_private_connection_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -6522,7 +6522,7 @@ async def test_delete_private_connection_field_headers_async(): # a field header. Set these to a non-empty value. request = datastream.DeletePrivateConnectionRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -6542,7 +6542,7 @@ async def test_delete_private_connection_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -6724,7 +6724,7 @@ def test_create_route_field_headers(): # a field header. Set these to a non-empty value. request = datastream.CreateRouteRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_route), "__call__") as call: @@ -6740,7 +6740,7 @@ def test_create_route_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -6754,7 +6754,7 @@ async def test_create_route_field_headers_async(): # a field header. Set these to a non-empty value. request = datastream.CreateRouteRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_route), "__call__") as call: @@ -6772,7 +6772,7 @@ async def test_create_route_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -6988,7 +6988,7 @@ def test_get_route_field_headers(): # a field header. Set these to a non-empty value. request = datastream.GetRouteRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_route), "__call__") as call: @@ -7004,7 +7004,7 @@ def test_get_route_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -7018,7 +7018,7 @@ async def test_get_route_field_headers_async(): # a field header. Set these to a non-empty value. request = datastream.GetRouteRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_route), "__call__") as call: @@ -7036,7 +7036,7 @@ async def test_get_route_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -7224,7 +7224,7 @@ def test_list_routes_field_headers(): # a field header. Set these to a non-empty value. request = datastream.ListRoutesRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_routes), "__call__") as call: @@ -7240,7 +7240,7 @@ def test_list_routes_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -7254,7 +7254,7 @@ async def test_list_routes_field_headers_async(): # a field header. Set these to a non-empty value. request = datastream.ListRoutesRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_routes), "__call__") as call: @@ -7272,7 +7272,7 @@ async def test_list_routes_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -7403,7 +7403,7 @@ def test_list_routes_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all(isinstance(i, datastream_resources.Route) for i in results) @@ -7638,7 +7638,7 @@ def test_delete_route_field_headers(): # a field header. Set these to a non-empty value. request = datastream.DeleteRouteRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_route), "__call__") as call: @@ -7654,7 +7654,7 @@ def test_delete_route_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -7668,7 +7668,7 @@ async def test_delete_route_field_headers_async(): # a field header. Set these to a non-empty value. request = datastream.DeleteRouteRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_route), "__call__") as call: @@ -7686,7 +7686,7 @@ async def test_delete_route_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] diff --git a/tests/unit/gapic/datastream_v1alpha1/test_datastream.py b/tests/unit/gapic/datastream_v1alpha1/test_datastream.py index 00bde0d..4916f2b 100644 --- a/tests/unit/gapic/datastream_v1alpha1/test_datastream.py +++ b/tests/unit/gapic/datastream_v1alpha1/test_datastream.py @@ -742,7 +742,7 @@ def test_list_connection_profiles_field_headers(): # a field header. Set these to a non-empty value. request = datastream.ListConnectionProfilesRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -760,7 +760,7 @@ def test_list_connection_profiles_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -774,7 +774,7 @@ async def test_list_connection_profiles_field_headers_async(): # a field header. Set these to a non-empty value. request = datastream.ListConnectionProfilesRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -794,7 +794,7 @@ async def test_list_connection_profiles_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -931,7 +931,7 @@ def test_list_connection_profiles_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all( isinstance(i, datastream_resources.ConnectionProfile) for i in results @@ -1196,7 +1196,7 @@ def test_get_connection_profile_field_headers(): # a field header. Set these to a non-empty value. request = datastream.GetConnectionProfileRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1214,7 +1214,7 @@ def test_get_connection_profile_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1228,7 +1228,7 @@ async def test_get_connection_profile_field_headers_async(): # a field header. Set these to a non-empty value. request = datastream.GetConnectionProfileRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1248,7 +1248,7 @@ async def test_get_connection_profile_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1437,7 +1437,7 @@ def test_create_connection_profile_field_headers(): # a field header. Set these to a non-empty value. request = datastream.CreateConnectionProfileRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1455,7 +1455,7 @@ def test_create_connection_profile_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1469,7 +1469,7 @@ async def test_create_connection_profile_field_headers_async(): # a field header. Set these to a non-empty value. request = datastream.CreateConnectionProfileRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1489,7 +1489,7 @@ async def test_create_connection_profile_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1706,7 +1706,7 @@ def test_update_connection_profile_field_headers(): # a field header. Set these to a non-empty value. request = datastream.UpdateConnectionProfileRequest() - request.connection_profile.name = "connection_profile.name/value" + request.connection_profile.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1724,7 +1724,7 @@ def test_update_connection_profile_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "connection_profile.name=connection_profile.name/value", + "connection_profile.name=name_value", ) in kw["metadata"] @@ -1738,7 +1738,7 @@ async def test_update_connection_profile_field_headers_async(): # a field header. Set these to a non-empty value. request = datastream.UpdateConnectionProfileRequest() - request.connection_profile.name = "connection_profile.name/value" + request.connection_profile.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1758,7 +1758,7 @@ async def test_update_connection_profile_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "connection_profile.name=connection_profile.name/value", + "connection_profile.name=name_value", ) in kw["metadata"] @@ -1965,7 +1965,7 @@ def test_delete_connection_profile_field_headers(): # a field header. Set these to a non-empty value. request = datastream.DeleteConnectionProfileRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1983,7 +1983,7 @@ def test_delete_connection_profile_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1997,7 +1997,7 @@ async def test_delete_connection_profile_field_headers_async(): # a field header. Set these to a non-empty value. request = datastream.DeleteConnectionProfileRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2017,7 +2017,7 @@ async def test_delete_connection_profile_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2212,7 +2212,7 @@ def test_discover_connection_profile_field_headers(): # a field header. Set these to a non-empty value. request = datastream.DiscoverConnectionProfileRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2230,7 +2230,7 @@ def test_discover_connection_profile_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -2244,7 +2244,7 @@ async def test_discover_connection_profile_field_headers_async(): # a field header. Set these to a non-empty value. request = datastream.DiscoverConnectionProfileRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2264,7 +2264,7 @@ async def test_discover_connection_profile_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -2370,7 +2370,7 @@ def test_list_streams_field_headers(): # a field header. Set these to a non-empty value. request = datastream.ListStreamsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_streams), "__call__") as call: @@ -2386,7 +2386,7 @@ def test_list_streams_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -2400,7 +2400,7 @@ async def test_list_streams_field_headers_async(): # a field header. Set these to a non-empty value. request = datastream.ListStreamsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_streams), "__call__") as call: @@ -2418,7 +2418,7 @@ async def test_list_streams_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -2549,7 +2549,7 @@ def test_list_streams_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all(isinstance(i, datastream_resources.Stream) for i in results) @@ -2807,7 +2807,7 @@ def test_get_stream_field_headers(): # a field header. Set these to a non-empty value. request = datastream.GetStreamRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_stream), "__call__") as call: @@ -2823,7 +2823,7 @@ def test_get_stream_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2837,7 +2837,7 @@ async def test_get_stream_field_headers_async(): # a field header. Set these to a non-empty value. request = datastream.GetStreamRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_stream), "__call__") as call: @@ -2855,7 +2855,7 @@ async def test_get_stream_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -3033,7 +3033,7 @@ def test_create_stream_field_headers(): # a field header. Set these to a non-empty value. request = datastream.CreateStreamRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_stream), "__call__") as call: @@ -3049,7 +3049,7 @@ def test_create_stream_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -3063,7 +3063,7 @@ async def test_create_stream_field_headers_async(): # a field header. Set these to a non-empty value. request = datastream.CreateStreamRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_stream), "__call__") as call: @@ -3081,7 +3081,7 @@ async def test_create_stream_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -3279,7 +3279,7 @@ def test_update_stream_field_headers(): # a field header. Set these to a non-empty value. request = datastream.UpdateStreamRequest() - request.stream.name = "stream.name/value" + request.stream.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_stream), "__call__") as call: @@ -3295,7 +3295,7 @@ def test_update_stream_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "stream.name=stream.name/value", + "stream.name=name_value", ) in kw["metadata"] @@ -3309,7 +3309,7 @@ async def test_update_stream_field_headers_async(): # a field header. Set these to a non-empty value. request = datastream.UpdateStreamRequest() - request.stream.name = "stream.name/value" + request.stream.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_stream), "__call__") as call: @@ -3327,7 +3327,7 @@ async def test_update_stream_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "stream.name=stream.name/value", + "stream.name=name_value", ) in kw["metadata"] @@ -3515,7 +3515,7 @@ def test_delete_stream_field_headers(): # a field header. Set these to a non-empty value. request = datastream.DeleteStreamRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_stream), "__call__") as call: @@ -3531,7 +3531,7 @@ def test_delete_stream_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -3545,7 +3545,7 @@ async def test_delete_stream_field_headers_async(): # a field header. Set these to a non-empty value. request = datastream.DeleteStreamRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_stream), "__call__") as call: @@ -3563,7 +3563,7 @@ async def test_delete_stream_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -3741,7 +3741,7 @@ def test_fetch_errors_field_headers(): # a field header. Set these to a non-empty value. request = datastream.FetchErrorsRequest() - request.stream = "stream/value" + request.stream = "stream_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.fetch_errors), "__call__") as call: @@ -3757,7 +3757,7 @@ def test_fetch_errors_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "stream=stream/value", + "stream=stream_value", ) in kw["metadata"] @@ -3771,7 +3771,7 @@ async def test_fetch_errors_field_headers_async(): # a field header. Set these to a non-empty value. request = datastream.FetchErrorsRequest() - request.stream = "stream/value" + request.stream = "stream_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.fetch_errors), "__call__") as call: @@ -3789,7 +3789,7 @@ async def test_fetch_errors_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "stream=stream/value", + "stream=stream_value", ) in kw["metadata"] @@ -3895,7 +3895,7 @@ def test_fetch_static_ips_field_headers(): # a field header. Set these to a non-empty value. request = datastream.FetchStaticIpsRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.fetch_static_ips), "__call__") as call: @@ -3911,7 +3911,7 @@ def test_fetch_static_ips_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -3925,7 +3925,7 @@ async def test_fetch_static_ips_field_headers_async(): # a field header. Set these to a non-empty value. request = datastream.FetchStaticIpsRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.fetch_static_ips), "__call__") as call: @@ -3943,7 +3943,7 @@ async def test_fetch_static_ips_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -4074,7 +4074,7 @@ def test_fetch_static_ips_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all(isinstance(i, str) for i in results) @@ -4316,7 +4316,7 @@ def test_create_private_connection_field_headers(): # a field header. Set these to a non-empty value. request = datastream.CreatePrivateConnectionRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4334,7 +4334,7 @@ def test_create_private_connection_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -4348,7 +4348,7 @@ async def test_create_private_connection_field_headers_async(): # a field header. Set these to a non-empty value. request = datastream.CreatePrivateConnectionRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4368,7 +4368,7 @@ async def test_create_private_connection_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -4598,7 +4598,7 @@ def test_get_private_connection_field_headers(): # a field header. Set these to a non-empty value. request = datastream.GetPrivateConnectionRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4616,7 +4616,7 @@ def test_get_private_connection_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -4630,7 +4630,7 @@ async def test_get_private_connection_field_headers_async(): # a field header. Set these to a non-empty value. request = datastream.GetPrivateConnectionRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4650,7 +4650,7 @@ async def test_get_private_connection_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -4849,7 +4849,7 @@ def test_list_private_connections_field_headers(): # a field header. Set these to a non-empty value. request = datastream.ListPrivateConnectionsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4867,7 +4867,7 @@ def test_list_private_connections_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -4881,7 +4881,7 @@ async def test_list_private_connections_field_headers_async(): # a field header. Set these to a non-empty value. request = datastream.ListPrivateConnectionsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4901,7 +4901,7 @@ async def test_list_private_connections_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -5038,7 +5038,7 @@ def test_list_private_connections_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all( isinstance(i, datastream_resources.PrivateConnection) for i in results @@ -5290,7 +5290,7 @@ def test_delete_private_connection_field_headers(): # a field header. Set these to a non-empty value. request = datastream.DeletePrivateConnectionRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5308,7 +5308,7 @@ def test_delete_private_connection_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -5322,7 +5322,7 @@ async def test_delete_private_connection_field_headers_async(): # a field header. Set these to a non-empty value. request = datastream.DeletePrivateConnectionRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5342,7 +5342,7 @@ async def test_delete_private_connection_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -5524,7 +5524,7 @@ def test_create_route_field_headers(): # a field header. Set these to a non-empty value. request = datastream.CreateRouteRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_route), "__call__") as call: @@ -5540,7 +5540,7 @@ def test_create_route_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -5554,7 +5554,7 @@ async def test_create_route_field_headers_async(): # a field header. Set these to a non-empty value. request = datastream.CreateRouteRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_route), "__call__") as call: @@ -5572,7 +5572,7 @@ async def test_create_route_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -5788,7 +5788,7 @@ def test_get_route_field_headers(): # a field header. Set these to a non-empty value. request = datastream.GetRouteRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_route), "__call__") as call: @@ -5804,7 +5804,7 @@ def test_get_route_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -5818,7 +5818,7 @@ async def test_get_route_field_headers_async(): # a field header. Set these to a non-empty value. request = datastream.GetRouteRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_route), "__call__") as call: @@ -5836,7 +5836,7 @@ async def test_get_route_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -6024,7 +6024,7 @@ def test_list_routes_field_headers(): # a field header. Set these to a non-empty value. request = datastream.ListRoutesRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_routes), "__call__") as call: @@ -6040,7 +6040,7 @@ def test_list_routes_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -6054,7 +6054,7 @@ async def test_list_routes_field_headers_async(): # a field header. Set these to a non-empty value. request = datastream.ListRoutesRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_routes), "__call__") as call: @@ -6072,7 +6072,7 @@ async def test_list_routes_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -6203,7 +6203,7 @@ def test_list_routes_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all(isinstance(i, datastream_resources.Route) for i in results) @@ -6438,7 +6438,7 @@ def test_delete_route_field_headers(): # a field header. Set these to a non-empty value. request = datastream.DeleteRouteRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_route), "__call__") as call: @@ -6454,7 +6454,7 @@ def test_delete_route_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -6468,7 +6468,7 @@ async def test_delete_route_field_headers_async(): # a field header. Set these to a non-empty value. request = datastream.DeleteRouteRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_route), "__call__") as call: @@ -6486,7 +6486,7 @@ async def test_delete_route_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] From 1851ad8036aad29e037afcb1b166fa3786fc51eb Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 5 May 2022 12:12:21 -0400 Subject: [PATCH 13/15] chore: [autoapprove] update readme_gen.py to include autoescape True (#96) Source-Link: https://github.com/googleapis/synthtool/commit/6b4d5a6407d740beb4158b302194a62a4108a8a6 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:f792ee1320e03eda2d13a5281a2989f7ed8a9e50b73ef6da97fac7e1e850b149 Co-authored-by: Owl Bot --- .github/.OwlBot.lock.yaml | 4 ++-- scripts/readme-gen/readme_gen.py | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 64f82d6..b631901 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,5 +13,5 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest - digest: sha256:bc5eed3804aec2f05fad42aacf973821d9500c174015341f721a984a0825b6fd -# created: 2022-04-21T15:43:16.246106921Z + digest: sha256:f792ee1320e03eda2d13a5281a2989f7ed8a9e50b73ef6da97fac7e1e850b149 +# created: 2022-05-05T15:17:27.599381182Z diff --git a/scripts/readme-gen/readme_gen.py b/scripts/readme-gen/readme_gen.py index d309d6e..91b5967 100644 --- a/scripts/readme-gen/readme_gen.py +++ b/scripts/readme-gen/readme_gen.py @@ -28,7 +28,10 @@ jinja_env = jinja2.Environment( trim_blocks=True, loader=jinja2.FileSystemLoader( - os.path.abspath(os.path.join(os.path.dirname(__file__), 'templates')))) + os.path.abspath(os.path.join(os.path.dirname(__file__), "templates")) + ), + autoescape=True, +) README_TMPL = jinja_env.get_template('README.tmpl.rst') From b0cc7762d3df44adaf1ea573d9bb46bf51734d41 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 5 May 2022 20:03:41 -0400 Subject: [PATCH 14/15] chore(python): auto approve template changes (#98) Source-Link: https://github.com/googleapis/synthtool/commit/453a5d9c9a55d1969240a37d36cec626d20a9024 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:81ed5ecdfc7cac5b699ba4537376f3563f6f04122c4ec9e735d3b3dc1d43dd32 Co-authored-by: Owl Bot --- .github/.OwlBot.lock.yaml | 4 ++-- .github/auto-approve.yml | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 .github/auto-approve.yml diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index b631901..757c9dc 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,5 +13,5 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest - digest: sha256:f792ee1320e03eda2d13a5281a2989f7ed8a9e50b73ef6da97fac7e1e850b149 -# created: 2022-05-05T15:17:27.599381182Z + digest: sha256:81ed5ecdfc7cac5b699ba4537376f3563f6f04122c4ec9e735d3b3dc1d43dd32 +# created: 2022-05-05T22:08:23.383410683Z diff --git a/.github/auto-approve.yml b/.github/auto-approve.yml new file mode 100644 index 0000000..311ebbb --- /dev/null +++ b/.github/auto-approve.yml @@ -0,0 +1,3 @@ +# https://github.com/googleapis/repo-automation-bots/tree/main/packages/auto-approve +processes: + - "OwlBotTemplateChanges" From 3150957c1d524730c8eb941d2527df9ef04b954c Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 19 May 2022 08:45:07 -0400 Subject: [PATCH 15/15] chore(main): release 1.0.1 (#90) 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 1f4b5c1..e79f8ab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +### [1.0.1](https://github.com/googleapis/python-datastream/compare/v1.0.0...v1.0.1) (2022-05-06) + + +### Documentation + +* fix type in docstring for map fields ([cb7249d](https://github.com/googleapis/python-datastream/commit/cb7249d165c28d6c4005313759282ce4f78966c8)) + ## [1.0.0](https://github.com/googleapis/python-datastream/compare/v0.4.2...v1.0.0) (2022-03-15) diff --git a/setup.py b/setup.py index 9d2d0b3..b369ee5 100644 --- a/setup.py +++ b/setup.py @@ -21,7 +21,7 @@ name = "google-cloud-datastream" description = "Datastream client library" -version = "1.0.0" +version = "1.0.1" release_status = "Development Status :: 5 - Production/Stable" url = "https://github.com/googleapis/python-datastream" dependencies = [