telnyx-account-notifications-python

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese
<!-- Auto-generated from Telnyx OpenAPI specs. Do not edit. -->
<!-- 由Telnyx OpenAPI规范自动生成,请勿编辑。 -->

Telnyx Account Notifications - Python

Telnyx 账户通知 - Python版

Installation

安装

bash
pip install telnyx
bash
pip install telnyx

Setup

设置

python
import os
from telnyx import Telnyx

client = Telnyx(
    api_key=os.environ.get("TELNYX_API_KEY"),  # This is the default and can be omitted
)
All examples below assume
client
is already initialized as shown above.
python
import os
from telnyx import Telnyx

client = Telnyx(
    api_key=os.environ.get("TELNYX_API_KEY"),  # 这是默认配置,可省略
)
以下所有示例均假设
client
已按上述方式初始化完成。

List notification channels

列出通知渠道

List notification channels.
GET /notification_channels
python
page = client.notification_channels.list()
page = page.data[0]
print(page.id)
列出所有通知渠道。
GET /notification_channels
python
page = client.notification_channels.list()
page = page.data[0]
print(page.id)

Create a notification channel

创建通知渠道

Create a notification channel.
POST /notification_channels
Optional:
channel_destination
(string),
channel_type_id
(enum),
created_at
(date-time),
id
(string),
notification_profile_id
(string),
updated_at
(date-time)
python
notification_channel = client.notification_channels.create()
print(notification_channel.data)
创建一条通知渠道。
POST /notification_channels
可选参数:
channel_destination
(字符串)、
channel_type_id
(枚举)、
created_at
(日期时间)、
id
(字符串)、
notification_profile_id
(字符串)、
updated_at
(日期时间)
python
notification_channel = client.notification_channels.create()
print(notification_channel.data)

Get a notification channel

获取通知渠道详情

