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

Commit

Permalink
docs: add generated snippets (#66)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
3 people authored Feb 16, 2022
1 parent a7ffab3 commit 75656c1
Show file tree
Hide file tree
Showing 98 changed files with 10,882 additions and 0 deletions.
592 changes: 592 additions & 0 deletions google/cloud/datastream_v1/services/datastream/async_client.py

Large diffs are not rendered by default.

617 changes: 617 additions & 0 deletions google/cloud/datastream_v1/services/datastream/client.py

Large diffs are not rendered by default.

510 changes: 510 additions & 0 deletions google/cloud/datastream_v1alpha1/services/datastream/async_client.py

Large diffs are not rendered by default.

531 changes: 531 additions & 0 deletions google/cloud/datastream_v1alpha1/services/datastream/client.py

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# -*- 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 CreateConnectionProfile
# 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-datastream


# [START datastream_generated_datastream_v1_Datastream_CreateConnectionProfile_async]
from google.cloud import datastream_v1


async def sample_create_connection_profile():
# Create a client
client = datastream_v1.DatastreamAsyncClient()

# Initialize request argument(s)
connection_profile = datastream_v1.ConnectionProfile()
connection_profile.oracle_profile.hostname = "hostname_value"
connection_profile.oracle_profile.username = "username_value"
connection_profile.oracle_profile.password = "password_value"
connection_profile.oracle_profile.database_service = "database_service_value"
connection_profile.display_name = "display_name_value"

request = datastream_v1.CreateConnectionProfileRequest(
parent="parent_value",
connection_profile_id="connection_profile_id_value",
connection_profile=connection_profile,
)

# Make the request
operation = client.create_connection_profile(request=request)

print("Waiting for operation to complete...")

response = await operation.result()

# Handle the response
print(response)

# [END datastream_generated_datastream_v1_Datastream_CreateConnectionProfile_async]
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# -*- 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 CreateConnectionProfile
# 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-datastream


# [START datastream_generated_datastream_v1_Datastream_CreateConnectionProfile_sync]
from google.cloud import datastream_v1


def sample_create_connection_profile():
# Create a client
client = datastream_v1.DatastreamClient()

# Initialize request argument(s)
connection_profile = datastream_v1.ConnectionProfile()
connection_profile.oracle_profile.hostname = "hostname_value"
connection_profile.oracle_profile.username = "username_value"
connection_profile.oracle_profile.password = "password_value"
connection_profile.oracle_profile.database_service = "database_service_value"
connection_profile.display_name = "display_name_value"

request = datastream_v1.CreateConnectionProfileRequest(
parent="parent_value",
connection_profile_id="connection_profile_id_value",
connection_profile=connection_profile,
)

# Make the request
operation = client.create_connection_profile(request=request)

print("Waiting for operation to complete...")

response = operation.result()

# Handle the response
print(response)

# [END datastream_generated_datastream_v1_Datastream_CreateConnectionProfile_sync]
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# -*- 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 CreatePrivateConnection
# 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-datastream


# [START datastream_generated_datastream_v1_Datastream_CreatePrivateConnection_async]
from google.cloud import datastream_v1


async def sample_create_private_connection():
# Create a client
client = datastream_v1.DatastreamAsyncClient()

# Initialize request argument(s)
private_connection = datastream_v1.PrivateConnection()
private_connection.display_name = "display_name_value"

request = datastream_v1.CreatePrivateConnectionRequest(
parent="parent_value",
private_connection_id="private_connection_id_value",
private_connection=private_connection,
)

# Make the request
operation = client.create_private_connection(request=request)

print("Waiting for operation to complete...")

response = await operation.result()

# Handle the response
print(response)

# [END datastream_generated_datastream_v1_Datastream_CreatePrivateConnection_async]
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# -*- 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 CreatePrivateConnection
# 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-datastream


# [START datastream_generated_datastream_v1_Datastream_CreatePrivateConnection_sync]
from google.cloud import datastream_v1


def sample_create_private_connection():
# Create a client
client = datastream_v1.DatastreamClient()

# Initialize request argument(s)
private_connection = datastream_v1.PrivateConnection()
private_connection.display_name = "display_name_value"

request = datastream_v1.CreatePrivateConnectionRequest(
parent="parent_value",
private_connection_id="private_connection_id_value",
private_connection=private_connection,
)

# Make the request
operation = client.create_private_connection(request=request)

print("Waiting for operation to complete...")

response = operation.result()

# Handle the response
print(response)

# [END datastream_generated_datastream_v1_Datastream_CreatePrivateConnection_sync]
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# -*- 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 CreateRoute
# 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-datastream


# [START datastream_generated_datastream_v1_Datastream_CreateRoute_async]
from google.cloud import datastream_v1


async def sample_create_route():
# Create a client
client = datastream_v1.DatastreamAsyncClient()

# Initialize request argument(s)
route = datastream_v1.Route()
route.display_name = "display_name_value"
route.destination_address = "destination_address_value"

request = datastream_v1.CreateRouteRequest(
parent="parent_value",
route_id="route_id_value",
route=route,
)

# Make the request
operation = client.create_route(request=request)

print("Waiting for operation to complete...")

response = await operation.result()

# Handle the response
print(response)

# [END datastream_generated_datastream_v1_Datastream_CreateRoute_async]
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# -*- 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 CreateRoute
# 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-datastream


# [START datastream_generated_datastream_v1_Datastream_CreateRoute_sync]
from google.cloud import datastream_v1


def sample_create_route():
# Create a client
client = datastream_v1.DatastreamClient()

# Initialize request argument(s)
route = datastream_v1.Route()
route.display_name = "display_name_value"
route.destination_address = "destination_address_value"

request = datastream_v1.CreateRouteRequest(
parent="parent_value",
route_id="route_id_value",
route=route,
)

# Make the request
operation = client.create_route(request=request)

print("Waiting for operation to complete...")

response = operation.result()

# Handle the response
print(response)

# [END datastream_generated_datastream_v1_Datastream_CreateRoute_sync]
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# -*- 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 CreateStream
# 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-datastream


# [START datastream_generated_datastream_v1_Datastream_CreateStream_async]
from google.cloud import datastream_v1


async def sample_create_stream():
# Create a client
client = datastream_v1.DatastreamAsyncClient()

# Initialize request argument(s)
stream = datastream_v1.Stream()
stream.display_name = "display_name_value"
stream.source_config.source_connection_profile = "source_connection_profile_value"
stream.destination_config.destination_connection_profile = "destination_connection_profile_value"

request = datastream_v1.CreateStreamRequest(
parent="parent_value",
stream_id="stream_id_value",
stream=stream,
)

# Make the request
operation = client.create_stream(request=request)

print("Waiting for operation to complete...")

response = await operation.result()

# Handle the response
print(response)

# [END datastream_generated_datastream_v1_Datastream_CreateStream_async]
Loading

0 comments on commit 75656c1

Please sign in to comment.