surge_api 0.24.0 → 0.26.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 (109) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +19 -0
  3. data/README.md +9 -9
  4. data/lib/surge_api/client.rb +4 -0
  5. data/lib/surge_api/internal/type/union.rb +2 -2
  6. data/lib/surge_api/models/call_ended_webhook_event.rb +8 -3
  7. data/lib/surge_api/models/campaign.rb +15 -7
  8. data/lib/surge_api/models/campaign_approved_webhook_event.rb +9 -1
  9. data/lib/surge_api/models/campaign_params.rb +6 -6
  10. data/lib/surge_api/models/campaign_rejected_webhook_event.rb +135 -0
  11. data/lib/surge_api/models/campaign_submitted_webhook_event.rb +74 -0
  12. data/lib/surge_api/models/campaign_update_params.rb +188 -1
  13. data/lib/surge_api/models/campaign_warning_webhook_event.rb +134 -0
  14. data/lib/surge_api/models/message.rb +28 -2
  15. data/lib/surge_api/models/message_delivered_webhook_event.rb +20 -1
  16. data/lib/surge_api/models/message_failed_webhook_event.rb +17 -5
  17. data/lib/surge_api/models/message_received_webhook_event.rb +20 -1
  18. data/lib/surge_api/models/message_sent_webhook_event.rb +20 -1
  19. data/lib/surge_api/models/phone_number.rb +9 -1
  20. data/lib/surge_api/models/phone_number_attached_to_campaign_webhook_event.rb +9 -1
  21. data/lib/surge_api/models/phone_number_imported_webhook_event.rb +9 -1
  22. data/lib/surge_api/models/phone_number_purchase_params.rb +9 -1
  23. data/lib/surge_api/models/phone_number_update_params.rb +9 -1
  24. data/lib/surge_api/models/toll_free_campaign.rb +132 -0
  25. data/lib/surge_api/models/toll_free_campaign_consent_flow.rb +176 -0
  26. data/lib/surge_api/models/toll_free_campaign_create_params.rb +22 -0
  27. data/lib/surge_api/models/toll_free_campaign_list_params.rb +42 -0
  28. data/lib/surge_api/models/toll_free_campaign_params.rb +286 -0
  29. data/lib/surge_api/models/toll_free_campaign_retrieve_params.rb +22 -0
  30. data/lib/surge_api/models/toll_free_campaign_update_params.rb +278 -0
  31. data/lib/surge_api/models/unwrap_webhook_event.rb +7 -1
  32. data/lib/surge_api/models/user_create_token_params.rb +15 -1
  33. data/lib/surge_api/models.rb +20 -0
  34. data/lib/surge_api/resources/accounts.rb +2 -2
  35. data/lib/surge_api/resources/campaigns.rb +26 -8
  36. data/lib/surge_api/resources/phone_numbers.rb +6 -2
  37. data/lib/surge_api/resources/toll_free_campaigns.rb +140 -0
  38. data/lib/surge_api/resources/users.rb +6 -1
  39. data/lib/surge_api/resources/webhooks.rb +1 -1
  40. data/lib/surge_api/version.rb +1 -1
  41. data/lib/surge_api.rb +11 -0
  42. data/rbi/surge_api/client.rbi +3 -0
  43. data/rbi/surge_api/models/call_ended_webhook_event.rbi +6 -3
  44. data/rbi/surge_api/models/campaign.rbi +17 -9
  45. data/rbi/surge_api/models/campaign_approved_webhook_event.rbi +8 -0
  46. data/rbi/surge_api/models/campaign_params.rbi +9 -9
  47. data/rbi/surge_api/models/campaign_rejected_webhook_event.rbi +269 -0
  48. data/rbi/surge_api/models/campaign_submitted_webhook_event.rbi +149 -0
  49. data/rbi/surge_api/models/campaign_update_params.rbi +378 -1
  50. data/rbi/surge_api/models/campaign_warning_webhook_event.rbi +259 -0
  51. data/rbi/surge_api/models/message.rbi +28 -0
  52. data/rbi/surge_api/models/message_delivered_webhook_event.rbi +22 -0
  53. data/rbi/surge_api/models/message_failed_webhook_event.rbi +21 -5
  54. data/rbi/surge_api/models/message_received_webhook_event.rbi +22 -0
  55. data/rbi/surge_api/models/message_sent_webhook_event.rbi +22 -0
  56. data/rbi/surge_api/models/phone_number.rbi +8 -0
  57. data/rbi/surge_api/models/phone_number_attached_to_campaign_webhook_event.rbi +8 -0
  58. data/rbi/surge_api/models/phone_number_imported_webhook_event.rbi +8 -0
  59. data/rbi/surge_api/models/phone_number_purchase_params.rbi +11 -0
  60. data/rbi/surge_api/models/phone_number_update_params.rbi +11 -0
  61. data/rbi/surge_api/models/toll_free_campaign.rbi +230 -0
  62. data/rbi/surge_api/models/toll_free_campaign_consent_flow.rbi +476 -0
  63. data/rbi/surge_api/models/toll_free_campaign_create_params.rbi +43 -0
  64. data/rbi/surge_api/models/toll_free_campaign_list_params.rbi +70 -0
  65. data/rbi/surge_api/models/toll_free_campaign_params.rbi +711 -0
  66. data/rbi/surge_api/models/toll_free_campaign_retrieve_params.rbi +43 -0
  67. data/rbi/surge_api/models/toll_free_campaign_update_params.rbi +760 -0
  68. data/rbi/surge_api/models/unwrap_webhook_event.rbi +3 -0
  69. data/rbi/surge_api/models/user_create_token_params.rbi +17 -0
  70. data/rbi/surge_api/models.rbi +22 -0
  71. data/rbi/surge_api/resources/accounts.rbi +2 -2
  72. data/rbi/surge_api/resources/campaigns.rbi +94 -12
  73. data/rbi/surge_api/resources/phone_numbers.rbi +6 -0
  74. data/rbi/surge_api/resources/toll_free_campaigns.rbi +129 -0
  75. data/rbi/surge_api/resources/users.rbi +6 -0
  76. data/rbi/surge_api/resources/webhooks.rbi +3 -0
  77. data/sig/surge_api/client.rbs +2 -0
  78. data/sig/surge_api/models/campaign.rbs +5 -0
  79. data/sig/surge_api/models/campaign_approved_webhook_event.rbs +5 -0
  80. data/sig/surge_api/models/campaign_rejected_webhook_event.rbs +115 -0
  81. data/sig/surge_api/models/campaign_submitted_webhook_event.rbs +67 -0
  82. data/sig/surge_api/models/campaign_update_params.rbs +128 -2
  83. data/sig/surge_api/models/campaign_warning_webhook_event.rbs +114 -0
  84. data/sig/surge_api/models/message.rbs +15 -0
  85. data/sig/surge_api/models/message_delivered_webhook_event.rbs +10 -0
  86. data/sig/surge_api/models/message_failed_webhook_event.rbs +9 -4
  87. data/sig/surge_api/models/message_received_webhook_event.rbs +10 -0
  88. data/sig/surge_api/models/message_sent_webhook_event.rbs +10 -0
  89. data/sig/surge_api/models/phone_number.rbs +5 -0
  90. data/sig/surge_api/models/phone_number_attached_to_campaign_webhook_event.rbs +5 -0
  91. data/sig/surge_api/models/phone_number_imported_webhook_event.rbs +5 -0
  92. data/sig/surge_api/models/phone_number_purchase_params.rbs +7 -0
  93. data/sig/surge_api/models/phone_number_update_params.rbs +12 -1
  94. data/sig/surge_api/models/toll_free_campaign.rbs +126 -0
  95. data/sig/surge_api/models/toll_free_campaign_consent_flow.rbs +207 -0
  96. data/sig/surge_api/models/toll_free_campaign_create_params.rbs +25 -0
  97. data/sig/surge_api/models/toll_free_campaign_list_params.rbs +36 -0
  98. data/sig/surge_api/models/toll_free_campaign_params.rbs +321 -0
  99. data/sig/surge_api/models/toll_free_campaign_retrieve_params.rbs +23 -0
  100. data/sig/surge_api/models/toll_free_campaign_update_params.rbs +332 -0
  101. data/sig/surge_api/models/unwrap_webhook_event.rbs +3 -0
  102. data/sig/surge_api/models/user_create_token_params.rbs +7 -1
  103. data/sig/surge_api/models.rbs +20 -0
  104. data/sig/surge_api/resources/campaigns.rbs +9 -1
  105. data/sig/surge_api/resources/phone_numbers.rbs +2 -0
  106. data/sig/surge_api/resources/toll_free_campaigns.rbs +44 -0
  107. data/sig/surge_api/resources/users.rbs +1 -0
  108. data/sig/surge_api/resources/webhooks.rbs +3 -0
  109. metadata +50 -7