Get a notification channel.
GET /notification_channels/{id}
python
notification_channel = client.notification_channels.retrieve(
    "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
print(notification_channel.data)
获取指定通知渠道的详情。
GET /notification_channels/{id}
python
notification_channel = client.notification_channels.retrieve(
    "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
print(notification_channel.data)

Update a notification channel

更新通知渠道

Update a notification channel.
PATCH /notification_channels/{id}
Optional:
channel_destination
(string),
channel_type_id
(enum),
created_at
(date-time),
id
(string),
notification_profile_id
(string),
updated_at
(date-time)
python
notification_channel = client.notification_channels.update(
    notification_channel_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
print(notification_channel.data)
更新指定通知渠道的信息。
PATCH /notification_channels/{id}
可选参数:
channel_destination
(字符串)、
channel_type_id
(枚举)、
created_at
(日期时间)、
id
(字符串)、
notification_profile_id
(字符串)、
updated_at
(日期时间)
python
notification_channel = client.notification_channels.update(
    notification_channel_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
print(notification_channel.data)

Delete a notification channel

删除通知渠道

Delete a notification channel.
DELETE /notification_channels/{id}
python
notification_channel = client.notification_channels.delete(
    "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
print(notification_channel.data)
删除指定通知渠道。
DELETE /notification_channels/{id}
python
notification_channel = client.notification_channels.delete(
    "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
print(notification_channel.data)

List all Notifications Events Conditions

列出所有通知事件条件

Returns a list of your notifications events conditions.
GET /notification_event_conditions
python
page = client.notification_event_conditions.list()
page = page.data[0]
print(page.id)
返回所有通知事件条件的列表。
GET /notification_event_conditions
python
page = client.notification_event_conditions.list()
page = page.data[0]
print(page.id)

List all Notifications Events

列出所有通知事件

Returns a list of your notifications events.
GET /notification_events
python
page = client.notification_events.list()
page = page.data[0]
print(page.id)
返回所有通知事件的列表。
GET /notification_events
python
page = client.notification_events.list()
page = page.data[0]
print(page.id)

List all Notifications Profiles

列出所有通知配置文件

Returns a list of your notifications profiles.
GET /notification_profiles
python
page = client.notification_profiles.list()
page = page.data[0]
print(page.id)
返回所有通知配置文件的列表。
GET /notification_profiles
python
page = client.notification_profiles.list()
page = page.data[0]
print(page.id)

Create a notification profile

创建通知配置文件

Create a notification profile.
POST /notification_profiles
Optional:
created_at
(date-time),
id
(string),
name
(string),
updated_at
(date-time)
python
notification_profile = client.notification_profiles.create()
print(notification_profile.data)
创建一个通知配置文件。
POST /notification_profiles
可选参数:
created_at
(日期时间)、
id
(字符串)、
name
(字符串)、
updated_at
(日期时间)
python
notification_profile = client.notification_profiles.create()
print(notification_profile.data)

Get a notification profile

获取通知配置文件详情

Get a notification profile.
GET /notification_profiles/{id}
python
notification_profile = client.notification_profiles.retrieve(
    "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
print(notification_profile.data)
获取指定通知配置文件的详情。
GET /notification_profiles/{id}
python
notification_profile = client.notification_profiles.retrieve(
    "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
print(notification_profile.data)

Update a notification profile

更新通知配置文件

Update a notification profile.
PATCH /notification_profiles/{id}
Optional:
created_at
(date-time),
id
(string),
name
(string),
updated_at
(date-time)
python
notification_profile = client.notification_profiles.update(
    notification_profile_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
print(notification_profile.data)
更新指定通知配置文件的信息。
PATCH /notification_profiles/{id}
可选参数:
created_at
(日期时间)、
id
(字符串)、
name
(字符串)、
updated_at
(日期时间)
python
notification_profile = client.notification_profiles.update(
    notification_profile_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
print(notification_profile.data)

Delete a notification profile

删除通知配置文件

Delete a notification profile.
DELETE /notification_profiles/{id}
python
notification_profile = client.notification_profiles.delete(
    "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
print(notification_profile.data)
删除指定通知配置文件。
DELETE /notification_profiles/{id}
python
notification_profile = client.notification_profiles.delete(
    "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
print(notification_profile.data)

List notification settings

列出通知设置

List notification settings.
GET /notification_settings
python
page = client.notification_settings.list()
page = page.data[0]
print(page.id)
列出所有通知设置。
GET /notification_settings
python
page = client.notification_settings.list()
page = page.data[0]
print(page.id)

Add a Notification Setting

添加通知设置

Add a notification setting.
POST /notification_settings
Optional:
associated_record_type
(string),
associated_record_type_value
(string),
created_at
(date-time),
id
(string),
notification_channel_id
(string),
notification_event_condition_id
(string),
notification_profile_id
(string),
parameters
(array[object]),
status
(enum),
updated_at
(date-time)
python
notification_setting = client.notification_settings.create()
print(notification_setting.data)
添加一条通知设置。
POST /notification_settings
可选参数:
associated_record_type
(字符串)、
associated_record_type_value
(字符串)、
created_at
(日期时间)、
id
(字符串)、
notification_channel_id
(字符串)、
notification_event_condition_id
(字符串)、
notification_profile_id
(字符串)、
parameters
(对象数组)、
status
(枚举)、
updated_at
(日期时间)
python
notification_setting = client.notification_settings.create()
print(notification_setting.data)

Get a notification setting

获取通知设置详情

Get a notification setting.
GET /notification_settings/{id}
python
notification_setting = client.notification_settings.retrieve(
    "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
print(notification_setting.data)
获取指定通知设置的详情。
GET /notification_settings/{id}
python
notification_setting = client.notification_settings.retrieve(
    "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
print(notification_setting.data)

Delete a notification setting

删除通知设置

Delete a notification setting.
DELETE /notification_settings/{id}
python
notification_setting = client.notification_settings.delete(
    "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
print(notification_setting.data)
删除指定通知设置。
DELETE /notification_settings/{id}
python
notification_setting = client.notification_settings.delete(
    "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
print(notification_setting.data)