Class: Telnyx::Resources::NotificationSettings

Inherits:
Object
  • Object
show all
Defined in:
lib/telnyx/resources/notification_settings.rb

Overview

Notification settings operations

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ NotificationSettings

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 NotificationSettings.

Parameters:



110
111
112
# File 'lib/telnyx/resources/notification_settings.rb', line 110

def initialize(client:)
  @client = client
end

Instance Method Details

#create(notification_channel_id: nil, notification_event_condition_id: nil, notification_profile_id: nil, parameters: nil, request_options: {}) ⇒ Telnyx::Models::NotificationSettingCreateResponse

Add a notification setting.

Parameters:

  • notification_channel_id (String)

    A UUID reference to the associated Notification Channel.

  • notification_event_condition_id (String)

    A UUID reference to the associated Notification Event Condition.

  • notification_profile_id (String)

    A UUID reference to the associated Notification Profile.

  • parameters (Array<Telnyx::Models::NotificationSetting::Parameter>)
  • request_options (Telnyx::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



24
25
26
27
28
29
30
31
32
33
# File 'lib/telnyx/resources/notification_settings.rb', line 24

def create(params = {})
  parsed, options = Telnyx::NotificationSettingCreateParams.dump_request(params)
  @client.request(
    method: :post,
    path: "notification_settings",
    body: parsed,
    model: Telnyx::Models::NotificationSettingCreateResponse,
    options: options
  )
end

#delete(id, request_options: {}) ⇒ Telnyx::Models::NotificationSettingDeleteResponse

Delete a notification setting.

Parameters:

Returns:

See Also:



98
99
100
101
102
103
104
105
# File 'lib/telnyx/resources/notification_settings.rb', line 98

def delete(id, params = {})
  @client.request(
    method: :delete,
    path: ["notification_settings/%1$s", id],
    model: Telnyx::Models::NotificationSettingDeleteResponse,
    options: params[:request_options]
  )
end

#list(filter: nil, page_number: nil, page_size: nil, request_options: {}) ⇒ Telnyx::Internal::DefaultFlatPagination<Telnyx::Models::NotificationSetting>

Some parameter documentations has been truncated, see Models::NotificationSettingListParams for more details.

List notification settings.

filter[associated_

Parameters:

Returns:

See Also:



74
75
76
77
78
79
80
81
82
83
84
85
# File 'lib/telnyx/resources/notification_settings.rb', line 74

def list(params = {})
  parsed, options = Telnyx::NotificationSettingListParams.dump_request(params)
  query = Telnyx::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: "notification_settings",
    query: query.transform_keys(page_number: "page[number]", page_size: "page[size]"),
    page: Telnyx::Internal::DefaultFlatPagination,
    model: Telnyx::NotificationSetting,
    options: options
  )
end

#retrieve(id, request_options: {}) ⇒ Telnyx::Models::NotificationSettingRetrieveResponse

Get a notification setting.

Parameters:

Returns:

See Also:



46
47
48
49
50
51
52
53
# File 'lib/telnyx/resources/notification_settings.rb', line 46

def retrieve(id, params = {})
  @client.request(
    method: :get,
    path: ["notification_settings/%1$s", id],
    model: Telnyx::Models::NotificationSettingRetrieveResponse,
    options: params[:request_options]
  )
end