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 telnyxbash
pip install telnyxSetup
设置
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 is already initialized as shown above.
clientpython
import os
from telnyx import Telnyx
client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # 这是默认配置,可省略
)以下所有示例均假设已按上述方式初始化完成。
clientList notification channels
列出通知渠道
List notification channels.
GET /notification_channelspython
page = client.notification_channels.list()
page = page.data[0]
print(page.id)列出所有通知渠道。
GET /notification_channelspython
page = client.notification_channels.list()
page = page.data[0]
print(page.id)Create a notification channel
创建通知渠道
Create a notification channel.
POST /notification_channelsOptional: (string), (enum), (date-time), (string), (string), (date-time)
channel_destinationchannel_type_idcreated_atidnotification_profile_idupdated_atpython
notification_channel = client.notification_channels.create()
print(notification_channel.data)创建一条通知渠道。
POST /notification_channels可选参数:(字符串)、(枚举)、(日期时间)、(字符串)、(字符串)、(日期时间)
channel_destinationchannel_type_idcreated_atidnotification_profile_idupdated_atpython
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: (string), (enum), (date-time), (string), (string), (date-time)
channel_destinationchannel_type_idcreated_atidnotification_profile_idupdated_atpython
notification_channel = client.notification_channels.update(
notification_channel_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
print(notification_channel.data)更新指定通知渠道的信息。
PATCH /notification_channels/{id}可选参数:(字符串)、(枚举)、(日期时间)、(字符串)、(字符串)、(日期时间)
channel_destinationchannel_type_idcreated_atidnotification_profile_idupdated_atpython
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_conditionspython
page = client.notification_event_conditions.list()
page = page.data[0]
print(page.id)返回所有通知事件条件的列表。
GET /notification_event_conditionspython
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_eventspython
page = client.notification_events.list()
page = page.data[0]
print(page.id)返回所有通知事件的列表。
GET /notification_eventspython
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_profilespython
page = client.notification_profiles.list()
page = page.data[0]
print(page.id)返回所有通知配置文件的列表。
GET /notification_profilespython
page = client.notification_profiles.list()
page = page.data[0]
print(page.id)Create a notification profile
创建通知配置文件
Create a notification profile.
POST /notification_profilesOptional: (date-time), (string), (string), (date-time)
created_atidnameupdated_atpython
notification_profile = client.notification_profiles.create()
print(notification_profile.data)创建一个通知配置文件。
POST /notification_profiles可选参数:(日期时间)、(字符串)、(字符串)、(日期时间)
created_atidnameupdated_atpython
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: (date-time), (string), (string), (date-time)
created_atidnameupdated_atpython
notification_profile = client.notification_profiles.update(
notification_profile_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
print(notification_profile.data)更新指定通知配置文件的信息。
PATCH /notification_profiles/{id}可选参数:(日期时间)、(字符串)、(字符串)、(日期时间)
created_atidnameupdated_atpython
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_settingspython
page = client.notification_settings.list()
page = page.data[0]
print(page.id)列出所有通知设置。
GET /notification_settingspython
page = client.notification_settings.list()
page = page.data[0]
print(page.id)Add a Notification Setting
添加通知设置
Add a notification setting.
POST /notification_settingsOptional: (string), (string), (date-time), (string), (string), (string), (string), (array[object]), (enum), (date-time)
associated_record_typeassociated_record_type_valuecreated_atidnotification_channel_idnotification_event_condition_idnotification_profile_idparametersstatusupdated_atpython
notification_setting = client.notification_settings.create()
print(notification_setting.data)添加一条通知设置。
POST /notification_settings可选参数:(字符串)、(字符串)、(日期时间)、(字符串)、(字符串)、(字符串)、(字符串)、(对象数组)、(枚举)、(日期时间)
associated_record_typeassociated_record_type_valuecreated_atidnotification_channel_idnotification_event_condition_idnotification_profile_idparametersstatusupdated_atpython
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)