Class: Telnyx::Resources::NotificationProfiles
- Inherits:
-
Object
- Object
- Telnyx::Resources::NotificationProfiles
- Defined in:
- lib/telnyx/resources/notification_profiles.rb,
sig/telnyx/resources/notification_profiles.rbs
Overview
Notification settings operations
Instance Method Summary collapse
-
#create(name: nil, request_options: {}) ⇒ Telnyx::Models::NotificationProfileCreateResponse
Creates a new notification profile, a named grouping used to organize notification settings, and returns it.
-
#delete(id, request_options: {}) ⇒ Telnyx::Models::NotificationProfileDeleteResponse
Deletes the specified notification profile from your account.
-
#initialize(client:) ⇒ NotificationProfiles
constructor
private
A new instance of NotificationProfiles.
-
#list(page_number: nil, page_size: nil, request_options: {}) ⇒ Telnyx::Internal::DefaultFlatPagination<Telnyx::Models::NotificationProfile>
Returns a list of your notifications profiles.
-
#retrieve(id, request_options: {}) ⇒ Telnyx::Models::NotificationProfileRetrieveResponse
Returns the details of a single notification profile by its identifier.
-
#update(notification_profile_id, name: nil, request_options: {}) ⇒ Telnyx::Models::NotificationProfileUpdateResponse
Updates the specified notification profile and returns the updated profile.
Constructor Details
#initialize(client:) ⇒ NotificationProfiles
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 NotificationProfiles.
121 122 123 |
# File 'lib/telnyx/resources/notification_profiles.rb', line 121 def initialize(client:) @client = client end |
Instance Method Details
#create(name: nil, request_options: {}) ⇒ Telnyx::Models::NotificationProfileCreateResponse
Creates a new notification profile, a named grouping used to organize notification settings, and returns it.
19 20 21 22 23 24 25 26 27 28 |
# File 'lib/telnyx/resources/notification_profiles.rb', line 19 def create(params = {}) parsed, = Telnyx::NotificationProfileCreateParams.dump_request(params) @client.request( method: :post, path: "notification_profiles", body: parsed, model: Telnyx::Models::NotificationProfileCreateResponse, options: ) end |
#delete(id, request_options: {}) ⇒ Telnyx::Models::NotificationProfileDeleteResponse
Deletes the specified notification profile from your account.
109 110 111 112 113 114 115 116 |
# File 'lib/telnyx/resources/notification_profiles.rb', line 109 def delete(id, params = {}) @client.request( method: :delete, path: ["notification_profiles/%1$s", id], model: Telnyx::Models::NotificationProfileDeleteResponse, options: params[:request_options] ) end |
#list(page_number: nil, page_size: nil, request_options: {}) ⇒ Telnyx::Internal::DefaultFlatPagination<Telnyx::Models::NotificationProfile>
Returns a list of your notifications profiles.
85 86 87 88 89 90 91 92 93 94 95 96 |
# File 'lib/telnyx/resources/notification_profiles.rb', line 85 def list(params = {}) parsed, = Telnyx::NotificationProfileListParams.dump_request(params) query = Telnyx::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: "notification_profiles", query: query.transform_keys(page_number: "page[number]", page_size: "page[size]"), page: Telnyx::Internal::DefaultFlatPagination, model: Telnyx::NotificationProfile, options: ) end |
#retrieve(id, request_options: {}) ⇒ Telnyx::Models::NotificationProfileRetrieveResponse
Returns the details of a single notification profile by its identifier.
41 42 43 44 45 46 47 48 |
# File 'lib/telnyx/resources/notification_profiles.rb', line 41 def retrieve(id, params = {}) @client.request( method: :get, path: ["notification_profiles/%1$s", id], model: Telnyx::Models::NotificationProfileRetrieveResponse, options: params[:request_options] ) end |
#update(notification_profile_id, name: nil, request_options: {}) ⇒ Telnyx::Models::NotificationProfileUpdateResponse
Updates the specified notification profile and returns the updated profile.
63 64 65 66 67 68 69 70 71 72 |
# File 'lib/telnyx/resources/notification_profiles.rb', line 63 def update(notification_profile_id, params = {}) parsed, = Telnyx::NotificationProfileUpdateParams.dump_request(params) @client.request( method: :patch, path: ["notification_profiles/%1$s", notification_profile_id], body: parsed, model: Telnyx::Models::NotificationProfileUpdateResponse, options: ) end |