Skip to content

Commit 369c180

Browse files
committed
add generated samples/update client specific post processing
1 parent 46e55a1 commit 369c180

File tree

43 files changed

+4659
-22
lines changed

Some content is hidden

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

43 files changed

+4659
-22
lines changed

packages/google-cloud-dataflow-client/docs/index.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ API Reference
88
.. toctree::
99
:maxdepth: 2
1010

11-
dataflow_v1beta3/services
12-
dataflow_v1beta3/types
11+
dataflow_v1beta3/services_
12+
dataflow_v1beta3/types_
1313

1414

1515
Changelog

packages/google-cloud-dataflow-client/google/cloud/dataflow/gapic_version.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -*- coding: utf-8 -*-
2-
# Copyright 2022 Google LLC
2+
# Copyright 2023 Google LLC
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.
@@ -13,4 +13,4 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
__version__ = "0.8.5" # {x-release-please-version}
16+
__version__ = "0.0.0" # {x-release-please-version}

packages/google-cloud-dataflow-client/google/cloud/dataflow_v1beta3/gapic_version.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -*- coding: utf-8 -*-
2-
# Copyright 2022 Google LLC
2+
# Copyright 2023 Google LLC
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.
@@ -13,4 +13,4 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
__version__ = "0.8.5" # {x-release-please-version}
16+
__version__ = "0.0.0" # {x-release-please-version}

packages/google-cloud-dataflow-client/noxfile.py

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -22,41 +22,44 @@
2222
import pathlib
2323
import re
2424
import shutil
25+
from typing import Dict, List
2526
import warnings
2627

2728
import nox
2829

29-
BLACK_VERSION = "black==22.3.0"
30-
ISORT_VERSION = "isort==5.10.1"
30+
BLACK_VERSION = "black[jupyter]==23.7.0"
31+
ISORT_VERSION = "isort==5.11.0"
32+
3133
LINT_PATHS = ["docs", "google", "tests", "noxfile.py", "setup.py"]
3234

35+
3336
DEFAULT_PYTHON_VERSION = "3.9"
3437

35-
UNIT_TEST_PYTHON_VERSIONS = ["3.7", "3.8", "3.9", "3.10", "3.11"]
38+
UNIT_TEST_PYTHON_VERSIONS: List[str] = ["3.7", "3.8", "3.9", "3.10", "3.11"]
3639
UNIT_TEST_STANDARD_DEPENDENCIES = [
3740
"mock",
3841
"asyncmock",
3942
"pytest",
4043
"pytest-cov",
4144
"pytest-asyncio",
4245
]
43-
UNIT_TEST_EXTERNAL_DEPENDENCIES = []
44-
UNIT_TEST_LOCAL_DEPENDENCIES = []
45-
UNIT_TEST_DEPENDENCIES = []
46-
UNIT_TEST_EXTRAS = []
47-
UNIT_TEST_EXTRAS_BY_PYTHON = {}
46+
UNIT_TEST_EXTERNAL_DEPENDENCIES: List[str] = []
47+
UNIT_TEST_LOCAL_DEPENDENCIES: List[str] = []
48+
UNIT_TEST_DEPENDENCIES: List[str] = []
49+
UNIT_TEST_EXTRAS: List[str] = []
50+
UNIT_TEST_EXTRAS_BY_PYTHON: Dict[str, List[str]] = {}
4851

49-
SYSTEM_TEST_PYTHON_VERSIONS = ["3.8", "3.9", "3.10", "3.11"]
52+
SYSTEM_TEST_PYTHON_VERSIONS: List[str] = ["3.8", "3.9", "3.10", "3.11"]
5053
SYSTEM_TEST_STANDARD_DEPENDENCIES = [
5154
"mock",
5255
"pytest",
5356
"google-cloud-testutils",
5457
]
55-
SYSTEM_TEST_EXTERNAL_DEPENDENCIES = []
56-
SYSTEM_TEST_LOCAL_DEPENDENCIES = []
57-
SYSTEM_TEST_DEPENDENCIES = []
58-
SYSTEM_TEST_EXTRAS = []
59-
SYSTEM_TEST_EXTRAS_BY_PYTHON = {}
58+
SYSTEM_TEST_EXTERNAL_DEPENDENCIES: List[str] = []
59+
SYSTEM_TEST_LOCAL_DEPENDENCIES: List[str] = []
60+
SYSTEM_TEST_DEPENDENCIES: List[str] = []
61+
SYSTEM_TEST_EXTRAS: List[str] = []
62+
SYSTEM_TEST_EXTRAS_BY_PYTHON: Dict[str, List[str]] = {}
6063

6164
CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute()
6265

@@ -88,6 +91,7 @@ def lint(session):
8891
"--check",
8992
*LINT_PATHS,
9093
)
94+
9195
session.run("flake8", "google", "tests")
9296

9397

@@ -187,7 +191,6 @@ def unit(session):
187191

188192

