surge_api 0.23.0 → 0.24.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 +16 -0
- data/README.md +1 -1
- data/lib/surge_api/models/account_retrieve_status_params.rb +1 -0
- data/lib/surge_api/models/campaign.rb +6 -6
- data/lib/surge_api/models/campaign_params.rb +5 -6
- data/lib/surge_api/models/message.rb +25 -1
- data/lib/surge_api/models/message_delivered_webhook_event.rb +21 -1
- data/lib/surge_api/models/message_failed_webhook_event.rb +21 -1
- data/lib/surge_api/models/message_received_webhook_event.rb +21 -1
- data/lib/surge_api/models/message_sent_webhook_event.rb +21 -1
- data/lib/surge_api/models/phone_number_imported_webhook_event.rb +152 -0
- data/lib/surge_api/models/unwrap_webhook_event.rb +3 -1
- data/lib/surge_api/models.rb +2 -0
- data/lib/surge_api/resources/webhooks.rb +1 -1
- data/lib/surge_api/version.rb +1 -1
- data/lib/surge_api.rb +1 -0
- data/rbi/surge_api/models/account_retrieve_status_params.rbi +5 -0
- data/rbi/surge_api/models/campaign.rbi +9 -10
- data/rbi/surge_api/models/campaign_params.rbi +8 -10
- data/rbi/surge_api/models/message.rbi +34 -3
- data/rbi/surge_api/models/message_delivered_webhook_event.rbi +44 -0
- data/rbi/surge_api/models/message_failed_webhook_event.rbi +40 -0
- data/rbi/surge_api/models/message_received_webhook_event.rbi +41 -0
- data/rbi/surge_api/models/message_sent_webhook_event.rbi +38 -0
- data/rbi/surge_api/models/phone_number_imported_webhook_event.rbi +310 -0
- data/rbi/surge_api/models/unwrap_webhook_event.rbi +1 -0
- data/rbi/surge_api/models.rbi +3 -0
- data/rbi/surge_api/resources/webhooks.rbi +1 -0
- data/sig/surge_api/models/account_retrieve_status_params.rbs +2 -1
- data/sig/surge_api/models/campaign.rbs +3 -1
- data/sig/surge_api/models/message.rbs +26 -3
- data/sig/surge_api/models/message_delivered_webhook_event.rbs +15 -0
- data/sig/surge_api/models/message_failed_webhook_event.rbs +15 -0
- data/sig/surge_api/models/message_received_webhook_event.rbs +15 -0
- data/sig/surge_api/models/message_sent_webhook_event.rbs +15 -0
- data/sig/surge_api/models/phone_number_imported_webhook_event.rbs +125 -0
- data/sig/surge_api/models/unwrap_webhook_event.rbs +1 -0
- data/sig/surge_api/models.rbs +2 -0
- data/sig/surge_api/resources/webhooks.rbs +1 -0
- metadata +5 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b5716cf1bf5c2e7a858c9c7a706c388a3a174518d8d1170c4254b5a813e7bd0d
|
|
4
|
+
data.tar.gz: 6a184865cd4ac3b7a8498431c2b229b64794624768f7e4782ad7d74b2d7b98e3
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4a2f8940ada65f353148d318d9167f83d25a145a766018d83245aa8fece4f6cb27d419f2ecf164e0a4a03b253a443cfcdd543ac0cdaaf55d01459d8ca87e6959
|
|
7
|
+
data.tar.gz: f65c4af57e2f91a1604c54b119285014d42beb0e070e98cf91610bb4a77b17bf1a7dc8246710d5f970a1c37661eed4e4413bb3caa9b0d505b49807765ed5ba47
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.24.0 (2026-09-04)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v0.23.0...v0.24.0](https://github.com/surgeapi/ruby-sdk/compare/v0.23.0...v0.24.0)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* **api:** add status to messages ([1a1b928](https://github.com/surgeapi/ruby-sdk/commit/1a1b9288784e37ae35e8c01f814eb39e952a24b0))
|
|
10
|
+
* **api:** add toll free messaging capability to accounts ([87fff80](https://github.com/surgeapi/ruby-sdk/commit/87fff8049ea378688bd2ca8df6b4f5e9919ee832))
|
|
11
|
+
* **api:** phone number imported webhook event ([358bf6d](https://github.com/surgeapi/ruby-sdk/commit/358bf6d5128520687260208216f8923a6c37db29))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Documentation
|
|
15
|
+
|
|
16
|
+
* **api:** add note about links in messages for campaigns ([0b7c72d](https://github.com/surgeapi/ruby-sdk/commit/0b7c72ddf56ff3a92959ff50b484a55f62807e42))
|
|
17
|
+
* **api:** add note about links in messages for campaigns (continued) ([0847773](https://github.com/surgeapi/ruby-sdk/commit/0847773d88887971ec454d1ff89ac3a979ed9e0d))
|
|
18
|
+
|
|
3
19
|
## 0.23.0 (2026-08-19)
|
|
4
20
|
|
|
5
21
|
Full Changelog: [v0.22.0...v0.23.0](https://github.com/surgeapi/ruby-sdk/compare/v0.22.0...v0.23.0)
|
data/README.md
CHANGED
|
@@ -113,11 +113,10 @@ module SurgeAPI
|
|
|
113
113
|
required :volume, enum: -> { SurgeAPI::Campaign::Volume }
|
|
114
114
|
|
|
115
115
|
# @!attribute link_sample
|
|
116
|
-
# A sample link that might be sent by this campaign.
|
|
117
|
-
#
|
|
118
|
-
#
|
|
119
|
-
#
|
|
120
|
-
# to disable automatic link shortening.
|
|
116
|
+
# A sample link that might be sent by this campaign. This is required when
|
|
117
|
+
# `includes` contains `links`. Provide the same URL or domain that the campaign
|
|
118
|
+
# will use in production. If links from other domains are sent through this
|
|
119
|
+
# campaign, they are much more likely to be filtered by the carriers.
|
|
121
120
|
#
|
|
122
121
|
# @return [String, nil]
|
|
123
122
|
optional :link_sample, String
|
|
@@ -156,7 +155,7 @@ module SurgeAPI
|
|
|
156
155
|
#
|
|
157
156
|
# @param volume [Symbol, SurgeAPI::Models::Campaign::Volume] This will be one of the following:
|
|
158
157
|
#
|
|
159
|
-
# @param link_sample [String] A sample link that might be sent by this campaign.
|
|
158
|
+
# @param link_sample [String] A sample link that might be sent by this campaign. This is required when `includ
|
|
160
159
|
#
|
|
161
160
|
# @param terms_and_conditions_url [String] The URL of the terms and conditions presented to end users when they opt in to m
|
|
162
161
|
|
|
@@ -180,6 +179,7 @@ module SurgeAPI
|
|
|
180
179
|
|
|
181
180
|
ACTIVE = :active
|
|
182
181
|
CANCELED = :canceled
|
|
182
|
+
REJECTED = :rejected
|
|
183
183
|
CREATED = :created
|
|
184
184
|
DEACTIVATED = :deactivated
|
|
185
185
|
IN_REVIEW = :in_review
|
|
@@ -122,11 +122,10 @@ module SurgeAPI
|
|
|
122
122
|
-> { SurgeAPI::Internal::Type::ArrayOf[enum: SurgeAPI::CampaignParams::StandardCampaignParams::Include] }
|
|
123
123
|
|
|
124
124
|
# @!attribute link_sample
|
|
125
|
-
# A sample link that might be sent by this campaign.
|
|
126
|
-
#
|
|
127
|
-
#
|
|
128
|
-
#
|
|
129
|
-
# to disable automatic link shortening.
|
|
125
|
+
# A sample link that might be sent by this campaign. This is required when
|
|
126
|
+
# `includes` contains `links`. Provide the same URL or domain that the campaign
|
|
127
|
+
# will use in production. If links from other domains are sent through this
|
|
128
|
+
# campaign, they are much more likely to be filtered by the carriers.
|
|
130
129
|
#
|
|
131
130
|
# @return [String, nil]
|
|
132
131
|
optional :link_sample, String
|
|
@@ -153,7 +152,7 @@ module SurgeAPI
|
|
|
153
152
|
#
|
|
154
153
|
# @param includes [Array<Symbol, SurgeAPI::Models::CampaignParams::StandardCampaignParams::Include>] A list of properties that this campaign should include. These properties can be
|
|
155
154
|
#
|
|
156
|
-
# @param link_sample [String] A sample link that might be sent by this campaign.
|
|
155
|
+
# @param link_sample [String] A sample link that might be sent by this campaign. This is required when `includ
|
|
157
156
|
|
|
158
157
|
module UseCase
|
|
159
158
|
extend SurgeAPI::Internal::Type::Enum
|
|
@@ -40,7 +40,13 @@ module SurgeAPI
|
|
|
40
40
|
# @return [Hash{Symbol=>String}, nil]
|
|
41
41
|
optional :metadata, SurgeAPI::Internal::Type::HashOf[String]
|
|
42
42
|
|
|
43
|
-
# @!
|
|
43
|
+
# @!attribute status
|
|
44
|
+
# The current status of the message.
|
|
45
|
+
#
|
|
46
|
+
# @return [Symbol, SurgeAPI::Models::Message::Status, nil]
|
|
47
|
+
optional :status, enum: -> { SurgeAPI::Message::Status }
|
|
48
|
+
|
|
49
|
+
# @!method initialize(id: nil, attachments: nil, blast_id: nil, body: nil, conversation: nil, metadata: nil, status: nil)
|
|
44
50
|
# Some parameter documentations has been truncated, see
|
|
45
51
|
# {SurgeAPI::Models::Message} for more details.
|
|
46
52
|
#
|
|
@@ -57,6 +63,8 @@ module SurgeAPI
|
|
|
57
63
|
# @param conversation [SurgeAPI::Models::Message::Conversation] A conversation with a Contact
|
|
58
64
|
#
|
|
59
65
|
# @param metadata [Hash{Symbol=>String}] Set of key-value pairs that will be stored with the object.
|
|
66
|
+
#
|
|
67
|
+
# @param status [Symbol, SurgeAPI::Models::Message::Status] The current status of the message.
|
|
60
68
|
|
|
61
69
|
class Attachment < SurgeAPI::Internal::Type::BaseModel
|
|
62
70
|
# @!attribute id
|
|
@@ -185,6 +193,22 @@ module SurgeAPI
|
|
|
185
193
|
end
|
|
186
194
|
end
|
|
187
195
|
end
|
|
196
|
+
|
|
197
|
+
# The current status of the message.
|
|
198
|
+
#
|
|
199
|
+
# @see SurgeAPI::Models::Message#status
|
|
200
|
+
module Status
|
|
201
|
+
extend SurgeAPI::Internal::Type::Enum
|
|
202
|
+
|
|
203
|
+
PENDING = :pending
|
|
204
|
+
RECEIVED = :received
|
|
205
|
+
SENT = :sent
|
|
206
|
+
DELIVERED = :delivered
|
|
207
|
+
FAILED = :failed
|
|
208
|
+
|
|
209
|
+
# @!method self.values
|
|
210
|
+
# @return [Array<Symbol>]
|
|
211
|
+
end
|
|
188
212
|
end
|
|
189
213
|
end
|
|
190
214
|
end
|
|
@@ -68,6 +68,12 @@ module SurgeAPI
|
|
|
68
68
|
# @return [Hash{Symbol=>String}]
|
|
69
69
|
required :metadata, SurgeAPI::Internal::Type::HashOf[String]
|
|
70
70
|
|
|
71
|
+
# @!attribute status
|
|
72
|
+
# The message status represented by this event
|
|
73
|
+
#
|
|
74
|
+
# @return [Symbol, SurgeAPI::Models::MessageDeliveredWebhookEvent::Data::Status]
|
|
75
|
+
required :status, enum: -> { SurgeAPI::MessageDeliveredWebhookEvent::Data::Status }
|
|
76
|
+
|
|
71
77
|
# @!attribute attachments
|
|
72
78
|
# Attachments included with the message
|
|
73
79
|
#
|
|
@@ -82,7 +88,7 @@ module SurgeAPI
|
|
|
82
88
|
# @return [String, nil]
|
|
83
89
|
optional :blast_id, String
|
|
84
90
|
|
|
85
|
-
# @!method initialize(id:, body:, conversation:, delivered_at:, metadata:, attachments: nil, blast_id: nil)
|
|
91
|
+
# @!method initialize(id:, body:, conversation:, delivered_at:, metadata:, status:, attachments: nil, blast_id: nil)
|
|
86
92
|
# Some parameter documentations has been truncated, see
|
|
87
93
|
# {SurgeAPI::Models::MessageDeliveredWebhookEvent::Data} for more details.
|
|
88
94
|
#
|
|
@@ -98,6 +104,8 @@ module SurgeAPI
|
|
|
98
104
|
#
|
|
99
105
|
# @param metadata [Hash{Symbol=>String}] Set of key-value pairs that will be stored with the object.
|
|
100
106
|
#
|
|
107
|
+
# @param status [Symbol, SurgeAPI::Models::MessageDeliveredWebhookEvent::Data::Status] The message status represented by this event
|
|
108
|
+
#
|
|
101
109
|
# @param attachments [Array<SurgeAPI::Models::MessageDeliveredWebhookEvent::Data::Attachment>] Attachments included with the message
|
|
102
110
|
#
|
|
103
111
|
# @param blast_id [String] The ID of the blast this message belongs to, if any. This can be used to attribu
|
|
@@ -132,6 +140,18 @@ module SurgeAPI
|
|
|
132
140
|
# @param phone_number [SurgeAPI::Models::PhoneNumber] A phone number that can be used to send and receive messages and calls
|
|
133
141
|
end
|
|
134
142
|
|
|
143
|
+
# The message status represented by this event
|
|
144
|
+
#
|
|
145
|
+
# @see SurgeAPI::Models::MessageDeliveredWebhookEvent::Data#status
|
|
146
|
+
module Status
|
|
147
|
+
extend SurgeAPI::Internal::Type::Enum
|
|
148
|
+
|
|
149
|
+
DELIVERED = :delivered
|
|
150
|
+
|
|
151
|
+
# @!method self.values
|
|
152
|
+
# @return [Array<Symbol>]
|
|
153
|
+
end
|
|
154
|
+
|
|
135
155
|
class Attachment < SurgeAPI::Internal::Type::BaseModel
|
|
136
156
|
# @!attribute id
|
|
137
157
|
# The unique identifier for the attachment
|
|
@@ -74,6 +74,12 @@ module SurgeAPI
|
|
|
74
74
|
# @return [Hash{Symbol=>String}]
|
|
75
75
|
required :metadata, SurgeAPI::Internal::Type::HashOf[String]
|
|
76
76
|
|
|
77
|
+
# @!attribute status
|
|
78
|
+
# The message status represented by this event
|
|
79
|
+
#
|
|
80
|
+
# @return [Symbol, SurgeAPI::Models::MessageFailedWebhookEvent::Data::Status]
|
|
81
|
+
required :status, enum: -> { SurgeAPI::MessageFailedWebhookEvent::Data::Status }
|
|
82
|
+
|
|
77
83
|
# @!attribute attachments
|
|
78
84
|
# Attachments included with the message
|
|
79
85
|
#
|
|
@@ -88,7 +94,7 @@ module SurgeAPI
|
|
|
88
94
|
# @return [String, nil]
|
|
89
95
|
optional :blast_id, String
|
|
90
96
|
|
|
91
|
-
# @!method initialize(id:, body:, conversation:, failed_at:, failure_reason:, metadata:, attachments: nil, blast_id: nil)
|
|
97
|
+
# @!method initialize(id:, body:, conversation:, failed_at:, failure_reason:, metadata:, status:, attachments: nil, blast_id: nil)
|
|
92
98
|
# Some parameter documentations has been truncated, see
|
|
93
99
|
# {SurgeAPI::Models::MessageFailedWebhookEvent::Data} for more details.
|
|
94
100
|
#
|
|
@@ -106,6 +112,8 @@ module SurgeAPI
|
|
|
106
112
|
#
|
|
107
113
|
# @param metadata [Hash{Symbol=>String}] Set of key-value pairs that will be stored with the object.
|
|
108
114
|
#
|
|
115
|
+
# @param status [Symbol, SurgeAPI::Models::MessageFailedWebhookEvent::Data::Status] The message status represented by this event
|
|
116
|
+
#
|
|
109
117
|
# @param attachments [Array<SurgeAPI::Models::MessageFailedWebhookEvent::Data::Attachment>] Attachments included with the message
|
|
110
118
|
#
|
|
111
119
|
# @param blast_id [String] The ID of the blast this message belongs to, if any. This can be used to attribu
|
|
@@ -140,6 +148,18 @@ module SurgeAPI
|
|
|
140
148
|
# @param phone_number [SurgeAPI::Models::PhoneNumber] A phone number that can be used to send and receive messages and calls
|
|
141
149
|
end
|
|
142
150
|
|
|
151
|
+
# The message status represented by this event
|
|
152
|
+
#
|
|
153
|
+
# @see SurgeAPI::Models::MessageFailedWebhookEvent::Data#status
|
|
154
|
+
module Status
|
|
155
|
+
extend SurgeAPI::Internal::Type::Enum
|
|
156
|
+
|
|
157
|
+
FAILED = :failed
|
|
158
|
+
|
|
159
|
+
# @!method self.values
|
|
160
|
+
# @return [Array<Symbol>]
|
|
161
|
+
end
|
|
162
|
+
|
|
143
163
|
class Attachment < SurgeAPI::Internal::Type::BaseModel
|
|
144
164
|
# @!attribute id
|
|
145
165
|
# The unique identifier for the attachment
|
|
@@ -68,6 +68,12 @@ module SurgeAPI
|
|
|
68
68
|
# @return [Time]
|
|
69
69
|
required :received_at, Time
|
|
70
70
|
|
|
71
|
+
# @!attribute status
|
|
72
|
+
# The message status represented by this event
|
|
73
|
+
#
|
|
74
|
+
# @return [Symbol, SurgeAPI::Models::MessageReceivedWebhookEvent::Data::Status]
|
|
75
|
+
required :status, enum: -> { SurgeAPI::MessageReceivedWebhookEvent::Data::Status }
|
|
76
|
+
|
|
71
77
|
# @!attribute attachments
|
|
72
78
|
# Attachments included with the message
|
|
73
79
|
#
|
|
@@ -82,7 +88,7 @@ module SurgeAPI
|
|
|
82
88
|
# @return [String, nil]
|
|
83
89
|
optional :blast_id, String
|
|
84
90
|
|
|
85
|
-
# @!method initialize(id:, body:, conversation:, metadata:, received_at:, attachments: nil, blast_id: nil)
|
|
91
|
+
# @!method initialize(id:, body:, conversation:, metadata:, received_at:, status:, attachments: nil, blast_id: nil)
|
|
86
92
|
# Some parameter documentations has been truncated, see
|
|
87
93
|
# {SurgeAPI::Models::MessageReceivedWebhookEvent::Data} for more details.
|
|
88
94
|
#
|
|
@@ -98,6 +104,8 @@ module SurgeAPI
|
|
|
98
104
|
#
|
|
99
105
|
# @param received_at [Time] When the message was received
|
|
100
106
|
#
|
|
107
|
+
# @param status [Symbol, SurgeAPI::Models::MessageReceivedWebhookEvent::Data::Status] The message status represented by this event
|
|
108
|
+
#
|
|
101
109
|
# @param attachments [Array<SurgeAPI::Models::MessageReceivedWebhookEvent::Data::Attachment>] Attachments included with the message
|
|
102
110
|
#
|
|
103
111
|
# @param blast_id [String] The ID of the blast this message belongs to, if any. This can be used to attribu
|
|
@@ -132,6 +140,18 @@ module SurgeAPI
|
|
|
132
140
|
# @param phone_number [SurgeAPI::Models::PhoneNumber] A phone number that can be used to send and receive messages and calls
|
|
133
141
|
end
|
|
134
142
|
|
|
143
|
+
# The message status represented by this event
|
|
144
|
+
#
|
|
145
|
+
# @see SurgeAPI::Models::MessageReceivedWebhookEvent::Data#status
|
|
146
|
+
module Status
|
|
147
|
+
extend SurgeAPI::Internal::Type::Enum
|
|
148
|
+
|
|
149
|
+
RECEIVED = :received
|
|
150
|
+
|
|
151
|
+
# @!method self.values
|
|
152
|
+
# @return [Array<Symbol>]
|
|
153
|
+
end
|
|
154
|
+
|
|
135
155
|
class Attachment < SurgeAPI::Internal::Type::BaseModel
|
|
136
156
|
# @!attribute id
|
|
137
157
|
# The unique identifier for the attachment
|
|
@@ -68,6 +68,12 @@ module SurgeAPI
|
|
|
68
68
|
# @return [Time]
|
|
69
69
|
required :sent_at, Time
|
|
70
70
|
|
|
71
|
+
# @!attribute status
|
|
72
|
+
# The message status represented by this event
|
|
73
|
+
#
|
|
74
|
+
# @return [Symbol, SurgeAPI::Models::MessageSentWebhookEvent::Data::Status]
|
|
75
|
+
required :status, enum: -> { SurgeAPI::MessageSentWebhookEvent::Data::Status }
|
|
76
|
+
|
|
71
77
|
# @!attribute attachments
|
|
72
78
|
# Attachments included with the message
|
|
73
79
|
#
|
|
@@ -82,7 +88,7 @@ module SurgeAPI
|
|
|
82
88
|
# @return [String, nil]
|
|
83
89
|
optional :blast_id, String
|
|
84
90
|
|
|
85
|
-
# @!method initialize(id:, body:, conversation:, metadata:, sent_at:, attachments: nil, blast_id: nil)
|
|
91
|
+
# @!method initialize(id:, body:, conversation:, metadata:, sent_at:, status:, attachments: nil, blast_id: nil)
|
|
86
92
|
# Some parameter documentations has been truncated, see
|
|
87
93
|
# {SurgeAPI::Models::MessageSentWebhookEvent::Data} for more details.
|
|
88
94
|
#
|
|
@@ -98,6 +104,8 @@ module SurgeAPI
|
|
|
98
104
|
#
|
|
99
105
|
# @param sent_at [Time] When the message was sent
|
|
100
106
|
#
|
|
107
|
+
# @param status [Symbol, SurgeAPI::Models::MessageSentWebhookEvent::Data::Status] The message status represented by this event
|
|
108
|
+
#
|
|
101
109
|
# @param attachments [Array<SurgeAPI::Models::MessageSentWebhookEvent::Data::Attachment>] Attachments included with the message
|
|
102
110
|
#
|
|
103
111
|
# @param blast_id [String] The ID of the blast this message belongs to, if any. This can be used to attribu
|
|
@@ -132,6 +140,18 @@ module SurgeAPI
|
|
|
132
140
|
# @param phone_number [SurgeAPI::Models::PhoneNumber] A phone number that can be used to send and receive messages and calls
|
|
133
141
|
end
|
|
134
142
|
|
|
143
|
+
# The message status represented by this event
|
|
144
|
+
#
|
|
145
|
+
# @see SurgeAPI::Models::MessageSentWebhookEvent::Data#status
|
|
146
|
+
module Status
|
|
147
|
+
extend SurgeAPI::Internal::Type::Enum
|
|
148
|
+
|
|
149
|
+
SENT = :sent
|
|
150
|
+
|
|
151
|
+
# @!method self.values
|
|
152
|
+
# @return [Array<Symbol>]
|
|
153
|
+
end
|
|
154
|
+
|
|
135
155
|
class Attachment < SurgeAPI::Internal::Type::BaseModel
|
|
136
156
|
# @!attribute id
|
|
137
157
|
# The unique identifier for the attachment
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module SurgeAPI
|
|
4
|
+
module Models
|
|
5
|
+
class PhoneNumberImportedWebhookEvent < SurgeAPI::Internal::Type::BaseModel
|
|
6
|
+
# @!attribute account_id
|
|
7
|
+
# The ID of the account in which this event occurred
|
|
8
|
+
#
|
|
9
|
+
# @return [String]
|
|
10
|
+
required :account_id, String
|
|
11
|
+
|
|
12
|
+
# @!attribute data
|
|
13
|
+
# The data associated with the event
|
|
14
|
+
#
|
|
15
|
+
# @return [SurgeAPI::Models::PhoneNumberImportedWebhookEvent::Data]
|
|
16
|
+
required :data, -> { SurgeAPI::PhoneNumberImportedWebhookEvent::Data }
|
|
17
|
+
|
|
18
|
+
# @!attribute timestamp
|
|
19
|
+
# The timestamp when this event occurred, in ISO8601 format
|
|
20
|
+
#
|
|
21
|
+
# @return [Time]
|
|
22
|
+
required :timestamp, Time
|
|
23
|
+
|
|
24
|
+
# @!attribute type
|
|
25
|
+
# The type of the event. Always `phone_number.imported` for this event.
|
|
26
|
+
#
|
|
27
|
+
# @return [Symbol, :"phone_number.imported"]
|
|
28
|
+
required :type, const: :"phone_number.imported"
|
|
29
|
+
|
|
30
|
+
# @!method initialize(account_id:, data:, timestamp:, type: :"phone_number.imported")
|
|
31
|
+
# @param account_id [String] The ID of the account in which this event occurred
|
|
32
|
+
#
|
|
33
|
+
# @param data [SurgeAPI::Models::PhoneNumberImportedWebhookEvent::Data] The data associated with the event
|
|
34
|
+
#
|
|
35
|
+
# @param timestamp [Time] The timestamp when this event occurred, in ISO8601 format
|
|
36
|
+
#
|
|
37
|
+
# @param type [Symbol, :"phone_number.imported"] The type of the event. Always `phone_number.imported` for this event.
|
|
38
|
+
|
|
39
|
+
# @see SurgeAPI::Models::PhoneNumberImportedWebhookEvent#data
|
|
40
|
+
class Data < SurgeAPI::Internal::Type::BaseModel
|
|
41
|
+
# @!attribute id
|
|
42
|
+
# The unique identifier for the phone number
|
|
43
|
+
#
|
|
44
|
+
# @return [String]
|
|
45
|
+
required :id, String
|
|
46
|
+
|
|
47
|
+
# @!attribute campaign
|
|
48
|
+
# Campaign attachment details for a domestic local phone number
|
|
49
|
+
#
|
|
50
|
+
# @return [SurgeAPI::Models::PhoneNumberImportedWebhookEvent::Data::Campaign, nil]
|
|
51
|
+
required :campaign, -> { SurgeAPI::PhoneNumberImportedWebhookEvent::Data::Campaign }, nil?: true
|
|
52
|
+
|
|
53
|
+
# @!attribute campaign_id
|
|
54
|
+
# @deprecated Use `campaign.id` instead.
|
|
55
|
+
#
|
|
56
|
+
# Deprecated. The unique identifier of the campaign this phone number is attached
|
|
57
|
+
# to
|
|
58
|
+
#
|
|
59
|
+
# @return [String, nil]
|
|
60
|
+
required :campaign_id, String, nil?: true
|
|
61
|
+
|
|
62
|
+
# @!attribute name
|
|
63
|
+
# A human-readable name for the phone number
|
|
64
|
+
#
|
|
65
|
+
# @return [String, nil]
|
|
66
|
+
required :name, String, nil?: true
|
|
67
|
+
|
|
68
|
+
# @!attribute number
|
|
69
|
+
# The phone number in E.164 format
|
|
70
|
+
#
|
|
71
|
+
# @return [String]
|
|
72
|
+
required :number, String
|
|
73
|
+
|
|
74
|
+
# @!attribute type
|
|
75
|
+
# Whether the phone number is local, toll-free, or short code
|
|
76
|
+
#
|
|
77
|
+
# @return [Symbol, SurgeAPI::Models::PhoneNumberImportedWebhookEvent::Data::Type]
|
|
78
|
+
required :type, enum: -> { SurgeAPI::PhoneNumberImportedWebhookEvent::Data::Type }
|
|
79
|
+
|
|
80
|
+
# @!method initialize(id:, campaign:, campaign_id:, name:, number:, type:)
|
|
81
|
+
# Some parameter documentations has been truncated, see
|
|
82
|
+
# {SurgeAPI::Models::PhoneNumberImportedWebhookEvent::Data} for more details.
|
|
83
|
+
#
|
|
84
|
+
# The data associated with the event
|
|
85
|
+
#
|
|
86
|
+
# @param id [String] The unique identifier for the phone number
|
|
87
|
+
#
|
|
88
|
+
# @param campaign [SurgeAPI::Models::PhoneNumberImportedWebhookEvent::Data::Campaign, nil] Campaign attachment details for a domestic local phone number
|
|
89
|
+
#
|
|
90
|
+
# @param campaign_id [String, nil] Deprecated. The unique identifier of the campaign this phone number is attached
|
|
91
|
+
#
|
|
92
|
+
# @param name [String, nil] A human-readable name for the phone number
|
|
93
|
+
#
|
|
94
|
+
# @param number [String] The phone number in E.164 format
|
|
95
|
+
#
|
|
96
|
+
# @param type [Symbol, SurgeAPI::Models::PhoneNumberImportedWebhookEvent::Data::Type] Whether the phone number is local, toll-free, or short code
|
|
97
|
+
|
|
98
|
+
# @see SurgeAPI::Models::PhoneNumberImportedWebhookEvent::Data#campaign
|
|
99
|
+
class Campaign < SurgeAPI::Internal::Type::BaseModel
|
|
100
|
+
# @!attribute id
|
|
101
|
+
# The unique identifier of the campaign this phone number is attached to
|
|
102
|
+
#
|
|
103
|
+
# @return [String]
|
|
104
|
+
required :id, String
|
|
105
|
+
|
|
106
|
+
# @!attribute attachment_status
|
|
107
|
+
# The current campaign attachment status for this phone number.
|
|
108
|
+
#
|
|
109
|
+
# @return [Symbol, SurgeAPI::Models::PhoneNumberImportedWebhookEvent::Data::Campaign::AttachmentStatus]
|
|
110
|
+
required :attachment_status,
|
|
111
|
+
enum: -> { SurgeAPI::PhoneNumberImportedWebhookEvent::Data::Campaign::AttachmentStatus }
|
|
112
|
+
|
|
113
|
+
# @!method initialize(id:, attachment_status:)
|
|
114
|
+
# Campaign attachment details for a domestic local phone number
|
|
115
|
+
#
|
|
116
|
+
# @param id [String] The unique identifier of the campaign this phone number is attached to
|
|
117
|
+
#
|
|
118
|
+
# @param attachment_status [Symbol, SurgeAPI::Models::PhoneNumberImportedWebhookEvent::Data::Campaign::AttachmentStatus] The current campaign attachment status for this phone number.
|
|
119
|
+
|
|
120
|
+
# The current campaign attachment status for this phone number.
|
|
121
|
+
#
|
|
122
|
+
# @see SurgeAPI::Models::PhoneNumberImportedWebhookEvent::Data::Campaign#attachment_status
|
|
123
|
+
module AttachmentStatus
|
|
124
|
+
extend SurgeAPI::Internal::Type::Enum
|
|
125
|
+
|
|
126
|
+
ATTACHED = :attached
|
|
127
|
+
ATTACHMENT_PENDING = :attachment_pending
|
|
128
|
+
DETACHED = :detached
|
|
129
|
+
DETACHMENT_PENDING = :detachment_pending
|
|
130
|
+
|
|
131
|
+
# @!method self.values
|
|
132
|
+
# @return [Array<Symbol>]
|
|
133
|
+
end
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
# Whether the phone number is local, toll-free, or short code
|
|
137
|
+
#
|
|
138
|
+
# @see SurgeAPI::Models::PhoneNumberImportedWebhookEvent::Data#type
|
|
139
|
+
module Type
|
|
140
|
+
extend SurgeAPI::Internal::Type::Enum
|
|
141
|
+
|
|
142
|
+
LOCAL = :local
|
|
143
|
+
SHORT_CODE = :short_code
|
|
144
|
+
TOLL_FREE = :toll_free
|
|
145
|
+
|
|
146
|
+
# @!method self.values
|
|
147
|
+
# @return [Array<Symbol>]
|
|
148
|
+
end
|
|
149
|
+
end
|
|
150
|
+
end
|
|
151
|
+
end
|
|
152
|
+
end
|
|
@@ -29,12 +29,14 @@ module SurgeAPI
|
|
|
29
29
|
|
|
30
30
|
variant :"phone_number.attached_to_campaign", -> { SurgeAPI::PhoneNumberAttachedToCampaignWebhookEvent }
|
|
31
31
|
|
|
32
|
+
variant :"phone_number.imported", -> { SurgeAPI::PhoneNumberImportedWebhookEvent }
|
|
33
|
+
|
|
32
34
|
variant :"recording.completed", -> { SurgeAPI::RecordingCompletedWebhookEvent }
|
|
33
35
|
|
|
34
36
|
variant :"voicemail.received", -> { SurgeAPI::VoicemailReceivedWebhookEvent }
|
|
35
37
|
|
|
36
38
|
# @!method self.variants
|
|
37
|
-
# @return [Array(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)]
|
|
39
|
+
# @return [Array(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::PhoneNumberImportedWebhookEvent, SurgeAPI::Models::RecordingCompletedWebhookEvent, SurgeAPI::Models::VoicemailReceivedWebhookEvent)]
|
|
38
40
|
end
|
|
39
41
|
end
|
|
40
42
|
end
|
data/lib/surge_api/models.rb
CHANGED
|
@@ -130,6 +130,8 @@ module SurgeAPI
|
|
|
130
130
|
|
|
131
131
|
PhoneNumberAttachedToCampaignWebhookEvent = SurgeAPI::Models::PhoneNumberAttachedToCampaignWebhookEvent
|
|
132
132
|
|
|
133
|
+
PhoneNumberImportedWebhookEvent = SurgeAPI::Models::PhoneNumberImportedWebhookEvent
|
|
134
|
+
|
|
133
135
|
PhoneNumberListAvailableNumbersParams = SurgeAPI::Models::PhoneNumberListAvailableNumbersParams
|
|
134
136
|
|
|
135
137
|
PhoneNumberListParams = SurgeAPI::Models::PhoneNumberListParams
|
|
@@ -9,7 +9,7 @@ module SurgeAPI
|
|
|
9
9
|
#
|
|
10
10
|
# @param key [String, nil] The webhook signing key
|
|
11
11
|
#
|
|
12
|
-
# @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]
|
|
12
|
+
# @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::PhoneNumberImportedWebhookEvent, SurgeAPI::Models::RecordingCompletedWebhookEvent, SurgeAPI::Models::VoicemailReceivedWebhookEvent]
|
|
13
13
|
def unwrap(payload, headers:, key: @client.webhook_signing_secret)
|
|
14
14
|
if key.nil?
|
|
15
15
|
raise ArgumentError.new("Cannot verify a webhook without a key on either the client's webhook_signing_secret or passed in as an argument")
|
data/lib/surge_api/version.rb
CHANGED
data/lib/surge_api.rb
CHANGED
|
@@ -102,6 +102,7 @@ require_relative "surge_api/models/message_sent_webhook_event"
|
|
|
102
102
|
require_relative "surge_api/models/organization"
|
|
103
103
|
require_relative "surge_api/models/phone_number"
|
|
104
104
|
require_relative "surge_api/models/phone_number_attached_to_campaign_webhook_event"
|
|
105
|
+
require_relative "surge_api/models/phone_number_imported_webhook_event"
|
|
105
106
|
require_relative "surge_api/models/phone_number_list_available_numbers_params"
|
|
106
107
|
require_relative "surge_api/models/phone_number_list_available_numbers_response"
|
|
107
108
|
require_relative "surge_api/models/phone_number_list_params"
|
|
@@ -88,6 +88,11 @@ module SurgeAPI
|
|
|
88
88
|
:local_messaging,
|
|
89
89
|
SurgeAPI::AccountRetrieveStatusParams::Capability::TaggedSymbol
|
|
90
90
|
)
|
|
91
|
+
TOLL_FREE_MESSAGING =
|
|
92
|
+
T.let(
|
|
93
|
+
:toll_free_messaging,
|
|
94
|
+
SurgeAPI::AccountRetrieveStatusParams::Capability::TaggedSymbol
|
|
95
|
+
)
|
|
91
96
|
|
|
92
97
|
sig do
|
|
93
98
|
override.returns(
|
|
@@ -96,11 +96,10 @@ module SurgeAPI
|
|
|
96
96
|
sig { returns(SurgeAPI::Campaign::Volume::TaggedSymbol) }
|
|
97
97
|
attr_accessor :volume
|
|
98
98
|
|
|
99
|
-
# A sample link that might be sent by this campaign.
|
|
100
|
-
#
|
|
101
|
-
#
|
|
102
|
-
#
|
|
103
|
-
# to disable automatic link shortening.
|
|
99
|
+
# A sample link that might be sent by this campaign. This is required when
|
|
100
|
+
# `includes` contains `links`. Provide the same URL or domain that the campaign
|
|
101
|
+
# will use in production. If links from other domains are sent through this
|
|
102
|
+
# campaign, they are much more likely to be filtered by the carriers.
|
|
104
103
|
sig { returns(T.nilable(String)) }
|
|
105
104
|
attr_reader :link_sample
|
|
106
105
|
|
|
@@ -207,11 +206,10 @@ module SurgeAPI
|
|
|
207
206
|
# volume number upon receipt of the API request, and phone numbers will be
|
|
208
207
|
# charged as high volume numbers going forward.
|
|
209
208
|
volume:,
|
|
210
|
-
# A sample link that might be sent by this campaign.
|
|
211
|
-
#
|
|
212
|
-
#
|
|
213
|
-
#
|
|
214
|
-
# to disable automatic link shortening.
|
|
209
|
+
# A sample link that might be sent by this campaign. This is required when
|
|
210
|
+
# `includes` contains `links`. Provide the same URL or domain that the campaign
|
|
211
|
+
# will use in production. If links from other domains are sent through this
|
|
212
|
+
# campaign, they are much more likely to be filtered by the carriers.
|
|
215
213
|
link_sample: nil,
|
|
216
214
|
# The URL of the terms and conditions presented to end users when they opt in to
|
|
217
215
|
# messaging. These terms and conditions may be shared among all of a platform's
|
|
@@ -272,6 +270,7 @@ module SurgeAPI
|
|
|
272
270
|
|
|
273
271
|
ACTIVE = T.let(:active, SurgeAPI::Campaign::Status::TaggedSymbol)
|
|
274
272
|
CANCELED = T.let(:canceled, SurgeAPI::Campaign::Status::TaggedSymbol)
|
|
273
|
+
REJECTED = T.let(:rejected, SurgeAPI::Campaign::Status::TaggedSymbol)
|
|
275
274
|
CREATED = T.let(:created, SurgeAPI::Campaign::Status::TaggedSymbol)
|
|
276
275
|
DEACTIVATED =
|
|
277
276
|
T.let(:deactivated, SurgeAPI::Campaign::Status::TaggedSymbol)
|