Skip to content
This repository has been archived by the owner on Nov 29, 2023. It is now read-only.

Commit

Permalink
docs: add generated snippets (#189)
Browse files Browse the repository at this point in the history
* chore: use gapic-generator-python 0.63.2
docs: add generated snippets

PiperOrigin-RevId: 427792504

Source-Link: googleapis/googleapis@55b9e1e

Source-Link: googleapis/googleapis-gen@bf4e86b
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYmY0ZTg2Yjc1M2Y0MmNiMGVkYjFmZDUxZmJlODQwZDdkYTBhMWNkZSJ9

* 🦉 Updates from OwlBot

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
gcf-owl-bot[bot] and gcf-owl-bot[bot] committed Feb 11, 2022
1 parent 140ed11 commit eccf8c6
Show file tree
Hide file tree
Showing 38 changed files with 3,484 additions and 0 deletions.
153 changes: 153 additions & 0 deletions google/cloud/scheduler_v1/services/cloud_scheduler/async_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,26 @@ async def list_jobs(
) -> pagers.ListJobsAsyncPager:
r"""Lists jobs.
.. code-block::
from google.cloud import scheduler_v1
def sample_list_jobs():
# Create a client
client = scheduler_v1.CloudSchedulerClient()
# Initialize request argument(s)
request = scheduler_v1.ListJobsRequest(
parent="parent_value",
)
# Make the request
page_result = client.list_jobs(request=request)
# Handle the response
for response in page_result:
print(response)
Args:
request (Union[google.cloud.scheduler_v1.types.ListJobsRequest, dict]):
The request object. Request message for listing jobs
Expand Down Expand Up @@ -315,6 +335,25 @@ async def get_job(
) -> job.Job:
r"""Gets a job.
.. code-block::
from google.cloud import scheduler_v1
def sample_get_job():
# Create a client
client = scheduler_v1.CloudSchedulerClient()
# Initialize request argument(s)
request = scheduler_v1.GetJobRequest(
name="name_value",
)
# Make the request
response = client.get_job(request=request)
# Handle the response
print(response)
Args:
request (Union[google.cloud.scheduler_v1.types.GetJobRequest, dict]):
The request object. Request message for
Expand Down Expand Up @@ -398,6 +437,25 @@ async def create_job(
) -> gcs_job.Job:
r"""Creates a job.
.. code-block::
from google.cloud import scheduler_v1
def sample_create_job():
# Create a client
client = scheduler_v1.CloudSchedulerClient()
# Initialize request argument(s)
request = scheduler_v1.CreateJobRequest(
parent="parent_value",
)
# Make the request
response = client.create_job(request=request)
# Handle the response
print(response)
Args:
request (Union[google.cloud.scheduler_v1.types.CreateJobRequest, dict]):
The request object. Request message for
Expand Down Expand Up @@ -497,6 +555,25 @@ async def update_job(
retry the UpdateJob request until a successful response is
received.
.. code-block::
from google.cloud import scheduler_v1
def sample_update_job():
# Create a client
client = scheduler_v1.CloudSchedulerClient()
# Initialize request argument(s)
request = scheduler_v1.UpdateJobRequest(
)
# Make the request
response = client.update_job(request=request)
# Handle the response
print(response)
Args:
request (Union[google.cloud.scheduler_v1.types.UpdateJobRequest, dict]):
The request object. Request message for
Expand Down Expand Up @@ -583,6 +660,22 @@ async def delete_job(
) -> None:
r"""Deletes a job.
.. code-block::
from google.cloud import scheduler_v1
def sample_delete_job():
# Create a client
client = scheduler_v1.CloudSchedulerClient()
# Initialize request argument(s)
request = scheduler_v1.DeleteJobRequest(
name="name_value",
)
# Make the request
client.delete_job(request=request)
Args:
request (Union[google.cloud.scheduler_v1.types.DeleteJobRequest, dict]):
The request object. Request message for deleting a job
Expand Down Expand Up @@ -669,6 +762,26 @@ async def pause_job(
[Job.State.ENABLED][google.cloud.scheduler.v1.Job.State.ENABLED]
to be paused.
.. code-block::
from google.cloud import scheduler_v1
def sample_pause_job():
# Create a client
client = scheduler_v1.CloudSchedulerClient()
# Initialize request argument(s)
request = scheduler_v1.PauseJobRequest(
name="name_value",
)
# Make the request
response = client.pause_job(request=request)
# Handle the response
print(response)
Args:
request (Union[google.cloud.scheduler_v1.types.PauseJobRequest, dict]):
The request object. Request message for
Expand Down Expand Up @@ -751,6 +864,26 @@ async def resume_job(
[Job.State.PAUSED][google.cloud.scheduler.v1.Job.State.PAUSED]
to be resumed.
.. code-block::
from google.cloud import scheduler_v1
def sample_resume_job():
# Create a client
client = scheduler_v1.CloudSchedulerClient()
# Initialize request argument(s)
request = scheduler_v1.ResumeJobRequest(
name="name_value",
)
# Make the request
response = client.resume_job(request=request)
# Handle the response
print(response)
Args:
request (Union[google.cloud.scheduler_v1.types.ResumeJobRequest, dict]):
The request object. Request message for
Expand Down Expand Up @@ -825,6 +958,26 @@ async def run_job(
When this method is called, Cloud Scheduler will
dispatch the job, even if the job is already running.
.. code-block::
from google.cloud import scheduler_v1
def sample_run_job():
# Create a client
client = scheduler_v1.CloudSchedulerClient()
# Initialize request argument(s)
request = scheduler_v1.RunJobRequest(
name="name_value",
)
# Make the request
response = client.run_job(request=request)
# Handle the response
print(response)
Args:
request (Union[google.cloud.scheduler_v1.types.RunJobRequest, dict]):
The request object. Request message for forcing a job to
Expand Down
Loading

0 comments on commit eccf8c6

Please sign in to comment.