surge_api 0.17.0 → 0.18.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.
Files changed (155) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +22 -0
  3. data/README.md +51 -16
  4. data/lib/surge_api/client.rb +22 -1
  5. data/lib/surge_api/internal/transport/base_client.rb +5 -0
  6. data/lib/surge_api/internal/util.rb +22 -7
  7. data/lib/surge_api/models/account_archive_params.rb +9 -1
  8. data/lib/surge_api/models/account_retrieve_status_params.rb +9 -1
  9. data/lib/surge_api/models/account_update_params.rb +9 -1
  10. data/lib/surge_api/models/attachment_get_file_params.rb +9 -1
  11. data/lib/surge_api/models/audience_add_contact_params.rb +9 -1
  12. data/lib/surge_api/models/audience_create_params.rb +9 -1
  13. data/lib/surge_api/models/audience_list_contacts_params.rb +9 -1
  14. data/lib/surge_api/models/blast_create_params.rb +9 -1
  15. data/lib/surge_api/models/campaign_create_params.rb +6 -10
  16. data/lib/surge_api/models/campaign_list_params.rb +9 -1
  17. data/lib/surge_api/models/campaign_retrieve_params.rb +9 -1
  18. data/lib/surge_api/models/campaign_update_params.rb +6 -10
  19. data/lib/surge_api/models/contact_create_params.rb +9 -1
  20. data/lib/surge_api/models/contact_list_params.rb +9 -1
  21. data/lib/surge_api/models/contact_retrieve_params.rb +9 -1
  22. data/lib/surge_api/models/contact_update_params.rb +9 -1
  23. data/lib/surge_api/models/message.rb +1 -0
  24. data/lib/surge_api/models/message_create_params.rb +6 -11
  25. data/lib/surge_api/models/message_delivered_webhook_event.rb +1 -0
  26. data/lib/surge_api/models/message_failed_webhook_event.rb +1 -0
  27. data/lib/surge_api/models/message_list_params.rb +9 -1
  28. data/lib/surge_api/models/message_params.rb +74 -2
  29. data/lib/surge_api/models/message_received_webhook_event.rb +1 -0
  30. data/lib/surge_api/models/message_retrieve_params.rb +9 -1
  31. data/lib/surge_api/models/message_sent_webhook_event.rb +1 -0
  32. data/lib/surge_api/models/phone_number.rb +1 -1
  33. data/lib/surge_api/models/phone_number_list_params.rb +9 -1
  34. data/lib/surge_api/models/phone_number_purchase_params.rb +9 -1
  35. data/lib/surge_api/models/phone_number_release_params.rb +22 -0
  36. data/lib/surge_api/models/phone_number_update_params.rb +38 -0
  37. data/lib/surge_api/models/recording_delete_params.rb +9 -1
  38. data/lib/surge_api/models/recording_get_file_params.rb +9 -1
  39. data/lib/surge_api/models/recording_list_params.rb +9 -1
  40. data/lib/surge_api/models/recording_retrieve_params.rb +9 -1
  41. data/lib/surge_api/models/user_create_params.rb +9 -1
  42. data/lib/surge_api/models/user_create_token_params.rb +9 -1
  43. data/lib/surge_api/models/user_delete_params.rb +9 -1
  44. data/lib/surge_api/models/user_list_params.rb +9 -1
  45. data/lib/surge_api/models/user_retrieve_params.rb +9 -1
  46. data/lib/surge_api/models/user_update_params.rb +9 -1
  47. data/lib/surge_api/models/verification_check_params.rb +9 -1
  48. data/lib/surge_api/models/verification_create_params.rb +9 -1
  49. data/lib/surge_api/models.rb +4 -0
  50. data/lib/surge_api/resources/campaigns.rb +4 -14
  51. data/lib/surge_api/resources/messages.rb +6 -7
  52. data/lib/surge_api/resources/phone_numbers.rb +46 -0
  53. data/lib/surge_api/resources/verifications.rb +7 -4
  54. data/lib/surge_api/resources/webhooks.rb +11 -1
  55. data/lib/surge_api/version.rb +1 -1
  56. data/lib/surge_api.rb +3 -0
  57. data/rbi/surge_api/client.rbi +6 -0
  58. data/rbi/surge_api/internal/util.rbi +8 -0
  59. data/rbi/surge_api/models/account_archive_params.rbi +18 -5
  60. data/rbi/surge_api/models/account_retrieve_status_params.rbi +8 -0
  61. data/rbi/surge_api/models/account_update_params.rbi +8 -0
  62. data/rbi/surge_api/models/attachment_get_file_params.rbi +18 -5
  63. data/rbi/surge_api/models/audience_add_contact_params.rbi +12 -1
  64. data/rbi/surge_api/models/audience_create_params.rbi +12 -1
  65. data/rbi/surge_api/models/audience_list_contacts_params.rbi +8 -0
  66. data/rbi/surge_api/models/blast_create_params.rbi +8 -0
  67. data/rbi/surge_api/models/campaign_create_params.rbi +7 -27
  68. data/rbi/surge_api/models/campaign_list_params.rbi +8 -0
  69. data/rbi/surge_api/models/campaign_retrieve_params.rbi +18 -5
  70. data/rbi/surge_api/models/campaign_update_params.rbi +7 -27
  71. data/rbi/surge_api/models/contact_create_params.rbi +8 -0
  72. data/rbi/surge_api/models/contact_list_params.rbi +8 -0
  73. data/rbi/surge_api/models/contact_retrieve_params.rbi +18 -5
  74. data/rbi/surge_api/models/contact_update_params.rbi +8 -0
  75. data/rbi/surge_api/models/message.rbi +2 -0
  76. data/rbi/surge_api/models/message_create_params.rbi +7 -29
  77. data/rbi/surge_api/models/message_delivered_webhook_event.rbi +5 -0
  78. data/rbi/surge_api/models/message_failed_webhook_event.rbi +5 -0
  79. data/rbi/surge_api/models/message_list_params.rbi +8 -0
  80. data/rbi/surge_api/models/message_params.rbi +225 -6
  81. data/rbi/surge_api/models/message_received_webhook_event.rbi +5 -0
  82. data/rbi/surge_api/models/message_retrieve_params.rbi +18 -5
  83. data/rbi/surge_api/models/message_sent_webhook_event.rbi +5 -0
  84. data/rbi/surge_api/models/phone_number_list_params.rbi +8 -0
  85. data/rbi/surge_api/models/phone_number_purchase_params.rbi +8 -0
  86. data/rbi/surge_api/models/phone_number_release_params.rbi +40 -0
  87. data/rbi/surge_api/models/phone_number_update_params.rbi +65 -0
  88. data/rbi/surge_api/models/recording_delete_params.rbi +18 -5
  89. data/rbi/surge_api/models/recording_get_file_params.rbi +18 -5
  90. data/rbi/surge_api/models/recording_list_params.rbi +8 -0
  91. data/rbi/surge_api/models/recording_retrieve_params.rbi +18 -5
  92. data/rbi/surge_api/models/user_create_params.rbi +8 -0
  93. data/rbi/surge_api/models/user_create_token_params.rbi +8 -0
  94. data/rbi/surge_api/models/user_delete_params.rbi +18 -5
  95. data/rbi/surge_api/models/user_list_params.rbi +8 -0
  96. data/rbi/surge_api/models/user_retrieve_params.rbi +18 -5
  97. data/rbi/surge_api/models/user_update_params.rbi +8 -0
  98. data/rbi/surge_api/models/verification_check_params.rbi +12 -1
  99. data/rbi/surge_api/models/verification_create_params.rbi +12 -1
  100. data/rbi/surge_api/models.rbi +4 -0
  101. data/rbi/surge_api/resources/campaigns.rbi +10 -2
  102. data/rbi/surge_api/resources/messages.rbi +9 -1
  103. data/rbi/surge_api/resources/phone_numbers.rbi +34 -0
  104. data/rbi/surge_api/resources/verifications.rbi +5 -1
  105. data/rbi/surge_api/resources/webhooks.rbi +10 -2
  106. data/sig/surge_api/client.rbs +3 -0
  107. data/sig/surge_api/internal/util.rbs +4 -0
  108. data/sig/surge_api/models/account_archive_params.rbs +8 -3
  109. data/sig/surge_api/models/account_retrieve_status_params.rbs +5 -0
  110. data/sig/surge_api/models/account_update_params.rbs +5 -0
  111. data/sig/surge_api/models/attachment_get_file_params.rbs +11 -3
  112. data/sig/surge_api/models/audience_add_contact_params.rbs +10 -2
  113. data/sig/surge_api/models/audience_create_params.rbs +6 -1
  114. data/sig/surge_api/models/audience_list_contacts_params.rbs +5 -1
  115. data/sig/surge_api/models/blast_create_params.rbs +5 -0
  116. data/sig/surge_api/models/campaign_create_params.rbs +4 -9
  117. data/sig/surge_api/models/campaign_list_params.rbs +5 -1
  118. data/sig/surge_api/models/campaign_retrieve_params.rbs +8 -3
  119. data/sig/surge_api/models/campaign_update_params.rbs +4 -12
  120. data/sig/surge_api/models/contact_create_params.rbs +5 -0
  121. data/sig/surge_api/models/contact_list_params.rbs +5 -1
  122. data/sig/surge_api/models/contact_retrieve_params.rbs +8 -3
  123. data/sig/surge_api/models/contact_update_params.rbs +5 -0
  124. data/sig/surge_api/models/message.rbs +2 -1
  125. data/sig/surge_api/models/message_create_params.rbs +4 -9
  126. data/sig/surge_api/models/message_delivered_webhook_event.rbs +2 -1
  127. data/sig/surge_api/models/message_failed_webhook_event.rbs +2 -1
  128. data/sig/surge_api/models/message_list_params.rbs +5 -1
  129. data/sig/surge_api/models/message_params.rbs +88 -6
  130. data/sig/surge_api/models/message_received_webhook_event.rbs +2 -1
  131. data/sig/surge_api/models/message_retrieve_params.rbs +8 -3
  132. data/sig/surge_api/models/message_sent_webhook_event.rbs +2 -1
  133. data/sig/surge_api/models/phone_number_list_params.rbs +5 -1
  134. data/sig/surge_api/models/phone_number_purchase_params.rbs +5 -0
  135. data/sig/surge_api/models/phone_number_release_params.rbs +20 -0
  136. data/sig/surge_api/models/phone_number_update_params.rbs +36 -0
  137. data/sig/surge_api/models/recording_delete_params.rbs +8 -3
  138. data/sig/surge_api/models/recording_get_file_params.rbs +11 -3
  139. data/sig/surge_api/models/recording_list_params.rbs +5 -1
  140. data/sig/surge_api/models/recording_retrieve_params.rbs +8 -3
  141. data/sig/surge_api/models/user_create_params.rbs +5 -0
  142. data/sig/surge_api/models/user_create_token_params.rbs +5 -1
  143. data/sig/surge_api/models/user_delete_params.rbs +8 -3
  144. data/sig/surge_api/models/user_list_params.rbs +5 -1
  145. data/sig/surge_api/models/user_retrieve_params.rbs +8 -3
  146. data/sig/surge_api/models/user_update_params.rbs +5 -0
  147. data/sig/surge_api/models/verification_check_params.rbs +6 -1
  148. data/sig/surge_api/models/verification_create_params.rbs +6 -1
  149. data/sig/surge_api/models.rbs +4 -0
  150. data/sig/surge_api/resources/campaigns.rbs +2 -2
  151. data/sig/surge_api/resources/messages.rbs +1 -1
  152. data/sig/surge_api/resources/phone_numbers.rbs +12 -0
  153. data/sig/surge_api/resources/verifications.rbs +1 -0
  154. data/sig/surge_api/resources/webhooks.rbs +3 -1
  155. metadata +22 -2