@@ -6,6 +6,12 @@ module SurgeAPI
6
6
  OrHash =
7
7
  T.type_alias { T.any(SurgeAPI::Message, SurgeAPI::Internal::AnyHash) }
8
8
 
9
+ # When the message was added to the conversation, in ISO8601 UTC format. Null for
10
+ # scheduled messages until they are created. For imported messages, this is the
11
+ # original creation time.
12
+ sig { returns(T.nilable(Time)) }
13
+ attr_accessor :created_at
14
+
9
15
  # Unique identifier for the object.
10
16
  sig { returns(T.nilable(String)) }
11
17
  attr_reader :id
@@ -39,6 +45,10 @@ module SurgeAPI
39
45
  sig { params(conversation: SurgeAPI::Message::Conversation::OrHash).void }
40
46
  attr_writer :conversation
41
47
 
48
+ # The reason the message failed, or null if no failure reason is set.
49
+ sig { returns(T.nilable(String)) }
50
+ attr_accessor :failure_reason
51
+
42
52
  # Set of key-value pairs that will be stored with the object.
43
53
  sig { returns(T.nilable(T::Hash[Symbol, String])) }
44
54
  attr_reader :metadata
@@ -56,16 +66,22 @@ module SurgeAPI
56
66
  # A Message is a communication sent to a Contact.
