Skip to content

Commit 5950ae4

Browse files
chore(job): migrate regions part 1 and delete region tag 'instantiate' for jobs/v3/api_client/ (#12976)
* chore(job): migrate regions step 1 - add regions to auto_complete_sample.py * chore(job): migrate regions step 1 - add regions to base_company_sample.py * chore(job): migrate regions step 1 - add regions to batch_operation_sample.py * chore(job): migrate regions step 1 - add regions to commute_search_sample.py * chore(job): migrate regions step 1 - add regions to custom_attribute_sample.py * chore(job): delete region tag: jobs_instantiate at jobs/v3/api_client/base_company_sample.py * chore(job): delete region tag: jobs_instantiate at jobs/v3/api_client/batch_operation_sample.py * chore(job): delete region tag: instantiate at jobs/v3/api_client/auto_complete_sample.py * chore(job): delete region tag: instantiate at jobs/v3/api_client/commute_search_sample.py * chore(job): delete region tag: instantiate at jobs/v3/api_client/base_job_sample.py
1 parent 72bd266 commit 5950ae4

File tree

6 files changed

+20
-13
lines changed

6 files changed

+20
-13
lines changed

jobs/v3/api_client/auto_complete_sample.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,13 @@
1414
# See the License for the specific language governing permissions and
1515
# limitations under the License.
1616

17-
# [START instantiate]
1817
import os
1918
import time
2019

2120
from googleapiclient.discovery import build
2221

2322
client_service = build("jobs", "v3")
2423
name = "projects/" + os.environ["GOOGLE_CLOUD_PROJECT"]
25-
# [END instantiate]
2624

2725

2826
# [START job_auto_complete_job_title]
@@ -42,6 +40,7 @@ def job_title_auto_complete(client_service, query, company_name):
4240
# [END job_auto_complete_job_title]
4341

4442

43+
# [START job_auto_complete_default]
4544
# [START auto_complete_default]
4645
def auto_complete_default(client_service, query, company_name):
4746
complete = client_service.projects().complete(
@@ -55,6 +54,7 @@ def auto_complete_default(client_service, query, company_name):
5554

5655

5756
# [END auto_complete_default]
57+
# [END job_auto_complete_default]
5858

5959

6060
def set_up():

jobs/v3/api_client/base_company_sample.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
# limitations under the License.
1616

1717

18-
# [START jobs_instantiate]
1918
import os
2019
import random
2120
import string
@@ -26,9 +25,8 @@
2625
client_service = build("jobs", "v3")
2726
parent = "projects/" + os.environ["GOOGLE_CLOUD_PROJECT"]
2827

29-
# [END jobs_instantiate]
30-
3128

29+
# [START job_basic_company]
3230
# [START jobs_basic_company]
3331
def generate_company():
3432
# external id should be a unique Id in your system.
@@ -49,8 +47,10 @@ def generate_company():
4947

5048

5149
# [END jobs_basic_company]
50+
# [END job_basic_company]
5251

5352

53+
# [START job_create_company]
5454
# [START jobs_create_company]
5555
def create_company(client_service, company_to_be_created):
5656
try:
@@ -69,8 +69,10 @@ def create_company(client_service, company_to_be_created):
6969

7070

7171
# [END jobs_create_company]
72+
# [END job_create_company]
7273

7374

75+
# [START job_get_company]
7476
# [START jobs_get_company]
7577
def get_company(client_service, company_name):
7678
try:
@@ -85,8 +87,10 @@ def get_company(client_service, company_name):
8587

8688

8789
# [END jobs_get_company]
90+
# [END job_get_company]
8891

8992

93+
# [START job_update_company]
9094
# [START jobs_update_company]
9195
def update_company(client_service, company_name, company_to_be_updated):
9296
try:
@@ -105,8 +109,10 @@ def update_company(client_service, company_name, company_to_be_updated):
105109

106110

107111
# [END jobs_update_company]
112+
# [END job_update_company]
108113

109114

115+
# [START job_update_company_with_field_mask]
110116
# [START jobs_update_company_with_field_mask]
111117
def update_company_with_field_mask(
112118
client_service, company_name, company_to_be_updated, field_mask
@@ -127,8 +133,10 @@ def update_company_with_field_mask(
127133

128134

129135
# [END jobs_update_company_with_field_mask]
136+
# [END job_update_company_with_field_mask]
130137

131138

139+
# [START job_delete_company]
132140
# [START jobs_delete_company]
133141
def delete_company(client_service, company_name):
134142
try:
@@ -140,6 +148,7 @@ def delete_company(client_service, company_name):
140148

141149

142150
# [END jobs_delete_company]
151+
# [END job_delete_company]
143152

144153

145154
def run_sample():

jobs/v3/api_client/base_job_sample.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414
# See the License for the specific language governing permissions and
1515
# limitations under the License.
1616

17-
# [START job_instantiate]
18-
# [START instantiate]
1917
import os
2018
import random
2119
import string
@@ -25,8 +23,6 @@
2523

2624
client_service = build("jobs", "v3")
2725
parent = "projects/" + os.environ["GOOGLE_CLOUD_PROJECT"]
28-
# [END instantiate]
29-
# [END job_instantiate]
3026

3127

3228
# [START job_basic_job]

jobs/v3/api_client/batch_operation_sample.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,12 @@
1414
# See the License for the specific language governing permissions and
1515
# limitations under the License.
1616

17-
# [START instantiate]
1817
import os
1918

2019
from googleapiclient.discovery import build
2120

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

2624

2725
# [START job_discovery_batch_job_create]

jobs/v3/api_client/commute_search_sample.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,13 @@
1414
# See the License for the specific language governing permissions and
1515
# limitations under the License.
1616

17-
# [START instantiate]
1817
import os
1918
import time
2019

2120
from googleapiclient.discovery import build
2221

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

2725

2826
# [START job_discovery_commute_search]

jobs/v3/api_client/custom_attribute_sample.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ def generate_job_with_custom_attributes(company_name):
5757
# [END job_custom_attribute_job]
5858

5959

60+
# [START job_custom_attribute_filter_string_value]
6061
# [START custom_attribute_filter_string_value]
6162
def custom_attribute_filter_string_value(client_service):
6263
request_metadata = {
@@ -80,8 +81,10 @@ def custom_attribute_filter_string_value(client_service):
8081

8182

8283
# [END custom_attribute_filter_string_value]
84+
# [END job_custom_attribute_filter_string_value]
8385

8486

87+
# [START job_custom_attribute_filter_long_value]
8588
# [START custom_attribute_filter_long_value]
8689
def custom_attribute_filter_long_value(client_service):
8790
request_metadata = {
@@ -105,8 +108,10 @@ def custom_attribute_filter_long_value(client_service):
105108

106109

107110
# [END custom_attribute_filter_long_value]
111+
# [END job_custom_attribute_filter_long_value]
108112

109113

114+
# [START job_custom_attribute_filter_multi_attributes]
110115
# [START custom_attribute_filter_multi_attributes]
111116
def custom_attribute_filter_multi_attributes(client_service):
112117
request_metadata = {
@@ -133,6 +138,7 @@ def custom_attribute_filter_multi_attributes(client_service):
133138

134139

135140
# [END custom_attribute_filter_multi_attributes]
141+
# [END job_custom_attribute_filter_multi_attributes]
136142

137143

138144
def set_up():

0 commit comments

Comments
 (0)