@@ -7,6 +7,12 @@ module SurgeAPI
7
7
  extend SurgeAPI::Internal::Type::RequestParameters::Converter
8
8
  include SurgeAPI::Internal::Type::RequestParameters
9
9
 
10
+ # @!attribute account_id
11
+ # The account ID to list contacts for.
12
+ #
13
+ # @return [String]
14
+ required :account_id, String
15
+
10
16
  # @!attribute after
11
17
  # Cursor for forward pagination. Use the next_cursor from a previous response.
12
18
  #
@@ -20,10 +26,12 @@ module SurgeAPI
20
26
  # @return [String, nil]
21
27
  optional :before, String
22
28
 
23
- # @!method initialize(after: nil, before: nil, request_options: {})
29
+ # @!method initialize(account_id:, after: nil, before: nil, request_options: {})
24
30
  # Some parameter documentations has been truncated, see
25
31
  # {SurgeAPI::Models::ContactListParams} for more details.
26
32
  #
33
+ # @param account_id [String] The account ID to list contacts for.
34
+ #
27
35
  # @param after [String] Cursor for forward pagination. Use the next_cursor from a previous response.
28
36
  #
29
37
  # @param before [String] Cursor for backward pagination. Use the previous_cursor from a previous response
@@ -7,7 +7,15 @@ module SurgeAPI
7
7
  extend SurgeAPI::Internal::Type::RequestParameters::Converter