189193
def install_systemtest_dependencies(session, *constraints):
190-
191194
# Use pre-release gRPC for system tests.
192195
# Exclude version 1.52.0rc1 which has a known issue.
193196
# See https://github.com/grpc/grpc/issues/32163
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# -*- coding: utf-8 -*-
2+
# Copyright 2023 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 LaunchFlexTemplate
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-dataflow-client
24+
25+
26+
# [START dataflow_v1beta3_generated_FlexTemplatesService_LaunchFlexTemplate_async]
27+
# This snippet has been automatically generated and should be regarded as a
28+
# code template only.
29+
# It will require modifications to work:
30+
# - It may require correct/in-range values for request initialization.
31+
# - It may require specifying regional endpoints when creating the service
32+
# client as shown in:
33+
# https://googleapis.dev/python/google-api-core/latest/client_options.html
34+
from google.cloud import dataflow_v1beta3
35+
36+
37+
async def sample_launch_flex_template():
38+
# Create a client
39+
client = dataflow_v1beta3.FlexTemplatesServiceAsyncClient()
40+
41+
# Initialize request argument(s)
42+
request = dataflow_v1beta3.LaunchFlexTemplateRequest(
43+
)
44+
45+
# Make the request
46+
response = await client.launch_flex_template(request=request)
47+
48+
# Handle the response
49+
print(response)
50+
51+
# [END dataflow_v1beta3_generated_FlexTemplatesService_LaunchFlexTemplate_async]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# -*- coding: utf-8 -*-
2+
# Copyright 2023 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 LaunchFlexTemplate
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-dataflow-client
24+
25+
26+
# [START dataflow_v1beta3_generated_FlexTemplatesService_LaunchFlexTemplate_sync]
27+
# This snippet has been automatically generated and should be regarded as a
28+
# code template only.
29+
# It will require modifications to work:
30+
# - It may require correct/in-range values for request initialization.
31+
# - It may require specifying regional endpoints when creating the service
32+
# client as shown in:
33+
# https://googleapis.dev/python/google-api-core/latest/client_options.html
34+
from google.cloud import dataflow_v1beta3
35+
36+
37+
def sample_launch_flex_template():
38+
# Create a client
39+
client = dataflow_v1beta3.FlexTemplatesServiceClient()
40+
41+
# Initialize request argument(s)
42+
request = dataflow_v1beta3.LaunchFlexTemplateRequest(
43+
)
44+
45+
# Make the request
46+
response = client.launch_flex_template(request=request)
47+
48+
# Handle the response
49+
print(response)
50+
51+
# [END dataflow_v1beta3_generated_FlexTemplatesService_LaunchFlexTemplate_sync]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# -*- coding: utf-8 -*-
2+
# Copyright 2023 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 AggregatedListJobs
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-dataflow-client
24+
25+
26+
# [START dataflow_v1beta3_generated_JobsV1Beta3_AggregatedListJobs_async]
27+
# This snippet has been automatically generated and should be regarded as a
28+
# code template only.
29+
# It will require modifications to work:
30+
# - It may require correct/in-range values for request initialization.
31+
# - It may require specifying regional endpoints when creating the service
32+
# client as shown in:
33+
# https://googleapis.dev/python/google-api-core/latest/client_options.html
34+
from google.cloud import dataflow_v1beta3
35+
36+
37+
async def sample_aggregated_list_jobs():
38+
# Create a client
39+
client = dataflow_v1beta3.JobsV1Beta3AsyncClient()
40+
41+
# Initialize request argument(s)
42+
request = dataflow_v1beta3.ListJobsRequest(
43+
)
44+
45+
# Make the request
46+
page_result = client.aggregated_list_jobs(request=request)
47+
48+
# Handle the response
49+
async for response in page_result:
50+
print(response)
51+
52+
# [END dataflow_v1beta3_generated_JobsV1Beta3_AggregatedListJobs_async]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# -*- coding: utf-8 -*-
2+
# Copyright 2023 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 AggregatedListJobs
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-dataflow-client
24+
25+
26+
# [START dataflow_v1beta3_generated_JobsV1Beta3_AggregatedListJobs_sync]
27+
# This snippet has been automatically generated and should be regarded as a
28+
# code template only.
29+
# It will require modifications to work:
30+
# - It may require correct/in-range values for request initialization.
31+
# - It may require specifying regional endpoints when creating the service
32+
# client as shown in:
33+
# https://googleapis.dev/python/google-api-core/latest/client_options.html
34+
from google.cloud import dataflow_v1beta3
35+
36+
37+
def sample_aggregated_list_jobs():
38+
# Create a client
39+
client = dataflow_v1beta3.JobsV1Beta3Client()
40+
41+
# Initialize request argument(s)
42+
request = dataflow_v1beta3.ListJobsRequest(
43+
)
44+
45+
# Make the request
46+
page_result = client.aggregated_list_jobs(request=request)
47+
48+
# Handle the response
49+
for response in page_result:
50+
print(response)
51+
52+
# [END dataflow_v1beta3_generated_JobsV1Beta3_AggregatedListJobs_sync]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# -*- coding: utf-8 -*-
2+
# Copyright 2023 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 CheckActiveJobs
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-dataflow-client
24+
25+
26+
# [START dataflow_v1beta3_generated_JobsV1Beta3_CheckActiveJobs_async]
27+
# This snippet has been automatically generated and should be regarded as a
28+
# code template only.
29+
# It will require modifications to work:
30+
# - It may require correct/in-range values for request initialization.
31+
# - It may require specifying regional endpoints when creating the service
32+
# client as shown in:
33+
# https://googleapis.dev/python/google-api-core/latest/client_options.html
34+
from google.cloud import dataflow_v1beta3
35+
36+
37+
async def sample_check_active_jobs():
38+
# Create a client
39+
client = dataflow_v1beta3.JobsV1Beta3AsyncClient()
40+
41+
# Initialize request argument(s)
42+
request = dataflow_v1beta3.CheckActiveJobsRequest(
43+
)
44+
45+
# Make the request
46+
response = await client.check_active_jobs(request=request)
47+
48+
# Handle the response
49+
print(response)
50+
51+
# [END dataflow_v1beta3_generated_JobsV1Beta3_CheckActiveJobs_async]

0 commit comments

Comments
 (0)