57
67
  sig do
58
68
  params(
69
+ created_at: T.nilable(Time),
59
70
  id: String,
60
71
  attachments: T::Array[SurgeAPI::Message::Attachment::OrHash],
61
72
  blast_id: T.nilable(String),
62
73
  body: T.nilable(String),
63
74
  conversation: SurgeAPI::Message::Conversation::OrHash,
75
+ failure_reason: T.nilable(String),
64
76
  metadata: T::Hash[Symbol, String],
65
77
  status: SurgeAPI::Message::Status::OrSymbol
66
78
  ).returns(T.attached_class)
67
79
  end
68
80
  def self.new(
81
+ # When the message was added to the conversation, in ISO8601 UTC format. Null for
82
+ # scheduled messages until they are created. For imported messages, this is the
83
+ # original creation time.
84
+ created_at:,
69
85
  # Unique identifier for the object.
70
86
  id: nil,
71
87
  attachments: nil,
@@ -76,6 +92,8 @@ module SurgeAPI
76
92
  body: nil,
77
93
  # A conversation with a Contact
78
94
  conversation: nil,
95
+ # The reason the message failed, or null if no failure reason is set.
96
+ failure_reason: nil,
79
97
  # Set of key-value pairs that will be stored with the object.
80
98
  metadata: nil,
81
99
  # The current status of the message.
@@ -86,11 +104,13 @@ module SurgeAPI
86
104
  sig do
87
105
  override.returns(
88
106
  {
107
+ created_at: T.nilable(Time),
89
108
  id: String,
90
109
  attachments: T::Array[SurgeAPI::Message::Attachment],
91
110
  blast_id: T.nilable(String),
92
111
  body: T.nilable(String),
93
112
  conversation: SurgeAPI::Message::Conversation,
113
+ failure_reason: T.nilable(String),
94
114
  metadata: T::Hash[Symbol, String],
95
115
  status: SurgeAPI::Message::Status::TaggedSymbol
96
116
  }
@@ -256,6 +276,10 @@ module SurgeAPI
256
276
  sig { returns(String) }
257
277
  attr_accessor :id
258
278
 
279
+ # Set of key-value pairs that will be stored with the object.
280
+ sig { returns(T::Hash[Symbol, String]) }
281
+ attr_accessor :metadata
282
+
259
283
  # A human-readable name for the phone number
260
284
  sig { returns(T.nilable(String)) }
261
285
  attr_accessor :name
@@ -276,6 +300,7 @@ module SurgeAPI
276
300
  sig do
277
301
  params(
278
302
  id: String,
303
+ metadata: T::Hash[Symbol, String],
279
304
  name: T.nilable(String),
280
305
  number: String,
281
306
  type: SurgeAPI::Message::Conversation::PhoneNumber::Type::OrSymbol
@@ -284,6 +309,8 @@ module SurgeAPI
284
309
  def self.new(
285
310
  # Unique identifier for the phone number
286
311
  id:,
312
+ # Set of key-value pairs that will be stored with the object.
313
+ metadata:,
287
314
  # A human-readable name for the phone number
288
315
  name:,
289
316
  # The canonical format of the phone number.
@@ -297,6 +324,7 @@ module SurgeAPI
297
324
  override.returns(
298
325
  {
299
326
  id: String,
327
+ metadata: T::Hash[Symbol, String],
300
328
  name: T.nilable(String),
301
329
  number: String,
302
330
  type:
@@ -96,10 +96,21 @@ module SurgeAPI
96
96
  end
97
97
  attr_writer :conversation
98
98
 
99
+ # When the message was added to the conversation, in ISO8601 UTC format. For
100
+ # scheduled messages, this is the actual creation time, which may be later than
101
+ # the requested send_at. For imported messages, this is the original creation
102
+ # time.
103
+ sig { returns(Time) }
104
+ attr_accessor :created_at
105
+
99
106
  # When the message was delivered
100
107
  sig { returns(Time) }
101
108
  attr_accessor :delivered_at
102
109
 
110
+ # The reason the message failed, or null if no failure reason is set
111
+ sig { returns(T.nilable(String)) }
112
+ attr_accessor :failure_reason
113
+
103
114
  # Set of key-value pairs that will be stored with the object.
104
115
  sig { returns(T::Hash[Symbol, String]) }
105
116
  attr_accessor :metadata
@@ -147,7 +158,9 @@ module SurgeAPI
147
158
  body: T.nilable(String),
148
159
  conversation:
149
160
  SurgeAPI::MessageDeliveredWebhookEvent::Data::Conversation::OrHash,
161
+ created_at: Time,
150
162
  delivered_at: Time,
163
+ failure_reason: T.nilable(String),
151
164
  metadata: T::Hash[Symbol, String],
152
165
  status:
153
166
  SurgeAPI::MessageDeliveredWebhookEvent::Data::Status::OrSymbol,
@@ -165,8 +178,15 @@ module SurgeAPI
165
178
  body:,
166
179
  # The conversation this message belongs to
167
180
  conversation:,
181
+ # When the message was added to the conversation, in ISO8601 UTC format. For
182
+ # scheduled messages, this is the actual creation time, which may be later than
183
+ # the requested send_at. For imported messages, this is the original creation
184
+ # time.
185
+ created_at:,
168
186
  # When the message was delivered
169
187
  delivered_at:,
188
+ # The reason the message failed, or null if no failure reason is set
189
+ failure_reason:,
170
190
  # Set of key-value pairs that will be stored with the object.
171
191
  metadata:,
172
192
  # The message status represented by this event
@@ -186,7 +206,9 @@ module SurgeAPI
186
206
  body: T.nilable(String),
187
207
  conversation:
188
208
  SurgeAPI::MessageDeliveredWebhookEvent::Data::Conversation,
209
+ created_at: Time,
189
210
  delivered_at: Time,
211
+ failure_reason: T.nilable(String),
190
212
  metadata: T::Hash[Symbol, String],
191
213
  status:
192
214
  SurgeAPI::MessageDeliveredWebhookEvent::Data::Status::TaggedSymbol,
@@ -94,12 +94,20 @@ module SurgeAPI
94
94
  end
95
95
  attr_writer :conversation
96
96
 
97
+ # When the message was added to the conversation, in ISO8601 UTC format. For
98
+ # scheduled messages, this is the actual creation time, which may be later than
99
+ # the requested send_at. For imported messages, this is the original creation
100
+ # time.
101
+ sig { returns(Time) }
102
+ attr_accessor :created_at
103
+
97
104
  # When the message failed
98
105
  sig { returns(Time) }
99
106
  attr_accessor :failed_at
100
107
 
101
- # The reason the message failed to be delivered
102
- sig { returns(String) }
108
+ # The reason the message failed to be delivered, or null if no failure reason is
109
+ # set
110
+ sig { returns(T.nilable(String)) }
103
111
  attr_accessor :failure_reason
104
112
 
105
113
  # Set of key-value pairs that will be stored with the object.
@@ -149,8 +157,9 @@ module SurgeAPI
149
157
  body: T.nilable(String),
150
158
  conversation:
151
159
  SurgeAPI::MessageFailedWebhookEvent::Data::Conversation::OrHash,
160
+ created_at: Time,
152
161
  failed_at: Time,
153
- failure_reason: String,
162
+ failure_reason: T.nilable(String),
154
163
  metadata: T::Hash[Symbol, String],
155
164
  status: SurgeAPI::MessageFailedWebhookEvent::Data::Status::OrSymbol,
156
165
  attachments:
@@ -167,9 +176,15 @@ module SurgeAPI
167
176
  body:,
168
177
  # The conversation this message belongs to
169
178
  conversation:,
179
+ # When the message was added to the conversation, in ISO8601 UTC format. For
180
+ # scheduled messages, this is the actual creation time, which may be later than
181
+ # the requested send_at. For imported messages, this is the original creation
182
+ # time.
183
+ created_at:,
170
184
  # When the message failed
171
185
  failed_at:,
172
- # The reason the message failed to be delivered
186
+ # The reason the message failed to be delivered, or null if no failure reason is
187
+ # set
173
188
  failure_reason:,
174
189
  # Set of key-value pairs that will be stored with the object.
175
190
  metadata:,
@@ -190,8 +205,9 @@ module SurgeAPI
190
205
  body: T.nilable(String),
191
206
  conversation:
192
207
  SurgeAPI::MessageFailedWebhookEvent::Data::Conversation,
208
+ created_at: Time,
193
209
  failed_at: Time,
194
- failure_reason: String,
210
+ failure_reason: T.nilable(String),
195
211
  metadata: T::Hash[Symbol, String],
196
212
  status:
197
213
  SurgeAPI::MessageFailedWebhookEvent::Data::Status::TaggedSymbol,
@@ -96,6 +96,17 @@ module SurgeAPI
96
96
  end
97
97
  attr_writer :conversation
98
98
 
99
+ # When the message was added to the conversation, in ISO8601 UTC format. For
100
+ # scheduled messages, this is the actual creation time, which may be later than
101
+ # the requested send_at. For imported messages, this is the original creation
102
+ # time.
103
+ sig { returns(Time) }
104
+ attr_accessor :created_at
105
+
106
+ # The reason the message failed, or null if no failure reason is set
107
+ sig { returns(T.nilable(String)) }
108
+ attr_accessor :failure_reason
109
+
99
110
  # Set of key-value pairs that will be stored with the object.
100
111
  sig { returns(T::Hash[Symbol, String]) }
101
112
  attr_accessor :metadata
@@ -147,6 +158,8 @@ module SurgeAPI
147
158
  body: T.nilable(String),
148
159
  conversation:
149
160
  SurgeAPI::MessageReceivedWebhookEvent::Data::Conversation::OrHash,
161
+ created_at: Time,
162
+ failure_reason: T.nilable(String),
150
163
  metadata: T::Hash[Symbol, String],
151
164
  received_at: Time,
152
165
  status:
@@ -165,6 +178,13 @@ module SurgeAPI
165
178
  body:,
166
179
  # The conversation this message belongs to
167
180
  conversation:,
181
+ # When the message was added to the conversation, in ISO8601 UTC format. For
182
+ # scheduled messages, this is the actual creation time, which may be later than
183
+ # the requested send_at. For imported messages, this is the original creation
184
+ # time.
185
+ created_at:,
186
+ # The reason the message failed, or null if no failure reason is set
187
+ failure_reason:,
168
188
  # Set of key-value pairs that will be stored with the object.
169
189
  metadata:,
170
190
  # When the message was received
@@ -186,6 +206,8 @@ module SurgeAPI
186
206
  body: T.nilable(String),
187
207
  conversation:
188
208
  SurgeAPI::MessageReceivedWebhookEvent::Data::Conversation,
209
+ created_at: Time,
210
+ failure_reason: T.nilable(String),
189
211
  metadata: T::Hash[Symbol, String],
190
212
  received_at: Time,
191
213
  status:
@@ -89,6 +89,17 @@ module SurgeAPI
89
89
  end
90
90
  attr_writer :conversation
91
91
 
92
+ # When the message was added to the conversation, in ISO8601 UTC format. For
93
+ # scheduled messages, this is the actual creation time, which may be later than
94
+ # the requested send_at. For imported messages, this is the original creation
95
+ # time.
96
+ sig { returns(Time) }
97
+ attr_accessor :created_at
98
+
99
+ # The reason the message failed, or null if no failure reason is set
100
+ sig { returns(T.nilable(String)) }
101
+ attr_accessor :failure_reason
102
+
92
103
  # Set of key-value pairs that will be stored with the object.
93
104
  sig { returns(T::Hash[Symbol, String]) }
94
105
  attr_accessor :metadata
@@ -138,6 +149,8 @@ module SurgeAPI
138
149
  body: T.nilable(String),
139
150
  conversation:
140
151
  SurgeAPI::MessageSentWebhookEvent::Data::Conversation::OrHash,
152
+ created_at: Time,
153
+ failure_reason: T.nilable(String),
141
154
  metadata: T::Hash[Symbol, String],
142
155
  sent_at: Time,
143
156
  status: SurgeAPI::MessageSentWebhookEvent::Data::Status::OrSymbol,
@@ -155,6 +168,13 @@ module SurgeAPI
155
168
  body:,
156
169
  # The conversation this message belongs to
157
170
  conversation:,
171
+ # When the message was added to the conversation, in ISO8601 UTC format. For
172
+ # scheduled messages, this is the actual creation time, which may be later than
173
+ # the requested send_at. For imported messages, this is the original creation
174
+ # time.
175
+ created_at:,
176
+ # The reason the message failed, or null if no failure reason is set
177
+ failure_reason:,
158
178
  # Set of key-value pairs that will be stored with the object.
159
179
  metadata:,
160
180
  # When the message was sent
@@ -176,6 +196,8 @@ module SurgeAPI
176
196
  body: T.nilable(String),
177
197
  conversation:
178
198
  SurgeAPI::MessageSentWebhookEvent::Data::Conversation,
199
+ created_at: Time,
200
+ failure_reason: T.nilable(String),
179
201
  metadata: T::Hash[Symbol, String],
180
202
  sent_at: Time,
181
203
  status:
@@ -28,6 +28,10 @@ module SurgeAPI
28
28
  sig { returns(T.nilable(String)) }
29
29
  attr_accessor :campaign_id
30
30
 
31
+ # Set of key-value pairs that will be stored with the object.
32
+ sig { returns(T::Hash[Symbol, String]) }
33
+ attr_accessor :metadata
34
+
31
35
  # A human-readable name for the phone number
32
36
  sig { returns(T.nilable(String)) }
33
37
  attr_accessor :name
@@ -46,6 +50,7 @@ module SurgeAPI
46
50
  id: String,
47
51
  campaign: T.nilable(SurgeAPI::PhoneNumber::Campaign::OrHash),
48
52
  campaign_id: T.nilable(String),
53
+ metadata: T::Hash[Symbol, String],
49
54
  name: T.nilable(String),
50
55
  number: String,
51
56
  type: SurgeAPI::PhoneNumber::Type::OrSymbol
@@ -59,6 +64,8 @@ module SurgeAPI
59
64
  # Deprecated. The unique identifier of the campaign this phone number is attached
60
65
  # to, if any
61
66
  campaign_id:,
67
+ # Set of key-value pairs that will be stored with the object.
68
+ metadata:,
62
69
  # A human-readable name for the phone number
63
70
  name:,
64
71
  # The phone number in E.164 format
@@ -74,6 +81,7 @@ module SurgeAPI
74
81
  id: String,
75
82
  campaign: T.nilable(SurgeAPI::PhoneNumber::Campaign),
76
83
  campaign_id: T.nilable(String),
84
+ metadata: T::Hash[Symbol, String],
77
85
  name: T.nilable(String),
78
86
  number: String,
79
87
  type: SurgeAPI::PhoneNumber::Type::TaggedSymbol
@@ -109,6 +109,10 @@ module SurgeAPI
109
109
  sig { returns(String) }
110
110
  attr_accessor :campaign_id
111
111
 
112
+ # Set of key-value pairs that will be stored with the object.
113
+ sig { returns(T::Hash[Symbol, String]) }
114
+ attr_accessor :metadata
115
+
112
116
  # A human-readable name for the phone number
113
117
  sig { returns(T.nilable(String)) }
114
118
  attr_accessor :name
@@ -134,6 +138,7 @@ module SurgeAPI
134
138
  SurgeAPI::PhoneNumberAttachedToCampaignWebhookEvent::Data::Campaign::OrHash
135
139
  ),
136
140
  campaign_id: String,
141
+ metadata: T::Hash[Symbol, String],
137
142
  name: T.nilable(String),
138
143
  number: String,
139
144
  type:
@@ -148,6 +153,8 @@ module SurgeAPI
148
153
  # Deprecated. The unique identifier of the campaign this phone number is attached
149
154
  # to
150
155
  campaign_id:,
156
+ # Set of key-value pairs that will be stored with the object.
157
+ metadata:,
151
158
  # A human-readable name for the phone number
152
159
  name:,
153
160
  # The phone number in E.164 format
@@ -166,6 +173,7 @@ module SurgeAPI
166
173
  SurgeAPI::PhoneNumberAttachedToCampaignWebhookEvent::Data::Campaign
167
174
  ),
168
175
  campaign_id: String,
176
+ metadata: T::Hash[Symbol, String],
169
177
  name: T.nilable(String),
170
178
  number: String,
171
179
  type:
@@ -103,6 +103,10 @@ module SurgeAPI
103
103
  sig { returns(T.nilable(String)) }
104
104
  attr_accessor :campaign_id
105
105
 
106
+ # Set of key-value pairs that will be stored with the object.
107
+ sig { returns(T::Hash[Symbol, String]) }
108
+ attr_accessor :metadata
109
+
106
110
  # A human-readable name for the phone number
107
111
  sig { returns(T.nilable(String)) }
108
112
  attr_accessor :name
@@ -128,6 +132,7 @@ module SurgeAPI
128
132
  SurgeAPI::PhoneNumberImportedWebhookEvent::Data::Campaign::OrHash
129
133
  ),
130
134
  campaign_id: T.nilable(String),
135
+ metadata: T::Hash[Symbol, String],
131
136
  name: T.nilable(String),
132
137
  number: String,
133
138
  type:
@@ -142,6 +147,8 @@ module SurgeAPI
142
147
  # Deprecated. The unique identifier of the campaign this phone number is attached
143
148
  # to
144
149
  campaign_id:,
150
+ # Set of key-value pairs that will be stored with the object.
151
+ metadata:,
145
152
  # A human-readable name for the phone number
146
153
  name:,
147
154
  # The phone number in E.164 format
@@ -160,6 +167,7 @@ module SurgeAPI
160
167
  SurgeAPI::PhoneNumberImportedWebhookEvent::Data::Campaign
161
168
  ),
162
169
  campaign_id: T.nilable(String),
170
+ metadata: T::Hash[Symbol, String],
163
171
  name: T.nilable(String),
164
172
  number: String,
165
173
  type:
@@ -42,6 +42,13 @@ module SurgeAPI
42
42
  sig { params(longitude: Float).void }
43
43
  attr_writer :longitude
44
44
 
45
+ # Set of key-value pairs that will be stored with the object.
46
+ sig { returns(T.nilable(T::Hash[Symbol, String])) }
47
+ attr_reader :metadata
48
+
49
+ sig { params(metadata: T::Hash[Symbol, String]).void }
50
+ attr_writer :metadata
51
+
45
52
  # A human-readable name for the phone number. If not provided, defaults to the
46
53
  # formatted phone number.
47
54
  sig { returns(T.nilable(String)) }
@@ -76,6 +83,7 @@ module SurgeAPI
76
83
  area_code: String,
77
84
  latitude: Float,
78
85
  longitude: Float,
86
+ metadata: T::Hash[Symbol, String],
79
87
  name: String,
80
88
  phone_number: String,
81
89
  type: SurgeAPI::PhoneNumberPurchaseParams::Type::OrSymbol,
@@ -94,6 +102,8 @@ module SurgeAPI
94
102
  # Longitude to search for nearby phone numbers. Must be used with latitude. If
95
103
  # provided without type, type will be inferred as 'local'.
96
104
  longitude: nil,
105
+ # Set of key-value pairs that will be stored with the object.
106
+ metadata: nil,
97
107
  # A human-readable name for the phone number. If not provided, defaults to the
98
108
  # formatted phone number.
99
109
  name: nil,
@@ -114,6 +124,7 @@ module SurgeAPI
114
124
  area_code: String,
115
125
  latitude: Float,
116
126
  longitude: Float,
127
+ metadata: T::Hash[Symbol, String],
117
128
  name: String,
118
129
  phone_number: String,
119
130
  type: SurgeAPI::PhoneNumberPurchaseParams::Type::OrSymbol,
@@ -22,6 +22,13 @@ module SurgeAPI
22
22
  sig { params(campaign_id: String).void }
23
23
  attr_writer :campaign_id
24
24
 
25
+ # Set of key-value pairs that will be stored with the object.
26
+ sig { returns(T.nilable(T::Hash[Symbol, String])) }
27
+ attr_reader :metadata
28
+
29
+ sig { params(metadata: T::Hash[Symbol, String]).void }
30
+ attr_writer :metadata
31
+
25
32
  # A human-readable name for the phone number.
26
33
  sig { returns(T.nilable(String)) }
27
34
  attr_reader :name
@@ -33,6 +40,7 @@ module SurgeAPI
33
40
  params(
34
41
  id: String,
35
42
  campaign_id: String,
43
+ metadata: T::Hash[Symbol, String],
36
44
  name: String,
37
45
  request_options: SurgeAPI::RequestOptions::OrHash
38
46
  ).returns(T.attached_class)
@@ -42,6 +50,8 @@ module SurgeAPI
42
50
  id:,
43
51
  # Campaign ID to attach this number to (`cpn_...`).
44
52
  campaign_id: nil,
53
+ # Set of key-value pairs that will be stored with the object.
54
+ metadata: nil,
45
55
  # A human-readable name for the phone number.
46
56
  name: nil,
47
57
  request_options: {}
@@ -53,6 +63,7 @@ module SurgeAPI
53
63
  {
54
64
  id: String,
55
65
  campaign_id: String,
66
+ metadata: T::Hash[Symbol, String],
56
67
  name: String,
57
68
  request_options: SurgeAPI::RequestOptions
58
69
  }