8
8
  include SurgeAPI::Internal::Type::RequestParameters
9
9
 
10
- # @!method initialize(request_options: {})
10
+ # @!attribute id
11
+ # The ID of the contact to retrieve.
12
+ #
13
+ # @return [String]
14
+ required :id, String
15
+
16
+ # @!method initialize(id:, request_options: {})
17
+ # @param id [String] The ID of the contact to retrieve.
18
+ #
11
19
  # @param request_options [SurgeAPI::RequestOptions, Hash{Symbol=>Object}]
12
20
  end
13
21
  end
@@ -7,6 +7,12 @@ module SurgeAPI
7
7
  extend SurgeAPI::Internal::Type::RequestParameters::Converter
8
8
  include SurgeAPI::Internal::Type::RequestParameters
9
9
 
10
+ # @!attribute id
11
+ # The ID of the contact to update.
12
+ #
13
+ # @return [String]
14
+ required :id, String
15
+
10
16
  # @!attribute phone_number
11
17
  # The contact's phone number in E.164 format.
12
18
  #
@@ -37,7 +43,9 @@ module SurgeAPI
37
43
  # @return [Hash{Symbol=>String}, nil]
38
44
  optional :metadata, SurgeAPI::Internal::Type::HashOf[String]
39
45
 
40
- # @!method initialize(phone_number:, email: nil, first_name: nil, last_name: nil, metadata: nil, request_options: {})
46
+ # @!method initialize(id:, phone_number:, email: nil, first_name: nil, last_name: nil, metadata: nil, request_options: {})
47
+ # @param id [String] The ID of the contact to update.
48
+ #
41
49
  # @param phone_number [String] The contact's phone number in E.164 format.
42
50
  #
43
51
  # @param email [String] The contact's email address.
@@ -95,6 +95,7 @@ module SurgeAPI
95
95
  FILE = :file
96
96
  IMAGE = :image
97
97
  LINK = :link
