surge_api 0.18.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 +19 -0
- data/README.md +7 -7
- data/lib/surge_api/models/call_ended_webhook_event.rb +25 -1
- 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/recording_completed_webhook_event.rb +25 -1
- data/lib/surge_api/models/voicemail_received_webhook_event.rb +25 -1
- 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/call_ended_webhook_event.rbi +27 -3
- 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/recording_completed_webhook_event.rbi +27 -3
- data/rbi/surge_api/models/voicemail_received_webhook_event.rbi +27 -3
- data/rbi/surge_api/models.rbi +5 -0
- data/rbi/surge_api/resources/phone_numbers.rbi +59 -2
- data/sig/surge_api/models/call_ended_webhook_event.rbs +18 -3
- 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/recording_completed_webhook_event.rbs +18 -3
- data/sig/surge_api/models/voicemail_received_webhook_event.rbs +18 -3
- data/sig/surge_api/models.rbs +4 -0
- data/sig/surge_api/resources/phone_numbers.rbs +16 -0
- metadata +11 -2
|
@@ -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
|
|
@@ -161,6 +161,18 @@ module SurgeAPI
|
|
|
161
161
|
end
|
|
162
162
|
attr_accessor :status
|
|
163
163
|
|
|
164
|
+
# The E.164 phone number of the caller
|
|
165
|
+
sig { returns(T.nilable(String)) }
|
|
166
|
+
attr_accessor :from
|
|
167
|
+
|
|
168
|
+
# The Surge phone number ID (e.g. pn\_...)
|
|
169
|
+
sig { returns(T.nilable(String)) }
|
|
170
|
+
attr_accessor :phone_number_id
|
|
171
|
+
|
|
172
|
+
# The E.164 phone number of the callee
|
|
173
|
+
sig { returns(T.nilable(String)) }
|
|
174
|
+
attr_accessor :to
|
|
175
|
+
|
|
164
176
|
# The call that produced this recording
|
|
165
177
|
sig do
|
|
166
178
|
params(
|
|
@@ -169,7 +181,10 @@ module SurgeAPI
|
|
|
169
181
|
duration: Integer,
|
|
170
182
|
initiated_at: Time,
|
|
171
183
|
status:
|
|
172
|
-
SurgeAPI::RecordingCompletedWebhookEvent::Data::Call::Status::OrSymbol
|
|
184
|
+
SurgeAPI::RecordingCompletedWebhookEvent::Data::Call::Status::OrSymbol,
|
|
185
|
+
from: T.nilable(String),
|
|
186
|
+
phone_number_id: T.nilable(String),
|
|
187
|
+
to: T.nilable(String)
|
|
173
188
|
).returns(T.attached_class)
|
|
174
189
|
end
|
|
175
190
|
def self.new(
|
|
@@ -182,7 +197,13 @@ module SurgeAPI
|
|
|
182
197
|
# When the call was initiated
|
|
183
198
|
initiated_at:,
|
|
184
199
|
# The status of the call
|
|
185
|
-
status
|
|
200
|
+
status:,
|
|
201
|
+
# The E.164 phone number of the caller
|
|
202
|
+
from: nil,
|
|
203
|
+
# The Surge phone number ID (e.g. pn\_...)
|
|
204
|
+
phone_number_id: nil,
|
|
205
|
+
# The E.164 phone number of the callee
|
|
206
|
+
to: nil
|
|
186
207
|
)
|
|
187
208
|
end
|
|
188
209
|
|
|
@@ -194,7 +215,10 @@ module SurgeAPI
|
|
|
194
215
|
duration: Integer,
|
|
195
216
|
initiated_at: Time,
|
|
196
217
|
status:
|
|
197
|
-
SurgeAPI::RecordingCompletedWebhookEvent::Data::Call::Status::TaggedSymbol
|
|
218
|
+
SurgeAPI::RecordingCompletedWebhookEvent::Data::Call::Status::TaggedSymbol,
|
|
219
|
+
from: T.nilable(String),
|
|
220
|
+
phone_number_id: T.nilable(String),
|
|
221
|
+
to: T.nilable(String)
|
|
198
222
|
}
|
|
199
223
|
)
|
|
200
224
|
end
|
|
@@ -167,6 +167,18 @@ module SurgeAPI
|
|
|
167
167
|
end
|
|
168
168
|
attr_accessor :status
|
|
169
169
|
|
|
170
|
+
# The E.164 phone number of the caller
|
|
171
|
+
sig { returns(T.nilable(String)) }
|
|
172
|
+
attr_accessor :from
|
|
173
|
+
|
|
174
|
+
# The Surge phone number ID (e.g. pn\_...)
|
|
175
|
+
sig { returns(T.nilable(String)) }
|
|
176
|
+
attr_accessor :phone_number_id
|
|
177
|
+
|
|
178
|
+
# The E.164 phone number of the callee
|
|
179
|
+
sig { returns(T.nilable(String)) }
|
|
180
|
+
attr_accessor :to
|
|
181
|
+
|
|
170
182
|
# The call that resulted in this voicemail
|
|
171
183
|
sig do
|
|
172
184
|
params(
|
|
@@ -175,7 +187,10 @@ module SurgeAPI
|
|
|
175
187
|
duration: Integer,
|
|
176
188
|
initiated_at: Time,
|
|
177
189
|
status:
|
|
178
|
-
SurgeAPI::VoicemailReceivedWebhookEvent::Data::Call::Status::OrSymbol
|
|
190
|
+
SurgeAPI::VoicemailReceivedWebhookEvent::Data::Call::Status::OrSymbol,
|
|
191
|
+
from: T.nilable(String),
|
|
192
|
+
phone_number_id: T.nilable(String),
|
|
193
|
+
to: T.nilable(String)
|
|
179
194
|
).returns(T.attached_class)
|
|
180
195
|
end
|
|
181
196
|
def self.new(
|
|
@@ -188,7 +203,13 @@ module SurgeAPI
|
|
|
188
203
|
# When the call was initiated
|
|
189
204
|
initiated_at:,
|
|
190
205
|
# The status of the call
|
|
191
|
-
status
|
|
206
|
+
status:,
|
|
207
|
+
# The E.164 phone number of the caller
|
|
208
|
+
from: nil,
|
|
209
|
+
# The Surge phone number ID (e.g. pn\_...)
|
|
210
|
+
phone_number_id: nil,
|
|
211
|
+
# The E.164 phone number of the callee
|
|
212
|
+
to: nil
|
|
192
213
|
)
|
|
193
214
|
end
|
|
194
215
|
|
|
@@ -200,7 +221,10 @@ module SurgeAPI
|
|
|
200
221
|
duration: Integer,
|
|
201
222
|
initiated_at: Time,
|
|
202
223
|
status:
|
|
203
|
-
SurgeAPI::VoicemailReceivedWebhookEvent::Data::Call::Status::TaggedSymbol
|
|
224
|
+
SurgeAPI::VoicemailReceivedWebhookEvent::Data::Call::Status::TaggedSymbol,
|
|
225
|
+
from: T.nilable(String),
|
|
226
|
+
phone_number_id: T.nilable(String),
|
|
227
|
+
to: T.nilable(String)
|
|
204
228
|
}
|
|
205
229
|
)
|
|
206
230
|
end
|
data/rbi/surge_api/models.rbi
CHANGED
|
@@ -89,12 +89,17 @@ module SurgeAPI
|
|
|
89
89
|
PhoneNumberAttachedToCampaignWebhookEvent =
|
|
90
90
|
SurgeAPI::Models::PhoneNumberAttachedToCampaignWebhookEvent
|
|
91
91
|
|
|
92
|
+
PhoneNumberListAvailableNumbersParams =
|
|
93
|
+
SurgeAPI::Models::PhoneNumberListAvailableNumbersParams
|
|
94
|
+
|
|
92
95
|
PhoneNumberListParams = SurgeAPI::Models::PhoneNumberListParams
|
|
93
96
|
|
|
94
97
|
PhoneNumberPurchaseParams = SurgeAPI::Models::PhoneNumberPurchaseParams
|
|
95
98
|
|
|
96
99
|
PhoneNumberReleaseParams = SurgeAPI::Models::PhoneNumberReleaseParams
|
|
97
100
|
|
|
101
|
+
PhoneNumberRetrieveParams = SurgeAPI::Models::PhoneNumberRetrieveParams
|
|
102
|
+
|
|
98
103
|
PhoneNumberUpdateParams = SurgeAPI::Models::PhoneNumberUpdateParams
|
|
99
104
|
|
|
100
105
|
RecordingCompletedWebhookEvent =
|
|
@@ -3,6 +3,20 @@
|
|
|
3
3
|
module SurgeAPI
|
|
4
4
|
module Resources
|
|
5
5
|
class PhoneNumbers
|
|
6
|
+
# Retrieves a PhoneNumber object.
|
|
7
|
+
sig do
|
|
8
|
+
params(
|
|
9
|
+
id: String,
|
|
10
|
+
request_options: SurgeAPI::RequestOptions::OrHash
|
|
11
|
+
).returns(SurgeAPI::PhoneNumber)
|
|
12
|
+
end
|
|
13
|
+
def retrieve(
|
|
14
|
+
# The ID of the phone number to retrieve.
|
|
15
|
+
id,
|
|
16
|
+
request_options: {}
|
|
17
|
+
)
|
|
18
|
+
end
|
|
19
|
+
|
|
6
20
|
# Updates a phone number's details.
|
|
7
21
|
sig do
|
|
8
22
|
params(
|
|
@@ -44,8 +58,47 @@ module SurgeAPI
|
|
|
44
58
|
)
|
|
45
59
|
end
|
|
46
60
|
|
|
47
|
-
#
|
|
48
|
-
#
|
|
61
|
+
# Browse purchasable phone numbers from Surge inventory before buying.
|
|
62
|
+
#
|
|
63
|
+
# Pagination cursors are always null for now.
|
|
64
|
+
sig do
|
|
65
|
+
params(
|
|
66
|
+
account_id: String,
|
|
67
|
+
type: SurgeAPI::PhoneNumberListAvailableNumbersParams::Type::OrSymbol,
|
|
68
|
+
after: String,
|
|
69
|
+
area_code: String,
|
|
70
|
+
before: String,
|
|
71
|
+
country:
|
|
72
|
+
SurgeAPI::PhoneNumberListAvailableNumbersParams::Country::OrSymbol,
|
|
73
|
+
request_options: SurgeAPI::RequestOptions::OrHash
|
|
74
|
+
).returns(
|
|
75
|
+
SurgeAPI::Internal::Cursor[
|
|
76
|
+
SurgeAPI::Models::PhoneNumberListAvailableNumbersResponse
|
|
77
|
+
]
|
|
78
|
+
)
|
|
79
|
+
end
|
|
80
|
+
def list_available_numbers(
|
|
81
|
+
# The account ID to list available phone numbers for.
|
|
82
|
+
account_id,
|
|
83
|
+
# Whether to search for local or toll-free numbers.
|
|
84
|
+
type:,
|
|
85
|
+
# Cursor for forward pagination. Use the next_cursor from a previous response.
|
|
86
|
+
after: nil,
|
|
87
|
+
# Filter by 3-digit area code.
|
|
88
|
+
area_code: nil,
|
|
89
|
+
# Cursor for backward pagination. Use the previous_cursor from a previous
|
|
90
|
+
# response.
|
|
91
|
+
before: nil,
|
|
92
|
+
# ISO country code to search in.
|
|
93
|
+
country: nil,
|
|
94
|
+
request_options: {}
|
|
95
|
+
)
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
# Purchase a new phone number for the account. You can specify an exact phone
|
|
99
|
+
# number, search criteria, or let the system select a random number.
|
|
100
|
+
#
|
|
101
|
+
# When `phone_number` is provided, all other search parameters are ignored.
|
|
49
102
|
sig do
|
|
50
103
|
params(
|
|
51
104
|
account_id: String,
|
|
@@ -53,6 +106,7 @@ module SurgeAPI
|
|
|
53
106
|
latitude: Float,
|
|
54
107
|
longitude: Float,
|
|
55
108
|
name: String,
|
|
109
|
+
phone_number: String,
|
|
56
110
|
type: SurgeAPI::PhoneNumberPurchaseParams::Type::OrSymbol,
|
|
57
111
|
request_options: SurgeAPI::RequestOptions::OrHash
|
|
58
112
|
).returns(SurgeAPI::PhoneNumber)
|
|
@@ -72,6 +126,9 @@ module SurgeAPI
|
|
|
72
126
|
# A human-readable name for the phone number. If not provided, defaults to the
|
|
73
127
|
# formatted phone number.
|
|
74
128
|
name: nil,
|
|
129
|
+
# The exact phone number to purchase in E.164 format. When provided, all other
|
|
130
|
+
# search parameters are ignored.
|
|
131
|
+
phone_number: nil,
|
|
75
132
|
# Whether the phone number is local or toll-free. Can be omitted if area_code or
|
|
76
133
|
# latitude/longitude are provided.
|
|
77
134
|
type: nil,
|
|
@@ -37,7 +37,10 @@ module SurgeAPI
|
|
|
37
37
|
contact: SurgeAPI::Contact,
|
|
38
38
|
duration: Integer,
|
|
39
39
|
initiated_at: Time,
|
|
40
|
-
status: SurgeAPI::Models::CallEndedWebhookEvent::Data::status
|
|
40
|
+
status: SurgeAPI::Models::CallEndedWebhookEvent::Data::status,
|
|
41
|
+
from: String?,
|
|
42
|
+
phone_number_id: String?,
|
|
43
|
+
to: String?
|
|
41
44
|
}
|
|
42
45
|
|
|
43
46
|
class Data < SurgeAPI::Internal::Type::BaseModel
|
|
@@ -51,12 +54,21 @@ module SurgeAPI
|
|
|
51
54
|
|
|
52
55
|
attr_accessor status: SurgeAPI::Models::CallEndedWebhookEvent::Data::status
|
|
53
56
|
|
|
57
|
+
attr_accessor from: String?
|
|
58
|
+
|
|
59
|
+
attr_accessor phone_number_id: String?
|
|
60
|
+
|
|
61
|
+
attr_accessor to: String?
|
|
62
|
+
|
|
54
63
|
def initialize: (
|
|
55
64
|
id: String,
|
|
56
65
|
contact: SurgeAPI::Contact,
|
|
57
66
|
duration: Integer,
|
|
58
67
|
initiated_at: Time,
|
|
59
|
-
status: SurgeAPI::Models::CallEndedWebhookEvent::Data::status
|
|
68
|
+
status: SurgeAPI::Models::CallEndedWebhookEvent::Data::status,
|
|
69
|
+
?from: String?,
|
|
70
|
+
?phone_number_id: String?,
|
|
71
|
+
?to: String?
|
|
60
72
|
) -> void
|
|
61
73
|
|
|
62
74
|
def to_hash: -> {
|
|
@@ -64,7 +76,10 @@ module SurgeAPI
|
|
|
64
76
|
contact: SurgeAPI::Contact,
|
|
65
77
|
duration: Integer,
|
|
66
78
|
initiated_at: Time,
|
|
67
|
-
status: SurgeAPI::Models::CallEndedWebhookEvent::Data::status
|
|
79
|
+
status: SurgeAPI::Models::CallEndedWebhookEvent::Data::status,
|
|
80
|
+
from: String?,
|
|
81
|
+
phone_number_id: String?,
|
|
82
|
+
to: String?
|
|
68
83
|
}
|
|
69
84
|
|
|
70
85
|
type status =
|
|
@@ -3,6 +3,7 @@ module SurgeAPI
|
|
|
3
3
|
type phone_number =
|
|
4
4
|
{
|
|
5
5
|
id: String,
|
|
6
|
+
campaign: SurgeAPI::PhoneNumber::Campaign?,
|
|
6
7
|
campaign_id: String?,
|
|
7
8
|
name: String?,
|
|
8
9
|
number: String,
|
|
@@ -12,6 +13,8 @@ module SurgeAPI
|
|
|
12
13
|
class PhoneNumber < SurgeAPI::Internal::Type::BaseModel
|
|
13
14
|
attr_accessor id: String
|
|
14
15
|
|
|
16
|
+
attr_accessor campaign: SurgeAPI::PhoneNumber::Campaign?
|
|
17
|
+
|
|
15
18
|
attr_accessor campaign_id: String?
|
|
16
19
|
|
|
17
20
|
attr_accessor name: String?
|
|
@@ -22,6 +25,7 @@ module SurgeAPI
|
|
|
22
25
|
|
|
23
26
|
def initialize: (
|
|
24
27
|
id: String,
|
|
28
|
+
campaign: SurgeAPI::PhoneNumber::Campaign?,
|
|
25
29
|
campaign_id: String?,
|
|
26
30
|
name: String?,
|
|
27
31
|
number: String,
|
|
@@ -30,12 +34,49 @@ module SurgeAPI
|
|
|
30
34
|
|
|
31
35
|
def to_hash: -> {
|
|
32
36
|
id: String,
|
|
37
|
+
campaign: SurgeAPI::PhoneNumber::Campaign?,
|
|
33
38
|
campaign_id: String?,
|
|
34
39
|
name: String?,
|
|
35
40
|
number: String,
|
|
36
41
|
type: SurgeAPI::Models::PhoneNumber::type_
|
|
37
42
|
}
|
|
38
43
|
|
|
44
|
+
type campaign =
|
|
45
|
+
{
|
|
46
|
+
id: String,
|
|
47
|
+
attachment_status: SurgeAPI::Models::PhoneNumber::Campaign::attachment_status
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
class Campaign < SurgeAPI::Internal::Type::BaseModel
|
|
51
|
+
attr_accessor id: String
|
|
52
|
+
|
|
53
|
+
attr_accessor attachment_status: SurgeAPI::Models::PhoneNumber::Campaign::attachment_status
|
|
54
|
+
|
|
55
|
+
def initialize: (
|
|
56
|
+
id: String,
|
|
57
|
+
attachment_status: SurgeAPI::Models::PhoneNumber::Campaign::attachment_status
|
|
58
|
+
) -> void
|
|
59
|
+
|
|
60
|
+
def to_hash: -> {
|
|
61
|
+
id: String,
|
|
62
|
+
attachment_status: SurgeAPI::Models::PhoneNumber::Campaign::attachment_status
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
type attachment_status =
|
|
66
|
+
:attached | :attachment_pending | :detached | :detachment_pending
|
|
67
|
+
|
|
68
|
+
module AttachmentStatus
|
|
69
|
+
extend SurgeAPI::Internal::Type::Enum
|
|
70
|
+
|
|
71
|
+
ATTACHED: :attached
|
|
72
|
+
ATTACHMENT_PENDING: :attachment_pending
|
|
73
|
+
DETACHED: :detached
|
|
74
|
+
DETACHMENT_PENDING: :detachment_pending
|
|
75
|
+
|
|
76
|
+
def self?.values: -> ::Array[SurgeAPI::Models::PhoneNumber::Campaign::attachment_status]
|
|
77
|
+
end
|
|
78
|
+
end
|
|
79
|
+
|
|
39
80
|
type type_ = :local | :short_code | :toll_free
|
|
40
81
|
|
|
41
82
|
module Type
|
|
@@ -34,6 +34,7 @@ module SurgeAPI
|
|
|
34
34
|
type data =
|
|
35
35
|
{
|
|
36
36
|
id: String,
|
|
37
|
+
campaign: SurgeAPI::PhoneNumberAttachedToCampaignWebhookEvent::Data::Campaign?,
|
|
37
38
|
campaign_id: String,
|
|
38
39
|
name: String?,
|
|
39
40
|
number: String,
|
|
@@ -43,6 +44,8 @@ module SurgeAPI
|
|
|
43
44
|
class Data < SurgeAPI::Internal::Type::BaseModel
|
|
44
45
|
attr_accessor id: String
|
|
45
46
|
|
|
47
|
+
attr_accessor campaign: SurgeAPI::PhoneNumberAttachedToCampaignWebhookEvent::Data::Campaign?
|
|
48
|
+
|
|
46
49
|
attr_accessor campaign_id: String
|
|
47
50
|
|
|
48
51
|
attr_accessor name: String?
|
|
@@ -53,6 +56,7 @@ module SurgeAPI
|
|
|
53
56
|
|
|
54
57
|
def initialize: (
|
|
55
58
|
id: String,
|
|
59
|
+
campaign: SurgeAPI::PhoneNumberAttachedToCampaignWebhookEvent::Data::Campaign?,
|
|
56
60
|
campaign_id: String,
|
|
57
61
|
name: String?,
|
|
58
62
|
number: String,
|
|
@@ -61,12 +65,49 @@ module SurgeAPI
|
|
|
61
65
|
|
|
62
66
|
def to_hash: -> {
|
|
63
67
|
id: String,
|
|
68
|
+
campaign: SurgeAPI::PhoneNumberAttachedToCampaignWebhookEvent::Data::Campaign?,
|
|
64
69
|
campaign_id: String,
|
|
65
70
|
name: String?,
|
|
66
71
|
number: String,
|
|
67
72
|
type: SurgeAPI::Models::PhoneNumberAttachedToCampaignWebhookEvent::Data::type_
|
|
68
73
|
}
|
|
69
74
|
|
|
75
|
+
type campaign =
|
|
76
|
+
{
|
|
77
|
+
id: String,
|
|
78
|
+
attachment_status: SurgeAPI::Models::PhoneNumberAttachedToCampaignWebhookEvent::Data::Campaign::attachment_status
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
class Campaign < SurgeAPI::Internal::Type::BaseModel
|
|
82
|
+
attr_accessor id: String
|
|
83
|
+
|
|
84
|
+
attr_accessor attachment_status: SurgeAPI::Models::PhoneNumberAttachedToCampaignWebhookEvent::Data::Campaign::attachment_status
|
|
85
|
+
|
|
86
|
+
def initialize: (
|
|
87
|
+
id: String,
|
|
88
|
+
attachment_status: SurgeAPI::Models::PhoneNumberAttachedToCampaignWebhookEvent::Data::Campaign::attachment_status
|
|
89
|
+
) -> void
|
|
90
|
+
|
|
91
|
+
def to_hash: -> {
|
|
92
|
+
id: String,
|
|
93
|
+
attachment_status: SurgeAPI::Models::PhoneNumberAttachedToCampaignWebhookEvent::Data::Campaign::attachment_status
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
type attachment_status =
|
|
97
|
+
:attached | :attachment_pending | :detached | :detachment_pending
|
|
98
|
+
|
|
99
|
+
module AttachmentStatus
|
|
100
|
+
extend SurgeAPI::Internal::Type::Enum
|
|
101
|
+
|
|
102
|
+
ATTACHED: :attached
|
|
103
|
+
ATTACHMENT_PENDING: :attachment_pending
|
|
104
|
+
DETACHED: :detached
|
|
105
|
+
DETACHMENT_PENDING: :detachment_pending
|
|
106
|
+
|
|
107
|
+
def self?.values: -> ::Array[SurgeAPI::Models::PhoneNumberAttachedToCampaignWebhookEvent::Data::Campaign::attachment_status]
|
|
108
|
+
end
|
|
109
|
+
end
|
|
110
|
+
|
|
70
111
|
type type_ = :local | :short_code | :toll_free
|
|
71
112
|
|
|
72
113
|
module Type
|