Skip to content

Commit

Permalink
feat: generate v1alpha (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
parthea authored and dandhlee committed Nov 15, 2022
1 parent a823703 commit 53d41af
Show file tree
Hide file tree
Showing 13 changed files with 1,544 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# -*- 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_v1alpha_generated_BatchService_CreateJob_async]
from google.cloud import batch_v1alpha


async def sample_create_job():
# Create a client
client = batch_v1alpha.BatchServiceAsyncClient()

# Initialize request argument(s)
request = batch_v1alpha.CreateJobRequest(
parent="parent_value",
)

# Make the request
response = await client.create_job(request=request)

# Handle the response
print(response)

# [END batch_v1alpha_generated_BatchService_CreateJob_async]
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# -*- 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_v1alpha_generated_BatchService_CreateJob_sync]
from google.cloud import batch_v1alpha


def sample_create_job():
# Create a client
client = batch_v1alpha.BatchServiceClient()

# Initialize request argument(s)
request = batch_v1alpha.CreateJobRequest(
parent="parent_value",
)

# Make the request
response = client.create_job(request=request)

# Handle the response
print(response)

# [END batch_v1alpha_generated_BatchService_CreateJob_sync]
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# -*- 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_v1alpha_generated_BatchService_DeleteJob_async]
from google.cloud import batch_v1alpha


async def sample_delete_job():
# Create a client
client = batch_v1alpha.BatchServiceAsyncClient()

# Initialize request argument(s)
request = batch_v1alpha.DeleteJobRequest(
)

# Make the request
operation = client.delete_job(request=request)

print("Waiting for operation to complete...")

response = await operation.result()

# Handle the response
print(response)

# [END batch_v1alpha_generated_BatchService_DeleteJob_async]
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# -*- 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_v1alpha_generated_BatchService_DeleteJob_sync]
from google.cloud import batch_v1alpha


def sample_delete_job():
# Create a client
client = batch_v1alpha.BatchServiceClient()

# Initialize request argument(s)
request = batch_v1alpha.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_v1alpha_generated_BatchService_DeleteJob_sync]
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# -*- 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_v1alpha_generated_BatchService_GetJob_async]
from google.cloud import batch_v1alpha


async def sample_get_job():
# Create a client
client = batch_v1alpha.BatchServiceAsyncClient()

# Initialize request argument(s)
request = batch_v1alpha.GetJobRequest(
name="name_value",
)

# Make the request
response = await client.get_job(request=request)

# Handle the response
print(response)

# [END batch_v1alpha_generated_BatchService_GetJob_async]
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# -*- 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_v1alpha_generated_BatchService_GetJob_sync]
from google.cloud import batch_v1alpha


def sample_get_job():
# Create a client
client = batch_v1alpha.BatchServiceClient()

# Initialize request argument(s)
request = batch_v1alpha.GetJobRequest(
name="name_value",
)

# Make the request
response = client.get_job(request=request)

# Handle the response
print(response)

# [END batch_v1alpha_generated_BatchService_GetJob_sync]
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# -*- 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_v1alpha_generated_BatchService_GetTask_async]
from google.cloud import batch_v1alpha


async def sample_get_task():
# Create a client
client = batch_v1alpha.BatchServiceAsyncClient()

# Initialize request argument(s)
request = batch_v1alpha.GetTaskRequest(
name="name_value",
)

# Make the request
response = await client.get_task(request=request)

# Handle the response
print(response)

# [END batch_v1alpha_generated_BatchService_GetTask_async]
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# -*- 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_v1alpha_generated_BatchService_GetTask_sync]
from google.cloud import batch_v1alpha


def sample_get_task():
# Create a client
client = batch_v1alpha.BatchServiceClient()

# Initialize request argument(s)
request = batch_v1alpha.GetTaskRequest(
name="name_value",
)

# Make the request
response = client.get_task(request=request)

# Handle the response
print(response)

# [END batch_v1alpha_generated_BatchService_GetTask_sync]
Loading

0 comments on commit 53d41af

Please sign in to comment.