98
+ CONTACT = :contact
98
99
  VIDEO = :video
99
100
 
100
101
  # @!method self.values
@@ -7,19 +7,14 @@ module SurgeAPI
7
7
  extend SurgeAPI::Internal::Type::RequestParameters::Converter
8
8
  include SurgeAPI::Internal::Type::RequestParameters
9
9
 
10
- # @!attribute message_params
11
- # Payload for creating a message. Either an attachment or the body must be given.
12
- # You can specify the recipient either using the 'conversation' parameter or the
13
- # 'to'/'from' parameters, but not both.
10
+ # @!attribute account_id
11
+ # The account from which the message should be sent.
14
12
  #
15
- # @return [SurgeAPI::Models::MessageParams::MessageParamsWithConversation, SurgeAPI::Models::MessageParams::SimpleMessageParams]
16
- required :message_params, union: -> { SurgeAPI::MessageParams }
13
+ # @return [String]
14
+ required :account_id, String
17
15
 
18
- # @!method initialize(message_params:, request_options: {})
19
- # Some parameter documentations has been truncated, see
20
- # {SurgeAPI::Models::MessageCreateParams} for more details.
21
- #
22
- # @param message_params [SurgeAPI::Models::MessageParams::MessageParamsWithConversation, SurgeAPI::Models::MessageParams::SimpleMessageParams] Payload for creating a message. Either an attachment or the body must be given.
16
+ # @!method initialize(account_id:, request_options: {})
17
+ # @param account_id [String] The account from which the message should be sent.
23
18
  #
24
19
  # @param request_options [SurgeAPI::RequestOptions, Hash{Symbol=>Object}]
25
20
  end
@@ -167,6 +167,7 @@ module SurgeAPI
167
167
  FILE = :file
168
168
  IMAGE = :image
169
169
  LINK = :link
170
+ CONTACT = :contact
170
171
  VIDEO = :video
171
172
 
172
173
  # @!method self.values
@@ -175,6 +175,7 @@ module SurgeAPI
175
175
  FILE = :file
176
176
  IMAGE = :image
177
177
  LINK = :link
178
+ CONTACT = :contact
178
179
  VIDEO = :video
179
180
 
180
181
  # @!method self.values
@@ -7,6 +7,12 @@ module SurgeAPI
7
7
  extend SurgeAPI::Internal::Type::RequestParameters::Converter
8
8
  include SurgeAPI::Internal::Type::RequestParameters
9
9
 
10
+ # @!attribute account_id
11
+ # The account ID to list messages for.
12
+ #
13
+ # @return [String]
14
+ required :account_id, String
15
+
10
16
  # @!attribute after
11
17
  # Cursor for forward pagination. Use the next_cursor from a previous response.
12
18
  #
@@ -20,10 +26,12 @@ module SurgeAPI
20
26
  # @return [String, nil]
21
27
  optional :before, String
22
28
 
23
- # @!method initialize(after: nil, before: nil, request_options: {})
29
+ # @!method initialize(account_id:, after: nil, before: nil, request_options: {})
24
30
  # Some parameter documentations has been truncated, see
25
31
  # {SurgeAPI::Models::MessageListParams} for more details.
26
32
  #
33
+ # @param account_id [String] The account ID to list messages for.
34
+ #
27
35
  # @param after [String] Cursor for forward pagination. Use the next_cursor from a previous response.
28
36
  #
29
37
  # @param before [String] Cursor for backward pagination. Use the previous_cursor from a previous response
@@ -47,7 +47,13 @@ module SurgeAPI
47
47
  # @return [Time, nil]
48
48
  optional :send_at, Time
49
49
 
50
- # @!method initialize(conversation:, attachments: nil, body: nil, metadata: nil, send_at: nil)
50
+ # @!attribute settings
51
+ # Per-message setting overrides.
52
+ #
53
+ # @return [SurgeAPI::Models::MessageParams::MessageParamsWithConversation::Settings, nil]
54
+ optional :settings, -> { SurgeAPI::MessageParams::MessageParamsWithConversation::Settings }
55
+
56
+ # @!method initialize(conversation:, attachments: nil, body: nil, metadata: nil, send_at: nil, settings: nil)
51
57
  # Some parameter documentations has been truncated, see
52
58
  # {SurgeAPI::Models::MessageParams::MessageParamsWithConversation} for more
53
59
  # details.
@@ -64,6 +70,8 @@ module SurgeAPI
64
70
  # @param metadata [Hash{Symbol=>String}] Set of key-value pairs that will be stored with the object.
65
71
  #
66
72
  # @param send_at [Time] An optional datetime for scheduling message up to a couple of months in the futu
73
+ #
74
+ # @param settings [SurgeAPI::Models::MessageParams::MessageParamsWithConversation::Settings] Per-message setting overrides.
67
75
 
68
76
  # @see SurgeAPI::Models::MessageParams::MessageParamsWithConversation#conversation
69
77
  class Conversation < SurgeAPI::Internal::Type::BaseModel
@@ -151,6 +159,34 @@ module SurgeAPI
151
159
  #
152
160
  # @param url [String] The URL of the attachment.
