-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: mark fields in Contacts message as REQUIRED (#11420)
Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
- Loading branch information
1 parent
b3fb8b7
commit a83db2d
Showing
20 changed files
with
1,914 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
...mples/essentialcontacts_v1_generated_essential_contacts_service_compute_contacts_async.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# -*- 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 ComputeContacts | ||
# 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-essential-contacts | ||
|
||
|
||
# [START essentialcontacts_v1_generated_EssentialContactsService_ComputeContacts_async] | ||
# This snippet has been automatically generated and should be regarded as a | ||
# code template only. | ||
# It will require modifications to work: | ||
# - It may require correct/in-range values for request initialization. | ||
# - It may require specifying regional endpoints when creating the service | ||
# client as shown in: | ||
# https://googleapis.dev/python/google-api-core/latest/client_options.html | ||
from google.cloud import essential_contacts_v1 | ||
|
||
|
||
async def sample_compute_contacts(): | ||
# Create a client | ||
client = essential_contacts_v1.EssentialContactsServiceAsyncClient() | ||
|
||
# Initialize request argument(s) | ||
request = essential_contacts_v1.ComputeContactsRequest( | ||
parent="parent_value", | ||
) | ||
|
||
# Make the request | ||
page_result = client.compute_contacts(request=request) | ||
|
||
# Handle the response | ||
async for response in page_result: | ||
print(response) | ||
|
||
# [END essentialcontacts_v1_generated_EssentialContactsService_ComputeContacts_async] |
53 changes: 53 additions & 0 deletions
53
...amples/essentialcontacts_v1_generated_essential_contacts_service_compute_contacts_sync.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# -*- 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 ComputeContacts | ||
# 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-essential-contacts | ||
|
||
|
||
# [START essentialcontacts_v1_generated_EssentialContactsService_ComputeContacts_sync] | ||
# This snippet has been automatically generated and should be regarded as a | ||
# code template only. | ||
# It will require modifications to work: | ||
# - It may require correct/in-range values for request initialization. | ||
# - It may require specifying regional endpoints when creating the service | ||
# client as shown in: | ||
# https://googleapis.dev/python/google-api-core/latest/client_options.html | ||
from google.cloud import essential_contacts_v1 | ||
|
||
|
||
def sample_compute_contacts(): | ||
# Create a client | ||
client = essential_contacts_v1.EssentialContactsServiceClient() | ||
|
||
# Initialize request argument(s) | ||
request = essential_contacts_v1.ComputeContactsRequest( | ||
parent="parent_value", | ||
) | ||
|
||
# Make the request | ||
page_result = client.compute_contacts(request=request) | ||
|
||
# Handle the response | ||
for response in page_result: | ||
print(response) | ||
|
||
# [END essentialcontacts_v1_generated_EssentialContactsService_ComputeContacts_sync] |
58 changes: 58 additions & 0 deletions
58
...samples/essentialcontacts_v1_generated_essential_contacts_service_create_contact_async.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# -*- 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 CreateContact | ||
# 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-essential-contacts | ||
|
||
|
||
# [START essentialcontacts_v1_generated_EssentialContactsService_CreateContact_async] | ||
# This snippet has been automatically generated and should be regarded as a | ||
# code template only. | ||
# It will require modifications to work: | ||
# - It may require correct/in-range values for request initialization. | ||
# - It may require specifying regional endpoints when creating the service | ||
# client as shown in: | ||
# https://googleapis.dev/python/google-api-core/latest/client_options.html | ||
from google.cloud import essential_contacts_v1 | ||
|
||
|
||
async def sample_create_contact(): | ||
# Create a client | ||
client = essential_contacts_v1.EssentialContactsServiceAsyncClient() | ||
|
||
# Initialize request argument(s) | ||
contact = essential_contacts_v1.Contact() | ||
contact.email = "email_value" | ||
contact.notification_category_subscriptions = ['TECHNICAL_INCIDENTS'] | ||
contact.language_tag = "language_tag_value" | ||
|
||
request = essential_contacts_v1.CreateContactRequest( | ||
parent="parent_value", | ||
contact=contact, | ||
) | ||
|
||
# Make the request | ||
response = await client.create_contact(request=request) | ||
|
||
# Handle the response | ||
print(response) | ||
|
||
# [END essentialcontacts_v1_generated_EssentialContactsService_CreateContact_async] |
58 changes: 58 additions & 0 deletions
58
..._samples/essentialcontacts_v1_generated_essential_contacts_service_create_contact_sync.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# -*- 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 CreateContact | ||
# 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-essential-contacts | ||
|
||
|
||
# [START essentialcontacts_v1_generated_EssentialContactsService_CreateContact_sync] | ||
# This snippet has been automatically generated and should be regarded as a | ||
# code template only. | ||
# It will require modifications to work: | ||
# - It may require correct/in-range values for request initialization. | ||
# - It may require specifying regional endpoints when creating the service | ||
# client as shown in: | ||
# https://googleapis.dev/python/google-api-core/latest/client_options.html | ||
from google.cloud import essential_contacts_v1 | ||
|
||
|
||
def sample_create_contact(): | ||
# Create a client | ||
client = essential_contacts_v1.EssentialContactsServiceClient() | ||
|
||
# Initialize request argument(s) | ||
contact = essential_contacts_v1.Contact() | ||
contact.email = "email_value" | ||
contact.notification_category_subscriptions = ['TECHNICAL_INCIDENTS'] | ||
contact.language_tag = "language_tag_value" | ||
|
||
request = essential_contacts_v1.CreateContactRequest( | ||
parent="parent_value", | ||
contact=contact, | ||
) | ||
|
||
# Make the request | ||
response = client.create_contact(request=request) | ||
|
||
# Handle the response | ||
print(response) | ||
|
||
# [END essentialcontacts_v1_generated_EssentialContactsService_CreateContact_sync] |
50 changes: 50 additions & 0 deletions
50
...samples/essentialcontacts_v1_generated_essential_contacts_service_delete_contact_async.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# -*- 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 DeleteContact | ||
# 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-essential-contacts | ||
|
||
|
||
# [START essentialcontacts_v1_generated_EssentialContactsService_DeleteContact_async] | ||
# This snippet has been automatically generated and should be regarded as a | ||
# code template only. | ||
# It will require modifications to work: | ||
# - It may require correct/in-range values for request initialization. | ||
# - It may require specifying regional endpoints when creating the service | ||
# client as shown in: | ||
# https://googleapis.dev/python/google-api-core/latest/client_options.html | ||
from google.cloud import essential_contacts_v1 | ||
|
||
|
||
async def sample_delete_contact(): | ||
# Create a client | ||
client = essential_contacts_v1.EssentialContactsServiceAsyncClient() | ||
|
||
# Initialize request argument(s) | ||
request = essential_contacts_v1.DeleteContactRequest( | ||
name="name_value", | ||
) | ||
|
||
# Make the request | ||
await client.delete_contact(request=request) | ||
|
||
|
||
# [END essentialcontacts_v1_generated_EssentialContactsService_DeleteContact_async] |
Oops, something went wrong.