Skip to content

Commit

Permalink
chore(job): fix regions in files starting with 'e' to 'g' from folder…
Browse files Browse the repository at this point in the history
… 'jobs/v3/api_client/' (#13034)

* chore(job): fix regions in email_alert_search_sample.py

- Remove unused 'instance' region
- Migrate step 1 for search_for_alerts (Used in docs)

* chore(job): fix regions in featured_job_search_sample.py

- Remove unused 'instance' region tag
- Rename 'featured_job' (Not in docs, but valuable)
- Rename 'search_featured_job' (Not in docs, but valuable)

* chore(job): fix regions in general_search_sample.py

- Remove unused 'instance' region tag
- Cleanup empty space to make it consistent with remaining files in the folder

* chore(job): migrate step 3 remove old region tag from email_alert_search_sample.py

* chore(job): fix previous commit

- Remove an END region tag for featured_job.
  • Loading branch information
eapl-gemugami authored Jan 8, 2025
1 parent 5829629 commit 3c06ee5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 32 deletions.
8 changes: 2 additions & 6 deletions jobs/v3/api_client/email_alert_search_sample.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,16 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# [START instantiate]
import os
import time

from googleapiclient.discovery import build

client_service = build("jobs", "v3")
parent = "projects/" + os.environ["GOOGLE_CLOUD_PROJECT"]
# [END instantiate]


# [START search_for_alerts]
# [START job_search_for_alerts]
def search_for_alerts(client_service, company_name):
request_metadata = {
"user_id": "HashedUserId",
Expand All @@ -45,9 +43,7 @@ def search_for_alerts(client_service, company_name):
.execute()
)
print(response)


# [END search_for_alerts]
# [END job_search_for_alerts]


def set_up():
Expand Down
14 changes: 4 additions & 10 deletions jobs/v3/api_client/featured_job_search_sample.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# [START instantiate]
import os
import random
import string
Expand All @@ -24,10 +23,9 @@

client_service = build("jobs", "v3")
parent = "projects/" + os.environ["GOOGLE_CLOUD_PROJECT"]
# [END instantiate]


# [START featured_job]
# [START job_generate_featured_job]
def generate_featured_job(company_name):
# Requisition id should be a unique Id in your system.
requisition_id = "job_with_required_fields:" + "".join(
Expand All @@ -48,12 +46,10 @@ def generate_featured_job(company_name):
}
print("Job generated: %s" % job)
return job
# [END job_generate_featured_job]


# [END featured_job]


# [START search_featured_job]
# [START job_search_featured_job]
def search_featured_job(client_service, company_name):
request_metadata = {
"user_id": "HashedUserId",
Expand All @@ -73,9 +69,7 @@ def search_featured_job(client_service, company_name):
client_service.projects().jobs().search(parent=parent, body=request).execute()
)
print(response)


# [END search_featured_job]
# [END job_search_featured_job]


def set_up():
Expand Down
16 changes: 0 additions & 16 deletions jobs/v3/api_client/general_search_sample.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# [START instantiate]
import os
import time

from googleapiclient.discovery import build

client_service = build("jobs", "v3")
parent = "projects/" + os.environ["GOOGLE_CLOUD_PROJECT"]
# [END instantiate]


# [START job_discovery_basic_keyword_search]
Expand All @@ -45,8 +43,6 @@ def basic_keyword_search(client_service, company_name, keyword):
client_service.projects().jobs().search(parent=parent, body=request).execute()
)
print(response)


# [END job_discovery_basic_keyword_search]


Expand All @@ -70,8 +66,6 @@ def category_search(client_service, company_name, categories):
client_service.projects().jobs().search(parent=parent, body=request).execute()
)
print(response)


# [END job_discovery_category_filter_search]


Expand All @@ -95,8 +89,6 @@ def employment_types_search(client_service, company_name, employment_types):
client_service.projects().jobs().search(parent=parent, body=request).execute()
)
print(response)


# [END job_discovery_employment_types_filter_search]


Expand All @@ -120,8 +112,6 @@ def date_range_search(client_service, company_name, date_range):
client_service.projects().jobs().search(parent=parent, body=request).execute()
)
print(response)


# [END job_discovery_date_range_filter_search]


Expand All @@ -145,8 +135,6 @@ def language_code_search(client_service, company_name, language_codes):
client_service.projects().jobs().search(parent=parent, body=request).execute()
)
print(response)


# [END job_discovery_language_code_filter_search]


Expand All @@ -170,8 +158,6 @@ def company_display_name_search(client_service, company_name, company_display_na
client_service.projects().jobs().search(parent=parent, body=request).execute()
)
print(response)


# [END job_discovery_company_display_name_search]


Expand Down Expand Up @@ -204,8 +190,6 @@ def compensation_search(client_service, company_name):
client_service.projects().jobs().search(parent=parent, body=request).execute()
)
print(response)


# [END job_discovery_compensation_search]


Expand Down

0 comments on commit 3c06ee5

Please sign in to comment.