surge_api 0.10.0 → 0.12.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 +40 -0
- data/README.md +6 -6
- data/lib/surge_api/internal/cursor.rb +2 -2
- 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/campaign_list_params.rb +34 -0
- data/lib/surge_api/models/message.rb +18 -3
- data/lib/surge_api/models/message_delivered_webhook_event.rb +9 -1
- data/lib/surge_api/models/message_failed_webhook_event.rb +9 -1
- data/lib/surge_api/models/message_received_webhook_event.rb +9 -1
- data/lib/surge_api/models/message_sent_webhook_event.rb +9 -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_delete_params.rb +14 -0
- data/lib/surge_api/models/recording_delete_response.rb +101 -0
- data/lib/surge_api/models/unwrap_webhook_event.rb +3 -1
- data/lib/surge_api/models.rb +6 -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 +31 -0
- 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 +21 -0
- data/lib/surge_api/resources/webhooks.rb +1 -1
- data/lib/surge_api/version.rb +1 -1
- data/lib/surge_api.rb +4 -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/campaign_list_params.rbi +59 -0
- data/rbi/surge_api/models/message.rbi +42 -6
- data/rbi/surge_api/models/message_delivered_webhook_event.rbi +8 -0
- data/rbi/surge_api/models/message_failed_webhook_event.rbi +8 -0
- data/rbi/surge_api/models/message_received_webhook_event.rbi +8 -0
- data/rbi/surge_api/models/message_sent_webhook_event.rbi +8 -0
- 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_delete_params.rbi +27 -0
- data/rbi/surge_api/models/recording_delete_response.rbi +211 -0
- data/rbi/surge_api/models/unwrap_webhook_event.rbi +1 -0
- data/rbi/surge_api/models.rbi +7 -0
- data/rbi/surge_api/resources/blasts.rbi +2 -2
- data/rbi/surge_api/resources/campaigns.rbi +21 -0
- data/rbi/surge_api/resources/recordings.rbi +15 -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/campaign_list_params.rbs +32 -0
- data/sig/surge_api/models/message.rbs +33 -5
- data/sig/surge_api/models/message_delivered_webhook_event.rbs +5 -0
- data/sig/surge_api/models/message_failed_webhook_event.rbs +5 -0
- data/sig/surge_api/models/message_received_webhook_event.rbs +5 -0
- data/sig/surge_api/models/message_sent_webhook_event.rbs +5 -0
- 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_delete_params.rbs +15 -0
- data/sig/surge_api/models/recording_delete_response.rbs +94 -0
- data/sig/surge_api/models/unwrap_webhook_event.rbs +1 -0
- data/sig/surge_api/models.rbs +6 -0
- data/sig/surge_api/resources/campaigns.rbs +7 -0
- data/sig/surge_api/resources/recordings.rbs +5 -0
- data/sig/surge_api/resources/webhooks.rbs +1 -0
- metadata +14 -2
|
@@ -111,10 +111,11 @@ module SurgeAPI
|
|
|
111
111
|
# @see SurgeAPI::Models::AccountRetrieveStatusParams
|
|
112
112
|
def retrieve_status(account_id, params = {})
|
|
113
113
|
parsed, options = SurgeAPI::AccountRetrieveStatusParams.dump_request(params)
|
|
114
|
+
query = SurgeAPI::Internal::Util.encode_query_params(parsed)
|
|
114
115
|
@client.request(
|
|
115
116
|
method: :get,
|
|
116
117
|
path: ["accounts/%1$s/status", account_id],
|
|
117
|
-
query:
|
|
118
|
+
query: query,
|
|
118
119
|
model: SurgeAPI::AccountStatus,
|
|
119
120
|
options: options
|
|
120
121
|
)
|
|
@@ -22,7 +22,7 @@ module SurgeAPI
|
|
|
22
22
|
#
|
|
23
23
|
# @param name [String] Optional name for the blast.
|
|
24
24
|
#
|
|
25
|
-
# @param segments [Array<String>] Deprecated. Use `to` instead.
|
|
25
|
+
# @param segments [Array<String>] Deprecated. Use `to` with audience IDs instead.
|
|
26
26
|
#
|
|
27
27
|
# @param send_at [Time] When to send the blast. If not provided, sends immediately.
|
|
28
28
|
#
|
|
@@ -55,6 +55,37 @@ module SurgeAPI
|
|
|
55
55
|
)
|
|
56
56
|
end
|
|
57
57
|
|
|
58
|
+
# Some parameter documentations has been truncated, see
|
|
59
|
+
# {SurgeAPI::Models::CampaignListParams} for more details.
|
|
60
|
+
#
|
|
61
|
+
# List all campaigns for an account with cursor-based pagination.
|
|
62
|
+
#
|
|
63
|
+
# @overload list(account_id, after: nil, before: nil, request_options: {})
|
|
64
|
+
#
|
|
65
|
+
# @param account_id [String] The account ID to list campaigns for.
|
|
66
|
+
#
|
|
67
|
+
# @param after [String] Cursor for forward pagination. Use the next_cursor from a previous response.
|
|
68
|
+
#
|
|
69
|
+
# @param before [String] Cursor for backward pagination. Use the previous_cursor from a previous response
|
|
70
|
+
#
|
|
71
|
+
# @param request_options [SurgeAPI::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
72
|
+
#
|
|
73
|
+
# @return [SurgeAPI::Internal::Cursor<SurgeAPI::Models::Campaign>]
|
|
74
|
+
#
|
|
75
|
+
# @see SurgeAPI::Models::CampaignListParams
|
|
76
|
+
def list(account_id, params = {})
|
|
77
|
+
parsed, options = SurgeAPI::CampaignListParams.dump_request(params)
|
|
78
|
+
query = SurgeAPI::Internal::Util.encode_query_params(parsed)
|
|
79
|
+
@client.request(
|
|
80
|
+
method: :get,
|
|
81
|
+
path: ["accounts/%1$s/campaigns", account_id],
|
|
82
|
+
query: query,
|
|
83
|
+
page: SurgeAPI::Internal::Cursor,
|
|
84
|
+
model: SurgeAPI::Campaign,
|
|
85
|
+
options: options
|
|
86
|
+
)
|
|
87
|
+
end
|
|
88
|
+
|
|
58
89
|
# @api private
|
|
59
90
|
#
|
|
60
91
|
# @param client [SurgeAPI::Client]
|
|
@@ -108,10 +108,11 @@ module SurgeAPI
|
|
|
108
108
|
# @see SurgeAPI::Models::ContactListParams
|
|
109
109
|
def list(account_id, params = {})
|
|
110
110
|
parsed, options = SurgeAPI::ContactListParams.dump_request(params)
|
|
111
|
+
query = SurgeAPI::Internal::Util.encode_query_params(parsed)
|
|
111
112
|
@client.request(
|
|
112
113
|
method: :get,
|
|
113
114
|
path: ["accounts/%1$s/contacts", account_id],
|
|
114
|
-
query:
|
|
115
|
+
query: query,
|
|
115
116
|
page: SurgeAPI::Internal::Cursor,
|
|
116
117
|
model: SurgeAPI::Contact,
|
|
117
118
|
options: options
|
|
@@ -99,10 +99,11 @@ module SurgeAPI
|
|
|
99
99
|
# @see SurgeAPI::Models::MessageListParams
|
|
100
100
|
def list(account_id, params = {})
|
|
101
101
|
parsed, options = SurgeAPI::MessageListParams.dump_request(params)
|
|
102
|
+
query = SurgeAPI::Internal::Util.encode_query_params(parsed)
|
|
102
103
|
@client.request(
|
|
103
104
|
method: :get,
|
|
104
105
|
path: ["accounts/%1$s/messages", account_id],
|
|
105
|
-
query:
|
|
106
|
+
query: query,
|
|
106
107
|
page: SurgeAPI::Internal::Cursor,
|
|
107
108
|
model: SurgeAPI::Message,
|
|
108
109
|
options: options
|
|
@@ -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,27 @@
|
|
|
3
3
|
module SurgeAPI
|
|
4
4
|
module Resources
|
|
5
5
|
class Recordings
|
|
6
|
+
# Deletes a recording. The recording file will be removed from storage
|
|
7
|
+
# asynchronously.
|
|
8
|
+
#
|
|
9
|
+
# @overload delete(id, request_options: {})
|
|
10
|
+
#
|
|
11
|
+
# @param id [String] The ID of the recording.
|
|
12
|
+
#
|
|
13
|
+
# @param request_options [SurgeAPI::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
14
|
+
#
|
|
15
|
+
# @return [SurgeAPI::Models::RecordingDeleteResponse]
|
|
16
|
+
#
|
|
17
|
+
# @see SurgeAPI::Models::RecordingDeleteParams
|
|
18
|
+
def delete(id, params = {})
|
|
19
|
+
@client.request(
|
|
20
|
+
method: :delete,
|
|
21
|
+
path: ["recordings/%1$s", id],
|
|
22
|
+
model: SurgeAPI::Models::RecordingDeleteResponse,
|
|
23
|
+
options: params[:request_options]
|
|
24
|
+
)
|
|
25
|
+
end
|
|
26
|
+
|
|
6
27
|
# Redirects to a signed URL where the recording audio file can be downloaded. URL
|
|
7
28
|
# is short-lived, so redirect should be followed immediately.
|
|
8
29
|
#
|
|
@@ -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
|
@@ -67,6 +67,7 @@ require_relative "surge_api/models/call_ended_webhook_event"
|
|
|
67
67
|
require_relative "surge_api/models/campaign"
|
|
68
68
|
require_relative "surge_api/models/campaign_approved_webhook_event"
|
|
69
69
|
require_relative "surge_api/models/campaign_create_params"
|
|
70
|
+
require_relative "surge_api/models/campaign_list_params"
|
|
70
71
|
require_relative "surge_api/models/campaign_retrieve_params"
|
|
71
72
|
require_relative "surge_api/models/contact"
|
|
72
73
|
require_relative "surge_api/models/contact_create_params"
|
|
@@ -88,9 +89,12 @@ require_relative "surge_api/models/message_retrieve_params"
|
|
|
88
89
|
require_relative "surge_api/models/message_sent_webhook_event"
|
|
89
90
|
require_relative "surge_api/models/organization"
|
|
90
91
|
require_relative "surge_api/models/phone_number"
|
|
92
|
+
require_relative "surge_api/models/phone_number_attached_to_campaign_webhook_event"
|
|
91
93
|
require_relative "surge_api/models/phone_number_list_params"
|
|
92
94
|
require_relative "surge_api/models/phone_number_purchase_params"
|
|
93
95
|
require_relative "surge_api/models/recording_completed_webhook_event"
|
|
96
|
+
require_relative "surge_api/models/recording_delete_params"
|
|
97
|
+
require_relative "surge_api/models/recording_delete_response"
|
|
94
98
|
require_relative "surge_api/models/recording_get_file_params"
|
|
95
99
|
require_relative "surge_api/models/recording_get_file_response"
|
|
96
100
|
require_relative "surge_api/models/unwrap_webhook_event"
|
|
@@ -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
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module SurgeAPI
|
|
4
|
+
module Models
|
|
5
|
+
class CampaignListParams < 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::CampaignListParams, 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
|
|
@@ -102,10 +102,12 @@ module SurgeAPI
|
|
|
102
102
|
attr_writer :id
|
|
103
103
|
|
|
104
104
|
# The type of attachment.
|
|
105
|
-
sig
|
|
105
|
+
sig do
|
|
106
|
+
returns(T.nilable(SurgeAPI::Message::Attachment::Type::TaggedSymbol))
|
|
107
|
+
end
|
|
106
108
|
attr_reader :type
|
|
107
109
|
|
|
108
|
-
sig { params(type:
|
|
110
|
+
sig { params(type: SurgeAPI::Message::Attachment::Type::OrSymbol).void }
|
|
109
111
|
attr_writer :type
|
|
110
112
|
|
|
111
113
|
# The URL of the attachment.
|
|
@@ -117,9 +119,11 @@ module SurgeAPI
|
|
|
117
119
|
|
|
118
120
|
# An Attachment is a file that can be sent with a message.
|
|
119
121
|
sig do
|
|
120
|
-
params(
|
|
121
|
-
|
|
122
|
-
|
|
122
|
+
params(
|
|
123
|
+
id: String,
|
|
124
|
+
type: SurgeAPI::Message::Attachment::Type::OrSymbol,
|
|
125
|
+
url: String
|
|
126
|
+
).returns(T.attached_class)
|
|
123
127
|
end
|
|
124
128
|
def self.new(
|
|
125
129
|
# Unique identifier for the object.
|
|
@@ -131,9 +135,41 @@ module SurgeAPI
|
|
|
131
135
|
)
|
|
132
136
|
end
|
|
133
137
|
|
|
134
|
-
sig
|
|
138
|
+
sig do
|
|
139
|
+
override.returns(
|
|
140
|
+
{
|
|
141
|
+
id: String,
|
|
142
|
+
type: SurgeAPI::Message::Attachment::Type::TaggedSymbol,
|
|
143
|
+
url: String
|
|
144
|
+
}
|
|
145
|
+
)
|
|
146
|
+
end
|
|
135
147
|
def to_hash
|
|
136
148
|
end
|
|
149
|
+
|
|
150
|
+
# The type of attachment.
|
|
151
|
+
module Type
|
|
152
|
+
extend SurgeAPI::Internal::Type::Enum
|
|
153
|
+
|
|
154
|
+
TaggedSymbol =
|
|
155
|
+
T.type_alias { T.all(Symbol, SurgeAPI::Message::Attachment::Type) }
|
|
156
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
157
|
+
|
|
158
|
+
FILE = T.let(:file, SurgeAPI::Message::Attachment::Type::TaggedSymbol)
|
|
159
|
+
IMAGE =
|
|
160
|
+
T.let(:image, SurgeAPI::Message::Attachment::Type::TaggedSymbol)
|
|
161
|
+
LINK = T.let(:link, SurgeAPI::Message::Attachment::Type::TaggedSymbol)
|
|
162
|
+
VIDEO =
|
|
163
|
+
T.let(:video, SurgeAPI::Message::Attachment::Type::TaggedSymbol)
|
|
164
|
+
|
|
165
|
+
sig do
|
|
166
|
+
override.returns(
|
|
167
|
+
T::Array[SurgeAPI::Message::Attachment::Type::TaggedSymbol]
|
|
168
|
+
)
|
|
169
|
+
end
|
|
170
|
+
def self.values
|
|
171
|
+
end
|
|
172
|
+
end
|
|
137
173
|
end
|
|
138
174
|
|
|
139
175
|
class Conversation < SurgeAPI::Internal::Type::BaseModel
|
|
@@ -100,6 +100,10 @@ module SurgeAPI
|
|
|
100
100
|
sig { returns(Time) }
|
|
101
101
|
attr_accessor :delivered_at
|
|
102
102
|
|
|
103
|
+
# Set of key-value pairs that will be stored with the object.
|
|
104
|
+
sig { returns(T::Hash[Symbol, String]) }
|
|
105
|
+
attr_accessor :metadata
|
|
106
|
+
|
|
103
107
|
# Attachments included with the message
|
|
104
108
|
sig do
|
|
105
109
|
returns(
|
|
@@ -136,6 +140,7 @@ module SurgeAPI
|
|
|
136
140
|
conversation:
|
|
137
141
|
SurgeAPI::MessageDeliveredWebhookEvent::Data::Conversation::OrHash,
|
|
138
142
|
delivered_at: Time,
|
|
143
|
+
metadata: T::Hash[Symbol, String],
|
|
139
144
|
attachments:
|
|
140
145
|
T::Array[
|
|
141
146
|
SurgeAPI::MessageDeliveredWebhookEvent::Data::Attachment::OrHash
|
|
@@ -152,6 +157,8 @@ module SurgeAPI
|
|
|
152
157
|
conversation:,
|
|
153
158
|
# When the message was delivered
|
|
154
159
|
delivered_at:,
|
|
160
|
+
# Set of key-value pairs that will be stored with the object.
|
|
161
|
+
metadata:,
|
|
155
162
|
# Attachments included with the message
|
|
156
163
|
attachments: nil,
|
|
157
164
|
# The ID of the blast this message belongs to, if any. This can be used to
|
|
@@ -168,6 +175,7 @@ module SurgeAPI
|
|
|
168
175
|
conversation:
|
|
169
176
|
SurgeAPI::MessageDeliveredWebhookEvent::Data::Conversation,
|
|
170
177
|
delivered_at: Time,
|
|
178
|
+
metadata: T::Hash[Symbol, String],
|
|
171
179
|
attachments:
|
|
172
180
|
T::Array[
|
|
173
181
|
SurgeAPI::MessageDeliveredWebhookEvent::Data::Attachment
|
|
@@ -102,6 +102,10 @@ module SurgeAPI
|
|
|
102
102
|
sig { returns(String) }
|
|
103
103
|
attr_accessor :failure_reason
|
|
104
104
|
|
|
105
|
+
# Set of key-value pairs that will be stored with the object.
|
|
106
|
+
sig { returns(T::Hash[Symbol, String]) }
|
|
107
|
+
attr_accessor :metadata
|
|
108
|
+
|
|
105
109
|
# Attachments included with the message
|
|
106
110
|
sig do
|
|
107
111
|
returns(
|
|
@@ -139,6 +143,7 @@ module SurgeAPI
|
|
|
139
143
|
SurgeAPI::MessageFailedWebhookEvent::Data::Conversation::OrHash,
|
|
140
144
|
failed_at: Time,
|
|
141
145
|
failure_reason: String,
|
|
146
|
+
metadata: T::Hash[Symbol, String],
|
|
142
147
|
attachments:
|
|
143
148
|
T::Array[
|
|
144
149
|
SurgeAPI::MessageFailedWebhookEvent::Data::Attachment::OrHash
|
|
@@ -157,6 +162,8 @@ module SurgeAPI
|
|
|
157
162
|
failed_at:,
|
|
158
163
|
# The reason the message failed to be delivered
|
|
159
164
|
failure_reason:,
|
|
165
|
+
# Set of key-value pairs that will be stored with the object.
|
|
166
|
+
metadata:,
|
|
160
167
|
# Attachments included with the message
|
|
161
168
|
attachments: nil,
|
|
162
169
|
# The ID of the blast this message belongs to, if any. This can be used to
|
|
@@ -174,6 +181,7 @@ module SurgeAPI
|
|
|
174
181
|
SurgeAPI::MessageFailedWebhookEvent::Data::Conversation,
|
|
175
182
|
failed_at: Time,
|
|
176
183
|
failure_reason: String,
|
|
184
|
+
metadata: T::Hash[Symbol, String],
|
|
177
185
|
attachments:
|
|
178
186
|
T::Array[SurgeAPI::MessageFailedWebhookEvent::Data::Attachment],
|
|
179
187
|
blast_id: String
|
|
@@ -96,6 +96,10 @@ module SurgeAPI
|
|
|
96
96
|
end
|
|
97
97
|
attr_writer :conversation
|
|
98
98
|
|
|
99
|
+
# Set of key-value pairs that will be stored with the object.
|
|
100
|
+
sig { returns(T::Hash[Symbol, String]) }
|
|
101
|
+
attr_accessor :metadata
|
|
102
|
+
|
|
99
103
|
# When the message was received
|
|
100
104
|
sig { returns(Time) }
|
|
101
105
|
attr_accessor :received_at
|
|
@@ -135,6 +139,7 @@ module SurgeAPI
|
|
|
135
139
|
body: T.nilable(String),
|
|
136
140
|
conversation:
|
|
137
141
|
SurgeAPI::MessageReceivedWebhookEvent::Data::Conversation::OrHash,
|
|
142
|
+
metadata: T::Hash[Symbol, String],
|
|
138
143
|
received_at: Time,
|
|
139
144
|
attachments:
|
|
140
145
|
T::Array[
|
|
@@ -150,6 +155,8 @@ module SurgeAPI
|
|
|
150
155
|
body:,
|
|
151
156
|
# The conversation this message belongs to
|
|
152
157
|
conversation:,
|
|
158
|
+
# Set of key-value pairs that will be stored with the object.
|
|
159
|
+
metadata:,
|
|
153
160
|
# When the message was received
|
|
154
161
|
received_at:,
|
|
155
162
|
# Attachments included with the message
|
|
@@ -167,6 +174,7 @@ module SurgeAPI
|
|
|
167
174
|
body: T.nilable(String),
|
|
168
175
|
conversation:
|
|
169
176
|
SurgeAPI::MessageReceivedWebhookEvent::Data::Conversation,
|
|
177
|
+
metadata: T::Hash[Symbol, String],
|
|
170
178
|
received_at: Time,
|
|
171
179
|
attachments:
|
|
172
180
|
T::Array[
|
|
@@ -89,6 +89,10 @@ module SurgeAPI
|
|
|
89
89
|
end
|
|
90
90
|
attr_writer :conversation
|
|
91
91
|
|
|
92
|
+
# Set of key-value pairs that will be stored with the object.
|
|
93
|
+
sig { returns(T::Hash[Symbol, String]) }
|
|
94
|
+
attr_accessor :metadata
|
|
95
|
+
|
|
92
96
|
# When the message was sent
|
|
93
97
|
sig { returns(Time) }
|
|
94
98
|
attr_accessor :sent_at
|
|
@@ -128,6 +132,7 @@ module SurgeAPI
|
|
|
128
132
|
body: T.nilable(String),
|
|
129
133
|
conversation:
|
|
130
134
|
SurgeAPI::MessageSentWebhookEvent::Data::Conversation::OrHash,
|
|
135
|
+
metadata: T::Hash[Symbol, String],
|
|
131
136
|
sent_at: Time,
|
|
132
137
|
attachments:
|
|
133
138
|
T::Array[
|
|
@@ -143,6 +148,8 @@ module SurgeAPI
|
|
|
143
148
|
body:,
|
|
144
149
|
# The conversation this message belongs to
|
|
145
150
|
conversation:,
|
|
151
|
+
# Set of key-value pairs that will be stored with the object.
|
|
152
|
+
metadata:,
|
|
146
153
|
# When the message was sent
|
|
147
154
|
sent_at:,
|
|
148
155
|
# Attachments included with the message
|
|
@@ -160,6 +167,7 @@ module SurgeAPI
|
|
|
160
167
|
body: T.nilable(String),
|
|
161
168
|
conversation:
|
|
162
169
|
SurgeAPI::MessageSentWebhookEvent::Data::Conversation,
|
|
170
|
+
metadata: T::Hash[Symbol, String],
|
|
163
171
|
sent_at: Time,
|
|
164
172
|
attachments:
|
|
165
173
|
T::Array[SurgeAPI::MessageSentWebhookEvent::Data::Attachment],
|
|
@@ -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
|
}
|