153
161
  end
162
+
163
+ # @see SurgeAPI::Models::MessageParams::MessageParamsWithConversation#settings
164
+ class Settings < SurgeAPI::Internal::Type::BaseModel
165
+ # @!attribute link_shortening
166
+ # Override link shortening for this message.
167
+ #
168
+ # @return [Symbol, SurgeAPI::Models::MessageParams::MessageParamsWithConversation::Settings::LinkShortening, nil]
169
+ optional :link_shortening,
170
+ enum: -> { SurgeAPI::MessageParams::MessageParamsWithConversation::Settings::LinkShortening }
171
+
172
+ # @!method initialize(link_shortening: nil)
173
+ # Per-message setting overrides.
174
+ #
175
+ # @param link_shortening [Symbol, SurgeAPI::Models::MessageParams::MessageParamsWithConversation::Settings::LinkShortening] Override link shortening for this message.
176
+
177
+ # Override link shortening for this message.
178
+ #
179
+ # @see SurgeAPI::Models::MessageParams::MessageParamsWithConversation::Settings#link_shortening
180
+ module LinkShortening
181
+ extend SurgeAPI::Internal::Type::Enum
182
+
183
+ ENABLED = :enabled
184
+ DISABLED = :disabled
185
+
186
+ # @!method self.values
187
+ # @return [Array<Symbol>]
188
+ end
189
+ end
154
190
  end
155
191
 
156
192
  class SimpleMessageParams < SurgeAPI::Internal::Type::BaseModel
@@ -193,7 +229,13 @@ module SurgeAPI
193
229
  # @return [Time, nil]
194
230
  optional :send_at, Time
195
231
 
196
- # @!method initialize(to:, attachments: nil, body: nil, from: nil, metadata: nil, send_at: nil)
232
+ # @!attribute settings
233
+ # Per-message setting overrides.
234
+ #
235
+ # @return [SurgeAPI::Models::MessageParams::SimpleMessageParams::Settings, nil]
236
+ optional :settings, -> { SurgeAPI::MessageParams::SimpleMessageParams::Settings }
237
+
238
+ # @!method initialize(to:, attachments: nil, body: nil, from: nil, metadata: nil, send_at: nil, settings: nil)
197
239
  # Some parameter documentations has been truncated, see
198
240
  # {SurgeAPI::Models::MessageParams::SimpleMessageParams} for more details.
199
241
  #
@@ -210,6 +252,8 @@ module SurgeAPI
210
252
  # @param metadata [Hash{Symbol=>String}] Set of key-value pairs that will be stored with the object.
211
253
  #
212
254
  # @param send_at [Time] An optional datetime for scheduling message up to a couple of months in the futu
255
+ #
256
+ # @param settings [SurgeAPI::Models::MessageParams::SimpleMessageParams::Settings] Per-message setting overrides.
213
257
 
214
258
  class Attachment < SurgeAPI::Internal::Type::BaseModel
215
259
  # @!attribute url
@@ -223,6 +267,34 @@ module SurgeAPI
223
267
  #
224
268
  # @param url [String] The URL of the attachment.
225
269
  end
270
+
271
+ # @see SurgeAPI::Models::MessageParams::SimpleMessageParams#settings
272
+ class Settings < SurgeAPI::Internal::Type::BaseModel
273
+ # @!attribute link_shortening
274
+ # Override link shortening for this message.
275
+ #
276
+ # @return [Symbol, SurgeAPI::Models::MessageParams::SimpleMessageParams::Settings::LinkShortening, nil]
277
+ optional :link_shortening,
278
+ enum: -> { SurgeAPI::MessageParams::SimpleMessageParams::Settings::LinkShortening }
279
+
280
+ # @!method initialize(link_shortening: nil)
281
+ # Per-message setting overrides.
282
+ #
283
+ # @param link_shortening [Symbol, SurgeAPI::Models::MessageParams::SimpleMessageParams::Settings::LinkShortening] Override link shortening for this message.
284
+
285
+ # Override link shortening for this message.
286
+ #
287
+ # @see SurgeAPI::Models::MessageParams::SimpleMessageParams::Settings#link_shortening
288
+ module LinkShortening
289
+ extend SurgeAPI::Internal::Type::Enum
290
+
291
+ ENABLED = :enabled
292
+ DISABLED = :disabled
293
+
294
+ # @!method self.values
295
+ # @return [Array<Symbol>]
296
+ end
297
+ end
226
298
  end
227
299
 
228
300
  # @!method self.variants
@@ -167,6 +167,7 @@ module SurgeAPI
167
167
  FILE = :file
168
168
  IMAGE = :image
169
169
  LINK = :link
170
+ CONTACT = :contact
170
171
  VIDEO = :video
171
172
 
172
173
  # @!method self.values
@@ -7,7 +7,15 @@ module SurgeAPI
7
7
  extend SurgeAPI::Internal::Type::RequestParameters::Converter
8
8
  include SurgeAPI::Internal::Type::RequestParameters
9
9
 
