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

Commit 939d4c3

Browse files
docs: add generated code samples (#283)
- [ ] Regenerate this pull request now. docs: add generated snippets PiperOrigin-RevId: 427792504 Source-Link: googleapis/googleapis@55b9e1e Source-Link: https://github.com/googleapis/googleapis-gen/commit/bf4e86b753f42cb0edb1fd51fbe840d7da0a1cde Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYmY0ZTg2Yjc1M2Y0MmNiMGVkYjFmZDUxZmJlODQwZDdkYTBhMWNkZSJ9
1 parent 6af80a8 commit 939d4c3

File tree

33 files changed

+3290
-0
lines changed

33 files changed

+3290
-0
lines changed

google/cloud/bigquery_datatransfer_v1/services/data_transfer_service/async_client.py

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

google/cloud/bigquery_datatransfer_v1/services/data_transfer_service/client.py

Lines changed: 311 additions & 0 deletions
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
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 CheckValidCreds
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-bigquery-datatransfer
24+
25+
26+
# [START bigquerydatatransfer_generated_bigquery_datatransfer_v1_DataTransferService_CheckValidCreds_async]
27+
from google.cloud import bigquery_datatransfer_v1
28+
29+
30+
async def sample_check_valid_creds():
31+
# Create a client
32+
client = bigquery_datatransfer_v1.DataTransferServiceAsyncClient()
33+
34+
# Initialize request argument(s)
35+
request = bigquery_datatransfer_v1.CheckValidCredsRequest(
36+
name="name_value",
37+
)
38+
39+
# Make the request
40+
response = await client.check_valid_creds(request=request)
41+
42+
# Handle the response
43+
print(response)
44+
45+
# [END bigquerydatatransfer_generated_bigquery_datatransfer_v1_DataTransferService_CheckValidCreds_async]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
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 CheckValidCreds
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-bigquery-datatransfer
24+
25+
26+
# [START bigquerydatatransfer_generated_bigquery_datatransfer_v1_DataTransferService_CheckValidCreds_sync]
27+
from google.cloud import bigquery_datatransfer_v1
28+
29+
30+
def sample_check_valid_creds():
31+
# Create a client
32+
client = bigquery_datatransfer_v1.DataTransferServiceClient()
33+
34+
# Initialize request argument(s)
35+
request = bigquery_datatransfer_v1.CheckValidCredsRequest(
36+
name="name_value",
37+
)
38+
39+
# Make the request
40+
response = client.check_valid_creds(request=request)
41+
42+
# Handle the response
43+
print(response)
44+
45+
# [END bigquerydatatransfer_generated_bigquery_datatransfer_v1_DataTransferService_CheckValidCreds_sync]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
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 CreateTransferConfig
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-bigquery-datatransfer
24+
25+
26+
# [START bigquerydatatransfer_generated_bigquery_datatransfer_v1_DataTransferService_CreateTransferConfig_async]
27+
from google.cloud import bigquery_datatransfer_v1
28+
29+
30+
async def sample_create_transfer_config():
31+
# Create a client
32+
client = bigquery_datatransfer_v1.DataTransferServiceAsyncClient()
33+
34+
# Initialize request argument(s)
35+
transfer_config = bigquery_datatransfer_v1.TransferConfig()
36+
transfer_config.destination_dataset_id = "destination_dataset_id_value"
37+
38+
request = bigquery_datatransfer_v1.CreateTransferConfigRequest(
39+
parent="parent_value",
40+
transfer_config=transfer_config,
41+
)
42+
43+
# Make the request
44+
response = await client.create_transfer_config(request=request)
45+
46+
# Handle the response
47+
print(response)
48+
49+
# [END bigquerydatatransfer_generated_bigquery_datatransfer_v1_DataTransferService_CreateTransferConfig_async]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
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 CreateTransferConfig
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-bigquery-datatransfer
24+
25+
26+
# [START bigquerydatatransfer_generated_bigquery_datatransfer_v1_DataTransferService_CreateTransferConfig_sync]
27+
from google.cloud import bigquery_datatransfer_v1
28+
29+
30+
def sample_create_transfer_config():
31+
# Create a client
32+
client = bigquery_datatransfer_v1.DataTransferServiceClient()
33+
34+
# Initialize request argument(s)
35+
transfer_config = bigquery_datatransfer_v1.TransferConfig()
36+
transfer_config.destination_dataset_id = "destination_dataset_id_value"
37+
38+
request = bigquery_datatransfer_v1.CreateTransferConfigRequest(
39+
parent="parent_value",
40+
transfer_config=transfer_config,
41+
)
42+
43+
# Make the request
44+
response = client.create_transfer_config(request=request)
45+
46+
# Handle the response
47+
print(response)
48+
49+
# [END bigquerydatatransfer_generated_bigquery_datatransfer_v1_DataTransferService_CreateTransferConfig_sync]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
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 DeleteTransferConfig
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-bigquery-datatransfer
24+
25+
26+
# [START bigquerydatatransfer_generated_bigquery_datatransfer_v1_DataTransferService_DeleteTransferConfig_async]
27+
from google.cloud import bigquery_datatransfer_v1
28+
29+
30+
async def sample_delete_transfer_config():
31+
# Create a client
32+
client = bigquery_datatransfer_v1.DataTransferServiceAsyncClient()
33+
34+
# Initialize request argument(s)
35+
request = bigquery_datatransfer_v1.DeleteTransferConfigRequest(
36+
name="name_value",
37+
)
38+
39+
# Make the request
40+
await client.delete_transfer_config(request=request)
41+
42+
43+
# [END bigquerydatatransfer_generated_bigquery_datatransfer_v1_DataTransferService_DeleteTransferConfig_async]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
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 DeleteTransferConfig
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-bigquery-datatransfer
24+
25+
26+
# [START bigquerydatatransfer_generated_bigquery_datatransfer_v1_DataTransferService_DeleteTransferConfig_sync]
27+
from google.cloud import bigquery_datatransfer_v1
28+
29+
30+
def sample_delete_transfer_config():
31+
# Create a client
32+
client = bigquery_datatransfer_v1.DataTransferServiceClient()
33+
34+
# Initialize request argument(s)
35+
request = bigquery_datatransfer_v1.DeleteTransferConfigRequest(
36+
name="name_value",
37+
)
38+
39+
# Make the request
40+
client.delete_transfer_config(request=request)
41+
42+
43+
# [END bigquerydatatransfer_generated_bigquery_datatransfer_v1_DataTransferService_DeleteTransferConfig_sync]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
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 DeleteTransferRun
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-bigquery-datatransfer
24+
25+
26+
# [START bigquerydatatransfer_generated_bigquery_datatransfer_v1_DataTransferService_DeleteTransferRun_async]
27+
from google.cloud import bigquery_datatransfer_v1
28+
29+
30+
async def sample_delete_transfer_run():
31+
# Create a client
32+
client = bigquery_datatransfer_v1.DataTransferServiceAsyncClient()
33+
34+
# Initialize request argument(s)
35+
request = bigquery_datatransfer_v1.DeleteTransferRunRequest(
36+
name="name_value",
37+
)
38+
39+
# Make the request
40+
await client.delete_transfer_run(request=request)
41+
42+
43+
# [END bigquerydatatransfer_generated_bigquery_datatransfer_v1_DataTransferService_DeleteTransferRun_async]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
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 DeleteTransferRun
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-bigquery-datatransfer
24+
25+
26+
# [START bigquerydatatransfer_generated_bigquery_datatransfer_v1_DataTransferService_DeleteTransferRun_sync]
27+
from google.cloud import bigquery_datatransfer_v1
28+
29+
30+
def sample_delete_transfer_run():
31+
# Create a client
32+
client = bigquery_datatransfer_v1.DataTransferServiceClient()
33+
34+
# Initialize request argument(s)
35+
request = bigquery_datatransfer_v1.DeleteTransferRunRequest(
36+
name="name_value",
37+
)
38+
39+
# Make the request
40+
client.delete_transfer_run(request=request)
41+
42+
43+
# [END bigquerydatatransfer_generated_bigquery_datatransfer_v1_DataTransferService_DeleteTransferRun_sync]

0 commit comments

Comments
 (0)