-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add support for REST transport (#37)
- [ ] Regenerate this pull request now. PiperOrigin-RevId: 474571730 Source-Link: googleapis/googleapis@5a9ee4d Source-Link: googleapis/googleapis-gen@ceafe52 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiY2VhZmU1MjFmMTM3NjgwZmRlZTJmOWNhOWUxOTQ3Y2RkODI1MDcwZCJ9 fix(deps): require google-api-core>=1.33.1,>=2.8.0 fix(deps): require protobuf >= 3.20.1
- Loading branch information
1 parent
d644388
commit ef0aa39
Showing
26 changed files
with
2,264 additions
and
24 deletions.
There are no files selected for viewing
52 changes: 52 additions & 0 deletions
52
compute/batch/generated_samples/batch_v1_generated_batch_service_create_job_sync_2bc66fef.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# -*- coding: utf-8 -*- | ||
# Copyright 2022 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 CreateJob | ||
# 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-batch | ||
|
||
|
||
# [START batch_v1_generated_BatchService_CreateJob_sync_2bc66fef] | ||
# This snippet has been automatically generated and should be regarded as a | ||
# code template only. | ||
# It will require modifications to work: | ||
# - It may require correct/in-range values for request initialization. | ||
# - It may require specifying regional endpoints when creating the service | ||
# client as shown in: | ||
# https://googleapis.dev/python/google-api-core/latest/client_options.html | ||
from google.cloud import batch_v1 | ||
|
||
|
||
def sample_create_job(): | ||
# Create a client | ||
client = batch_v1.BatchServiceClient() | ||
|
||
# Initialize request argument(s) | ||
request = batch_v1.CreateJobRequest( | ||
parent="parent_value", | ||
) | ||
|
||
# Make the request | ||
response = client.create_job(request=request) | ||
|
||
# Handle the response | ||
print(response) | ||
|
||
# [END batch_v1_generated_BatchService_CreateJob_sync_2bc66fef] |
52 changes: 52 additions & 0 deletions
52
compute/batch/generated_samples/batch_v1_generated_batch_service_create_job_sync_6f38dd76.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# -*- coding: utf-8 -*- | ||
# Copyright 2022 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 CreateJob | ||
# 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-batch | ||
|
||
|
||
# [START batch_v1_generated_BatchService_CreateJob_sync_6f38dd76] | ||
# This snippet has been automatically generated and should be regarded as a | ||
# code template only. | ||
# It will require modifications to work: | ||
# - It may require correct/in-range values for request initialization. | ||
# - It may require specifying regional endpoints when creating the service | ||
# client as shown in: | ||
# https://googleapis.dev/python/google-api-core/latest/client_options.html | ||
from google.cloud import batch_v1 | ||
|
||
|
||
def sample_create_job(): | ||
# Create a client | ||
client = batch_v1.BatchServiceClient() | ||
|
||
# Initialize request argument(s) | ||
request = batch_v1.CreateJobRequest( | ||
parent="parent_value", | ||
) | ||
|
||
# Make the request | ||
response = client.create_job(request=request) | ||
|
||
# Handle the response | ||
print(response) | ||
|
||
# [END batch_v1_generated_BatchService_CreateJob_sync_6f38dd76] |
55 changes: 55 additions & 0 deletions
55
compute/batch/generated_samples/batch_v1_generated_batch_service_delete_job_sync_0196009c.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# -*- coding: utf-8 -*- | ||
# Copyright 2022 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 DeleteJob | ||
# 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-batch | ||
|
||
|
||
# [START batch_v1_generated_BatchService_DeleteJob_sync_0196009c] | ||
# This snippet has been automatically generated and should be regarded as a | ||
# code template only. | ||
# It will require modifications to work: | ||
# - It may require correct/in-range values for request initialization. | ||
# - It may require specifying regional endpoints when creating the service | ||
# client as shown in: | ||
# https://googleapis.dev/python/google-api-core/latest/client_options.html | ||
from google.cloud import batch_v1 | ||
|
||
|
||
def sample_delete_job(): | ||
# Create a client | ||
client = batch_v1.BatchServiceClient() | ||
|
||
# Initialize request argument(s) | ||
request = batch_v1.DeleteJobRequest( | ||
) | ||
|
||
# Make the request | ||
operation = client.delete_job(request=request) | ||
|
||
print("Waiting for operation to complete...") | ||
|
||
response = operation.result() | ||
|
||
# Handle the response | ||
print(response) | ||
|
||
# [END batch_v1_generated_BatchService_DeleteJob_sync_0196009c] |
55 changes: 55 additions & 0 deletions
55
compute/batch/generated_samples/batch_v1_generated_batch_service_delete_job_sync_91684552.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# -*- coding: utf-8 -*- | ||
# Copyright 2022 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 DeleteJob | ||
# 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-batch | ||
|
||
|
||
# [START batch_v1_generated_BatchService_DeleteJob_sync_91684552] | ||
# This snippet has been automatically generated and should be regarded as a | ||
# code template only. | ||
# It will require modifications to work: | ||
# - It may require correct/in-range values for request initialization. | ||
# - It may require specifying regional endpoints when creating the service | ||
# client as shown in: | ||
# https://googleapis.dev/python/google-api-core/latest/client_options.html | ||
from google.cloud import batch_v1 | ||
|
||
|
||
def sample_delete_job(): | ||
# Create a client | ||
client = batch_v1.BatchServiceClient() | ||
|
||
# Initialize request argument(s) | ||
request = batch_v1.DeleteJobRequest( | ||
) | ||
|
||
# Make the request | ||
operation = client.delete_job(request=request) | ||
|
||
print("Waiting for operation to complete...") | ||
|
||
response = operation.result() | ||
|
||
# Handle the response | ||
print(response) | ||
|
||
# [END batch_v1_generated_BatchService_DeleteJob_sync_91684552] |
52 changes: 52 additions & 0 deletions
52
compute/batch/generated_samples/batch_v1_generated_batch_service_get_job_sync_97ad7e29.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# -*- coding: utf-8 -*- | ||
# Copyright 2022 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 GetJob | ||
# 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-batch | ||
|
||
|
||
# [START batch_v1_generated_BatchService_GetJob_sync_97ad7e29] | ||
# This snippet has been automatically generated and should be regarded as a | ||
# code template only. | ||
# It will require modifications to work: | ||
# - It may require correct/in-range values for request initialization. | ||
# - It may require specifying regional endpoints when creating the service | ||
# client as shown in: | ||
# https://googleapis.dev/python/google-api-core/latest/client_options.html | ||
from google.cloud import batch_v1 | ||
|
||
|
||
def sample_get_job(): | ||
# Create a client | ||
client = batch_v1.BatchServiceClient() | ||
|
||
# Initialize request argument(s) | ||
request = batch_v1.GetJobRequest( | ||
name="name_value", | ||
) | ||
|
||
# Make the request | ||
response = client.get_job(request=request) | ||
|
||
# Handle the response | ||
print(response) | ||
|
||
# [END batch_v1_generated_BatchService_GetJob_sync_97ad7e29] |
52 changes: 52 additions & 0 deletions
52
compute/batch/generated_samples/batch_v1_generated_batch_service_get_job_sync_b06cc31b.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# -*- coding: utf-8 -*- | ||
# Copyright 2022 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 GetJob | ||
# 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-batch | ||
|
||
|
||
# [START batch_v1_generated_BatchService_GetJob_sync_b06cc31b] | ||
# This snippet has been automatically generated and should be regarded as a | ||
# code template only. | ||
# It will require modifications to work: | ||
# - It may require correct/in-range values for request initialization. | ||
# - It may require specifying regional endpoints when creating the service | ||
# client as shown in: | ||
# https://googleapis.dev/python/google-api-core/latest/client_options.html | ||
from google.cloud import batch_v1 | ||
|
||
|
||
def sample_get_job(): | ||
# Create a client | ||
client = batch_v1.BatchServiceClient() | ||
|
||
# Initialize request argument(s) | ||
request = batch_v1.GetJobRequest( | ||
name="name_value", | ||
) | ||
|
||
# Make the request | ||
response = client.get_job(request=request) | ||
|
||
# Handle the response | ||
print(response) | ||
|
||
# [END batch_v1_generated_BatchService_GetJob_sync_b06cc31b] |
52 changes: 52 additions & 0 deletions
52
compute/batch/generated_samples/batch_v1_generated_batch_service_get_task_sync_bbff024f.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# -*- coding: utf-8 -*- | ||
# Copyright 2022 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 GetTask | ||
# 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-batch | ||
|
||
|
||
# [START batch_v1_generated_BatchService_GetTask_sync_bbff024f] | ||
# This snippet has been automatically generated and should be regarded as a | ||
# code template only. | ||
# It will require modifications to work: | ||
# - It may require correct/in-range values for request initialization. | ||
# - It may require specifying regional endpoints when creating the service | ||
# client as shown in: | ||
# https://googleapis.dev/python/google-api-core/latest/client_options.html | ||
from google.cloud import batch_v1 | ||
|
||
|
||
def sample_get_task(): | ||
# Create a client | ||
client = batch_v1.BatchServiceClient() | ||
|
||
# Initialize request argument(s) | ||
request = batch_v1.GetTaskRequest( | ||
name="name_value", | ||
) | ||
|
||
# Make the request | ||
response = client.get_task(request=request) | ||
|
||
# Handle the response | ||
print(response) | ||
|
||
# [END batch_v1_generated_BatchService_GetTask_sync_bbff024f] |
Oops, something went wrong.