10
- # @!method initialize(request_options: {})
10
+ # @!attribute id
11
+ # The ID of the message to retrieve.
12
+ #
13
+ # @return [String]
14
+ required :id, String
15
+
16
+ # @!method initialize(id:, request_options: {})
17
+ # @param id [String] The ID of the message to retrieve.
18
+ #
11
19
  # @param request_options [SurgeAPI::RequestOptions, Hash{Symbol=>Object}]
12
20
  end
13
21
  end
@@ -167,6 +167,7 @@ module SurgeAPI
167
167
  FILE = :file
168
168
  IMAGE = :image
169
169
  LINK = :link
170
+ CONTACT = :contact
170
171
  VIDEO = :video
171
172
 
172
173
  # @!method self.values
@@ -2,7 +2,7 @@
2
2
 
3
3
  module SurgeAPI
4
4
  module Models
5
- # @see SurgeAPI::Resources::PhoneNumbers#list
5
+ # @see SurgeAPI::Resources::PhoneNumbers#update
6
6
  class PhoneNumber < SurgeAPI::Internal::Type::BaseModel
7
7
  # @!attribute id
8
8
  # Unique identifier for the phone number
@@ -7,6 +7,12 @@ module SurgeAPI
7
7
  extend SurgeAPI::Internal::Type::RequestParameters::Converter
8
8
  include SurgeAPI::Internal::Type::RequestParameters
9
9
 
10
+ # @!attribute account_id
11
+ # The account ID to list phone numbers for.
12
+ #
13
+ # @return [String]
14
+ required :account_id, String
15
+
10
16
  # @!attribute after
11
17
  # Cursor for forward pagination. Use the next_cursor from a previous response.
12
18
  #
@@ -20,10 +26,12 @@ module SurgeAPI
20
26
  # @return [String, nil]
21
27
  optional :before, String
22
28
 
23
- # @!method initialize(after: nil, before: nil, request_options: {})
29
+ # @!method initialize(account_id:, after: nil, before: nil, request_options: {})
24
30
  # Some parameter documentations has been truncated, see
25
31
  # {SurgeAPI::Models::PhoneNumberListParams} for more details.
26
32
  #
33
+ # @param account_id [String] The account ID to list phone numbers for.
34
+ #
27
35
  # @param after [String] Cursor for forward pagination. Use the next_cursor from a previous response.
28
36
  #
29
37
  # @param before [String] Cursor for backward pagination. Use the previous_cursor from a previous response
@@ -7,6 +7,12 @@ module SurgeAPI
7
7
  extend SurgeAPI::Internal::Type::RequestParameters::Converter
8
8
  include SurgeAPI::Internal::Type::RequestParameters
9
9
 
10
+ # @!attribute account_id
11
+ # The account for which the phone number should be created.
12
+ #
13
+ # @return [String]
14
+ required :account_id, String
15
+
10
16
  # @!attribute area_code
11
17
  # The desired area code for this phone number. If provided without type, the type
12
18
  # will be inferred.
@@ -42,10 +48,12 @@ module SurgeAPI
42
48
  # @return [Symbol, SurgeAPI::Models::PhoneNumberPurchaseParams::Type, nil]
43
49
  optional :type, enum: -> { SurgeAPI::PhoneNumberPurchaseParams::Type }
44
50
 
45
- # @!method initialize(area_code: nil, latitude: nil, longitude: nil, name: nil, type: nil, request_options: {})
51
+ # @!method initialize(account_id:, area_code: nil, latitude: nil, longitude: nil, name: nil, type: nil, request_options: {})
46
52
  # Some parameter documentations has been truncated, see
47
53
  # {SurgeAPI::Models::PhoneNumberPurchaseParams} for more details.
48
54
  #
55
+ # @param account_id [String] The account for which the phone number should be created.
56
+ #
49
57
  # @param area_code [String] The desired area code for this phone number. If provided without type, the type
50
58
  #
51
59
  # @param latitude [Float] Latitude to search for nearby phone numbers. Must be used with longitude. If pro
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ module SurgeAPI
4
+ module Models
5
+ # @see SurgeAPI::Resources::PhoneNumbers#release
6
+ class PhoneNumberReleaseParams < SurgeAPI::Internal::Type::BaseModel
7
+ extend SurgeAPI::Internal::Type::RequestParameters::Converter
8
+ include SurgeAPI::Internal::Type::RequestParameters
9
+
10
+ # @!attribute id
11
+ # The ID of the phone number to release.
12
+ #
13
+ # @return [String]
14
+ required :id, String
15
+
16
+ # @!method initialize(id:, request_options: {})
17
+ # @param id [String] The ID of the phone number to release.
18
+ #
19
+ # @param request_options [SurgeAPI::RequestOptions, Hash{Symbol=>Object}]
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,38 @@
1
+ # frozen_string_literal: true
2
+
3
+ module SurgeAPI
4
+ module Models
5
+ # @see SurgeAPI::Resources::PhoneNumbers#update
6
+ class PhoneNumberUpdateParams < SurgeAPI::Internal::Type::BaseModel
7
+ extend SurgeAPI::Internal::Type::RequestParameters::Converter
8
+ include SurgeAPI::Internal::Type::RequestParameters
9
+
10
+ # @!attribute id
11
+ # The ID of the phone number to update.
12
+ #
13
+ # @return [String]
14
+ required :id, String
15
+
16
+ # @!attribute campaign_id
17
+ # Campaign ID to attach this number to (`cpn_...`).
18
+ #
19
+ # @return [String, nil]
20
+ optional :campaign_id, String
21
+
22
+ # @!attribute name
23
+ # A human-readable name for the phone number.
24
+ #
25
+ # @return [String, nil]
26
+ optional :name, String
27
+
28
+ # @!method initialize(id:, campaign_id: nil, name: nil, request_options: {})
29
+ # @param id [String] The ID of the phone number to update.
30
+ #
31
+ # @param campaign_id [String] Campaign ID to attach this number to (`cpn_...`).
32
+ #
33
+ # @param name [String] A human-readable name for the phone number.
34
+ #
35
+ # @param request_options [SurgeAPI::RequestOptions, Hash{Symbol=>Object}]
36
+ end
37
+ end
38
+ end
@@ -7,7 +7,15 @@ module SurgeAPI
7
7
  extend SurgeAPI::Internal::Type::RequestParameters::Converter
