diff --git a/packages/google-cloud-datastream/.github/.OwlBot.lock.yaml b/packages/google-cloud-datastream/.github/.OwlBot.lock.yaml index 88076277a251..87dd00611576 100644 --- a/packages/google-cloud-datastream/.github/.OwlBot.lock.yaml +++ b/packages/google-cloud-datastream/.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/packages/google-cloud-datastream/docs/conf.py b/packages/google-cloud-datastream/docs/conf.py index 17393f025590..2654f0d37aa3 100644 --- a/packages/google-cloud-datastream/docs/conf.py +++ b/packages/google-cloud-datastream/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/packages/google-cloud-datastream/google/cloud/datastream_v1/services/datastream/async_client.py b/packages/google-cloud-datastream/google/cloud/datastream_v1/services/datastream/async_client.py index c098b9b5fafd..f7e91f39d77e 100644 --- a/packages/google-cloud-datastream/google/cloud/datastream_v1/services/datastream/async_client.py +++ b/packages/google-cloud-datastream/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/packages/google-cloud-datastream/google/cloud/datastream_v1/services/datastream/client.py b/packages/google-cloud-datastream/google/cloud/datastream_v1/services/datastream/client.py index 3ab4e1998276..8bab25af28fd 100644 --- a/packages/google-cloud-datastream/google/cloud/datastream_v1/services/datastream/client.py +++ b/packages/google-cloud-datastream/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/packages/google-cloud-datastream/google/cloud/datastream_v1/services/datastream/transports/base.py b/packages/google-cloud-datastream/google/cloud/datastream_v1/services/datastream/transports/base.py index 6be6f2670d9b..8034d6236e0e 100644 --- a/packages/google-cloud-datastream/google/cloud/datastream_v1/services/datastream/transports/base.py +++ b/packages/google-cloud-datastream/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/packages/google-cloud-datastream/google/cloud/datastream_v1/services/datastream/transports/grpc.py b/packages/google-cloud-datastream/google/cloud/datastream_v1/services/datastream/transports/grpc.py index e9b279d6ed03..58201b466de8 100644 --- a/packages/google-cloud-datastream/google/cloud/datastream_v1/services/datastream/transports/grpc.py +++ b/packages/google-cloud-datastream/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/packages/google-cloud-datastream/google/cloud/datastream_v1/types/datastream.py b/packages/google-cloud-datastream/google/cloud/datastream_v1/types/datastream.py index 1e57cc0f6baa..27db13019532 100644 --- a/packages/google-cloud-datastream/google/cloud/datastream_v1/types/datastream.py +++ b/packages/google-cloud-datastream/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/packages/google-cloud-datastream/google/cloud/datastream_v1/types/datastream_resources.py b/packages/google-cloud-datastream/google/cloud/datastream_v1/types/datastream_resources.py index 71eab252f820..4d175797c943 100644 --- a/packages/google-cloud-datastream/google/cloud/datastream_v1/types/datastream_resources.py +++ b/packages/google-cloud-datastream/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/packages/google-cloud-datastream/google/cloud/datastream_v1alpha1/services/datastream/async_client.py b/packages/google-cloud-datastream/google/cloud/datastream_v1alpha1/services/datastream/async_client.py index e9e829cbb1cf..870277c7ce04 100644 --- a/packages/google-cloud-datastream/google/cloud/datastream_v1alpha1/services/datastream/async_client.py +++ b/packages/google-cloud-datastream/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/packages/google-cloud-datastream/google/cloud/datastream_v1alpha1/services/datastream/client.py b/packages/google-cloud-datastream/google/cloud/datastream_v1alpha1/services/datastream/client.py index 09df96388e65..a042a5d5ad23 100644 --- a/packages/google-cloud-datastream/google/cloud/datastream_v1alpha1/services/datastream/client.py +++ b/packages/google-cloud-datastream/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/packages/google-cloud-datastream/google/cloud/datastream_v1alpha1/services/datastream/transports/base.py b/packages/google-cloud-datastream/google/cloud/datastream_v1alpha1/services/datastream/transports/base.py index 37457e4fcca0..08831d3b4058 100644 --- a/packages/google-cloud-datastream/google/cloud/datastream_v1alpha1/services/datastream/transports/base.py +++ b/packages/google-cloud-datastream/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/packages/google-cloud-datastream/google/cloud/datastream_v1alpha1/services/datastream/transports/grpc.py b/packages/google-cloud-datastream/google/cloud/datastream_v1alpha1/services/datastream/transports/grpc.py index 6bfd1307742e..4348b5906a95 100644 --- a/packages/google-cloud-datastream/google/cloud/datastream_v1alpha1/services/datastream/transports/grpc.py +++ b/packages/google-cloud-datastream/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/packages/google-cloud-datastream/google/cloud/datastream_v1alpha1/types/datastream.py b/packages/google-cloud-datastream/google/cloud/datastream_v1alpha1/types/datastream.py index 327eb7463a3d..24348c742bc9 100644 --- a/packages/google-cloud-datastream/google/cloud/datastream_v1alpha1/types/datastream.py +++ b/packages/google-cloud-datastream/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/packages/google-cloud-datastream/google/cloud/datastream_v1alpha1/types/datastream_resources.py b/packages/google-cloud-datastream/google/cloud/datastream_v1alpha1/types/datastream_resources.py index b6c2f08f405b..1e0ab45a1eec 100644 --- a/packages/google-cloud-datastream/google/cloud/datastream_v1alpha1/types/datastream_resources.py +++ b/packages/google-cloud-datastream/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/packages/google-cloud-datastream/noxfile.py b/packages/google-cloud-datastream/noxfile.py index 2a2001c49998..3addb4ed9431 100644 --- a/packages/google-cloud-datastream/noxfile.py +++ b/packages/google-cloud-datastream/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/packages/google-cloud-datastream/tests/unit/gapic/datastream_v1/test_datastream.py b/packages/google-cloud-datastream/tests/unit/gapic/datastream_v1/test_datastream.py index ce7fc66bf7c9..5e1e7fdc8d7a 100644 --- a/packages/google-cloud-datastream/tests/unit/gapic/datastream_v1/test_datastream.py +++ b/packages/google-cloud-datastream/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/packages/google-cloud-datastream/tests/unit/gapic/datastream_v1alpha1/test_datastream.py b/packages/google-cloud-datastream/tests/unit/gapic/datastream_v1alpha1/test_datastream.py index e714883c18f2..7c0789e9ea82 100644 --- a/packages/google-cloud-datastream/tests/unit/gapic/datastream_v1alpha1/test_datastream.py +++ b/packages/google-cloud-datastream/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"