Skip to content

Commit

Permalink
docs: mark fields in Contacts message as REQUIRED (#11420)
Browse files Browse the repository at this point in the history
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 Jun 22, 2023
1 parent b3fb8b7 commit a83db2d
Show file tree
Hide file tree
Showing 20 changed files with 1,914 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = "1.5.1" # {x-release-please-version}
__version__ = "0.1.0" # {x-release-please-version}
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = "1.5.1" # {x-release-please-version}
__version__ = "0.1.0" # {x-release-please-version}
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,14 @@ async def sample_create_contact():
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
Expand Down Expand Up @@ -367,7 +373,13 @@ async def sample_update_contact():
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.UpdateContactRequest(
contact=contact,
)
# Make the request
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -471,8 +471,14 @@ def sample_create_contact():
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
Expand Down Expand Up @@ -586,7 +592,13 @@ def sample_update_contact():
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.UpdateContactRequest(
contact=contact,
)
# Make the request
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,19 @@ class Contact(proto.Message):
Attributes:
name (str):
The identifier for the contact. Format:
Output only. The identifier for the contact. Format:
{resource_type}/{resource_id}/contacts/{contact_id}
email (str):
Required. The email address to send
notifications to. This does not need to be a
Google account.
notifications to. The email address does not
need to be a Google Account.
notification_category_subscriptions (MutableSequence[google.cloud.essential_contacts_v1.types.NotificationCategory]):
The categories of notifications that the
contact will receive communications for.
Required. The categories of notifications
that the contact will receive communications
for.
language_tag (str):
The preferred language for notifications, as a ISO 639-1
language code. See `Supported
Required. The preferred language for notifications, as a ISO
639-1 language code. See `Supported
languages <https://cloud.google.com/resource-manager/docs/managing-notification-contacts#supported-languages>`__
for a list of supported languages.
validation_state (google.cloud.essential_contacts_v1.types.ValidationState):
Expand Down
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]
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]
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]
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]
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]
Loading

0 comments on commit a83db2d

Please sign in to comment.