surge_api 0.9.0 → 0.11.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 +36 -0
- data/README.md +6 -6
- data/lib/surge_api/client.rb +4 -0
- data/lib/surge_api/internal/cursor.rb +2 -2
- data/lib/surge_api/internal/util.rb +1 -1
- data/lib/surge_api/models/campaign.rb +27 -1
- data/lib/surge_api/models/campaign_list_params.rb +34 -0
- data/lib/surge_api/models/campaign_retrieve_params.rb +14 -0
- data/lib/surge_api/models/message.rb +20 -5
- 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/recording_completed_webhook_event.rb +136 -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/recording_get_file_params.rb +14 -0
- data/lib/surge_api/models/recording_get_file_response.rb +19 -0
- data/lib/surge_api/models/unwrap_webhook_event.rb +5 -1
- data/lib/surge_api/models/voicemail_received_webhook_event.rb +144 -0
- data/lib/surge_api/models.rb +12 -0
- data/lib/surge_api/resources/campaigns.rb +50 -0
- data/lib/surge_api/resources/recordings.rb +56 -0
- data/lib/surge_api/resources/webhooks.rb +1 -1
- data/lib/surge_api/version.rb +1 -1
- data/lib/surge_api.rb +9 -0
- data/rbi/surge_api/client.rbi +3 -0
- data/rbi/surge_api/internal/util.rbi +1 -1
- data/rbi/surge_api/models/campaign.rbi +32 -0
- data/rbi/surge_api/models/campaign_list_params.rbi +59 -0
- data/rbi/surge_api/models/campaign_retrieve_params.rbi +27 -0
- data/rbi/surge_api/models/message.rbi +45 -12
- 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/recording_completed_webhook_event.rbi +277 -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/recording_get_file_params.rbi +27 -0
- data/rbi/surge_api/models/recording_get_file_response.rbi +34 -0
- data/rbi/surge_api/models/unwrap_webhook_event.rbi +3 -1
- data/rbi/surge_api/models/voicemail_received_webhook_event.rbi +283 -0
- data/rbi/surge_api/models.rbi +14 -0
- data/rbi/surge_api/resources/campaigns.rbi +35 -0
- data/rbi/surge_api/resources/recordings.rbi +42 -0
- data/rbi/surge_api/resources/webhooks.rbi +3 -1
- data/sig/surge_api/client.rbs +2 -0
- data/sig/surge_api/models/campaign.rbs +28 -0
- data/sig/surge_api/models/campaign_list_params.rbs +32 -0
- data/sig/surge_api/models/campaign_retrieve_params.rbs +15 -0
- data/sig/surge_api/models/message.rbs +37 -11
- 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/recording_completed_webhook_event.rbs +126 -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/recording_get_file_params.rbs +15 -0
- data/sig/surge_api/models/recording_get_file_response.rbs +13 -0
- data/sig/surge_api/models/unwrap_webhook_event.rbs +2 -0
- data/sig/surge_api/models/voicemail_received_webhook_event.rbs +131 -0
- data/sig/surge_api/models.rbs +12 -0
- data/sig/surge_api/resources/campaigns.rbs +12 -0
- data/sig/surge_api/resources/recordings.rbs +17 -0
- data/sig/surge_api/resources/webhooks.rbs +3 -1
- metadata +29 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 21d19ad8088d287a26c0293ecbec97d29a879616d98b219dbcb8c672c699f58d
|
|
4
|
+
data.tar.gz: eb81ac34997ec986242cdd64006a69d31f7bb76555a8a711644fcc06210c1293
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: af5bc8ed33052eb78f9a1bcb9e165e594f2b684891c6a159315903847da918c38ce1a4b8cb60bdb10b5cc4d144eb1a7398f816c90606268189408f9da6de25d0
|
|
7
|
+
data.tar.gz: 17951922f214b0a5d290fd520658d9964ae51972e5761199272d3193a91bfa3f2b52cc1fa749f4235174d42733472d732b2c20a4dd6767509b5b89b06e86d82b
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,41 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.11.0 (2026-02-22)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v0.10.0...v0.11.0](https://github.com/surgeapi/ruby-sdk/compare/v0.10.0...v0.11.0)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* **api:** add list campaigns endpoint ([253f71e](https://github.com/surgeapi/ruby-sdk/commit/253f71e0ac6ba81778c59aeddf33a6a80b898ac3))
|
|
10
|
+
* **api:** add metadata to message webhooks ([6827521](https://github.com/surgeapi/ruby-sdk/commit/68275214c295b5b102ef3c05a62ed08a03794ac6))
|
|
11
|
+
* **api:** delete recording endpoint ([64d7bf2](https://github.com/surgeapi/ruby-sdk/commit/64d7bf2f8730fa7a11a4b38c07ade41a850bf5a8))
|
|
12
|
+
* **api:** make attachment type an enum ([2897de1](https://github.com/surgeapi/ruby-sdk/commit/2897de13cd5eb3c95c30b251b7baf7edf5c0b6d7))
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Chores
|
|
16
|
+
|
|
17
|
+
* **internal:** remove mock server code ([1411557](https://github.com/surgeapi/ruby-sdk/commit/1411557864e6741dc576fe5802cbd2bb2dcaa9e6))
|
|
18
|
+
* **test:** update skip reason message ([cbb9e45](https://github.com/surgeapi/ruby-sdk/commit/cbb9e4564283c9b1e733c443bba93cefe10d0f85))
|
|
19
|
+
* update mock server docs ([cd3da3a](https://github.com/surgeapi/ruby-sdk/commit/cd3da3a27ea9d4d5a511ecf8ea82ca4fbe00eaef))
|
|
20
|
+
|
|
21
|
+
## 0.10.0 (2026-02-12)
|
|
22
|
+
|
|
23
|
+
Full Changelog: [v0.9.0...v0.10.0](https://github.com/surgeapi/ruby-sdk/compare/v0.9.0...v0.10.0)
|
|
24
|
+
|
|
25
|
+
### Features
|
|
26
|
+
|
|
27
|
+
* **api:** add campaign.status field ([f0ab6be](https://github.com/surgeapi/ruby-sdk/commit/f0ab6bef5d1cbca9741b3731189e5a821c6abcb3))
|
|
28
|
+
* **api:** add get campaign endpoint ([511d2b3](https://github.com/surgeapi/ruby-sdk/commit/511d2b3cd36a3e4a1f1737093a02f5c31296c332))
|
|
29
|
+
* **api:** add recording.completed webhook ([9a72a0c](https://github.com/surgeapi/ruby-sdk/commit/9a72a0c754dad51ac7b02e84c3f8ce8e6ba85378))
|
|
30
|
+
* **api:** add voicemail.received webhook ([37edfcd](https://github.com/surgeapi/ruby-sdk/commit/37edfcd3a2d26f42ea5a0fbf5481e046486f4456))
|
|
31
|
+
* **api:** get recording file ([db0184e](https://github.com/surgeapi/ruby-sdk/commit/db0184e171168f74e20d91b65cea452a32aad263))
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
### Bug Fixes
|
|
35
|
+
|
|
36
|
+
* **api:** make message.blast_id nullable ([9096e75](https://github.com/surgeapi/ruby-sdk/commit/9096e75d5aa6803c4b11aba0fe2c61448abf3f6a))
|
|
37
|
+
* **client:** loosen json header parsing ([51f4092](https://github.com/surgeapi/ruby-sdk/commit/51f409235dc8e2c377411b3f53595df8fea9b4e4))
|
|
38
|
+
|
|
3
39
|
## 0.9.0 (2026-02-04)
|
|
4
40
|
|
|
5
41
|
Full Changelog: [v0.8.0...v0.9.0](https://github.com/surgeapi/ruby-sdk/compare/v0.8.0...v0.9.0)
|
data/README.md
CHANGED
|
@@ -17,7 +17,7 @@ To use this gem, install via Bundler by adding the following to your application
|
|
|
17
17
|
<!-- x-release-please-start-version -->
|
|
18
18
|
|
|
19
19
|
```ruby
|
|
20
|
-
gem "surge_api", "~> 0.
|
|
20
|
+
gem "surge_api", "~> 0.11.0"
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
<!-- x-release-please-end -->
|
|
@@ -44,15 +44,15 @@ List methods in the Surge API are paginated.
|
|
|
44
44
|
This library provides auto-paginating iterators with each list response, so you do not have to request successive pages manually:
|
|
45
45
|
|
|
46
46
|
```ruby
|
|
47
|
-
page = surge.
|
|
47
|
+
page = surge.campaigns.list
|
|
48
48
|
|
|
49
49
|
# Fetch single item from page.
|
|
50
|
-
|
|
51
|
-
puts(
|
|
50
|
+
campaign = page.data[0]
|
|
51
|
+
puts(campaign.id)
|
|
52
52
|
|
|
53
53
|
# Automatically fetches more pages as needed.
|
|
54
|
-
page.auto_paging_each do |
|
|
55
|
-
puts(
|
|
54
|
+
page.auto_paging_each do |campaign|
|
|
55
|
+
puts(campaign.id)
|
|
56
56
|
end
|
|
57
57
|
```
|
|
58
58
|
|
data/lib/surge_api/client.rb
CHANGED
|
@@ -36,6 +36,9 @@ module SurgeAPI
|
|
|
36
36
|
# @return [SurgeAPI::Resources::PhoneNumbers]
|
|
37
37
|
attr_reader :phone_numbers
|
|
38
38
|
|
|
39
|
+
# @return [SurgeAPI::Resources::Recordings]
|
|
40
|
+
attr_reader :recordings
|
|
41
|
+
|
|
39
42
|
# @return [SurgeAPI::Resources::Users]
|
|
40
43
|
attr_reader :users
|
|
41
44
|
|
|
@@ -98,6 +101,7 @@ module SurgeAPI
|
|
|
98
101
|
@contacts = SurgeAPI::Resources::Contacts.new(client: self)
|
|
99
102
|
@messages = SurgeAPI::Resources::Messages.new(client: self)
|
|
100
103
|
@phone_numbers = SurgeAPI::Resources::PhoneNumbers.new(client: self)
|
|
104
|
+
@recordings = SurgeAPI::Resources::Recordings.new(client: self)
|
|
101
105
|
@users = SurgeAPI::Resources::Users.new(client: self)
|
|
102
106
|
@verifications = SurgeAPI::Resources::Verifications.new(client: self)
|
|
103
107
|
@webhooks = SurgeAPI::Resources::Webhooks.new(client: self)
|
|
@@ -485,7 +485,7 @@ module SurgeAPI
|
|
|
485
485
|
end
|
|
486
486
|
|
|
487
487
|
# @type [Regexp]
|
|
488
|
-
JSON_CONTENT = %r{^application/(?:
|
|
488
|
+
JSON_CONTENT = %r{^application/(?:[a-zA-Z0-9.-]+\+)?json(?!l)}
|
|
489
489
|
# @type [Regexp]
|
|
490
490
|
JSONL_CONTENT = %r{^application/(:?x-(?:n|l)djson)|(:?(?:x-)?jsonl)}
|
|
491
491
|
|
|
@@ -60,6 +60,12 @@ module SurgeAPI
|
|
|
60
60
|
# @return [String]
|
|
61
61
|
required :privacy_policy_url, String
|
|
62
62
|
|
|
63
|
+
# @!attribute status
|
|
64
|
+
# The current status of the campaign.
|
|
65
|
+
#
|
|
66
|
+
# @return [Symbol, SurgeAPI::Models::Campaign::Status]
|
|
67
|
+
required :status, enum: -> { SurgeAPI::Campaign::Status }
|
|
68
|
+
|
|
63
69
|
# @!attribute use_cases
|
|
64
70
|
# A list containing 1-5 types of messages that will be sent with this campaign.
|
|
65
71
|
#
|
|
@@ -125,7 +131,7 @@ module SurgeAPI
|
|
|
125
131
|
# @return [String, nil]
|
|
126
132
|
optional :terms_and_conditions_url, String
|
|
127
133
|
|
|
128
|
-
# @!method initialize(id:, consent_flow:, description:, includes:, message_samples:, privacy_policy_url:, use_cases:, volume:, link_sample: nil, terms_and_conditions_url: nil)
|
|
134
|
+
# @!method initialize(id:, consent_flow:, description:, includes:, message_samples:, privacy_policy_url:, status:, use_cases:, volume:, link_sample: nil, terms_and_conditions_url: nil)
|
|
129
135
|
# Some parameter documentations has been truncated, see
|
|
130
136
|
# {SurgeAPI::Models::Campaign} for more details.
|
|
131
137
|
#
|
|
@@ -144,6 +150,8 @@ module SurgeAPI
|
|
|
144
150
|
#
|
|
145
151
|
# @param privacy_policy_url [String] The URL of the privacy policy for the brand in question. This may be a shared pr
|
|
146
152
|
#
|
|
153
|
+
# @param status [Symbol, SurgeAPI::Models::Campaign::Status] The current status of the campaign.
|
|
154
|
+
#
|
|
147
155
|
# @param use_cases [Array<Symbol, SurgeAPI::Models::Campaign::UseCase>] A list containing 1-5 types of messages that will be sent with this campaign.
|
|
148
156
|
#
|
|
149
157
|
# @param volume [Symbol, SurgeAPI::Models::Campaign::Volume] This will be one of the following:
|
|
@@ -164,6 +172,24 @@ module SurgeAPI
|
|
|
164
172
|
# @return [Array<Symbol>]
|
|
165
173
|
end
|
|
166
174
|
|
|
175
|
+
# The current status of the campaign.
|
|
176
|
+
#
|
|
177
|
+
# @see SurgeAPI::Models::Campaign#status
|
|
178
|
+
module Status
|
|
179
|
+
extend SurgeAPI::Internal::Type::Enum
|
|
180
|
+
|
|
181
|
+
ACTIVE = :active
|
|
182
|
+
CANCELED = :canceled
|
|
183
|
+
CREATED = :created
|
|
184
|
+
DEACTIVATED = :deactivated
|
|
185
|
+
IN_REVIEW = :in_review
|
|
186
|
+
PENDING = :pending
|
|
187
|
+
REJECTED = :rejected
|
|
188
|
+
|
|
189
|
+
# @!method self.values
|
|
190
|
+
# @return [Array<Symbol>]
|
|
191
|
+
end
|
|
192
|
+
|
|
167
193
|
module UseCase
|
|
168
194
|
extend SurgeAPI::Internal::Type::Enum
|
|
169
195
|
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module SurgeAPI
|
|
4
|
+
module Models
|
|
5
|
+
# @see SurgeAPI::Resources::Campaigns#list
|
|
6
|
+
class CampaignListParams < SurgeAPI::Internal::Type::BaseModel
|
|
7
|
+
extend SurgeAPI::Internal::Type::RequestParameters::Converter
|
|
8
|
+
include SurgeAPI::Internal::Type::RequestParameters
|
|
9
|
+
|
|
10
|
+
# @!attribute after
|
|
11
|
+
# Cursor for forward pagination. Use the next_cursor from a previous response.
|
|
12
|
+
#
|
|
13
|
+
# @return [String, nil]
|
|
14
|
+
optional :after, String
|
|
15
|
+
|
|
16
|
+
# @!attribute before
|
|
17
|
+
# Cursor for backward pagination. Use the previous_cursor from a previous
|
|
18
|
+
# response.
|
|
19
|
+
#
|
|
20
|
+
# @return [String, nil]
|
|
21
|
+
optional :before, String
|
|
22
|
+
|
|
23
|
+
# @!method initialize(after: nil, before: nil, request_options: {})
|
|
24
|
+
# Some parameter documentations has been truncated, see
|
|
25
|
+
# {SurgeAPI::Models::CampaignListParams} for more details.
|
|
26
|
+
#
|
|
27
|
+
# @param after [String] Cursor for forward pagination. Use the next_cursor from a previous response.
|
|
28
|
+
#
|
|
29
|
+
# @param before [String] Cursor for backward pagination. Use the previous_cursor from a previous response
|
|
30
|
+
#
|
|
31
|
+
# @param request_options [SurgeAPI::RequestOptions, Hash{Symbol=>Object}]
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module SurgeAPI
|
|
4
|
+
module Models
|
|
5
|
+
# @see SurgeAPI::Resources::Campaigns#retrieve
|
|
6
|
+
class CampaignRetrieveParams < SurgeAPI::Internal::Type::BaseModel
|
|
7
|
+
extend SurgeAPI::Internal::Type::RequestParameters::Converter
|
|
8
|
+
include SurgeAPI::Internal::Type::RequestParameters
|
|
9
|
+
|
|
10
|
+
# @!method initialize(request_options: {})
|
|
11
|
+
# @param request_options [SurgeAPI::RequestOptions, Hash{Symbol=>Object}]
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
@@ -20,7 +20,7 @@ module SurgeAPI
|
|
|
20
20
|
# attribute messages back to a specific blast.
|
|
21
21
|
#
|
|
22
22
|
# @return [String, nil]
|
|
23
|
-
optional :blast_id, String
|
|
23
|
+
optional :blast_id, String, nil?: true
|
|
24
24
|
|
|
25
25
|
# @!attribute body
|
|
26
26
|
# The message body.
|
|
@@ -50,7 +50,7 @@ module SurgeAPI
|
|
|
50
50
|
#
|
|
51
51
|
# @param attachments [Array<SurgeAPI::Models::Message::Attachment>]
|
|
52
52
|
#
|
|
53
|
-
# @param blast_id [String] The ID of the blast this message belongs to, if any. This can be used to attribu
|
|
53
|
+
# @param blast_id [String, nil] The ID of the blast this message belongs to, if any. This can be used to attribu
|
|
54
54
|
#
|
|
55
55
|
# @param body [String, nil] The message body.
|
|
56
56
|
#
|
|
@@ -68,8 +68,8 @@ module SurgeAPI
|
|
|
68
68
|
# @!attribute type
|
|
69
69
|
# The type of attachment.
|
|
70
70
|
#
|
|
71
|
-
# @return [
|
|
72
|
-
optional :type,
|
|
71
|
+
# @return [Symbol, SurgeAPI::Models::Message::Attachment::Type, nil]
|
|
72
|
+
optional :type, enum: -> { SurgeAPI::Message::Attachment::Type }
|
|
73
73
|
|
|
74
74
|
# @!attribute url
|
|
75
75
|
# The URL of the attachment.
|
|
@@ -82,9 +82,24 @@ module SurgeAPI
|
|
|
82
82
|
#
|
|
83
83
|
# @param id [String] Unique identifier for the object.
|
|
84
84
|
#
|
|
85
|
-
# @param type [
|
|
85
|
+
# @param type [Symbol, SurgeAPI::Models::Message::Attachment::Type] The type of attachment.
|
|
86
86
|
#
|
|
87
87
|
# @param url [String] The URL of the attachment.
|
|
88
|
+
|
|
89
|
+
# The type of attachment.
|
|
90
|
+
#
|
|
91
|
+
# @see SurgeAPI::Models::Message::Attachment#type
|
|
92
|
+
module Type
|
|
93
|
+
extend SurgeAPI::Internal::Type::Enum
|
|
94
|
+
|
|
95
|
+
FILE = :file
|
|
96
|
+
IMAGE = :image
|
|
97
|
+
LINK = :link
|
|
98
|
+
VIDEO = :video
|
|
99
|
+
|
|
100
|
+
# @!method self.values
|
|
101
|
+
# @return [Array<Symbol>]
|
|
102
|
+
end
|
|
88
103
|
end
|
|
89
104
|
|
|
90
105
|
# @see SurgeAPI::Models::Message#conversation
|
|
@@ -62,6 +62,12 @@ module SurgeAPI
|
|
|
62
62
|
# @return [Time]
|
|
63
63
|
required :delivered_at, Time
|
|
64
64
|
|
|
65
|
+
# @!attribute metadata
|
|
66
|
+
# Set of key-value pairs that will be stored with the object.
|
|
67
|
+
#
|
|
68
|
+
# @return [Hash{Symbol=>String}]
|
|
69
|
+
required :metadata, SurgeAPI::Internal::Type::HashOf[String]
|
|
70
|
+
|
|
65
71
|
# @!attribute attachments
|
|
66
72
|
# Attachments included with the message
|
|
67
73
|
#
|
|
@@ -76,7 +82,7 @@ module SurgeAPI
|
|
|
76
82
|
# @return [String, nil]
|
|
77
83
|
optional :blast_id, String
|
|
78
84
|
|
|
79
|
-
# @!method initialize(id:, body:, conversation:, delivered_at:, attachments: nil, blast_id: nil)
|
|
85
|
+
# @!method initialize(id:, body:, conversation:, delivered_at:, metadata:, attachments: nil, blast_id: nil)
|
|
80
86
|
# Some parameter documentations has been truncated, see
|
|
81
87
|
# {SurgeAPI::Models::MessageDeliveredWebhookEvent::Data} for more details.
|
|
82
88
|
#
|
|
@@ -90,6 +96,8 @@ module SurgeAPI
|
|
|
90
96
|
#
|
|
91
97
|
# @param delivered_at [Time] When the message was delivered
|
|
92
98
|
#
|
|
99
|
+
# @param metadata [Hash{Symbol=>String}] Set of key-value pairs that will be stored with the object.
|
|
100
|
+
#
|
|
93
101
|
# @param attachments [Array<SurgeAPI::Models::MessageDeliveredWebhookEvent::Data::Attachment>] Attachments included with the message
|
|
94
102
|
#
|
|
95
103
|
# @param blast_id [String] The ID of the blast this message belongs to, if any. This can be used to attribu
|
|
@@ -68,6 +68,12 @@ module SurgeAPI
|
|
|
68
68
|
# @return [String]
|
|
69
69
|
required :failure_reason, String
|
|
70
70
|
|
|
71
|
+
# @!attribute metadata
|
|
72
|
+
# Set of key-value pairs that will be stored with the object.
|
|
73
|
+
#
|
|
74
|
+
# @return [Hash{Symbol=>String}]
|
|
75
|
+
required :metadata, SurgeAPI::Internal::Type::HashOf[String]
|
|
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:, failed_at:, failure_reason:, attachments: nil, blast_id: nil)
|
|
91
|
+
# @!method initialize(id:, body:, conversation:, failed_at:, failure_reason:, metadata:, attachments: nil, blast_id: nil)
|
|
86
92
|
# Some parameter documentations has been truncated, see
|
|
87
93
|
# {SurgeAPI::Models::MessageFailedWebhookEvent::Data} for more details.
|
|
88
94
|
#
|
|
@@ -98,6 +104,8 @@ module SurgeAPI
|
|
|
98
104
|
#
|
|
99
105
|
# @param failure_reason [String] The reason the message failed to be delivered
|
|
100
106
|
#
|
|
107
|
+
# @param metadata [Hash{Symbol=>String}] Set of key-value pairs that will be stored with the object.
|
|
108
|
+
#
|
|
101
109
|
# @param attachments [Array<SurgeAPI::Models::MessageFailedWebhookEvent::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
|
|
@@ -56,6 +56,12 @@ module SurgeAPI
|
|
|
56
56
|
# @return [SurgeAPI::Models::MessageReceivedWebhookEvent::Data::Conversation]
|
|
57
57
|
required :conversation, -> { SurgeAPI::MessageReceivedWebhookEvent::Data::Conversation }
|
|
58
58
|
|
|
59
|
+
# @!attribute metadata
|
|
60
|
+
# Set of key-value pairs that will be stored with the object.
|
|
61
|
+
#
|
|
62
|
+
# @return [Hash{Symbol=>String}]
|
|
63
|
+
required :metadata, SurgeAPI::Internal::Type::HashOf[String]
|
|
64
|
+
|
|
59
65
|
# @!attribute received_at
|
|
60
66
|
# When the message was received
|
|
61
67
|
#
|
|
@@ -76,7 +82,7 @@ module SurgeAPI
|
|
|
76
82
|
# @return [String, nil]
|
|
77
83
|
optional :blast_id, String
|
|
78
84
|
|
|
79
|
-
# @!method initialize(id:, body:, conversation:, received_at:, attachments: nil, blast_id: nil)
|
|
85
|
+
# @!method initialize(id:, body:, conversation:, metadata:, received_at:, attachments: nil, blast_id: nil)
|
|
80
86
|
# Some parameter documentations has been truncated, see
|
|
81
87
|
# {SurgeAPI::Models::MessageReceivedWebhookEvent::Data} for more details.
|
|
82
88
|
#
|
|
@@ -88,6 +94,8 @@ module SurgeAPI
|
|
|
88
94
|
#
|
|
89
95
|
# @param conversation [SurgeAPI::Models::MessageReceivedWebhookEvent::Data::Conversation] The conversation this message belongs to
|
|
90
96
|
#
|
|
97
|
+
# @param metadata [Hash{Symbol=>String}] Set of key-value pairs that will be stored with the object.
|
|
98
|
+
#
|
|
91
99
|
# @param received_at [Time] When the message was received
|
|
92
100
|
#
|
|
93
101
|
# @param attachments [Array<SurgeAPI::Models::MessageReceivedWebhookEvent::Data::Attachment>] Attachments included with the message
|
|
@@ -56,6 +56,12 @@ module SurgeAPI
|
|
|
56
56
|
# @return [SurgeAPI::Models::MessageSentWebhookEvent::Data::Conversation]
|
|
57
57
|
required :conversation, -> { SurgeAPI::MessageSentWebhookEvent::Data::Conversation }
|
|
58
58
|
|
|
59
|
+
# @!attribute metadata
|
|
60
|
+
# Set of key-value pairs that will be stored with the object.
|
|
61
|
+
#
|
|
62
|
+
# @return [Hash{Symbol=>String}]
|
|
63
|
+
required :metadata, SurgeAPI::Internal::Type::HashOf[String]
|
|
64
|
+
|
|
59
65
|
# @!attribute sent_at
|
|
60
66
|
# When the message was sent
|
|
61
67
|
#
|
|
@@ -76,7 +82,7 @@ module SurgeAPI
|
|
|
76
82
|
# @return [String, nil]
|
|
77
83
|
optional :blast_id, String
|
|
78
84
|
|
|
79
|
-
# @!method initialize(id:, body:, conversation:, sent_at:, attachments: nil, blast_id: nil)
|
|
85
|
+
# @!method initialize(id:, body:, conversation:, metadata:, sent_at:, attachments: nil, blast_id: nil)
|
|
80
86
|
# Some parameter documentations has been truncated, see
|
|
81
87
|
# {SurgeAPI::Models::MessageSentWebhookEvent::Data} for more details.
|
|
82
88
|
#
|
|
@@ -88,6 +94,8 @@ module SurgeAPI
|
|
|
88
94
|
#
|
|
89
95
|
# @param conversation [SurgeAPI::Models::MessageSentWebhookEvent::Data::Conversation] The conversation this message belongs to
|
|
90
96
|
#
|
|
97
|
+
# @param metadata [Hash{Symbol=>String}] Set of key-value pairs that will be stored with the object.
|
|
98
|
+
#
|
|
91
99
|
# @param sent_at [Time] When the message was sent
|
|
92
100
|
#
|
|
93
101
|
# @param attachments [Array<SurgeAPI::Models::MessageSentWebhookEvent::Data::Attachment>] Attachments included with the message
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module SurgeAPI
|
|
4
|
+
module Models
|
|
5
|
+
class RecordingCompletedWebhookEvent < 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::RecordingCompletedWebhookEvent::Data]
|
|
16
|
+
required :data, -> { SurgeAPI::RecordingCompletedWebhookEvent::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 `recording.completed` for this event.
|
|
26
|
+
#
|
|
27
|
+
# @return [Symbol, :"recording.completed"]
|
|
28
|
+
required :type, const: :"recording.completed"
|
|
29
|
+
|
|
30
|
+
# @!method initialize(account_id:, data:, timestamp:, type: :"recording.completed")
|
|
31
|
+
# @param account_id [String] The ID of the account in which this event occurred
|
|
32
|
+
#
|
|
33
|
+
# @param data [SurgeAPI::Models::RecordingCompletedWebhookEvent::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, :"recording.completed"] The type of the event. Always `recording.completed` for this event.
|
|
38
|
+
|
|
39
|
+
# @see SurgeAPI::Models::RecordingCompletedWebhookEvent#data
|
|
40
|
+
class Data < SurgeAPI::Internal::Type::BaseModel
|
|
41
|
+
# @!attribute id
|
|
42
|
+
# The unique identifier for the recording
|
|
43
|
+
#
|
|
44
|
+
# @return [String]
|
|
45
|
+
required :id, String
|
|
46
|
+
|
|
47
|
+
# @!attribute call
|
|
48
|
+
# The call that produced this recording
|
|
49
|
+
#
|
|
50
|
+
# @return [SurgeAPI::Models::RecordingCompletedWebhookEvent::Data::Call]
|
|
51
|
+
required :call, -> { SurgeAPI::RecordingCompletedWebhookEvent::Data::Call }
|
|
52
|
+
|
|
53
|
+
# @!attribute duration
|
|
54
|
+
# The duration of the recording in seconds
|
|
55
|
+
#
|
|
56
|
+
# @return [Integer]
|
|
57
|
+
required :duration, Integer
|
|
58
|
+
|
|
59
|
+
# @!method initialize(id:, call:, duration:)
|
|
60
|
+
# The data associated with the event
|
|
61
|
+
#
|
|
62
|
+
# @param id [String] The unique identifier for the recording
|
|
63
|
+
#
|
|
64
|
+
# @param call [SurgeAPI::Models::RecordingCompletedWebhookEvent::Data::Call] The call that produced this recording
|
|
65
|
+
#
|
|
66
|
+
# @param duration [Integer] The duration of the recording in seconds
|
|
67
|
+
|
|
68
|
+
# @see SurgeAPI::Models::RecordingCompletedWebhookEvent::Data#call
|
|
69
|
+
class Call < SurgeAPI::Internal::Type::BaseModel
|
|
70
|
+
# @!attribute id
|
|
71
|
+
# The unique identifier for the call
|
|
72
|
+
#
|
|
73
|
+
# @return [String]
|
|
74
|
+
required :id, String
|
|
75
|
+
|
|
76
|
+
# @!attribute contact
|
|
77
|
+
# A contact who has consented to receive messages
|
|
78
|
+
#
|
|
79
|
+
# @return [SurgeAPI::Models::Contact]
|
|
80
|
+
required :contact, -> { SurgeAPI::Contact }
|
|
81
|
+
|
|
82
|
+
# @!attribute duration
|
|
83
|
+
# The duration of the call in seconds
|
|
84
|
+
#
|
|
85
|
+
# @return [Integer]
|
|
86
|
+
required :duration, Integer
|
|
87
|
+
|
|
88
|
+
# @!attribute initiated_at
|
|
89
|
+
# When the call was initiated
|
|
90
|
+
#
|
|
91
|
+
# @return [Time]
|
|
92
|
+
required :initiated_at, Time
|
|
93
|
+
|
|
94
|
+
# @!attribute status
|
|
95
|
+
# The status of the call
|
|
96
|
+
#
|
|
97
|
+
# @return [Symbol, SurgeAPI::Models::RecordingCompletedWebhookEvent::Data::Call::Status]
|
|
98
|
+
required :status, enum: -> { SurgeAPI::RecordingCompletedWebhookEvent::Data::Call::Status }
|
|
99
|
+
|
|
100
|
+
# @!method initialize(id:, contact:, duration:, initiated_at:, status:)
|
|
101
|
+
# The call that produced this recording
|
|
102
|
+
#
|
|
103
|
+
# @param id [String] The unique identifier for the call
|
|
104
|
+
#
|
|
105
|
+
# @param contact [SurgeAPI::Models::Contact] A contact who has consented to receive messages
|
|
106
|
+
#
|
|
107
|
+
# @param duration [Integer] The duration of the call in seconds
|
|
108
|
+
#
|
|
109
|
+
# @param initiated_at [Time] When the call was initiated
|
|
110
|
+
#
|
|
111
|
+
# @param status [Symbol, SurgeAPI::Models::RecordingCompletedWebhookEvent::Data::Call::Status] The status of the call
|
|
112
|
+
|
|
113
|
+
# The status of the call
|
|
114
|
+
#
|
|
115
|
+
# @see SurgeAPI::Models::RecordingCompletedWebhookEvent::Data::Call#status
|
|
116
|
+
module Status
|
|
117
|
+
extend SurgeAPI::Internal::Type::Enum
|
|
118
|
+
|
|
119
|
+
BUSY = :busy
|
|
120
|
+
CANCELED = :canceled
|
|
121
|
+
COMPLETED = :completed
|
|
122
|
+
FAILED = :failed
|
|
123
|
+
IN_PROGRESS = :in_progress
|
|
124
|
+
MISSED = :missed
|
|
125
|
+
NO_ANSWER = :no_answer
|
|
126
|
+
QUEUED = :queued
|
|
127
|
+
RINGING = :ringing
|
|
128
|
+
|
|
129
|
+
# @!method self.values
|
|
130
|
+
# @return [Array<Symbol>]
|
|
131
|
+
end
|
|
132
|
+
end
|
|
133
|
+
end
|
|
134
|
+
end
|
|
135
|
+
end
|
|
136
|
+
end
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module SurgeAPI
|
|
4
|
+
module Models
|
|
5
|
+
# @see SurgeAPI::Resources::Recordings#delete
|
|
6
|
+
class RecordingDeleteParams < SurgeAPI::Internal::Type::BaseModel
|
|
7
|
+
extend SurgeAPI::Internal::Type::RequestParameters::Converter
|
|
8
|
+
include SurgeAPI::Internal::Type::RequestParameters
|
|
9
|
+
|
|
10
|
+
# @!method initialize(request_options: {})
|
|
11
|
+
# @param request_options [SurgeAPI::RequestOptions, Hash{Symbol=>Object}]
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module SurgeAPI
|
|
4
|
+
module Models
|
|
5
|
+
# @see SurgeAPI::Resources::Recordings#delete
|
|
6
|
+
class RecordingDeleteResponse < SurgeAPI::Internal::Type::BaseModel
|
|
7
|
+
# @!attribute id
|
|
8
|
+
# The unique identifier for the recording
|
|
9
|
+
#
|
|
10
|
+
# @return [String]
|
|
11
|
+
required :id, String
|
|
12
|
+
|
|
13
|
+
# @!attribute call
|
|
14
|
+
# The call that produced this recording
|
|
15
|
+
#
|
|
16
|
+
# @return [SurgeAPI::Models::RecordingDeleteResponse::Call]
|
|
17
|
+
required :call, -> { SurgeAPI::Models::RecordingDeleteResponse::Call }
|
|
18
|
+
|
|
19
|
+
# @!attribute duration
|
|
20
|
+
# The duration of the recording in seconds
|
|
21
|
+
#
|
|
22
|
+
# @return [Integer]
|
|
23
|
+
required :duration, Integer
|
|
24
|
+
|
|
25
|
+
# @!method initialize(id:, call:, duration:)
|
|
26
|
+
# A call recording
|
|
27
|
+
#
|
|
28
|
+
# @param id [String] The unique identifier for the recording
|
|
29
|
+
#
|
|
30
|
+
# @param call [SurgeAPI::Models::RecordingDeleteResponse::Call] The call that produced this recording
|
|
31
|
+
#
|
|
32
|
+
# @param duration [Integer] The duration of the recording in seconds
|
|
33
|
+
|
|
34
|
+
# @see SurgeAPI::Models::RecordingDeleteResponse#call
|
|
35
|
+
class Call < SurgeAPI::Internal::Type::BaseModel
|
|
36
|
+
# @!attribute id
|
|
37
|
+
# The unique identifier for the call
|
|
38
|
+
#
|
|
39
|
+
# @return [String]
|
|
40
|
+
required :id, String
|
|
41
|
+
|
|
42
|
+
# @!attribute contact
|
|
43
|
+
# A contact who has consented to receive messages
|
|
44
|
+
#
|
|
45
|
+
# @return [SurgeAPI::Models::Contact]
|
|
46
|
+
required :contact, -> { SurgeAPI::Contact }
|
|
47
|
+
|
|
48
|
+
# @!attribute duration
|
|
49
|
+
# The duration of the call in seconds
|
|
50
|
+
#
|
|
51
|
+
# @return [Integer]
|
|
52
|
+
required :duration, Integer
|
|
53
|
+
|
|
54
|
+
# @!attribute initiated_at
|
|
55
|
+
# When the call was initiated
|
|
56
|
+
#
|
|
57
|
+
# @return [Time]
|
|
58
|
+
required :initiated_at, Time
|
|
59
|
+
|
|
60
|
+
# @!attribute status
|
|
61
|
+
# The status of the call
|
|
62
|
+
#
|
|
63
|
+
# @return [Symbol, SurgeAPI::Models::RecordingDeleteResponse::Call::Status]
|
|
64
|
+
required :status, enum: -> { SurgeAPI::Models::RecordingDeleteResponse::Call::Status }
|
|
65
|
+
|
|
66
|
+
# @!method initialize(id:, contact:, duration:, initiated_at:, status:)
|
|
67
|
+
# The call that produced this recording
|
|
68
|
+
#
|
|
69
|
+
# @param id [String] The unique identifier for the call
|
|
70
|
+
#
|
|
71
|
+
# @param contact [SurgeAPI::Models::Contact] A contact who has consented to receive messages
|
|
72
|
+
#
|
|
73
|
+
# @param duration [Integer] The duration of the call in seconds
|
|
74
|
+
#
|
|
75
|
+
# @param initiated_at [Time] When the call was initiated
|
|
76
|
+
#
|
|
77
|
+
# @param status [Symbol, SurgeAPI::Models::RecordingDeleteResponse::Call::Status] The status of the call
|
|
78
|
+
|
|
79
|
+
# The status of the call
|
|
80
|
+
#
|
|
81
|
+
# @see SurgeAPI::Models::RecordingDeleteResponse::Call#status
|
|
82
|
+
module Status
|
|
83
|
+
extend SurgeAPI::Internal::Type::Enum
|
|
84
|
+
|
|
85
|
+
BUSY = :busy
|
|
86
|
+
CANCELED = :canceled
|
|
87
|
+
COMPLETED = :completed
|
|
88
|
+
FAILED = :failed
|
|
89
|
+
IN_PROGRESS = :in_progress
|
|
90
|
+
MISSED = :missed
|
|
91
|
+
NO_ANSWER = :no_answer
|
|
92
|
+
QUEUED = :queued
|
|
93
|
+
RINGING = :ringing
|
|
94
|
+
|
|
95
|
+
# @!method self.values
|
|
96
|
+
# @return [Array<Symbol>]
|
|
97
|
+
end
|
|
98
|
+
end
|
|
99
|
+
end
|
|
100
|
+
end
|
|
101
|
+
end
|