diff --git a/packages/google-cloud-apigee-connect/google/cloud/apigeeconnect_v1/services/connection_service/async_client.py b/packages/google-cloud-apigee-connect/google/cloud/apigeeconnect_v1/services/connection_service/async_client.py index 3bbfcac07cf4..dd9fb1703ebf 100644 --- a/packages/google-cloud-apigee-connect/google/cloud/apigeeconnect_v1/services/connection_service/async_client.py +++ b/packages/google-cloud-apigee-connect/google/cloud/apigeeconnect_v1/services/connection_service/async_client.py @@ -216,6 +216,25 @@ async def list_connections( r"""Lists connections that are currently active for the given Apigee Connect endpoint. + + .. code-block:: + + from google.cloud import apigeeconnect_v1 + + def sample_list_connections(): + # Create a client + client = apigeeconnect_v1.ConnectionServiceClient() + + # Initialize request argument(s) + request = apigeeconnect_v1.ListConnectionsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_connections(request=request) + for response in page_result: + print(response) + Args: request (Union[google.cloud.apigeeconnect_v1.types.ListConnectionsRequest, dict]): The request object. The request for diff --git a/packages/google-cloud-apigee-connect/google/cloud/apigeeconnect_v1/services/connection_service/client.py b/packages/google-cloud-apigee-connect/google/cloud/apigeeconnect_v1/services/connection_service/client.py index dd798db71ca3..419182f86544 100644 --- a/packages/google-cloud-apigee-connect/google/cloud/apigeeconnect_v1/services/connection_service/client.py +++ b/packages/google-cloud-apigee-connect/google/cloud/apigeeconnect_v1/services/connection_service/client.py @@ -412,6 +412,26 @@ def list_connections( r"""Lists connections that are currently active for the given Apigee Connect endpoint. + + + .. code-block:: + + from google.cloud import apigeeconnect_v1 + + def sample_list_connections(): + # Create a client + client = apigeeconnect_v1.ConnectionServiceClient() + + # Initialize request argument(s) + request = apigeeconnect_v1.ListConnectionsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_connections(request=request) + for response in page_result: + print(response) + Args: request (Union[google.cloud.apigeeconnect_v1.types.ListConnectionsRequest, dict]): The request object. The request for diff --git a/packages/google-cloud-apigee-connect/google/cloud/apigeeconnect_v1/services/tether/async_client.py b/packages/google-cloud-apigee-connect/google/cloud/apigeeconnect_v1/services/tether/async_client.py index fad893e1bafc..425b96669918 100644 --- a/packages/google-cloud-apigee-connect/google/cloud/apigeeconnect_v1/services/tether/async_client.py +++ b/packages/google-cloud-apigee-connect/google/cloud/apigeeconnect_v1/services/tether/async_client.py @@ -222,6 +222,33 @@ def egress( The listener streams http requests and the dialer streams http responses. + + .. code-block:: + + from google.cloud import apigeeconnect_v1 + + def sample_egress(): + # Create a client + client = apigeeconnect_v1.TetherClient() + + # Initialize request argument(s) + request = apigeeconnect_v1.EgressResponse( + ) + + # This method expects an iterator which contains + # 'apigeeconnect_v1.EgressResponse' objects + # Here we create a generator that yields a single `request` for + # demonstrative purposes. + requests = [request] + def request_generator(): + for request in requests: + yield request + + # Make the request + stream = client.egress(requests=request_generator()) + for response in stream: + print(response) + Args: requests (AsyncIterator[`google.cloud.apigeeconnect_v1.types.EgressResponse`]): The request object AsyncIterator. gRPC response payload for tether. diff --git a/packages/google-cloud-apigee-connect/google/cloud/apigeeconnect_v1/services/tether/client.py b/packages/google-cloud-apigee-connect/google/cloud/apigeeconnect_v1/services/tether/client.py index efdf232e4239..a9afb09ca1c2 100644 --- a/packages/google-cloud-apigee-connect/google/cloud/apigeeconnect_v1/services/tether/client.py +++ b/packages/google-cloud-apigee-connect/google/cloud/apigeeconnect_v1/services/tether/client.py @@ -403,6 +403,34 @@ def egress( The listener streams http requests and the dialer streams http responses. + + + .. code-block:: + + from google.cloud import apigeeconnect_v1 + + def sample_egress(): + # Create a client + client = apigeeconnect_v1.TetherClient() + + # Initialize request argument(s) + request = apigeeconnect_v1.EgressResponse( + ) + + # This method expects an iterator which contains + # 'apigeeconnect_v1.EgressResponse' objects + # Here we create a generator that yields a single `request` for + # demonstrative purposes. + requests = [request] + def request_generator(): + for request in requests: + yield request + + # Make the request + stream = client.egress(requests=request_generator()) + for response in stream: + print(response) + Args: requests (Iterator[google.cloud.apigeeconnect_v1.types.EgressResponse]): The request object iterator. gRPC response payload for tether. diff --git a/packages/google-cloud-apigee-connect/samples/generated_samples/apigeeconnect_generated_apigeeconnect_v1_connection_service_list_connections_async.py b/packages/google-cloud-apigee-connect/samples/generated_samples/apigeeconnect_generated_apigeeconnect_v1_connection_service_list_connections_async.py new file mode 100644 index 000000000000..5be38573732f --- /dev/null +++ b/packages/google-cloud-apigee-connect/samples/generated_samples/apigeeconnect_generated_apigeeconnect_v1_connection_service_list_connections_async.py @@ -0,0 +1,44 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListConnections +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-apigee-connect + + +# [START apigeeconnect_generated_apigeeconnect_v1_ConnectionService_ListConnections_async] +from google.cloud import apigeeconnect_v1 + + +async def sample_list_connections(): + # Create a client + client = apigeeconnect_v1.ConnectionServiceAsyncClient() + + # Initialize request argument(s) + request = apigeeconnect_v1.ListConnectionsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_connections(request=request) + async for response in page_result: + print(response) + +# [END apigeeconnect_generated_apigeeconnect_v1_ConnectionService_ListConnections_async] diff --git a/packages/google-cloud-apigee-connect/samples/generated_samples/apigeeconnect_generated_apigeeconnect_v1_connection_service_list_connections_sync.py b/packages/google-cloud-apigee-connect/samples/generated_samples/apigeeconnect_generated_apigeeconnect_v1_connection_service_list_connections_sync.py new file mode 100644 index 000000000000..28140d815478 --- /dev/null +++ b/packages/google-cloud-apigee-connect/samples/generated_samples/apigeeconnect_generated_apigeeconnect_v1_connection_service_list_connections_sync.py @@ -0,0 +1,44 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListConnections +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-apigee-connect + + +# [START apigeeconnect_generated_apigeeconnect_v1_ConnectionService_ListConnections_sync] +from google.cloud import apigeeconnect_v1 + + +def sample_list_connections(): + # Create a client + client = apigeeconnect_v1.ConnectionServiceClient() + + # Initialize request argument(s) + request = apigeeconnect_v1.ListConnectionsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_connections(request=request) + for response in page_result: + print(response) + +# [END apigeeconnect_generated_apigeeconnect_v1_ConnectionService_ListConnections_sync] diff --git a/packages/google-cloud-apigee-connect/samples/generated_samples/apigeeconnect_generated_apigeeconnect_v1_tether_egress_async.py b/packages/google-cloud-apigee-connect/samples/generated_samples/apigeeconnect_generated_apigeeconnect_v1_tether_egress_async.py new file mode 100644 index 000000000000..1836c5b429f5 --- /dev/null +++ b/packages/google-cloud-apigee-connect/samples/generated_samples/apigeeconnect_generated_apigeeconnect_v1_tether_egress_async.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for Egress +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-apigee-connect + + +# [START apigeeconnect_generated_apigeeconnect_v1_Tether_Egress_async] +from google.cloud import apigeeconnect_v1 + + +async def sample_egress(): + # Create a client + client = apigeeconnect_v1.TetherAsyncClient() + + # Initialize request argument(s) + request = apigeeconnect_v1.EgressResponse( + ) + + # This method expects an iterator which contains + # 'apigeeconnect_v1.EgressResponse' objects + # Here we create a generator that yields a single `request` for + # demonstrative purposes. + requests = [request] + def request_generator(): + for request in requests: + yield request + + # Make the request + stream = await client.egress(requests=request_generator()) + async for response in stream: + print(response) + +# [END apigeeconnect_generated_apigeeconnect_v1_Tether_Egress_async] diff --git a/packages/google-cloud-apigee-connect/samples/generated_samples/apigeeconnect_generated_apigeeconnect_v1_tether_egress_sync.py b/packages/google-cloud-apigee-connect/samples/generated_samples/apigeeconnect_generated_apigeeconnect_v1_tether_egress_sync.py new file mode 100644 index 000000000000..35cb4ca7fe96 --- /dev/null +++ b/packages/google-cloud-apigee-connect/samples/generated_samples/apigeeconnect_generated_apigeeconnect_v1_tether_egress_sync.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for Egress +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-apigee-connect + + +# [START apigeeconnect_generated_apigeeconnect_v1_Tether_Egress_sync] +from google.cloud import apigeeconnect_v1 + + +def sample_egress(): + # Create a client + client = apigeeconnect_v1.TetherClient() + + # Initialize request argument(s) + request = apigeeconnect_v1.EgressResponse( + ) + + # This method expects an iterator which contains + # 'apigeeconnect_v1.EgressResponse' objects + # Here we create a generator that yields a single `request` for + # demonstrative purposes. + requests = [request] + def request_generator(): + for request in requests: + yield request + + # Make the request + stream = client.egress(requests=request_generator()) + for response in stream: + print(response) + +# [END apigeeconnect_generated_apigeeconnect_v1_Tether_Egress_sync] diff --git a/packages/google-cloud-apigee-connect/samples/generated_samples/snippet_metadata_apigeeconnect_v1.json b/packages/google-cloud-apigee-connect/samples/generated_samples/snippet_metadata_apigeeconnect_v1.json new file mode 100644 index 000000000000..17ffce8fac04 --- /dev/null +++ b/packages/google-cloud-apigee-connect/samples/generated_samples/snippet_metadata_apigeeconnect_v1.json @@ -0,0 +1,174 @@ +{ + "snippets": [ + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "ConnectionService" + }, + "shortName": "ListConnections" + } + }, + "file": "apigeeconnect_generated_apigeeconnect_v1_connection_service_list_connections_async.py", + "regionTag": "apigeeconnect_generated_apigeeconnect_v1_ConnectionService_ListConnections_async", + "segments": [ + { + "end": 43, + "start": 27, + "type": "FULL" + }, + { + "end": 43, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 44, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "ConnectionService" + }, + "shortName": "ListConnections" + } + }, + "file": "apigeeconnect_generated_apigeeconnect_v1_connection_service_list_connections_sync.py", + "regionTag": "apigeeconnect_generated_apigeeconnect_v1_ConnectionService_ListConnections_sync", + "segments": [ + { + "end": 43, + "start": 27, + "type": "FULL" + }, + { + "end": 43, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 44, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "Tether" + }, + "shortName": "Egress" + } + }, + "file": "apigeeconnect_generated_apigeeconnect_v1_tether_egress_async.py", + "regionTag": "apigeeconnect_generated_apigeeconnect_v1_Tether_Egress_async", + "segments": [ + { + "end": 51, + "start": 27, + "type": "FULL" + }, + { + "end": 51, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 46, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "start": 47, + "type": "REQUEST_EXECUTION" + }, + { + "end": 52, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "Tether" + }, + "shortName": "Egress" + } + }, + "file": "apigeeconnect_generated_apigeeconnect_v1_tether_egress_sync.py", + "regionTag": "apigeeconnect_generated_apigeeconnect_v1_Tether_Egress_sync", + "segments": [ + { + "end": 51, + "start": 27, + "type": "FULL" + }, + { + "end": 51, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 46, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "start": 47, + "type": "REQUEST_EXECUTION" + }, + { + "end": 52, + "type": "RESPONSE_HANDLING" + } + ] + } + ] +}