Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 0 additions & 22 deletions jobs/v3/api_client/base_job_sample.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@


# [START job_basic_job]
# [START basic_job]
def generate_job_with_required_fields(company_name):
# Requisition id should be a unique Id in your system.
requisition_id = "job_with_required_fields:" + "".join(
Expand All @@ -46,14 +45,10 @@ def generate_job_with_required_fields(company_name):
}
print("Job generated: %s" % job)
return job


# [END basic_job]
# [END job_basic_job]


# [START job_create_job]
# [START create_job]
def create_job(client_service, job_to_be_created):
try:
request = {"job": job_to_be_created}
Expand All @@ -68,9 +63,6 @@ def create_job(client_service, job_to_be_created):
except Error as e:
print("Got exception while creating job")
raise e


# [END create_job]
# [END job_create_job]


Expand All @@ -83,12 +75,9 @@ def get_job(client_service, job_name):
except Error as e:
print("Got exception while getting job")
raise e


# [END job_get_job]


# [START update_job]
# [START job_update_job]
def update_job(client_service, job_name, job_to_be_updated):
try:
Expand All @@ -104,14 +93,10 @@ def update_job(client_service, job_name, job_to_be_updated):
except Error as e:
print("Got exception while updating job")
raise e


# [END update_job]
# [END job_update_job]


# [START job_update_job_with_field_mask]
# [START update_job_with_field_mask]
def update_job_with_field_mask(client_service, job_name, job_to_be_updated, field_mask):
try:
request = {"job": job_to_be_updated, "update_mask": field_mask}
Expand All @@ -126,24 +111,17 @@ def update_job_with_field_mask(client_service, job_name, job_to_be_updated, fiel
except Error as e:
print("Got exception while updating job with field mask")
raise e


# [END update_job_with_field_mask]
# [END job_update_job_with_field_mask]


# [START job_delete_job]
# [START delete_job]
def delete_job(client_service, job_name):
try:
client_service.projects().jobs().delete(name=job_name).execute()
print("Job deleted")
except Error as e:
print("Got exception while deleting job")
raise e


# [END delete_job]
# [END job_delete_job]


Expand Down