surge_api 0.19.0 → 0.20.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 +11 -0
- data/README.md +7 -7
- data/lib/surge_api/models/phone_number.rb +55 -4
- data/lib/surge_api/models/phone_number_attached_to_campaign_webhook_event.rb +60 -3
- data/lib/surge_api/models/phone_number_list_available_numbers_params.rb +88 -0
- data/lib/surge_api/models/phone_number_list_available_numbers_response.rb +61 -0
- data/lib/surge_api/models/phone_number_purchase_params.rb +10 -1
- data/lib/surge_api/models/phone_number_retrieve_params.rb +22 -0
- data/lib/surge_api/models.rb +4 -0
- data/lib/surge_api/resources/phone_numbers.rb +66 -3
- data/lib/surge_api/version.rb +1 -1
- data/lib/surge_api.rb +3 -0
- data/rbi/surge_api/models/phone_number.rbi +108 -2
- data/rbi/surge_api/models/phone_number_attached_to_campaign_webhook_event.rbi +129 -2
- data/rbi/surge_api/models/phone_number_list_available_numbers_params.rbi +183 -0
- data/rbi/surge_api/models/phone_number_list_available_numbers_response.rbi +139 -0
- data/rbi/surge_api/models/phone_number_purchase_params.rbi +13 -0
- data/rbi/surge_api/models/phone_number_retrieve_params.rbi +43 -0
- data/rbi/surge_api/models.rbi +5 -0
- data/rbi/surge_api/resources/phone_numbers.rbi +59 -2
- data/sig/surge_api/models/phone_number.rbs +41 -0
- data/sig/surge_api/models/phone_number_attached_to_campaign_webhook_event.rbs +41 -0
- data/sig/surge_api/models/phone_number_list_available_numbers_params.rbs +83 -0
- data/sig/surge_api/models/phone_number_list_available_numbers_response.rbs +52 -0
- data/sig/surge_api/models/phone_number_purchase_params.rbs +7 -0
- data/sig/surge_api/models/phone_number_retrieve_params.rbs +20 -0
- data/sig/surge_api/models.rbs +4 -0
- data/sig/surge_api/resources/phone_numbers.rbs +16 -0
- metadata +11 -2
|
@@ -12,7 +12,19 @@ module SurgeAPI
|
|
|
12
12
|
sig { returns(String) }
|
|
13
13
|
attr_accessor :id
|
|
14
14
|
|
|
15
|
-
#
|
|
15
|
+
# Campaign attachment details for a domestic local phone number
|
|
16
|
+
sig { returns(T.nilable(SurgeAPI::PhoneNumber::Campaign)) }
|
|
17
|
+
attr_reader :campaign
|
|
18
|
+
|
|
19
|
+
sig do
|
|
20
|
+
params(
|
|
21
|
+
campaign: T.nilable(SurgeAPI::PhoneNumber::Campaign::OrHash)
|
|
22
|
+
).void
|
|
23
|
+
end
|
|
24
|
+
attr_writer :campaign
|
|
25
|
+
|
|
26
|
+
# Deprecated. The unique identifier of the campaign this phone number is attached
|
|
27
|
+
# to, if any
|
|
16
28
|
sig { returns(T.nilable(String)) }
|
|
17
29
|
attr_accessor :campaign_id
|
|
18
30
|
|
|
@@ -32,6 +44,7 @@ module SurgeAPI
|
|
|
32
44
|
sig do
|
|
33
45
|
params(
|
|
34
46
|
id: String,
|
|
47
|
+
campaign: T.nilable(SurgeAPI::PhoneNumber::Campaign::OrHash),
|
|
35
48
|
campaign_id: T.nilable(String),
|
|
36
49
|
name: T.nilable(String),
|
|
37
50
|
number: String,
|
|
@@ -41,7 +54,10 @@ module SurgeAPI
|
|
|
41
54
|
def self.new(
|
|
42
55
|
# Unique identifier for the phone number
|
|
43
56
|
id:,
|
|
44
|
-
#
|
|
57
|
+
# Campaign attachment details for a domestic local phone number
|
|
58
|
+
campaign:,
|
|
59
|
+
# Deprecated. The unique identifier of the campaign this phone number is attached
|
|
60
|
+
# to, if any
|
|
45
61
|
campaign_id:,
|
|
46
62
|
# A human-readable name for the phone number
|
|
47
63
|
name:,
|
|
@@ -56,6 +72,7 @@ module SurgeAPI
|
|
|
56
72
|
override.returns(
|
|
57
73
|
{
|
|
58
74
|
id: String,
|
|
75
|
+
campaign: T.nilable(SurgeAPI::PhoneNumber::Campaign),
|
|
59
76
|
campaign_id: T.nilable(String),
|
|
60
77
|
name: T.nilable(String),
|
|
61
78
|
number: String,
|
|
@@ -66,6 +83,95 @@ module SurgeAPI
|
|
|
66
83
|
def to_hash
|
|
67
84
|
end
|
|
68
85
|
|
|
86
|
+
class Campaign < SurgeAPI::Internal::Type::BaseModel
|
|
87
|
+
OrHash =
|
|
88
|
+
T.type_alias do
|
|
89
|
+
T.any(SurgeAPI::PhoneNumber::Campaign, SurgeAPI::Internal::AnyHash)
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
# The unique identifier of the campaign this phone number is attached to
|
|
93
|
+
sig { returns(String) }
|
|
94
|
+
attr_accessor :id
|
|
95
|
+
|
|
96
|
+
# The current campaign attachment status for this phone number.
|
|
97
|
+
sig do
|
|
98
|
+
returns(
|
|
99
|
+
SurgeAPI::PhoneNumber::Campaign::AttachmentStatus::TaggedSymbol
|
|
100
|
+
)
|
|
101
|
+
end
|
|
102
|
+
attr_accessor :attachment_status
|
|
103
|
+
|
|
104
|
+
# Campaign attachment details for a domestic local phone number
|
|
105
|
+
sig do
|
|
106
|
+
params(
|
|
107
|
+
id: String,
|
|
108
|
+
attachment_status:
|
|
109
|
+
SurgeAPI::PhoneNumber::Campaign::AttachmentStatus::OrSymbol
|
|
110
|
+
).returns(T.attached_class)
|
|
111
|
+
end
|
|
112
|
+
def self.new(
|
|
113
|
+
# The unique identifier of the campaign this phone number is attached to
|
|
114
|
+
id:,
|
|
115
|
+
# The current campaign attachment status for this phone number.
|
|
116
|
+
attachment_status:
|
|
117
|
+
)
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
sig do
|
|
121
|
+
override.returns(
|
|
122
|
+
{
|
|
123
|
+
id: String,
|
|
124
|
+
attachment_status:
|
|
125
|
+
SurgeAPI::PhoneNumber::Campaign::AttachmentStatus::TaggedSymbol
|
|
126
|
+
}
|
|
127
|
+
)
|
|
128
|
+
end
|
|
129
|
+
def to_hash
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
# The current campaign attachment status for this phone number.
|
|
133
|
+
module AttachmentStatus
|
|
134
|
+
extend SurgeAPI::Internal::Type::Enum
|
|
135
|
+
|
|
136
|
+
TaggedSymbol =
|
|
137
|
+
T.type_alias do
|
|
138
|
+
T.all(Symbol, SurgeAPI::PhoneNumber::Campaign::AttachmentStatus)
|
|
139
|
+
end
|
|
140
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
141
|
+
|
|
142
|
+
ATTACHED =
|
|
143
|
+
T.let(
|
|
144
|
+
:attached,
|
|
145
|
+
SurgeAPI::PhoneNumber::Campaign::AttachmentStatus::TaggedSymbol
|
|
146
|
+
)
|
|
147
|
+
ATTACHMENT_PENDING =
|
|
148
|
+
T.let(
|
|
149
|
+
:attachment_pending,
|
|
150
|
+
SurgeAPI::PhoneNumber::Campaign::AttachmentStatus::TaggedSymbol
|
|
151
|
+
)
|
|
152
|
+
DETACHED =
|
|
153
|
+
T.let(
|
|
154
|
+
:detached,
|
|
155
|
+
SurgeAPI::PhoneNumber::Campaign::AttachmentStatus::TaggedSymbol
|
|
156
|
+
)
|
|
157
|
+
DETACHMENT_PENDING =
|
|
158
|
+
T.let(
|
|
159
|
+
:detachment_pending,
|
|
160
|
+
SurgeAPI::PhoneNumber::Campaign::AttachmentStatus::TaggedSymbol
|
|
161
|
+
)
|
|
162
|
+
|
|
163
|
+
sig do
|
|
164
|
+
override.returns(
|
|
165
|
+
T::Array[
|
|
166
|
+
SurgeAPI::PhoneNumber::Campaign::AttachmentStatus::TaggedSymbol
|
|
167
|
+
]
|
|
168
|
+
)
|
|
169
|
+
end
|
|
170
|
+
def self.values
|
|
171
|
+
end
|
|
172
|
+
end
|
|
173
|
+
end
|
|
174
|
+
|
|
69
175
|
# Whether the phone number is local, toll-free, or short code
|
|
70
176
|
module Type
|
|
71
177
|
extend SurgeAPI::Internal::Type::Enum
|
|
@@ -84,7 +84,28 @@ module SurgeAPI
|
|
|
84
84
|
sig { returns(String) }
|
|
85
85
|
attr_accessor :id
|
|
86
86
|
|
|
87
|
-
#
|
|
87
|
+
# Campaign attachment details for a domestic local phone number
|
|
88
|
+
sig do
|
|
89
|
+
returns(
|
|
90
|
+
T.nilable(
|
|
91
|
+
SurgeAPI::PhoneNumberAttachedToCampaignWebhookEvent::Data::Campaign
|
|
92
|
+
)
|
|
93
|
+
)
|
|
94
|
+
end
|
|
95
|
+
attr_reader :campaign
|
|
96
|
+
|
|
97
|
+
sig do
|
|
98
|
+
params(
|
|
99
|
+
campaign:
|
|
100
|
+
T.nilable(
|
|
101
|
+
SurgeAPI::PhoneNumberAttachedToCampaignWebhookEvent::Data::Campaign::OrHash
|
|
102
|
+
)
|
|
103
|
+
).void
|
|
104
|
+
end
|
|
105
|
+
attr_writer :campaign
|
|
106
|
+
|
|
107
|
+
# Deprecated. The unique identifier of the campaign this phone number is attached
|
|
108
|
+
# to
|
|
88
109
|
sig { returns(String) }
|
|
89
110
|
attr_accessor :campaign_id
|
|
90
111
|
|
|
@@ -108,6 +129,10 @@ module SurgeAPI
|
|
|
108
129
|
sig do
|
|
109
130
|
params(
|
|
110
131
|
id: String,
|
|
132
|
+
campaign:
|
|
133
|
+
T.nilable(
|
|
134
|
+
SurgeAPI::PhoneNumberAttachedToCampaignWebhookEvent::Data::Campaign::OrHash
|
|
135
|
+
),
|
|
111
136
|
campaign_id: String,
|
|
112
137
|
name: T.nilable(String),
|
|
113
138
|
number: String,
|
|
@@ -118,7 +143,10 @@ module SurgeAPI
|
|
|
118
143
|
def self.new(
|
|
119
144
|
# The unique identifier for the phone number
|
|
120
145
|
id:,
|
|
121
|
-
#
|
|
146
|
+
# Campaign attachment details for a domestic local phone number
|
|
147
|
+
campaign:,
|
|
148
|
+
# Deprecated. The unique identifier of the campaign this phone number is attached
|
|
149
|
+
# to
|
|
122
150
|
campaign_id:,
|
|
123
151
|
# A human-readable name for the phone number
|
|
124
152
|
name:,
|
|
@@ -133,6 +161,10 @@ module SurgeAPI
|
|
|
133
161
|
override.returns(
|
|
134
162
|
{
|
|
135
163
|
id: String,
|
|
164
|
+
campaign:
|
|
165
|
+
T.nilable(
|
|
166
|
+
SurgeAPI::PhoneNumberAttachedToCampaignWebhookEvent::Data::Campaign
|
|
167
|
+
),
|
|
136
168
|
campaign_id: String,
|
|
137
169
|
name: T.nilable(String),
|
|
138
170
|
number: String,
|
|
@@ -144,6 +176,101 @@ module SurgeAPI
|
|
|
144
176
|
def to_hash
|
|
145
177
|
end
|
|
146
178
|
|
|
179
|
+
class Campaign < SurgeAPI::Internal::Type::BaseModel
|
|
180
|
+
OrHash =
|
|
181
|
+
T.type_alias do
|
|
182
|
+
T.any(
|
|
183
|
+
SurgeAPI::PhoneNumberAttachedToCampaignWebhookEvent::Data::Campaign,
|
|
184
|
+
SurgeAPI::Internal::AnyHash
|
|
185
|
+
)
|
|
186
|
+
end
|
|
187
|
+
|
|
188
|
+
# The unique identifier of the campaign this phone number is attached to
|
|
189
|
+
sig { returns(String) }
|
|
190
|
+
attr_accessor :id
|
|
191
|
+
|
|
192
|
+
# The current campaign attachment status for this phone number.
|
|
193
|
+
sig do
|
|
194
|
+
returns(
|
|
195
|
+
SurgeAPI::PhoneNumberAttachedToCampaignWebhookEvent::Data::Campaign::AttachmentStatus::TaggedSymbol
|
|
196
|
+
)
|
|
197
|
+
end
|
|
198
|
+
attr_accessor :attachment_status
|
|
199
|
+
|
|
200
|
+
# Campaign attachment details for a domestic local phone number
|
|
201
|
+
sig do
|
|
202
|
+
params(
|
|
203
|
+
id: String,
|
|
204
|
+
attachment_status:
|
|
205
|
+
SurgeAPI::PhoneNumberAttachedToCampaignWebhookEvent::Data::Campaign::AttachmentStatus::OrSymbol
|
|
206
|
+
).returns(T.attached_class)
|
|
207
|
+
end
|
|
208
|
+
def self.new(
|
|
209
|
+
# The unique identifier of the campaign this phone number is attached to
|
|
210
|
+
id:,
|
|
211
|
+
# The current campaign attachment status for this phone number.
|
|
212
|
+
attachment_status:
|
|
213
|
+
)
|
|
214
|
+
end
|
|
215
|
+
|
|
216
|
+
sig do
|
|
217
|
+
override.returns(
|
|
218
|
+
{
|
|
219
|
+
id: String,
|
|
220
|
+
attachment_status:
|
|
221
|
+
SurgeAPI::PhoneNumberAttachedToCampaignWebhookEvent::Data::Campaign::AttachmentStatus::TaggedSymbol
|
|
222
|
+
}
|
|
223
|
+
)
|
|
224
|
+
end
|
|
225
|
+
def to_hash
|
|
226
|
+
end
|
|
227
|
+
|
|
228
|
+
# The current campaign attachment status for this phone number.
|
|
229
|
+
module AttachmentStatus
|
|
230
|
+
extend SurgeAPI::Internal::Type::Enum
|
|
231
|
+
|
|
232
|
+
TaggedSymbol =
|
|
233
|
+
T.type_alias do
|
|
234
|
+
T.all(
|
|
235
|
+
Symbol,
|
|
236
|
+
SurgeAPI::PhoneNumberAttachedToCampaignWebhookEvent::Data::Campaign::AttachmentStatus
|
|
237
|
+
)
|
|
238
|
+
end
|
|
239
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
240
|
+
|
|
241
|
+
ATTACHED =
|
|
242
|
+
T.let(
|
|
243
|
+
:attached,
|
|
244
|
+
SurgeAPI::PhoneNumberAttachedToCampaignWebhookEvent::Data::Campaign::AttachmentStatus::TaggedSymbol
|
|
245
|
+
)
|
|
246
|
+
ATTACHMENT_PENDING =
|
|
247
|
+
T.let(
|
|
248
|
+
:attachment_pending,
|
|
249
|
+
SurgeAPI::PhoneNumberAttachedToCampaignWebhookEvent::Data::Campaign::AttachmentStatus::TaggedSymbol
|
|
250
|
+
)
|
|
251
|
+
DETACHED =
|
|
252
|
+
T.let(
|
|
253
|
+
:detached,
|
|
254
|
+
SurgeAPI::PhoneNumberAttachedToCampaignWebhookEvent::Data::Campaign::AttachmentStatus::TaggedSymbol
|
|
255
|
+
)
|
|
256
|
+
DETACHMENT_PENDING =
|
|
257
|
+
T.let(
|
|
258
|
+
:detachment_pending,
|
|
259
|
+
SurgeAPI::PhoneNumberAttachedToCampaignWebhookEvent::Data::Campaign::AttachmentStatus::TaggedSymbol
|
|
260
|
+
)
|
|
261
|
+
|
|
262
|
+
sig do
|
|
263
|
+
override.returns(
|
|
264
|
+
T::Array[
|
|
265
|
+
SurgeAPI::PhoneNumberAttachedToCampaignWebhookEvent::Data::Campaign::AttachmentStatus::TaggedSymbol
|
|
266
|
+
]
|
|
267
|
+
)
|
|
268
|
+
end
|
|
269
|
+
def self.values
|
|
270
|
+
end
|
|
271
|
+
end
|
|
272
|
+
end
|
|
273
|
+
|
|
147
274
|
# Whether the phone number is local, toll-free, or short code
|
|
148
275
|
module Type
|
|
149
276
|
extend SurgeAPI::Internal::Type::Enum
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module SurgeAPI
|
|
4
|
+
module Models
|
|
5
|
+
class PhoneNumberListAvailableNumbersParams < SurgeAPI::Internal::Type::BaseModel
|
|
6
|
+
extend SurgeAPI::Internal::Type::RequestParameters::Converter
|
|
7
|
+
include SurgeAPI::Internal::Type::RequestParameters
|
|
8
|
+
|
|
9
|
+
OrHash =
|
|
10
|
+
T.type_alias do
|
|
11
|
+
T.any(
|
|
12
|
+
SurgeAPI::PhoneNumberListAvailableNumbersParams,
|
|
13
|
+
SurgeAPI::Internal::AnyHash
|
|
14
|
+
)
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
# The account ID to list available phone numbers for.
|
|
18
|
+
sig { returns(String) }
|
|
19
|
+
attr_accessor :account_id
|
|
20
|
+
|
|
21
|
+
# Whether to search for local or toll-free numbers.
|
|
22
|
+
sig do
|
|
23
|
+
returns(SurgeAPI::PhoneNumberListAvailableNumbersParams::Type::OrSymbol)
|
|
24
|
+
end
|
|
25
|
+
attr_accessor :type
|
|
26
|
+
|
|
27
|
+
# Cursor for forward pagination. Use the next_cursor from a previous response.
|
|
28
|
+
sig { returns(T.nilable(String)) }
|
|
29
|
+
attr_reader :after
|
|
30
|
+
|
|
31
|
+
sig { params(after: String).void }
|
|
32
|
+
attr_writer :after
|
|
33
|
+
|
|
34
|
+
# Filter by 3-digit area code.
|
|
35
|
+
sig { returns(T.nilable(String)) }
|
|
36
|
+
attr_reader :area_code
|
|
37
|
+
|
|
38
|
+
sig { params(area_code: String).void }
|
|
39
|
+
attr_writer :area_code
|
|
40
|
+
|
|
41
|
+
# Cursor for backward pagination. Use the previous_cursor from a previous
|
|
42
|
+
# response.
|
|
43
|
+
sig { returns(T.nilable(String)) }
|
|
44
|
+
attr_reader :before
|
|
45
|
+
|
|
46
|
+
sig { params(before: String).void }
|
|
47
|
+
attr_writer :before
|
|
48
|
+
|
|
49
|
+
# ISO country code to search in.
|
|
50
|
+
sig do
|
|
51
|
+
returns(
|
|
52
|
+
T.nilable(
|
|
53
|
+
SurgeAPI::PhoneNumberListAvailableNumbersParams::Country::OrSymbol
|
|
54
|
+
)
|
|
55
|
+
)
|
|
56
|
+
end
|
|
57
|
+
attr_reader :country
|
|
58
|
+
|
|
59
|
+
sig do
|
|
60
|
+
params(
|
|
61
|
+
country:
|
|
62
|
+
SurgeAPI::PhoneNumberListAvailableNumbersParams::Country::OrSymbol
|
|
63
|
+
).void
|
|
64
|
+
end
|
|
65
|
+
attr_writer :country
|
|
66
|
+
|
|
67
|
+
sig do
|
|
68
|
+
params(
|
|
69
|
+
account_id: String,
|
|
70
|
+
type: SurgeAPI::PhoneNumberListAvailableNumbersParams::Type::OrSymbol,
|
|
71
|
+
after: String,
|
|
72
|
+
area_code: String,
|
|
73
|
+
before: String,
|
|
74
|
+
country:
|
|
75
|
+
SurgeAPI::PhoneNumberListAvailableNumbersParams::Country::OrSymbol,
|
|
76
|
+
request_options: SurgeAPI::RequestOptions::OrHash
|
|
77
|
+
).returns(T.attached_class)
|
|
78
|
+
end
|
|
79
|
+
def self.new(
|
|
80
|
+
# The account ID to list available phone numbers for.
|
|
81
|
+
account_id:,
|
|
82
|
+
# Whether to search for local or toll-free numbers.
|
|
83
|
+
type:,
|
|
84
|
+
# Cursor for forward pagination. Use the next_cursor from a previous response.
|
|
85
|
+
after: nil,
|
|
86
|
+
# Filter by 3-digit area code.
|
|
87
|
+
area_code: nil,
|
|
88
|
+
# Cursor for backward pagination. Use the previous_cursor from a previous
|
|
89
|
+
# response.
|
|
90
|
+
before: nil,
|
|
91
|
+
# ISO country code to search in.
|
|
92
|
+
country: nil,
|
|
93
|
+
request_options: {}
|
|
94
|
+
)
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
sig do
|
|
98
|
+
override.returns(
|
|
99
|
+
{
|
|
100
|
+
account_id: String,
|
|
101
|
+
type:
|
|
102
|
+
SurgeAPI::PhoneNumberListAvailableNumbersParams::Type::OrSymbol,
|
|
103
|
+
after: String,
|
|
104
|
+
area_code: String,
|
|
105
|
+
before: String,
|
|
106
|
+
country:
|
|
107
|
+
SurgeAPI::PhoneNumberListAvailableNumbersParams::Country::OrSymbol,
|
|
108
|
+
request_options: SurgeAPI::RequestOptions
|
|
109
|
+
}
|
|
110
|
+
)
|
|
111
|
+
end
|
|
112
|
+
def to_hash
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
# Whether to search for local or toll-free numbers.
|
|
116
|
+
module Type
|
|
117
|
+
extend SurgeAPI::Internal::Type::Enum
|
|
118
|
+
|
|
119
|
+
TaggedSymbol =
|
|
120
|
+
T.type_alias do
|
|
121
|
+
T.all(Symbol, SurgeAPI::PhoneNumberListAvailableNumbersParams::Type)
|
|
122
|
+
end
|
|
123
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
124
|
+
|
|
125
|
+
LOCAL =
|
|
126
|
+
T.let(
|
|
127
|
+
:local,
|
|
128
|
+
SurgeAPI::PhoneNumberListAvailableNumbersParams::Type::TaggedSymbol
|
|
129
|
+
)
|
|
130
|
+
TOLL_FREE =
|
|
131
|
+
T.let(
|
|
132
|
+
:toll_free,
|
|
133
|
+
SurgeAPI::PhoneNumberListAvailableNumbersParams::Type::TaggedSymbol
|
|
134
|
+
)
|
|
135
|
+
|
|
136
|
+
sig do
|
|
137
|
+
override.returns(
|
|
138
|
+
T::Array[
|
|
139
|
+
SurgeAPI::PhoneNumberListAvailableNumbersParams::Type::TaggedSymbol
|
|
140
|
+
]
|
|
141
|
+
)
|
|
142
|
+
end
|
|
143
|
+
def self.values
|
|
144
|
+
end
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
# ISO country code to search in.
|
|
148
|
+
module Country
|
|
149
|
+
extend SurgeAPI::Internal::Type::Enum
|
|
150
|
+
|
|
151
|
+
TaggedSymbol =
|
|
152
|
+
T.type_alias do
|
|
153
|
+
T.all(
|
|
154
|
+
Symbol,
|
|
155
|
+
SurgeAPI::PhoneNumberListAvailableNumbersParams::Country
|
|
156
|
+
)
|
|
157
|
+
end
|
|
158
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
159
|
+
|
|
160
|
+
US =
|
|
161
|
+
T.let(
|
|
162
|
+
:US,
|
|
163
|
+
SurgeAPI::PhoneNumberListAvailableNumbersParams::Country::TaggedSymbol
|
|
164
|
+
)
|
|
165
|
+
CA =
|
|
166
|
+
T.let(
|
|
167
|
+
:CA,
|
|
168
|
+
SurgeAPI::PhoneNumberListAvailableNumbersParams::Country::TaggedSymbol
|
|
169
|
+
)
|
|
170
|
+
|
|
171
|
+
sig do
|
|
172
|
+
override.returns(
|
|
173
|
+
T::Array[
|
|
174
|
+
SurgeAPI::PhoneNumberListAvailableNumbersParams::Country::TaggedSymbol
|
|
175
|
+
]
|
|
176
|
+
)
|
|
177
|
+
end
|
|
178
|
+
def self.values
|
|
179
|
+
end
|
|
180
|
+
end
|
|
181
|
+
end
|
|
182
|
+
end
|
|
183
|
+
end
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module SurgeAPI
|
|
4
|
+
module Models
|
|
5
|
+
class PhoneNumberListAvailableNumbersResponse < SurgeAPI::Internal::Type::BaseModel
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias do
|
|
8
|
+
T.any(
|
|
9
|
+
SurgeAPI::Models::PhoneNumberListAvailableNumbersResponse,
|
|
10
|
+
SurgeAPI::Internal::AnyHash
|
|
11
|
+
)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
# ISO country code for the phone number
|
|
15
|
+
sig do
|
|
16
|
+
returns(
|
|
17
|
+
SurgeAPI::Models::PhoneNumberListAvailableNumbersResponse::Country::TaggedSymbol
|
|
18
|
+
)
|
|
19
|
+
end
|
|
20
|
+
attr_accessor :country
|
|
21
|
+
|
|
22
|
+
# The phone number in E.164 format
|
|
23
|
+
sig { returns(String) }
|
|
24
|
+
attr_accessor :number
|
|
25
|
+
|
|
26
|
+
# Whether the phone number is local or toll-free
|
|
27
|
+
sig do
|
|
28
|
+
returns(
|
|
29
|
+
SurgeAPI::Models::PhoneNumberListAvailableNumbersResponse::Type::TaggedSymbol
|
|
30
|
+
)
|
|
31
|
+
end
|
|
32
|
+
attr_accessor :type
|
|
33
|
+
|
|
34
|
+
# A phone number available for purchase from Surge inventory
|
|
35
|
+
sig do
|
|
36
|
+
params(
|
|
37
|
+
country:
|
|
38
|
+
SurgeAPI::Models::PhoneNumberListAvailableNumbersResponse::Country::OrSymbol,
|
|
39
|
+
number: String,
|
|
40
|
+
type:
|
|
41
|
+
SurgeAPI::Models::PhoneNumberListAvailableNumbersResponse::Type::OrSymbol
|
|
42
|
+
).returns(T.attached_class)
|
|
43
|
+
end
|
|
44
|
+
def self.new(
|
|
45
|
+
# ISO country code for the phone number
|
|
46
|
+
country:,
|
|
47
|
+
# The phone number in E.164 format
|
|
48
|
+
number:,
|
|
49
|
+
# Whether the phone number is local or toll-free
|
|
50
|
+
type:
|
|
51
|
+
)
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
sig do
|
|
55
|
+
override.returns(
|
|
56
|
+
{
|
|
57
|
+
country:
|
|
58
|
+
SurgeAPI::Models::PhoneNumberListAvailableNumbersResponse::Country::TaggedSymbol,
|
|
59
|
+
number: String,
|
|
60
|
+
type:
|
|
61
|
+
SurgeAPI::Models::PhoneNumberListAvailableNumbersResponse::Type::TaggedSymbol
|
|
62
|
+
}
|
|
63
|
+
)
|
|
64
|
+
end
|
|
65
|
+
def to_hash
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
# ISO country code for the phone number
|
|
69
|
+
module Country
|
|
70
|
+
extend SurgeAPI::Internal::Type::Enum
|
|
71
|
+
|
|
72
|
+
TaggedSymbol =
|
|
73
|
+
T.type_alias do
|
|
74
|
+
T.all(
|
|
75
|
+
Symbol,
|
|
76
|
+
SurgeAPI::Models::PhoneNumberListAvailableNumbersResponse::Country
|
|
77
|
+
)
|
|
78
|
+
end
|
|
79
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
80
|
+
|
|
81
|
+
US =
|
|
82
|
+
T.let(
|
|
83
|
+
:US,
|
|
84
|
+
SurgeAPI::Models::PhoneNumberListAvailableNumbersResponse::Country::TaggedSymbol
|
|
85
|
+
)
|
|
86
|
+
CA =
|
|
87
|
+
T.let(
|
|
88
|
+
:CA,
|
|
89
|
+
SurgeAPI::Models::PhoneNumberListAvailableNumbersResponse::Country::TaggedSymbol
|
|
90
|
+
)
|
|
91
|
+
|
|
92
|
+
sig do
|
|
93
|
+
override.returns(
|
|
94
|
+
T::Array[
|
|
95
|
+
SurgeAPI::Models::PhoneNumberListAvailableNumbersResponse::Country::TaggedSymbol
|
|
96
|
+
]
|
|
97
|
+
)
|
|
98
|
+
end
|
|
99
|
+
def self.values
|
|
100
|
+
end
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
# Whether the phone number is local or toll-free
|
|
104
|
+
module Type
|
|
105
|
+
extend SurgeAPI::Internal::Type::Enum
|
|
106
|
+
|
|
107
|
+
TaggedSymbol =
|
|
108
|
+
T.type_alias do
|
|
109
|
+
T.all(
|
|
110
|
+
Symbol,
|
|
111
|
+
SurgeAPI::Models::PhoneNumberListAvailableNumbersResponse::Type
|
|
112
|
+
)
|
|
113
|
+
end
|
|
114
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
115
|
+
|
|
116
|
+
LOCAL =
|
|
117
|
+
T.let(
|
|
118
|
+
:local,
|
|
119
|
+
SurgeAPI::Models::PhoneNumberListAvailableNumbersResponse::Type::TaggedSymbol
|
|
120
|
+
)
|
|
121
|
+
TOLL_FREE =
|
|
122
|
+
T.let(
|
|
123
|
+
:toll_free,
|
|
124
|
+
SurgeAPI::Models::PhoneNumberListAvailableNumbersResponse::Type::TaggedSymbol
|
|
125
|
+
)
|
|
126
|
+
|
|
127
|
+
sig do
|
|
128
|
+
override.returns(
|
|
129
|
+
T::Array[
|
|
130
|
+
SurgeAPI::Models::PhoneNumberListAvailableNumbersResponse::Type::TaggedSymbol
|
|
131
|
+
]
|
|
132
|
+
)
|
|
133
|
+
end
|
|
134
|
+
def self.values
|
|
135
|
+
end
|
|
136
|
+
end
|
|
137
|
+
end
|
|
138
|
+
end
|
|
139
|
+
end
|
|
@@ -50,6 +50,14 @@ module SurgeAPI
|
|
|
50
50
|
sig { params(name: String).void }
|
|
51
51
|
attr_writer :name
|
|
52
52
|
|
|
53
|
+
# The exact phone number to purchase in E.164 format. When provided, all other
|
|
54
|
+
# search parameters are ignored.
|
|
55
|
+
sig { returns(T.nilable(String)) }
|
|
56
|
+
attr_reader :phone_number
|
|
57
|
+
|
|
58
|
+
sig { params(phone_number: String).void }
|
|
59
|
+
attr_writer :phone_number
|
|
60
|
+
|
|
53
61
|
# Whether the phone number is local or toll-free. Can be omitted if area_code or
|
|
54
62
|
# latitude/longitude are provided.
|
|
55
63
|
sig do
|
|
@@ -69,6 +77,7 @@ module SurgeAPI
|
|
|
69
77
|
latitude: Float,
|
|
70
78
|
longitude: Float,
|
|
71
79
|
name: String,
|
|
80
|
+
phone_number: String,
|
|
72
81
|
type: SurgeAPI::PhoneNumberPurchaseParams::Type::OrSymbol,
|
|
73
82
|
request_options: SurgeAPI::RequestOptions::OrHash
|
|
74
83
|
).returns(T.attached_class)
|
|
@@ -88,6 +97,9 @@ module SurgeAPI
|
|
|
88
97
|
# A human-readable name for the phone number. If not provided, defaults to the
|
|
89
98
|
# formatted phone number.
|
|
90
99
|
name: nil,
|
|
100
|
+
# The exact phone number to purchase in E.164 format. When provided, all other
|
|
101
|
+
# search parameters are ignored.
|
|
102
|
+
phone_number: nil,
|
|
91
103
|
# Whether the phone number is local or toll-free. Can be omitted if area_code or
|
|
92
104
|
# latitude/longitude are provided.
|
|
93
105
|
type: nil,
|
|
@@ -103,6 +115,7 @@ module SurgeAPI
|
|
|
103
115
|
latitude: Float,
|
|
104
116
|
longitude: Float,
|
|
105
117
|
name: String,
|
|
118
|
+
phone_number: String,
|
|
106
119
|
type: SurgeAPI::PhoneNumberPurchaseParams::Type::OrSymbol,
|
|
107
120
|
request_options: SurgeAPI::RequestOptions
|
|
108
121
|
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module SurgeAPI
|
|
4
|
+
module Models
|
|
5
|
+
class PhoneNumberRetrieveParams < SurgeAPI::Internal::Type::BaseModel
|
|
6
|
+
extend SurgeAPI::Internal::Type::RequestParameters::Converter
|
|
7
|
+
include SurgeAPI::Internal::Type::RequestParameters
|
|
8
|
+
|
|
9
|
+
OrHash =
|
|
10
|
+
T.type_alias do
|
|
11
|
+
T.any(
|
|
12
|
+
SurgeAPI::PhoneNumberRetrieveParams,
|
|
13
|
+
SurgeAPI::Internal::AnyHash
|
|
14
|
+
)
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
# The ID of the phone number to retrieve.
|
|
18
|
+
sig { returns(String) }
|
|
19
|
+
attr_accessor :id
|
|
20
|
+
|
|
21
|
+
sig do
|
|
22
|
+
params(
|
|
23
|
+
id: String,
|
|
24
|
+
request_options: SurgeAPI::RequestOptions::OrHash
|
|
25
|
+
).returns(T.attached_class)
|
|
26
|
+
end
|
|
27
|
+
def self.new(
|
|
28
|
+
# The ID of the phone number to retrieve.
|
|
29
|
+
id:,
|
|
30
|
+
request_options: {}
|
|
31
|
+
)
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
sig do
|
|
35
|
+
override.returns(
|
|
36
|
+
{ id: String, request_options: SurgeAPI::RequestOptions }
|
|
37
|
+
)
|
|
38
|
+
end
|
|
39
|
+
def to_hash
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|