8
8
  include SurgeAPI::Internal::Type::RequestParameters
9
9
 
10
- # @!method initialize(request_options: {})
10
+ # @!attribute id
11
+ # The ID of the recording.
12
+ #
13
+ # @return [String]
14
+ required :id, String
15
+
16
+ # @!method initialize(id:, request_options: {})
17
+ # @param id [String] The ID of the recording.
18
+ #
11
19
  # @param request_options [SurgeAPI::RequestOptions, Hash{Symbol=>Object}]
12
20
  end
13
21
  end
@@ -7,7 +7,15 @@ module SurgeAPI
7
7
  extend SurgeAPI::Internal::Type::RequestParameters::Converter
8
8
  include SurgeAPI::Internal::Type::RequestParameters
9
9
 
10
- # @!method initialize(request_options: {})
10
+ # @!attribute recording_id
11
+ # The ID of the recording.
12
+ #
13
+ # @return [String]
14
+ required :recording_id, String
15
+
16
+ # @!method initialize(recording_id:, request_options: {})
17
+ # @param recording_id [String] The ID of the recording.
18
+ #
11
19
  # @param request_options [SurgeAPI::RequestOptions, Hash{Symbol=>Object}]
12
20
  end
13
21
  end
@@ -7,6 +7,12 @@ module SurgeAPI
7
7
  extend SurgeAPI::Internal::Type::RequestParameters::Converter
8
8
  include SurgeAPI::Internal::Type::RequestParameters
9
9
 
10
+ # @!attribute account_id
11
+ # The account ID to list recordings for.
12
+ #
13
+ # @return [String]
14
+ required :account_id, String
15
+
10
16
  # @!attribute after
11
17
  # Cursor for forward pagination. Use the next_cursor from a previous response.
12
18
  #
@@ -20,10 +26,12 @@ module SurgeAPI
20
26
  # @return [String, nil]
21
27
  optional :before, String
22
28
 
23
- # @!method initialize(after: nil, before: nil, request_options: {})
29
+ # @!method initialize(account_id:, after: nil, before: nil, request_options: {})
24
30
  # Some parameter documentations has been truncated, see
25
31
  # {SurgeAPI::Models::RecordingListParams} for more details.
26
32
  #
33
+ # @param account_id [String] The account ID to list recordings for.
34
+ #
27
35
  # @param after [String] Cursor for forward pagination. Use the next_cursor from a previous response.
28
36
  #
29
37
  # @param before [String] Cursor for backward pagination. Use the previous_cursor from a previous response
@@ -7,7 +7,15 @@ module SurgeAPI
7
7
  extend SurgeAPI::Internal::Type::RequestParameters::Converter
8
8
  include SurgeAPI::Internal::Type::RequestParameters
9
9
 
10
- # @!method initialize(request_options: {})
10
+ # @!attribute id
11
+ # The ID of the recording to retrieve.
12
+ #
13
+ # @return [String]
14
+ required :id, String
15
+
16
+ # @!method initialize(id:, request_options: {})
17
+ # @param id [String] The ID of the recording to retrieve.
18
+ #
11
19
  # @param request_options [SurgeAPI::RequestOptions, Hash{Symbol=>Object}]
12
20
  end
13
21
  end
@@ -7,6 +7,12 @@ module SurgeAPI
7
7
  extend SurgeAPI::Internal::Type::RequestParameters::Converter
8
8
  include SurgeAPI::Internal::Type::RequestParameters
9
9
 
10
+ # @!attribute account_id
11
+ # The account for which the user should be created.
12
+ #
13
+ # @return [String]
14
+ required :account_id, String
15
+
10
16
  # @!attribute first_name
11
17
  # The user's first name.
12
18
  #
@@ -31,7 +37,9 @@ module SurgeAPI
31
37
  # @return [String, nil]
32
38
  optional :photo_url, String
33
39
 
