Class: Telnyx::Resources::NotificationChannels
- Inherits:
-
Object
- Object
- Telnyx::Resources::NotificationChannels
- Defined in:
- lib/telnyx/resources/notification_channels.rb,
sig/telnyx/resources/notification_channels.rbs
Overview
Notification settings operations
Instance Method Summary collapse
-
#create(channel_destination: nil, channel_type_id: nil, notification_profile_id: nil, request_options: {}) ⇒ Telnyx::Models::NotificationChannelCreateResponse
Creates a new notification channel defining where notifications are delivered, and returns the created channel.
-
#delete(id, request_options: {}) ⇒ Telnyx::Models::NotificationChannelDeleteResponse
Deletes the specified notification channel so notifications are no longer delivered to it.
-
#initialize(client:) ⇒ NotificationChannels
constructor
private
A new instance of NotificationChannels.
-
#list(filter: nil, page_number: nil, page_size: nil, request_options: {}) ⇒ Telnyx::Internal::DefaultFlatPagination<Telnyx::Models::NotificationChannel>
Some parameter documentations has been truncated, see Models::NotificationChannelListParams for more details.
-
#retrieve(id, request_options: {}) ⇒ Telnyx::Models::NotificationChannelRetrieveResponse
Returns the details of a single notification channel by its identifier.
-
#update(notification_channel_id, channel_destination: nil, channel_type_id: nil, notification_profile_id: nil, request_options: {}) ⇒ Telnyx::Models::NotificationChannelUpdateResponse
Updates the specified notification channel and returns the updated channel.
Constructor Details
#initialize(client:) ⇒ NotificationChannels
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of NotificationChannels.
139 140 141 |
# File 'lib/telnyx/resources/notification_channels.rb', line 139 def initialize(client:) @client = client end |
Instance Method Details
#create(channel_destination: nil, channel_type_id: nil, notification_profile_id: nil, request_options: {}) ⇒ Telnyx::Models::NotificationChannelCreateResponse
Creates a new notification channel defining where notifications are delivered, and returns the created channel.
23 24 25 26 27 28 29 30 31 32 |
# File 'lib/telnyx/resources/notification_channels.rb', line 23 def create(params = {}) parsed, = Telnyx::NotificationChannelCreateParams.dump_request(params) @client.request( method: :post, path: "notification_channels", body: parsed, model: Telnyx::Models::NotificationChannelCreateResponse, options: ) end |
#delete(id, request_options: {}) ⇒ Telnyx::Models::NotificationChannelDeleteResponse
Deletes the specified notification channel so notifications are no longer delivered to it.
127 128 129 130 131 132 133 134 |
# File 'lib/telnyx/resources/notification_channels.rb', line 127 def delete(id, params = {}) @client.request( method: :delete, path: ["notification_channels/%1$s", id], model: Telnyx::Models::NotificationChannelDeleteResponse, options: params[:request_options] ) end |
#list(filter: nil, page_number: nil, page_size: nil, request_options: {}) ⇒ Telnyx::Internal::DefaultFlatPagination<Telnyx::Models::NotificationChannel>
Some parameter documentations has been truncated, see Models::NotificationChannelListParams for more details.
Returns a paginated list of your notification channels, the destinations that receive notifications.
filter[associated_
102 103 104 105 106 107 108 109 110 111 112 113 |
# File 'lib/telnyx/resources/notification_channels.rb', line 102 def list(params = {}) parsed, = Telnyx::NotificationChannelListParams.dump_request(params) query = Telnyx::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: "notification_channels", query: query.transform_keys(page_number: "page[number]", page_size: "page[size]"), page: Telnyx::Internal::DefaultFlatPagination, model: Telnyx::NotificationChannel, options: ) end |
#retrieve(id, request_options: {}) ⇒ Telnyx::Models::NotificationChannelRetrieveResponse
Returns the details of a single notification channel by its identifier.
45 46 47 48 49 50 51 52 |
# File 'lib/telnyx/resources/notification_channels.rb', line 45 def retrieve(id, params = {}) @client.request( method: :get, path: ["notification_channels/%1$s", id], model: Telnyx::Models::NotificationChannelRetrieveResponse, options: params[:request_options] ) end |
#update(notification_channel_id, channel_destination: nil, channel_type_id: nil, notification_profile_id: nil, request_options: {}) ⇒ Telnyx::Models::NotificationChannelUpdateResponse
Updates the specified notification channel and returns the updated channel.
71 72 73 74 75 76 77 78 79 80 |
# File 'lib/telnyx/resources/notification_channels.rb', line 71 def update(notification_channel_id, params = {}) parsed, = Telnyx::NotificationChannelUpdateParams.dump_request(params) @client.request( method: :patch, path: ["notification_channels/%1$s", notification_channel_id], body: parsed, model: Telnyx::Models::NotificationChannelUpdateResponse, options: ) end |