Skip to content
This repository was archived by the owner on Sep 5, 2023. It is now read-only.

Commit 75656c1

Browse files
docs: add generated snippets (#66)
* chore: use gapic-generator-python 0.63.2 chore: use gapic-generator-python 0.63.2 PiperOrigin-RevId: 427792504 Source-Link: googleapis/googleapis@55b9e1e Source-Link: https://github.com/googleapis/googleapis-gen/commit/bf4e86b753f42cb0edb1fd51fbe840d7da0a1cde Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYmY0ZTg2Yjc1M2Y0MmNiMGVkYjFmZDUxZmJlODQwZDdkYTBhMWNkZSJ9 * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * run the generator locally at commit 98aa690 Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Anthonios Partheniou <[email protected]>
1 parent a7ffab3 commit 75656c1

File tree

98 files changed

+10882
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

98 files changed

+10882
-0
lines changed

google/cloud/datastream_v1/services/datastream/async_client.py

Lines changed: 592 additions & 0 deletions
Large diffs are not rendered by default.

google/cloud/datastream_v1/services/datastream/client.py

Lines changed: 617 additions & 0 deletions
Large diffs are not rendered by default.

google/cloud/datastream_v1alpha1/services/datastream/async_client.py

Lines changed: 510 additions & 0 deletions
Large diffs are not rendered by default.

google/cloud/datastream_v1alpha1/services/datastream/client.py

Lines changed: 531 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# -*- coding: utf-8 -*-
2+
# Copyright 2020 Google LLC
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
# Generated code. DO NOT EDIT!
17+
#
18+
# Snippet for CreateConnectionProfile
19+
# NOTE: This snippet has been automatically generated for illustrative purposes only.
20+
# It may require modifications to work in your environment.
21+
22+
# To install the latest published package dependency, execute the following:
23+
# python3 -m pip install google-cloud-datastream
24+
25+
26+
# [START datastream_generated_datastream_v1_Datastream_CreateConnectionProfile_async]
27+
from google.cloud import datastream_v1
28+
29+
30+
async def sample_create_connection_profile():
31+
# Create a client
32+
client = datastream_v1.DatastreamAsyncClient()
33+
34+
# Initialize request argument(s)
35+
connection_profile = datastream_v1.ConnectionProfile()
36+
connection_profile.oracle_profile.hostname = "hostname_value"
37+
connection_profile.oracle_profile.username = "username_value"
38+
connection_profile.oracle_profile.password = "password_value"
39+
connection_profile.oracle_profile.database_service = "database_service_value"
40+
connection_profile.display_name = "display_name_value"
41+
42+
request = datastream_v1.CreateConnectionProfileRequest(
43+
parent="parent_value",
44+
connection_profile_id="connection_profile_id_value",
45+
connection_profile=connection_profile,
46+
)
47+
48+
# Make the request
49+
operation = client.create_connection_profile(request=request)
50+
51+
print("Waiting for operation to complete...")
52+
53+
response = await operation.result()
54+
55+
# Handle the response
56+
print(response)
57+
58+
# [END datastream_generated_datastream_v1_Datastream_CreateConnectionProfile_async]
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# -*- coding: utf-8 -*-
2+
# Copyright 2020 Google LLC
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
# Generated code. DO NOT EDIT!
17+
#
18+
# Snippet for CreateConnectionProfile
19+
# NOTE: This snippet has been automatically generated for illustrative purposes only.
20+
# It may require modifications to work in your environment.
21+
22+
# To install the latest published package dependency, execute the following:
23+
# python3 -m pip install google-cloud-datastream
24+
25+
26+
# [START datastream_generated_datastream_v1_Datastream_CreateConnectionProfile_sync]
27+
from google.cloud import datastream_v1
28+
29+
30+
def sample_create_connection_profile():
31+
# Create a client
32+
client = datastream_v1.DatastreamClient()
33+
34+
# Initialize request argument(s)
35+
connection_profile = datastream_v1.ConnectionProfile()
36+
connection_profile.oracle_profile.hostname = "hostname_value"
37+
connection_profile.oracle_profile.username = "username_value"
38+
connection_profile.oracle_profile.password = "password_value"
39+
connection_profile.oracle_profile.database_service = "database_service_value"
40+
connection_profile.display_name = "display_name_value"
41+
42+
request = datastream_v1.CreateConnectionProfileRequest(
43+
parent="parent_value",
44+
connection_profile_id="connection_profile_id_value",
45+
connection_profile=connection_profile,
46+
)
47+
48+
# Make the request
49+
operation = client.create_connection_profile(request=request)
50+
51+
print("Waiting for operation to complete...")
52+
53+
response = operation.result()
54+
55+
# Handle the response
56+
print(response)
57+
58+
# [END datastream_generated_datastream_v1_Datastream_CreateConnectionProfile_sync]
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# -*- coding: utf-8 -*-
2+
# Copyright 2020 Google LLC
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
# Generated code. DO NOT EDIT!
17+
#
18+
# Snippet for CreatePrivateConnection
19+
# NOTE: This snippet has been automatically generated for illustrative purposes only.
20+
# It may require modifications to work in your environment.
21+
22+
# To install the latest published package dependency, execute the following:
23+
# python3 -m pip install google-cloud-datastream
24+
25+
26+
# [START datastream_generated_datastream_v1_Datastream_CreatePrivateConnection_async]
27+
from google.cloud import datastream_v1
28+
29+
30+
async def sample_create_private_connection():
31+
# Create a client
32+
client = datastream_v1.DatastreamAsyncClient()
33+
34+
# Initialize request argument(s)
35+
private_connection = datastream_v1.PrivateConnection()
36+
private_connection.display_name = "display_name_value"
37+
38+
request = datastream_v1.CreatePrivateConnectionRequest(
39+
parent="parent_value",
40+
private_connection_id="private_connection_id_value",
41+
private_connection=private_connection,
42+
)
43+
44+
# Make the request
45+
operation = client.create_private_connection(request=request)
46+
47+
print("Waiting for operation to complete...")
48+
49+
response = await operation.result()
50+
51+
# Handle the response
52+
print(response)
53+
54+
# [END datastream_generated_datastream_v1_Datastream_CreatePrivateConnection_async]
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# -*- coding: utf-8 -*-
2+
# Copyright 2020 Google LLC
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
# Generated code. DO NOT EDIT!
17+
#
18+
# Snippet for CreatePrivateConnection
19+
# NOTE: This snippet has been automatically generated for illustrative purposes only.
20+
# It may require modifications to work in your environment.
21+
22+
# To install the latest published package dependency, execute the following:
23+
# python3 -m pip install google-cloud-datastream
24+
25+
26+
# [START datastream_generated_datastream_v1_Datastream_CreatePrivateConnection_sync]
27+
from google.cloud import datastream_v1
28+
29+
30+
def sample_create_private_connection():
31+
# Create a client
32+
client = datastream_v1.DatastreamClient()
33+
34+
# Initialize request argument(s)
35+
private_connection = datastream_v1.PrivateConnection()
36+
private_connection.display_name = "display_name_value"
37+
38+
request = datastream_v1.CreatePrivateConnectionRequest(
39+
parent="parent_value",
40+
private_connection_id="private_connection_id_value",
41+
private_connection=private_connection,
42+
)
43+
44+
# Make the request
45+
operation = client.create_private_connection(request=request)
46+
47+
print("Waiting for operation to complete...")
48+
49+
response = operation.result()
50+
51+
# Handle the response
52+
print(response)
53+
54+
# [END datastream_generated_datastream_v1_Datastream_CreatePrivateConnection_sync]
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# -*- coding: utf-8 -*-
2+
# Copyright 2020 Google LLC
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
# Generated code. DO NOT EDIT!
17+
#
18+
# Snippet for CreateRoute
19+
# NOTE: This snippet has been automatically generated for illustrative purposes only.
20+
# It may require modifications to work in your environment.
21+
22+
# To install the latest published package dependency, execute the following:
23+
# python3 -m pip install google-cloud-datastream
24+
25+
26+
# [START datastream_generated_datastream_v1_Datastream_CreateRoute_async]
27+
from google.cloud import datastream_v1
28+
29+
30+
async def sample_create_route():
31+
# Create a client
32+
client = datastream_v1.DatastreamAsyncClient()
33+
34+
# Initialize request argument(s)
35+
route = datastream_v1.Route()
36+
route.display_name = "display_name_value"
37+
route.destination_address = "destination_address_value"
38+
39+
request = datastream_v1.CreateRouteRequest(
40+
parent="parent_value",
41+
route_id="route_id_value",
42+
route=route,
43+
)
44+
45+
# Make the request
46+
operation = client.create_route(request=request)
47+
48+
print("Waiting for operation to complete...")
49+
50+
response = await operation.result()
51+
52+
# Handle the response
53+
print(response)
54+
55+
# [END datastream_generated_datastream_v1_Datastream_CreateRoute_async]
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# -*- coding: utf-8 -*-
2+
# Copyright 2020 Google LLC
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
# Generated code. DO NOT EDIT!
17+
#
18+
# Snippet for CreateRoute
19+
# NOTE: This snippet has been automatically generated for illustrative purposes only.
20+
# It may require modifications to work in your environment.
21+
22+
# To install the latest published package dependency, execute the following:
23+
# python3 -m pip install google-cloud-datastream
24+
25+
26+
# [START datastream_generated_datastream_v1_Datastream_CreateRoute_sync]
27+
from google.cloud import datastream_v1
28+
29+
30+
def sample_create_route():
31+
# Create a client
32+
client = datastream_v1.DatastreamClient()
33+
34+
# Initialize request argument(s)
35+
route = datastream_v1.Route()
36+
route.display_name = "display_name_value"
37+
route.destination_address = "destination_address_value"
38+
39+
request = datastream_v1.CreateRouteRequest(
40+
parent="parent_value",
41+
route_id="route_id_value",
42+
route=route,
43+
)
44+
45+
# Make the request
46+
operation = client.create_route(request=request)
47+
48+
print("Waiting for operation to complete...")
49+
50+
response = operation.result()
51+
52+
# Handle the response
53+
print(response)
54+
55+
# [END datastream_generated_datastream_v1_Datastream_CreateRoute_sync]

0 commit comments

Comments
 (0)