surge_api 0.11.0 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +31 -0
- data/README.md +1 -1
- data/lib/surge_api/internal/util.rb +31 -0
- data/lib/surge_api/models/blast_create_params.rb +4 -4
- data/lib/surge_api/models/campaign.rb +0 -1
- data/lib/surge_api/models/phone_number.rb +9 -1
- data/lib/surge_api/models/phone_number_attached_to_campaign_webhook_event.rb +96 -0
- data/lib/surge_api/models/recording_list_params.rb +34 -0
- data/lib/surge_api/models/recording_list_response.rb +101 -0
- data/lib/surge_api/models/recording_retrieve_params.rb +14 -0
- data/lib/surge_api/models/recording_retrieve_response.rb +101 -0
- data/lib/surge_api/models/unwrap_webhook_event.rb +3 -1
- data/lib/surge_api/models/user_list_params.rb +34 -0
- data/lib/surge_api/models.rb +8 -0
- data/lib/surge_api/resources/accounts.rb +2 -1
- data/lib/surge_api/resources/blasts.rb +1 -1
- data/lib/surge_api/resources/campaigns.rb +2 -1
- data/lib/surge_api/resources/contacts.rb +2 -1
- data/lib/surge_api/resources/messages.rb +2 -1
- data/lib/surge_api/resources/phone_numbers.rb +2 -1
- data/lib/surge_api/resources/recordings.rb +51 -0
- data/lib/surge_api/resources/users.rb +31 -0
- data/lib/surge_api/resources/webhooks.rb +1 -1
- data/lib/surge_api/version.rb +1 -1
- data/lib/surge_api.rb +6 -0
- data/rbi/surge_api/internal/util.rbi +20 -0
- data/rbi/surge_api/models/blast_create_params.rbi +4 -4
- data/rbi/surge_api/models/campaign.rbi +0 -1
- data/rbi/surge_api/models/phone_number.rbi +8 -0
- data/rbi/surge_api/models/phone_number_attached_to_campaign_webhook_event.rbi +181 -0
- data/rbi/surge_api/models/recording_list_params.rbi +59 -0
- data/rbi/surge_api/models/recording_list_response.rbi +209 -0
- data/rbi/surge_api/models/recording_retrieve_params.rbi +27 -0
- data/rbi/surge_api/models/recording_retrieve_response.rbi +211 -0
- data/rbi/surge_api/models/unwrap_webhook_event.rbi +1 -0
- data/rbi/surge_api/models/user_list_params.rbi +59 -0
- data/rbi/surge_api/models.rbi +9 -0
- data/rbi/surge_api/resources/blasts.rbi +2 -2
- data/rbi/surge_api/resources/recordings.rbi +37 -0
- data/rbi/surge_api/resources/users.rbi +21 -0
- data/rbi/surge_api/resources/webhooks.rbi +1 -0
- data/sig/surge_api/internal/util.rbs +10 -0
- data/sig/surge_api/models/campaign.rbs +1 -8
- data/sig/surge_api/models/phone_number.rbs +10 -1
- data/sig/surge_api/models/phone_number_attached_to_campaign_webhook_event.rbs +79 -0
- data/sig/surge_api/models/recording_list_params.rbs +32 -0
- data/sig/surge_api/models/recording_list_response.rbs +94 -0
- data/sig/surge_api/models/recording_retrieve_params.rbs +15 -0
- data/sig/surge_api/models/recording_retrieve_response.rbs +94 -0
- data/sig/surge_api/models/unwrap_webhook_event.rbs +1 -0
- data/sig/surge_api/models/user_list_params.rbs +32 -0
- data/sig/surge_api/models.rbs +8 -0
- data/sig/surge_api/resources/recordings.rbs +12 -0
- data/sig/surge_api/resources/users.rbs +7 -0
- data/sig/surge_api/resources/webhooks.rbs +1 -0
- metadata +20 -2
|
@@ -23,10 +23,11 @@ module SurgeAPI
|
|
|
23
23
|
# @see SurgeAPI::Models::PhoneNumberListParams
|
|
24
24
|
def list(account_id, params = {})
|
|
25
25
|
parsed, options = SurgeAPI::PhoneNumberListParams.dump_request(params)
|
|
26
|
+
query = SurgeAPI::Internal::Util.encode_query_params(parsed)
|
|
26
27
|
@client.request(
|
|
27
28
|
method: :get,
|
|
28
29
|
path: ["accounts/%1$s/phone_numbers", account_id],
|
|
29
|
-
query:
|
|
30
|
+
query: query,
|
|
30
31
|
page: SurgeAPI::Internal::Cursor,
|
|
31
32
|
model: SurgeAPI::PhoneNumber,
|
|
32
33
|
options: options
|
|
@@ -3,6 +3,57 @@
|
|
|
3
3
|
module SurgeAPI
|
|
4
4
|
module Resources
|
|
5
5
|
class Recordings
|
|
6
|
+
# Retrieves a Recording object.
|
|
7
|
+
#
|
|
8
|
+
# @overload retrieve(id, request_options: {})
|
|
9
|
+
#
|
|
10
|
+
# @param id [String] The ID of the recording to retrieve.
|
|
11
|
+
#
|
|
12
|
+
# @param request_options [SurgeAPI::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
13
|
+
#
|
|
14
|
+
# @return [SurgeAPI::Models::RecordingRetrieveResponse]
|
|
15
|
+
#
|
|
16
|
+
# @see SurgeAPI::Models::RecordingRetrieveParams
|
|
17
|
+
def retrieve(id, params = {})
|
|
18
|
+
@client.request(
|
|
19
|
+
method: :get,
|
|
20
|
+
path: ["recordings/%1$s", id],
|
|
21
|
+
model: SurgeAPI::Models::RecordingRetrieveResponse,
|
|
22
|
+
options: params[:request_options]
|
|
23
|
+
)
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
# Some parameter documentations has been truncated, see
|
|
27
|
+
# {SurgeAPI::Models::RecordingListParams} for more details.
|
|
28
|
+
#
|
|
29
|
+
# List all recordings for an account with cursor-based pagination.
|
|
30
|
+
#
|
|
31
|
+
# @overload list(account_id, after: nil, before: nil, request_options: {})
|
|
32
|
+
#
|
|
33
|
+
# @param account_id [String] The account ID to list recordings for.
|
|
34
|
+
#
|
|
35
|
+
# @param after [String] Cursor for forward pagination. Use the next_cursor from a previous response.
|
|
36
|
+
#
|
|
37
|
+
# @param before [String] Cursor for backward pagination. Use the previous_cursor from a previous response
|
|
38
|
+
#
|
|
39
|
+
# @param request_options [SurgeAPI::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
40
|
+
#
|
|
41
|
+
# @return [SurgeAPI::Internal::Cursor<SurgeAPI::Models::RecordingListResponse>]
|
|
42
|
+
#
|
|
43
|
+
# @see SurgeAPI::Models::RecordingListParams
|
|
44
|
+
def list(account_id, params = {})
|
|
45
|
+
parsed, options = SurgeAPI::RecordingListParams.dump_request(params)
|
|
46
|
+
query = SurgeAPI::Internal::Util.encode_query_params(parsed)
|
|
47
|
+
@client.request(
|
|
48
|
+
method: :get,
|
|
49
|
+
path: ["accounts/%1$s/recordings", account_id],
|
|
50
|
+
query: query,
|
|
51
|
+
page: SurgeAPI::Internal::Cursor,
|
|
52
|
+
model: SurgeAPI::Models::RecordingListResponse,
|
|
53
|
+
options: options
|
|
54
|
+
)
|
|
55
|
+
end
|
|
56
|
+
|
|
6
57
|
# Deletes a recording. The recording file will be removed from storage
|
|
7
58
|
# asynchronously.
|
|
8
59
|
#
|
|
@@ -83,6 +83,37 @@ module SurgeAPI
|
|
|
83
83
|
)
|
|
84
84
|
end
|
|
85
85
|
|
|
86
|
+
# Some parameter documentations has been truncated, see
|
|
87
|
+
# {SurgeAPI::Models::UserListParams} for more details.
|
|
88
|
+
#
|
|
89
|
+
# List all users for an account with cursor-based pagination.
|
|
90
|
+
#
|
|
91
|
+
# @overload list(account_id, after: nil, before: nil, request_options: {})
|
|
92
|
+
#
|
|
93
|
+
# @param account_id [String] The account ID to list users for.
|
|
94
|
+
#
|
|
95
|
+
# @param after [String] Cursor for forward pagination. Use the next_cursor from a previous response.
|
|
96
|
+
#
|
|
97
|
+
# @param before [String] Cursor for backward pagination. Use the previous_cursor from a previous response
|
|
98
|
+
#
|
|
99
|
+
# @param request_options [SurgeAPI::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
100
|
+
#
|
|
101
|
+
# @return [SurgeAPI::Internal::Cursor<SurgeAPI::Models::User>]
|
|
102
|
+
#
|
|
103
|
+
# @see SurgeAPI::Models::UserListParams
|
|
104
|
+
def list(account_id, params = {})
|
|
105
|
+
parsed, options = SurgeAPI::UserListParams.dump_request(params)
|
|
106
|
+
query = SurgeAPI::Internal::Util.encode_query_params(parsed)
|
|
107
|
+
@client.request(
|
|
108
|
+
method: :get,
|
|
109
|
+
path: ["accounts/%1$s/users", account_id],
|
|
110
|
+
query: query,
|
|
111
|
+
page: SurgeAPI::Internal::Cursor,
|
|
112
|
+
model: SurgeAPI::User,
|
|
113
|
+
options: options
|
|
114
|
+
)
|
|
115
|
+
end
|
|
116
|
+
|
|
86
117
|
# Deletes a user.
|
|
87
118
|
#
|
|
88
119
|
# Once a user has been deleted, they will no longer be permitted to access any of
|
|
@@ -5,7 +5,7 @@ module SurgeAPI
|
|
|
5
5
|
class Webhooks
|
|
6
6
|
# @param payload [String] The raw webhook payload as a string
|
|
7
7
|
#
|
|
8
|
-
# @return [SurgeAPI::Models::CallEndedWebhookEvent, SurgeAPI::Models::CampaignApprovedWebhookEvent, SurgeAPI::Models::ContactOptedInWebhookEvent, SurgeAPI::Models::ContactOptedOutWebhookEvent, SurgeAPI::Models::ConversationCreatedWebhookEvent, SurgeAPI::Models::LinkFollowedWebhookEvent, SurgeAPI::Models::MessageDeliveredWebhookEvent, SurgeAPI::Models::MessageFailedWebhookEvent, SurgeAPI::Models::MessageReceivedWebhookEvent, SurgeAPI::Models::MessageSentWebhookEvent, SurgeAPI::Models::RecordingCompletedWebhookEvent, SurgeAPI::Models::VoicemailReceivedWebhookEvent]
|
|
8
|
+
# @return [SurgeAPI::Models::CallEndedWebhookEvent, SurgeAPI::Models::CampaignApprovedWebhookEvent, SurgeAPI::Models::ContactOptedInWebhookEvent, SurgeAPI::Models::ContactOptedOutWebhookEvent, SurgeAPI::Models::ConversationCreatedWebhookEvent, SurgeAPI::Models::LinkFollowedWebhookEvent, SurgeAPI::Models::MessageDeliveredWebhookEvent, SurgeAPI::Models::MessageFailedWebhookEvent, SurgeAPI::Models::MessageReceivedWebhookEvent, SurgeAPI::Models::MessageSentWebhookEvent, SurgeAPI::Models::PhoneNumberAttachedToCampaignWebhookEvent, SurgeAPI::Models::RecordingCompletedWebhookEvent, SurgeAPI::Models::VoicemailReceivedWebhookEvent]
|
|
9
9
|
def unwrap(payload)
|
|
10
10
|
parsed = JSON.parse(payload, symbolize_names: true)
|
|
11
11
|
SurgeAPI::Internal::Type::Converter.coerce(SurgeAPI::Models::UnwrapWebhookEvent, parsed)
|
data/lib/surge_api/version.rb
CHANGED
data/lib/surge_api.rb
CHANGED
|
@@ -89,6 +89,7 @@ require_relative "surge_api/models/message_retrieve_params"
|
|
|
89
89
|
require_relative "surge_api/models/message_sent_webhook_event"
|
|
90
90
|
require_relative "surge_api/models/organization"
|
|
91
91
|
require_relative "surge_api/models/phone_number"
|
|
92
|
+
require_relative "surge_api/models/phone_number_attached_to_campaign_webhook_event"
|
|
92
93
|
require_relative "surge_api/models/phone_number_list_params"
|
|
93
94
|
require_relative "surge_api/models/phone_number_purchase_params"
|
|
94
95
|
require_relative "surge_api/models/recording_completed_webhook_event"
|
|
@@ -96,11 +97,16 @@ require_relative "surge_api/models/recording_delete_params"
|
|
|
96
97
|
require_relative "surge_api/models/recording_delete_response"
|
|
97
98
|
require_relative "surge_api/models/recording_get_file_params"
|
|
98
99
|
require_relative "surge_api/models/recording_get_file_response"
|
|
100
|
+
require_relative "surge_api/models/recording_list_params"
|
|
101
|
+
require_relative "surge_api/models/recording_list_response"
|
|
102
|
+
require_relative "surge_api/models/recording_retrieve_params"
|
|
103
|
+
require_relative "surge_api/models/recording_retrieve_response"
|
|
99
104
|
require_relative "surge_api/models/unwrap_webhook_event"
|
|
100
105
|
require_relative "surge_api/models/user"
|
|
101
106
|
require_relative "surge_api/models/user_create_params"
|
|
102
107
|
require_relative "surge_api/models/user_create_token_params"
|
|
103
108
|
require_relative "surge_api/models/user_delete_params"
|
|
109
|
+
require_relative "surge_api/models/user_list_params"
|
|
104
110
|
require_relative "surge_api/models/user_retrieve_params"
|
|
105
111
|
require_relative "surge_api/models/user_token_response"
|
|
106
112
|
require_relative "surge_api/models/user_update_params"
|
|
@@ -301,6 +301,26 @@ module SurgeAPI
|
|
|
301
301
|
T.let(%r{^application/(:?x-(?:n|l)djson)|(:?(?:x-)?jsonl)}, Regexp)
|
|
302
302
|
|
|
303
303
|
class << self
|
|
304
|
+
# @api private
|
|
305
|
+
sig do
|
|
306
|
+
params(query: SurgeAPI::Internal::AnyHash).returns(
|
|
307
|
+
SurgeAPI::Internal::AnyHash
|
|
308
|
+
)
|
|
309
|
+
end
|
|
310
|
+
def encode_query_params(query)
|
|
311
|
+
end
|
|
312
|
+
|
|
313
|
+
# @api private
|
|
314
|
+
sig do
|
|
315
|
+
params(
|
|
316
|
+
collection: SurgeAPI::Internal::AnyHash,
|
|
317
|
+
key: String,
|
|
318
|
+
element: T.anything
|
|
319
|
+
).void
|
|
320
|
+
end
|
|
321
|
+
private def write_query_param_element!(collection, key, element)
|
|
322
|
+
end
|
|
323
|
+
|
|
304
324
|
# @api private
|
|
305
325
|
sig do
|
|
306
326
|
params(
|
|
@@ -50,7 +50,7 @@ module SurgeAPI
|
|
|
50
50
|
sig { params(name: String).void }
|
|
51
51
|
attr_writer :name
|
|
52
52
|
|
|
53
|
-
# Deprecated. Use `to` instead.
|
|
53
|
+
# Deprecated. Use `to` with audience IDs instead.
|
|
54
54
|
sig { returns(T.nilable(T::Array[String])) }
|
|
55
55
|
attr_reader :segments
|
|
56
56
|
|
|
@@ -65,7 +65,7 @@ module SurgeAPI
|
|
|
65
65
|
attr_writer :send_at
|
|
66
66
|
|
|
67
67
|
# List of recipients to whom the blast should be sent. This can be a combination
|
|
68
|
-
# of contact IDs,
|
|
68
|
+
# of contact IDs, audience IDs, and phone numbers.
|
|
69
69
|
sig { returns(T.nilable(T::Array[String])) }
|
|
70
70
|
attr_reader :to
|
|
71
71
|
|
|
@@ -98,12 +98,12 @@ module SurgeAPI
|
|
|
98
98
|
from: nil,
|
|
99
99
|
# Optional name for the blast.
|
|
100
100
|
name: nil,
|
|
101
|
-
# Deprecated. Use `to` instead.
|
|
101
|
+
# Deprecated. Use `to` with audience IDs instead.
|
|
102
102
|
segments: nil,
|
|
103
103
|
# When to send the blast. If not provided, sends immediately.
|
|
104
104
|
send_at: nil,
|
|
105
105
|
# List of recipients to whom the blast should be sent. This can be a combination
|
|
106
|
-
# of contact IDs,
|
|
106
|
+
# of contact IDs, audience IDs, and phone numbers.
|
|
107
107
|
to: nil,
|
|
108
108
|
request_options: {}
|
|
109
109
|
)
|
|
@@ -276,7 +276,6 @@ module SurgeAPI
|
|
|
276
276
|
DEACTIVATED =
|
|
277
277
|
T.let(:deactivated, SurgeAPI::Campaign::Status::TaggedSymbol)
|
|
278
278
|
IN_REVIEW = T.let(:in_review, SurgeAPI::Campaign::Status::TaggedSymbol)
|
|
279
|
-
PENDING = T.let(:pending, SurgeAPI::Campaign::Status::TaggedSymbol)
|
|
280
279
|
REJECTED = T.let(:rejected, SurgeAPI::Campaign::Status::TaggedSymbol)
|
|
281
280
|
|
|
282
281
|
sig do
|
|
@@ -12,6 +12,10 @@ module SurgeAPI
|
|
|
12
12
|
sig { returns(String) }
|
|
13
13
|
attr_accessor :id
|
|
14
14
|
|
|
15
|
+
# The unique identifier of the campaign this phone number is attached to, if any
|
|
16
|
+
sig { returns(T.nilable(String)) }
|
|
17
|
+
attr_accessor :campaign_id
|
|
18
|
+
|
|
15
19
|
# The phone number in E.164 format
|
|
16
20
|
sig { returns(String) }
|
|
17
21
|
attr_accessor :number
|
|
@@ -24,6 +28,7 @@ module SurgeAPI
|
|
|
24
28
|
sig do
|
|
25
29
|
params(
|
|
26
30
|
id: String,
|
|
31
|
+
campaign_id: T.nilable(String),
|
|
27
32
|
number: String,
|
|
28
33
|
type: SurgeAPI::PhoneNumber::Type::OrSymbol
|
|
29
34
|
).returns(T.attached_class)
|
|
@@ -31,6 +36,8 @@ module SurgeAPI
|
|
|
31
36
|
def self.new(
|
|
32
37
|
# Unique identifier for the phone number
|
|
33
38
|
id:,
|
|
39
|
+
# The unique identifier of the campaign this phone number is attached to, if any
|
|
40
|
+
campaign_id:,
|
|
34
41
|
# The phone number in E.164 format
|
|
35
42
|
number:,
|
|
36
43
|
# Whether the phone number is local, toll-free, or short code
|
|
@@ -42,6 +49,7 @@ module SurgeAPI
|
|
|
42
49
|
override.returns(
|
|
43
50
|
{
|
|
44
51
|
id: String,
|
|
52
|
+
campaign_id: T.nilable(String),
|
|
45
53
|
number: String,
|
|
46
54
|
type: SurgeAPI::PhoneNumber::Type::TaggedSymbol
|
|
47
55
|
}
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module SurgeAPI
|
|
4
|
+
module Models
|
|
5
|
+
class PhoneNumberAttachedToCampaignWebhookEvent < SurgeAPI::Internal::Type::BaseModel
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias do
|
|
8
|
+
T.any(
|
|
9
|
+
SurgeAPI::PhoneNumberAttachedToCampaignWebhookEvent,
|
|
10
|
+
SurgeAPI::Internal::AnyHash
|
|
11
|
+
)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
# The ID of the account in which this event occurred
|
|
15
|
+
sig { returns(String) }
|
|
16
|
+
attr_accessor :account_id
|
|
17
|
+
|
|
18
|
+
# The data associated with the event
|
|
19
|
+
sig { returns(SurgeAPI::PhoneNumberAttachedToCampaignWebhookEvent::Data) }
|
|
20
|
+
attr_reader :data
|
|
21
|
+
|
|
22
|
+
sig do
|
|
23
|
+
params(
|
|
24
|
+
data:
|
|
25
|
+
SurgeAPI::PhoneNumberAttachedToCampaignWebhookEvent::Data::OrHash
|
|
26
|
+
).void
|
|
27
|
+
end
|
|
28
|
+
attr_writer :data
|
|
29
|
+
|
|
30
|
+
# The timestamp when this event occurred, in ISO8601 format
|
|
31
|
+
sig { returns(Time) }
|
|
32
|
+
attr_accessor :timestamp
|
|
33
|
+
|
|
34
|
+
# The type of the event. Always `phone_number.attached_to_campaign` for this
|
|
35
|
+
# event.
|
|
36
|
+
sig { returns(Symbol) }
|
|
37
|
+
attr_accessor :type
|
|
38
|
+
|
|
39
|
+
sig do
|
|
40
|
+
params(
|
|
41
|
+
account_id: String,
|
|
42
|
+
data:
|
|
43
|
+
SurgeAPI::PhoneNumberAttachedToCampaignWebhookEvent::Data::OrHash,
|
|
44
|
+
timestamp: Time,
|
|
45
|
+
type: Symbol
|
|
46
|
+
).returns(T.attached_class)
|
|
47
|
+
end
|
|
48
|
+
def self.new(
|
|
49
|
+
# The ID of the account in which this event occurred
|
|
50
|
+
account_id:,
|
|
51
|
+
# The data associated with the event
|
|
52
|
+
data:,
|
|
53
|
+
# The timestamp when this event occurred, in ISO8601 format
|
|
54
|
+
timestamp:,
|
|
55
|
+
# The type of the event. Always `phone_number.attached_to_campaign` for this
|
|
56
|
+
# event.
|
|
57
|
+
type: :"phone_number.attached_to_campaign"
|
|
58
|
+
)
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
sig do
|
|
62
|
+
override.returns(
|
|
63
|
+
{
|
|
64
|
+
account_id: String,
|
|
65
|
+
data: SurgeAPI::PhoneNumberAttachedToCampaignWebhookEvent::Data,
|
|
66
|
+
timestamp: Time,
|
|
67
|
+
type: Symbol
|
|
68
|
+
}
|
|
69
|
+
)
|
|
70
|
+
end
|
|
71
|
+
def to_hash
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
class Data < SurgeAPI::Internal::Type::BaseModel
|
|
75
|
+
OrHash =
|
|
76
|
+
T.type_alias do
|
|
77
|
+
T.any(
|
|
78
|
+
SurgeAPI::PhoneNumberAttachedToCampaignWebhookEvent::Data,
|
|
79
|
+
SurgeAPI::Internal::AnyHash
|
|
80
|
+
)
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
# The unique identifier for the phone number
|
|
84
|
+
sig { returns(String) }
|
|
85
|
+
attr_accessor :id
|
|
86
|
+
|
|
87
|
+
# The unique identifier of the campaign this phone number is attached to
|
|
88
|
+
sig { returns(String) }
|
|
89
|
+
attr_accessor :campaign_id
|
|
90
|
+
|
|
91
|
+
# The phone number in E.164 format
|
|
92
|
+
sig { returns(String) }
|
|
93
|
+
attr_accessor :number
|
|
94
|
+
|
|
95
|
+
# Whether the phone number is local, toll-free, or short code
|
|
96
|
+
sig do
|
|
97
|
+
returns(
|
|
98
|
+
SurgeAPI::PhoneNumberAttachedToCampaignWebhookEvent::Data::Type::TaggedSymbol
|
|
99
|
+
)
|
|
100
|
+
end
|
|
101
|
+
attr_accessor :type
|
|
102
|
+
|
|
103
|
+
# The data associated with the event
|
|
104
|
+
sig do
|
|
105
|
+
params(
|
|
106
|
+
id: String,
|
|
107
|
+
campaign_id: String,
|
|
108
|
+
number: String,
|
|
109
|
+
type:
|
|
110
|
+
SurgeAPI::PhoneNumberAttachedToCampaignWebhookEvent::Data::Type::OrSymbol
|
|
111
|
+
).returns(T.attached_class)
|
|
112
|
+
end
|
|
113
|
+
def self.new(
|
|
114
|
+
# The unique identifier for the phone number
|
|
115
|
+
id:,
|
|
116
|
+
# The unique identifier of the campaign this phone number is attached to
|
|
117
|
+
campaign_id:,
|
|
118
|
+
# The phone number in E.164 format
|
|
119
|
+
number:,
|
|
120
|
+
# Whether the phone number is local, toll-free, or short code
|
|
121
|
+
type:
|
|
122
|
+
)
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
sig do
|
|
126
|
+
override.returns(
|
|
127
|
+
{
|
|
128
|
+
id: String,
|
|
129
|
+
campaign_id: String,
|
|
130
|
+
number: String,
|
|
131
|
+
type:
|
|
132
|
+
SurgeAPI::PhoneNumberAttachedToCampaignWebhookEvent::Data::Type::TaggedSymbol
|
|
133
|
+
}
|
|
134
|
+
)
|
|
135
|
+
end
|
|
136
|
+
def to_hash
|
|
137
|
+
end
|
|
138
|
+
|
|
139
|
+
# Whether the phone number is local, toll-free, or short code
|
|
140
|
+
module Type
|
|
141
|
+
extend SurgeAPI::Internal::Type::Enum
|
|
142
|
+
|
|
143
|
+
TaggedSymbol =
|
|
144
|
+
T.type_alias do
|
|
145
|
+
T.all(
|
|
146
|
+
Symbol,
|
|
147
|
+
SurgeAPI::PhoneNumberAttachedToCampaignWebhookEvent::Data::Type
|
|
148
|
+
)
|
|
149
|
+
end
|
|
150
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
151
|
+
|
|
152
|
+
LOCAL =
|
|
153
|
+
T.let(
|
|
154
|
+
:local,
|
|
155
|
+
SurgeAPI::PhoneNumberAttachedToCampaignWebhookEvent::Data::Type::TaggedSymbol
|
|
156
|
+
)
|
|
157
|
+
SHORT_CODE =
|
|
158
|
+
T.let(
|
|
159
|
+
:short_code,
|
|
160
|
+
SurgeAPI::PhoneNumberAttachedToCampaignWebhookEvent::Data::Type::TaggedSymbol
|
|
161
|
+
)
|
|
162
|
+
TOLL_FREE =
|
|
163
|
+
T.let(
|
|
164
|
+
:toll_free,
|
|
165
|
+
SurgeAPI::PhoneNumberAttachedToCampaignWebhookEvent::Data::Type::TaggedSymbol
|
|
166
|
+
)
|
|
167
|
+
|
|
168
|
+
sig do
|
|
169
|
+
override.returns(
|
|
170
|
+
T::Array[
|
|
171
|
+
SurgeAPI::PhoneNumberAttachedToCampaignWebhookEvent::Data::Type::TaggedSymbol
|
|
172
|
+
]
|
|
173
|
+
)
|
|
174
|
+
end
|
|
175
|
+
def self.values
|
|
176
|
+
end
|
|
177
|
+
end
|
|
178
|
+
end
|
|
179
|
+
end
|
|
180
|
+
end
|
|
181
|
+
end
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module SurgeAPI
|
|
4
|
+
module Models
|
|
5
|
+
class RecordingListParams < SurgeAPI::Internal::Type::BaseModel
|
|
6
|
+
extend SurgeAPI::Internal::Type::RequestParameters::Converter
|
|
7
|
+
include SurgeAPI::Internal::Type::RequestParameters
|
|
8
|
+
|
|
9
|
+
OrHash =
|
|
10
|
+
T.type_alias do
|
|
11
|
+
T.any(SurgeAPI::RecordingListParams, SurgeAPI::Internal::AnyHash)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
# Cursor for forward pagination. Use the next_cursor from a previous response.
|
|
15
|
+
sig { returns(T.nilable(String)) }
|
|
16
|
+
attr_reader :after
|
|
17
|
+
|
|
18
|
+
sig { params(after: String).void }
|
|
19
|
+
attr_writer :after
|
|
20
|
+
|
|
21
|
+
# Cursor for backward pagination. Use the previous_cursor from a previous
|
|
22
|
+
# response.
|
|
23
|
+
sig { returns(T.nilable(String)) }
|
|
24
|
+
attr_reader :before
|
|
25
|
+
|
|
26
|
+
sig { params(before: String).void }
|
|
27
|
+
attr_writer :before
|
|
28
|
+
|
|
29
|
+
sig do
|
|
30
|
+
params(
|
|
31
|
+
after: String,
|
|
32
|
+
before: String,
|
|
33
|
+
request_options: SurgeAPI::RequestOptions::OrHash
|
|
34
|
+
).returns(T.attached_class)
|
|
35
|
+
end
|
|
36
|
+
def self.new(
|
|
37
|
+
# Cursor for forward pagination. Use the next_cursor from a previous response.
|
|
38
|
+
after: nil,
|
|
39
|
+
# Cursor for backward pagination. Use the previous_cursor from a previous
|
|
40
|
+
# response.
|
|
41
|
+
before: nil,
|
|
42
|
+
request_options: {}
|
|
43
|
+
)
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
sig do
|
|
47
|
+
override.returns(
|
|
48
|
+
{
|
|
49
|
+
after: String,
|
|
50
|
+
before: String,
|
|
51
|
+
request_options: SurgeAPI::RequestOptions
|
|
52
|
+
}
|
|
53
|
+
)
|
|
54
|
+
end
|
|
55
|
+
def to_hash
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
end
|