Skip to content

Commit

Permalink
feat: Add support for REST transport (#37)
Browse files Browse the repository at this point in the history
- [ ] 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
gcf-owl-bot[bot] authored and dandhlee committed Nov 15, 2022
1 parent d644388 commit ef0aa39
Show file tree
Hide file tree
Showing 26 changed files with 2,264 additions and 24 deletions.
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]
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]
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]
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]
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]
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]
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]
Loading

0 comments on commit ef0aa39

Please sign in to comment.