Skip to content

Commit 8bdfeee

Browse files
feat: Add support for REST transport (#37)
- [ ] Regenerate this pull request now. PiperOrigin-RevId: 474571730 Source-Link: googleapis/googleapis@5a9ee4d Source-Link: https://github.com/googleapis/googleapis-gen/commit/ceafe521f137680fdee2f9ca9e1947cdd825070d Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiY2VhZmU1MjFmMTM3NjgwZmRlZTJmOWNhOWUxOTQ3Y2RkODI1MDcwZCJ9 fix(deps): require google-api-core>=1.33.1,>=2.8.0 fix(deps): require protobuf >= 3.20.1
1 parent 2e41659 commit 8bdfeee

File tree

26 files changed

+2264
-24
lines changed

26 files changed

+2264
-24
lines changed
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# -*- coding: utf-8 -*-
2+
# Copyright 2022 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 CreateJob
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-batch
24+
25+
26+
# [START batch_v1_generated_BatchService_CreateJob_sync_2bc66fef]
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 batch_v1
35+
36+
37+
def sample_create_job():
38+
# Create a client
39+
client = batch_v1.BatchServiceClient()
40+
41+
# Initialize request argument(s)
42+
request = batch_v1.CreateJobRequest(
43+
parent="parent_value",
44+
)
45+
46+
# Make the request
47+
response = client.create_job(request=request)
48+
49+
# Handle the response
50+
print(response)
51+
52+
# [END batch_v1_generated_BatchService_CreateJob_sync_2bc66fef]
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# -*- coding: utf-8 -*-
2+
# Copyright 2022 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 CreateJob
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-batch
24+
25+
26+
# [START batch_v1_generated_BatchService_CreateJob_sync_6f38dd76]
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 batch_v1
35+
36+
37+
def sample_create_job():
38+
# Create a client
39+
client = batch_v1.BatchServiceClient()
40+
41+
# Initialize request argument(s)
42+
request = batch_v1.CreateJobRequest(
43+
parent="parent_value",
44+
)
45+
46+
# Make the request
47+
response = client.create_job(request=request)
48+
49+
# Handle the response
50+
print(response)
51+
52+
# [END batch_v1_generated_BatchService_CreateJob_sync_6f38dd76]
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# -*- coding: utf-8 -*-
2+
# Copyright 2022 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 DeleteJob
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-batch
24+
25+
26+
# [START batch_v1_generated_BatchService_DeleteJob_sync_0196009c]
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 batch_v1
35+
36+
37+
def sample_delete_job():
38+
# Create a client
39+
client = batch_v1.BatchServiceClient()
40+
41+
# Initialize request argument(s)
42+
request = batch_v1.DeleteJobRequest(
43+
)
44+
45+
# Make the request
46+
operation = client.delete_job(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 batch_v1_generated_BatchService_DeleteJob_sync_0196009c]
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# -*- coding: utf-8 -*-
2+
# Copyright 2022 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 DeleteJob
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-batch
24+
25+
26+
# [START batch_v1_generated_BatchService_DeleteJob_sync_91684552]
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 batch_v1
35+
36+
37+
def sample_delete_job():
38+
# Create a client
39+
client = batch_v1.BatchServiceClient()
40+
41+
# Initialize request argument(s)
42+
request = batch_v1.DeleteJobRequest(
43+
)
44+
45+
# Make the request
46+
operation = client.delete_job(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 batch_v1_generated_BatchService_DeleteJob_sync_91684552]
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# -*- coding: utf-8 -*-
2+
# Copyright 2022 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 GetJob
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-batch
24+
25+
26+
# [START batch_v1_generated_BatchService_GetJob_sync_97ad7e29]
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 batch_v1
35+
36+
37+
def sample_get_job():
38+
# Create a client
39+
client = batch_v1.BatchServiceClient()
40+
41+
# Initialize request argument(s)
42+
request = batch_v1.GetJobRequest(
43+
name="name_value",
44+
)
45+
46+
# Make the request
47+
response = client.get_job(request=request)
48+
49+
# Handle the response
50+
print(response)
51+
52+
# [END batch_v1_generated_BatchService_GetJob_sync_97ad7e29]
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# -*- coding: utf-8 -*-
2+
# Copyright 2022 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 GetJob
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-batch
24+
25+
26+
# [START batch_v1_generated_BatchService_GetJob_sync_b06cc31b]
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 batch_v1
35+
36+
37+
def sample_get_job():
38+
# Create a client
39+
client = batch_v1.BatchServiceClient()
40+
41+
# Initialize request argument(s)
42+
request = batch_v1.GetJobRequest(
43+
name="name_value",
44+
)
45+
46+
# Make the request
47+
response = client.get_job(request=request)
48+
49+
# Handle the response
50+
print(response)
51+
52+
# [END batch_v1_generated_BatchService_GetJob_sync_b06cc31b]
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# -*- coding: utf-8 -*-
2+
# Copyright 2022 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 GetTask
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-batch
24+
25+
26+
# [START batch_v1_generated_BatchService_GetTask_sync_bbff024f]
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 batch_v1
35+
36+
37+
def sample_get_task():
38+
# Create a client
39+
client = batch_v1.BatchServiceClient()
40+
41+
# Initialize request argument(s)
42+
request = batch_v1.GetTaskRequest(
43+
name="name_value",
44+
)
45+
46+
# Make the request
47+
response = client.get_task(request=request)
48+
49+
# Handle the response
50+
print(response)
51+
52+
# [END batch_v1_generated_BatchService_GetTask_sync_bbff024f]

0 commit comments

Comments
 (0)