34
- # @!method initialize(first_name:, last_name: nil, metadata: nil, photo_url: nil, request_options: {})
40
+ # @!method initialize(account_id:, first_name:, last_name: nil, metadata: nil, photo_url: nil, request_options: {})
41
+ # @param account_id [String] The account for which the user should be created.
42
+ #
35
43
  # @param first_name [String] The user's first name.
36
44
  #
37
45
  # @param last_name [String] The user's last name.
@@ -7,13 +7,21 @@ module SurgeAPI
7
7
  extend SurgeAPI::Internal::Type::RequestParameters::Converter
8
8
  include SurgeAPI::Internal::Type::RequestParameters
9
9
 
10
+ # @!attribute user_id
11
+ # The user for which the token represents authentication.
12
+ #
13
+ # @return [String]
14
+ required :user_id, String
15
+
10
16
  # @!attribute duration_seconds
11
17
  # For how many seconds the token should be accepted. Defaults to 15 minutes.
12
18
  #
13
19
  # @return [Integer, nil]
14
20
  optional :duration_seconds, Integer
15
21
 
16
- # @!method initialize(duration_seconds: nil, request_options: {})
22
+ # @!method initialize(user_id:, duration_seconds: nil, request_options: {})
23
+ # @param user_id [String] The user for which the token represents authentication.
24
+ #
17
25
  # @param duration_seconds [Integer] For how many seconds the token should be accepted. Defaults to 15 minutes.
18
26
  #
19
27
  # @param request_options [SurgeAPI::RequestOptions, Hash{Symbol=>Object}]
@@ -7,7 +7,15 @@ module SurgeAPI
7
7
  extend SurgeAPI::Internal::Type::RequestParameters::Converter
8
8
  include SurgeAPI::Internal::Type::RequestParameters
9
9
 
10
- # @!method initialize(request_options: {})
10
+ # @!attribute id
11
+ # The ID of the user to delete.
12
+ #
13
+ # @return [String]
14
+ required :id, String
15
+
16
+ # @!method initialize(id:, request_options: {})
17
+ # @param id [String] The ID of the user to delete.
18
+ #
11
19
  # @param request_options [SurgeAPI::RequestOptions, Hash{Symbol=>Object}]
12
20
  end
13
21
  end
@@ -7,6 +7,12 @@ module SurgeAPI
7
7
  extend SurgeAPI::Internal::Type::RequestParameters::Converter
8
8
  include SurgeAPI::Internal::Type::RequestParameters
9
9
 
10
+ # @!attribute account_id
11
+ # The account ID to list users for.
12
+ #
13
+ # @return [String]
14
+ required :account_id, String
15
+
10
16
  # @!attribute after
11
17
  # Cursor for forward pagination. Use the next_cursor from a previous response.
12
18
  #
@@ -20,10 +26,12 @@ module SurgeAPI
20
26
  # @return [String, nil]
21
27
  optional :before, String
22
28
 
23
- # @!method initialize(after: nil, before: nil, request_options: {})
29
+ # @!method initialize(account_id:, after: nil, before: nil, request_options: {})
24
30
  # Some parameter documentations has been truncated, see
25
31
  # {SurgeAPI::Models::UserListParams} for more details.
26
32
  #
33
+ # @param account_id [String] The account ID to list users for.
34
+ #
27
35
  # @param after [String] Cursor for forward pagination. Use the next_cursor from a previous response.
28
36
  #
29
37
  # @param before [String] Cursor for backward pagination. Use the previous_cursor from a previous response
@@ -7,7 +7,15 @@ module SurgeAPI
7
7
  extend SurgeAPI::Internal::Type::RequestParameters::Converter
8
8
  include SurgeAPI::Internal::Type::RequestParameters
9
9
 
10
- # @!method initialize(request_options: {})
10
+ # @!attribute id
11
+ # The ID of the user to retrieve.
12
+ #
13
+ # @return [String]
14
+ required :id, String
15
+
16
+ # @!method initialize(id:, request_options: {})
17
+ # @param id [String] The ID of the user to retrieve.
18
+ #
11
19
  # @param request_options [SurgeAPI::RequestOptions, Hash{Symbol=>Object}]
12
20
  end
13
21
  end
@@ -7,6 +7,12 @@ module SurgeAPI
7
7
  extend SurgeAPI::Internal::Type::RequestParameters::Converter
8
8
  include SurgeAPI::Internal::Type::RequestParameters
9
9
 
10
+ # @!attribute id
11
+ # The ID of the user to update.
12
+ #
13
+ # @return [String]
14
+ required :id, String
15
+
10
16
  # @!attribute first_name
11
17
  # The user's first name.
12
18
  #
@@ -31,7 +37,9 @@ module SurgeAPI
31
37
  # @return [String, nil]
32
38
  optional :photo_url, String
33
39
 
34
- # @!method initialize(first_name:, last_name: nil, metadata: nil, photo_url: nil, request_options: {})
40
+ # @!method initialize(id:, first_name:, last_name: nil, metadata: nil, photo_url: nil, request_options: {})
41
+ # @param id [String] The ID of the user to update.
42
+ #
35
43
  # @param first_name [String] The user's first name.
36
44
  #
37
45
  # @param last_name [String] The user's last name.