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
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2c7a5d469cecb86e54c11530c7f97365e055e1990f7689c060a574cb7a7db892
|
|
4
|
+
data.tar.gz: 9b8688276c1c6de57242aa3ea37846db616c6dd9fb9d0cb89928d17ff9faa816
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7ac007b01940925b65714cd5f48c76ba82ff502450e316a971ba89bc578bd18deef2135ebf95c2a6c4f617688ad77f29d92ce149ab85ca57acf25a80de6f26ed
|
|
7
|
+
data.tar.gz: 95caca6f433199cdea6a8f1ef3ace3d87d1a431e8bb3f12e2d99b788951d9bed9dfd934e9463b21c4d8d2da0c1fdc382db8cbb2abadc801ef9a13ad0d4d50efa
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.20.0 (2026-07-14)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v0.19.0...v0.20.0](https://github.com/surgeapi/ruby-sdk/compare/v0.19.0...v0.20.0)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* **api:** add campaign to phone numbers ([037405d](https://github.com/surgeapi/ruby-sdk/commit/037405d891eaa84c91ede8b963d91a1910b1379e))
|
|
10
|
+
* **api:** add list available phone numbers endpoint ([d54f29f](https://github.com/surgeapi/ruby-sdk/commit/d54f29f90abc8cdc9d42577775bdbe727898d19f))
|
|
11
|
+
* **api:** add phone number field to purchase endpoint ([d9eafc6](https://github.com/surgeapi/ruby-sdk/commit/d9eafc611da5fb60b149eda5a676d3ca276b3780))
|
|
12
|
+
* **api:** add retrieve phone number endpoint ([2f15b40](https://github.com/surgeapi/ruby-sdk/commit/2f15b4093fd0ed099e41c2292ca9a433458eec19))
|
|
13
|
+
|
|
14
|
+
## 0.19.0 (2026-07-06)
|
|
15
|
+
|
|
16
|
+
Full Changelog: [v0.18.0...v0.19.0](https://github.com/surgeapi/ruby-sdk/compare/v0.18.0...v0.19.0)
|
|
17
|
+
|
|
18
|
+
### Features
|
|
19
|
+
|
|
20
|
+
* **api:** add phone numbers to call webhooks ([4498bd6](https://github.com/surgeapi/ruby-sdk/commit/4498bd66855cd38f001965b0acda0b61163b0165))
|
|
21
|
+
|
|
3
22
|
## 0.18.0 (2026-06-30)
|
|
4
23
|
|
|
5
24
|
Full Changelog: [v0.17.0...v0.18.0](https://github.com/surgeapi/ruby-sdk/compare/v0.17.0...v0.18.0)
|
data/README.md
CHANGED
|
@@ -17,7 +17,7 @@ To use this gem, install via Bundler by adding the following to your application
|
|
|
17
17
|
<!-- x-release-please-start-version -->
|
|
18
18
|
|
|
19
19
|
```ruby
|
|
20
|
-
gem "surge_api", "~> 0.
|
|
20
|
+
gem "surge_api", "~> 0.20.0"
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
<!-- x-release-please-end -->
|
|
@@ -261,23 +261,23 @@ Since this library does not depend on `sorbet-runtime`, it cannot provide [`T::E
|
|
|
261
261
|
|
|
262
262
|
```ruby
|
|
263
263
|
# :local
|
|
264
|
-
puts(SurgeAPI::
|
|
264
|
+
puts(SurgeAPI::PhoneNumberListAvailableNumbersParams::Type::LOCAL)
|
|
265
265
|
|
|
266
|
-
# Revealed type: `T.all(SurgeAPI::
|
|
267
|
-
T.reveal_type(SurgeAPI::
|
|
266
|
+
# Revealed type: `T.all(SurgeAPI::PhoneNumberListAvailableNumbersParams::Type, Symbol)`
|
|
267
|
+
T.reveal_type(SurgeAPI::PhoneNumberListAvailableNumbersParams::Type::LOCAL)
|
|
268
268
|
```
|
|
269
269
|
|
|
270
270
|
Enum parameters have a "relaxed" type, so you can either pass in enum constants or their literal value:
|
|
271
271
|
|
|
272
272
|
```ruby
|
|
273
273
|
# Using the enum constants preserves the tagged type information:
|
|
274
|
-
surge.phone_numbers.
|
|
275
|
-
type: SurgeAPI::
|
|
274
|
+
surge.phone_numbers.list_available_numbers(
|
|
275
|
+
type: SurgeAPI::PhoneNumberListAvailableNumbersParams::Type::LOCAL,
|
|
276
276
|
# …
|
|
277
277
|
)
|
|
278
278
|
|
|
279
279
|
# Literal values are also permissible:
|
|
280
|
-
surge.phone_numbers.
|
|
280
|
+
surge.phone_numbers.list_available_numbers(
|
|
281
281
|
type: :local,
|
|
282
282
|
# …
|
|
283
283
|
)
|
|
@@ -68,7 +68,25 @@ module SurgeAPI
|
|
|
68
68
|
# @return [Symbol, SurgeAPI::Models::CallEndedWebhookEvent::Data::Status]
|
|
69
69
|
required :status, enum: -> { SurgeAPI::CallEndedWebhookEvent::Data::Status }
|
|
70
70
|
|
|
71
|
-
# @!
|
|
71
|
+
# @!attribute from
|
|
72
|
+
# The E.164 phone number of the caller
|
|
73
|
+
#
|
|
74
|
+
# @return [String, nil]
|
|
75
|
+
optional :from, String, nil?: true
|
|
76
|
+
|
|
77
|
+
# @!attribute phone_number_id
|
|
78
|
+
# The Surge phone number ID (e.g. pn\_...)
|
|
79
|
+
#
|
|
80
|
+
# @return [String, nil]
|
|
81
|
+
optional :phone_number_id, String, nil?: true
|
|
82
|
+
|
|
83
|
+
# @!attribute to
|
|
84
|
+
# The E.164 phone number of the callee
|
|
85
|
+
#
|
|
86
|
+
# @return [String, nil]
|
|
87
|
+
optional :to, String, nil?: true
|
|
88
|
+
|
|
89
|
+
# @!method initialize(id:, contact:, duration:, initiated_at:, status:, from: nil, phone_number_id: nil, to: nil)
|
|
72
90
|
# The data associated with the event
|
|
73
91
|
#
|
|
74
92
|
# @param id [String] The unique identifier for the call
|
|
@@ -80,6 +98,12 @@ module SurgeAPI
|
|
|
80
98
|
# @param initiated_at [Time] When the call was initiated
|
|
81
99
|
#
|
|
82
100
|
# @param status [Symbol, SurgeAPI::Models::CallEndedWebhookEvent::Data::Status] The status of the call
|
|
101
|
+
#
|
|
102
|
+
# @param from [String, nil] The E.164 phone number of the caller
|
|
103
|
+
#
|
|
104
|
+
# @param phone_number_id [String, nil] The Surge phone number ID (e.g. pn\_...)
|
|
105
|
+
#
|
|
106
|
+
# @param to [String, nil] The E.164 phone number of the callee
|
|
83
107
|
|
|
84
108
|
# The status of the call
|
|
85
109
|
#
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
module SurgeAPI
|
|
4
4
|
module Models
|
|
5
|
-
# @see SurgeAPI::Resources::PhoneNumbers#
|
|
5
|
+
# @see SurgeAPI::Resources::PhoneNumbers#retrieve
|
|
6
6
|
class PhoneNumber < SurgeAPI::Internal::Type::BaseModel
|
|
7
7
|
# @!attribute id
|
|
8
8
|
# Unique identifier for the phone number
|
|
@@ -10,8 +10,17 @@ module SurgeAPI
|
|
|
10
10
|
# @return [String]
|
|
11
11
|
required :id, String
|
|
12
12
|
|
|
13
|
+
# @!attribute campaign
|
|
14
|
+
# Campaign attachment details for a domestic local phone number
|
|
15
|
+
#
|
|
16
|
+
# @return [SurgeAPI::Models::PhoneNumber::Campaign, nil]
|
|
17
|
+
required :campaign, -> { SurgeAPI::PhoneNumber::Campaign }, nil?: true
|
|
18
|
+
|
|
13
19
|
# @!attribute campaign_id
|
|
14
|
-
#
|
|
20
|
+
# @deprecated Use `campaign.id` instead.
|
|
21
|
+
#
|
|
22
|
+
# Deprecated. The unique identifier of the campaign this phone number is attached
|
|
23
|
+
# to, if any
|
|
15
24
|
#
|
|
16
25
|
# @return [String, nil]
|
|
17
26
|
required :campaign_id, String, nil?: true
|
|
@@ -34,12 +43,17 @@ module SurgeAPI
|
|
|
34
43
|
# @return [Symbol, SurgeAPI::Models::PhoneNumber::Type]
|
|
35
44
|
required :type, enum: -> { SurgeAPI::PhoneNumber::Type }
|
|
36
45
|
|
|
37
|
-
# @!method initialize(id:, campaign_id:, name:, number:, type:)
|
|
46
|
+
# @!method initialize(id:, campaign:, campaign_id:, name:, number:, type:)
|
|
47
|
+
# Some parameter documentations has been truncated, see
|
|
48
|
+
# {SurgeAPI::Models::PhoneNumber} for more details.
|
|
49
|
+
#
|
|
38
50
|
# A phone number that can be used to send and receive messages and calls
|
|
39
51
|
#
|
|
40
52
|
# @param id [String] Unique identifier for the phone number
|
|
41
53
|
#
|
|
42
|
-
# @param
|
|
54
|
+
# @param campaign [SurgeAPI::Models::PhoneNumber::Campaign, nil] Campaign attachment details for a domestic local phone number
|
|
55
|
+
#
|
|
56
|
+
# @param campaign_id [String, nil] Deprecated. The unique identifier of the campaign this phone number is attached
|
|
43
57
|
#
|
|
44
58
|
# @param name [String, nil] A human-readable name for the phone number
|
|
45
59
|
#
|
|
@@ -47,6 +61,43 @@ module SurgeAPI
|
|
|
47
61
|
#
|
|
48
62
|
# @param type [Symbol, SurgeAPI::Models::PhoneNumber::Type] Whether the phone number is local, toll-free, or short code
|
|
49
63
|
|
|
64
|
+
# @see SurgeAPI::Models::PhoneNumber#campaign
|
|
65
|
+
class Campaign < SurgeAPI::Internal::Type::BaseModel
|
|
66
|
+
# @!attribute id
|
|
67
|
+
# The unique identifier of the campaign this phone number is attached to
|
|
68
|
+
#
|
|
69
|
+
# @return [String]
|
|
70
|
+
required :id, String
|
|
71
|
+
|
|
72
|
+
# @!attribute attachment_status
|
|
73
|
+
# The current campaign attachment status for this phone number.
|
|
74
|
+
#
|
|
75
|
+
# @return [Symbol, SurgeAPI::Models::PhoneNumber::Campaign::AttachmentStatus]
|
|
76
|
+
required :attachment_status, enum: -> { SurgeAPI::PhoneNumber::Campaign::AttachmentStatus }
|
|
77
|
+
|
|
78
|
+
# @!method initialize(id:, attachment_status:)
|
|
79
|
+
# Campaign attachment details for a domestic local phone number
|
|
80
|
+
#
|
|
81
|
+
# @param id [String] The unique identifier of the campaign this phone number is attached to
|
|
82
|
+
#
|
|
83
|
+
# @param attachment_status [Symbol, SurgeAPI::Models::PhoneNumber::Campaign::AttachmentStatus] The current campaign attachment status for this phone number.
|
|
84
|
+
|
|
85
|
+
# The current campaign attachment status for this phone number.
|
|
86
|
+
#
|
|
87
|
+
# @see SurgeAPI::Models::PhoneNumber::Campaign#attachment_status
|
|
88
|
+
module AttachmentStatus
|
|
89
|
+
extend SurgeAPI::Internal::Type::Enum
|
|
90
|
+
|
|
91
|
+
ATTACHED = :attached
|
|
92
|
+
ATTACHMENT_PENDING = :attachment_pending
|
|
93
|
+
DETACHED = :detached
|
|
94
|
+
DETACHMENT_PENDING = :detachment_pending
|
|
95
|
+
|
|
96
|
+
# @!method self.values
|
|
97
|
+
# @return [Array<Symbol>]
|
|
98
|
+
end
|
|
99
|
+
end
|
|
100
|
+
|
|
50
101
|
# Whether the phone number is local, toll-free, or short code
|
|
51
102
|
#
|
|
52
103
|
# @see SurgeAPI::Models::PhoneNumber#type
|
|
@@ -48,8 +48,21 @@ module SurgeAPI
|
|
|
48
48
|
# @return [String]
|
|
49
49
|
required :id, String
|
|
50
50
|
|
|
51
|
+
# @!attribute campaign
|
|
52
|
+
# Campaign attachment details for a domestic local phone number
|
|
53
|
+
#
|
|
54
|
+
# @return [SurgeAPI::Models::PhoneNumberAttachedToCampaignWebhookEvent::Data::Campaign, nil]
|
|
55
|
+
required :campaign,
|
|
56
|
+
-> {
|
|
57
|
+
SurgeAPI::PhoneNumberAttachedToCampaignWebhookEvent::Data::Campaign
|
|
58
|
+
},
|
|
59
|
+
nil?: true
|
|
60
|
+
|
|
51
61
|
# @!attribute campaign_id
|
|
52
|
-
#
|
|
62
|
+
# @deprecated Use `campaign.id` instead.
|
|
63
|
+
#
|
|
64
|
+
# Deprecated. The unique identifier of the campaign this phone number is attached
|
|
65
|
+
# to
|
|
53
66
|
#
|
|
54
67
|
# @return [String]
|
|
55
68
|
required :campaign_id, String
|
|
@@ -72,12 +85,18 @@ module SurgeAPI
|
|
|
72
85
|
# @return [Symbol, SurgeAPI::Models::PhoneNumberAttachedToCampaignWebhookEvent::Data::Type]
|
|
73
86
|
required :type, enum: -> { SurgeAPI::PhoneNumberAttachedToCampaignWebhookEvent::Data::Type }
|
|
74
87
|
|
|
75
|
-
# @!method initialize(id:, campaign_id:, name:, number:, type:)
|
|
88
|
+
# @!method initialize(id:, campaign:, campaign_id:, name:, number:, type:)
|
|
89
|
+
# Some parameter documentations has been truncated, see
|
|
90
|
+
# {SurgeAPI::Models::PhoneNumberAttachedToCampaignWebhookEvent::Data} for more
|
|
91
|
+
# details.
|
|
92
|
+
#
|
|
76
93
|
# The data associated with the event
|
|
77
94
|
#
|
|
78
95
|
# @param id [String] The unique identifier for the phone number
|
|
79
96
|
#
|
|
80
|
-
# @param
|
|
97
|
+
# @param campaign [SurgeAPI::Models::PhoneNumberAttachedToCampaignWebhookEvent::Data::Campaign, nil] Campaign attachment details for a domestic local phone number
|
|
98
|
+
#
|
|
99
|
+
# @param campaign_id [String] Deprecated. The unique identifier of the campaign this phone number is attached
|
|
81
100
|
#
|
|
82
101
|
# @param name [String, nil] A human-readable name for the phone number
|
|
83
102
|
#
|
|
@@ -85,6 +104,44 @@ module SurgeAPI
|
|
|
85
104
|
#
|
|
86
105
|
# @param type [Symbol, SurgeAPI::Models::PhoneNumberAttachedToCampaignWebhookEvent::Data::Type] Whether the phone number is local, toll-free, or short code
|
|
87
106
|
|
|
107
|
+
# @see SurgeAPI::Models::PhoneNumberAttachedToCampaignWebhookEvent::Data#campaign
|
|
108
|
+
class Campaign < SurgeAPI::Internal::Type::BaseModel
|
|
109
|
+
# @!attribute id
|
|
110
|
+
# The unique identifier of the campaign this phone number is attached to
|
|
111
|
+
#
|
|
112
|
+
# @return [String]
|
|
113
|
+
required :id, String
|
|
114
|
+
|
|
115
|
+
# @!attribute attachment_status
|
|
116
|
+
# The current campaign attachment status for this phone number.
|
|
117
|
+
#
|
|
118
|
+
# @return [Symbol, SurgeAPI::Models::PhoneNumberAttachedToCampaignWebhookEvent::Data::Campaign::AttachmentStatus]
|
|
119
|
+
required :attachment_status,
|
|
120
|
+
enum: -> { SurgeAPI::PhoneNumberAttachedToCampaignWebhookEvent::Data::Campaign::AttachmentStatus }
|
|
121
|
+
|
|
122
|
+
# @!method initialize(id:, attachment_status:)
|
|
123
|
+
# Campaign attachment details for a domestic local phone number
|
|
124
|
+
#
|
|
125
|
+
# @param id [String] The unique identifier of the campaign this phone number is attached to
|
|
126
|
+
#
|
|
127
|
+
# @param attachment_status [Symbol, SurgeAPI::Models::PhoneNumberAttachedToCampaignWebhookEvent::Data::Campaign::AttachmentStatus] The current campaign attachment status for this phone number.
|
|
128
|
+
|
|
129
|
+
# The current campaign attachment status for this phone number.
|
|
130
|
+
#
|
|
131
|
+
# @see SurgeAPI::Models::PhoneNumberAttachedToCampaignWebhookEvent::Data::Campaign#attachment_status
|
|
132
|
+
module AttachmentStatus
|
|
133
|
+
extend SurgeAPI::Internal::Type::Enum
|
|
134
|
+
|
|
135
|
+
ATTACHED = :attached
|
|
136
|
+
ATTACHMENT_PENDING = :attachment_pending
|
|
137
|
+
DETACHED = :detached
|
|
138
|
+
DETACHMENT_PENDING = :detachment_pending
|
|
139
|
+
|
|
140
|
+
# @!method self.values
|
|
141
|
+
# @return [Array<Symbol>]
|
|
142
|
+
end
|
|
143
|
+
end
|
|
144
|
+
|
|
88
145
|
# Whether the phone number is local, toll-free, or short code
|
|
89
146
|
#
|
|
90
147
|
# @see SurgeAPI::Models::PhoneNumberAttachedToCampaignWebhookEvent::Data#type
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module SurgeAPI
|
|
4
|
+
module Models
|
|
5
|
+
# @see SurgeAPI::Resources::PhoneNumbers#list_available_numbers
|
|
6
|
+
class PhoneNumberListAvailableNumbersParams < SurgeAPI::Internal::Type::BaseModel
|
|
7
|
+
extend SurgeAPI::Internal::Type::RequestParameters::Converter
|
|
8
|
+
include SurgeAPI::Internal::Type::RequestParameters
|
|
9
|
+
|
|
10
|
+
# @!attribute account_id
|
|
11
|
+
# The account ID to list available phone numbers for.
|
|
12
|
+
#
|
|
13
|
+
# @return [String]
|
|
14
|
+
required :account_id, String
|
|
15
|
+
|
|
16
|
+
# @!attribute type
|
|
17
|
+
# Whether to search for local or toll-free numbers.
|
|
18
|
+
#
|
|
19
|
+
# @return [Symbol, SurgeAPI::Models::PhoneNumberListAvailableNumbersParams::Type]
|
|
20
|
+
required :type, enum: -> { SurgeAPI::PhoneNumberListAvailableNumbersParams::Type }
|
|
21
|
+
|
|
22
|
+
# @!attribute after
|
|
23
|
+
# Cursor for forward pagination. Use the next_cursor from a previous response.
|
|
24
|
+
#
|
|
25
|
+
# @return [String, nil]
|
|
26
|
+
optional :after, String
|
|
27
|
+
|
|
28
|
+
# @!attribute area_code
|
|
29
|
+
# Filter by 3-digit area code.
|
|
30
|
+
#
|
|
31
|
+
# @return [String, nil]
|
|
32
|
+
optional :area_code, String
|
|
33
|
+
|
|
34
|
+
# @!attribute before
|
|
35
|
+
# Cursor for backward pagination. Use the previous_cursor from a previous
|
|
36
|
+
# response.
|
|
37
|
+
#
|
|
38
|
+
# @return [String, nil]
|
|
39
|
+
optional :before, String
|
|
40
|
+
|
|
41
|
+
# @!attribute country
|
|
42
|
+
# ISO country code to search in.
|
|
43
|
+
#
|
|
44
|
+
# @return [Symbol, SurgeAPI::Models::PhoneNumberListAvailableNumbersParams::Country, nil]
|
|
45
|
+
optional :country, enum: -> { SurgeAPI::PhoneNumberListAvailableNumbersParams::Country }
|
|
46
|
+
|
|
47
|
+
# @!method initialize(account_id:, type:, after: nil, area_code: nil, before: nil, country: nil, request_options: {})
|
|
48
|
+
# Some parameter documentations has been truncated, see
|
|
49
|
+
# {SurgeAPI::Models::PhoneNumberListAvailableNumbersParams} for more details.
|
|
50
|
+
#
|
|
51
|
+
# @param account_id [String] The account ID to list available phone numbers for.
|
|
52
|
+
#
|
|
53
|
+
# @param type [Symbol, SurgeAPI::Models::PhoneNumberListAvailableNumbersParams::Type] Whether to search for local or toll-free numbers.
|
|
54
|
+
#
|
|
55
|
+
# @param after [String] Cursor for forward pagination. Use the next_cursor from a previous response.
|
|
56
|
+
#
|
|
57
|
+
# @param area_code [String] Filter by 3-digit area code.
|
|
58
|
+
#
|
|
59
|
+
# @param before [String] Cursor for backward pagination. Use the previous_cursor from a previous response
|
|
60
|
+
#
|
|
61
|
+
# @param country [Symbol, SurgeAPI::Models::PhoneNumberListAvailableNumbersParams::Country] ISO country code to search in.
|
|
62
|
+
#
|
|
63
|
+
# @param request_options [SurgeAPI::RequestOptions, Hash{Symbol=>Object}]
|
|
64
|
+
|
|
65
|
+
# Whether to search for local or toll-free numbers.
|
|
66
|
+
module Type
|
|
67
|
+
extend SurgeAPI::Internal::Type::Enum
|
|
68
|
+
|
|
69
|
+
LOCAL = :local
|
|
70
|
+
TOLL_FREE = :toll_free
|
|
71
|
+
|
|
72
|
+
# @!method self.values
|
|
73
|
+
# @return [Array<Symbol>]
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
# ISO country code to search in.
|
|
77
|
+
module Country
|
|
78
|
+
extend SurgeAPI::Internal::Type::Enum
|
|
79
|
+
|
|
80
|
+
US = :US
|
|
81
|
+
CA = :CA
|
|
82
|
+
|
|
83
|
+
# @!method self.values
|
|
84
|
+
# @return [Array<Symbol>]
|
|
85
|
+
end
|
|
86
|
+
end
|
|
87
|
+
end
|
|
88
|
+
end
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module SurgeAPI
|
|
4
|
+
module Models
|
|
5
|
+
# @see SurgeAPI::Resources::PhoneNumbers#list_available_numbers
|
|
6
|
+
class PhoneNumberListAvailableNumbersResponse < SurgeAPI::Internal::Type::BaseModel
|
|
7
|
+
# @!attribute country
|
|
8
|
+
# ISO country code for the phone number
|
|
9
|
+
#
|
|
10
|
+
# @return [Symbol, SurgeAPI::Models::PhoneNumberListAvailableNumbersResponse::Country]
|
|
11
|
+
required :country, enum: -> { SurgeAPI::Models::PhoneNumberListAvailableNumbersResponse::Country }
|
|
12
|
+
|
|
13
|
+
# @!attribute number
|
|
14
|
+
# The phone number in E.164 format
|
|
15
|
+
#
|
|
16
|
+
# @return [String]
|
|
17
|
+
required :number, String
|
|
18
|
+
|
|
19
|
+
# @!attribute type
|
|
20
|
+
# Whether the phone number is local or toll-free
|
|
21
|
+
#
|
|
22
|
+
# @return [Symbol, SurgeAPI::Models::PhoneNumberListAvailableNumbersResponse::Type]
|
|
23
|
+
required :type, enum: -> { SurgeAPI::Models::PhoneNumberListAvailableNumbersResponse::Type }
|
|
24
|
+
|
|
25
|
+
# @!method initialize(country:, number:, type:)
|
|
26
|
+
# A phone number available for purchase from Surge inventory
|
|
27
|
+
#
|
|
28
|
+
# @param country [Symbol, SurgeAPI::Models::PhoneNumberListAvailableNumbersResponse::Country] ISO country code for the phone number
|
|
29
|
+
#
|
|
30
|
+
# @param number [String] The phone number in E.164 format
|
|
31
|
+
#
|
|
32
|
+
# @param type [Symbol, SurgeAPI::Models::PhoneNumberListAvailableNumbersResponse::Type] Whether the phone number is local or toll-free
|
|
33
|
+
|
|
34
|
+
# ISO country code for the phone number
|
|
35
|
+
#
|
|
36
|
+
# @see SurgeAPI::Models::PhoneNumberListAvailableNumbersResponse#country
|
|
37
|
+
module Country
|
|
38
|
+
extend SurgeAPI::Internal::Type::Enum
|
|
39
|
+
|
|
40
|
+
US = :US
|
|
41
|
+
CA = :CA
|
|
42
|
+
|
|
43
|
+
# @!method self.values
|
|
44
|
+
# @return [Array<Symbol>]
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
# Whether the phone number is local or toll-free
|
|
48
|
+
#
|
|
49
|
+
# @see SurgeAPI::Models::PhoneNumberListAvailableNumbersResponse#type
|
|
50
|
+
module Type
|
|
51
|
+
extend SurgeAPI::Internal::Type::Enum
|
|
52
|
+
|
|
53
|
+
LOCAL = :local
|
|
54
|
+
TOLL_FREE = :toll_free
|
|
55
|
+
|
|
56
|
+
# @!method self.values
|
|
57
|
+
# @return [Array<Symbol>]
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
end
|
|
@@ -41,6 +41,13 @@ module SurgeAPI
|
|
|
41
41
|
# @return [String, nil]
|
|
42
42
|
optional :name, String
|
|
43
43
|
|
|
44
|
+
# @!attribute phone_number
|
|
45
|
+
# The exact phone number to purchase in E.164 format. When provided, all other
|
|
46
|
+
# search parameters are ignored.
|
|
47
|
+
#
|
|
48
|
+
# @return [String, nil]
|
|
49
|
+
optional :phone_number, String
|
|
50
|
+
|
|
44
51
|
# @!attribute type
|
|
45
52
|
# Whether the phone number is local or toll-free. Can be omitted if area_code or
|
|
46
53
|
# latitude/longitude are provided.
|
|
@@ -48,7 +55,7 @@ module SurgeAPI
|
|
|
48
55
|
# @return [Symbol, SurgeAPI::Models::PhoneNumberPurchaseParams::Type, nil]
|
|
49
56
|
optional :type, enum: -> { SurgeAPI::PhoneNumberPurchaseParams::Type }
|
|
50
57
|
|
|
51
|
-
# @!method initialize(account_id:, area_code: nil, latitude: nil, longitude: nil, name: nil, type: nil, request_options: {})
|
|
58
|
+
# @!method initialize(account_id:, area_code: nil, latitude: nil, longitude: nil, name: nil, phone_number: nil, type: nil, request_options: {})
|
|
52
59
|
# Some parameter documentations has been truncated, see
|
|
53
60
|
# {SurgeAPI::Models::PhoneNumberPurchaseParams} for more details.
|
|
54
61
|
#
|
|
@@ -62,6 +69,8 @@ module SurgeAPI
|
|
|
62
69
|
#
|
|
63
70
|
# @param name [String] A human-readable name for the phone number. If not provided, defaults to the for
|
|
64
71
|
#
|
|
72
|
+
# @param phone_number [String] The exact phone number to purchase in E.164 format. When provided, all other sea
|
|
73
|
+
#
|
|
65
74
|
# @param type [Symbol, SurgeAPI::Models::PhoneNumberPurchaseParams::Type] Whether the phone number is local or toll-free. Can be omitted if area_code or l
|
|
66
75
|
#
|
|
67
76
|
# @param request_options [SurgeAPI::RequestOptions, Hash{Symbol=>Object}]
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module SurgeAPI
|
|
4
|
+
module Models
|
|
5
|
+
# @see SurgeAPI::Resources::PhoneNumbers#retrieve
|
|
6
|
+
class PhoneNumberRetrieveParams < 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 retrieve.
|
|
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 retrieve.
|
|
18
|
+
#
|
|
19
|
+
# @param request_options [SurgeAPI::RequestOptions, Hash{Symbol=>Object}]
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
@@ -97,7 +97,25 @@ module SurgeAPI
|
|
|
97
97
|
# @return [Symbol, SurgeAPI::Models::RecordingCompletedWebhookEvent::Data::Call::Status]
|
|
98
98
|
required :status, enum: -> { SurgeAPI::RecordingCompletedWebhookEvent::Data::Call::Status }
|
|
99
99
|
|
|
100
|
-
# @!
|
|
100
|
+
# @!attribute from
|
|
101
|
+
# The E.164 phone number of the caller
|
|
102
|
+
#
|
|
103
|
+
# @return [String, nil]
|
|
104
|
+
optional :from, String, nil?: true
|
|
105
|
+
|
|
106
|
+
# @!attribute phone_number_id
|
|
107
|
+
# The Surge phone number ID (e.g. pn\_...)
|
|
108
|
+
#
|
|
109
|
+
# @return [String, nil]
|
|
110
|
+
optional :phone_number_id, String, nil?: true
|
|
111
|
+
|
|
112
|
+
# @!attribute to
|
|
113
|
+
# The E.164 phone number of the callee
|
|
114
|
+
#
|
|
115
|
+
# @return [String, nil]
|
|
116
|
+
optional :to, String, nil?: true
|
|
117
|
+
|
|
118
|
+
# @!method initialize(id:, contact:, duration:, initiated_at:, status:, from: nil, phone_number_id: nil, to: nil)
|
|
101
119
|
# The call that produced this recording
|
|
102
120
|
#
|
|
103
121
|
# @param id [String] The unique identifier for the call
|
|
@@ -109,6 +127,12 @@ module SurgeAPI
|
|
|
109
127
|
# @param initiated_at [Time] When the call was initiated
|
|
110
128
|
#
|
|
111
129
|
# @param status [Symbol, SurgeAPI::Models::RecordingCompletedWebhookEvent::Data::Call::Status] The status of the call
|
|
130
|
+
#
|
|
131
|
+
# @param from [String, nil] The E.164 phone number of the caller
|
|
132
|
+
#
|
|
133
|
+
# @param phone_number_id [String, nil] The Surge phone number ID (e.g. pn\_...)
|
|
134
|
+
#
|
|
135
|
+
# @param to [String, nil] The E.164 phone number of the callee
|
|
112
136
|
|
|
113
137
|
# The status of the call
|
|
114
138
|
#
|
|
@@ -105,7 +105,25 @@ module SurgeAPI
|
|
|
105
105
|
# @return [Symbol, SurgeAPI::Models::VoicemailReceivedWebhookEvent::Data::Call::Status]
|
|
106
106
|
required :status, enum: -> { SurgeAPI::VoicemailReceivedWebhookEvent::Data::Call::Status }
|
|
107
107
|
|
|
108
|
-
# @!
|
|
108
|
+
# @!attribute from
|
|
109
|
+
# The E.164 phone number of the caller
|
|
110
|
+
#
|
|
111
|
+
# @return [String, nil]
|
|
112
|
+
optional :from, String, nil?: true
|
|
113
|
+
|
|
114
|
+
# @!attribute phone_number_id
|
|
115
|
+
# The Surge phone number ID (e.g. pn\_...)
|
|
116
|
+
#
|
|
117
|
+
# @return [String, nil]
|
|
118
|
+
optional :phone_number_id, String, nil?: true
|
|
119
|
+
|
|
120
|
+
# @!attribute to
|
|
121
|
+
# The E.164 phone number of the callee
|
|
122
|
+
#
|
|
123
|
+
# @return [String, nil]
|
|
124
|
+
optional :to, String, nil?: true
|
|
125
|
+
|
|
126
|
+
# @!method initialize(id:, contact:, duration:, initiated_at:, status:, from: nil, phone_number_id: nil, to: nil)
|
|
109
127
|
# The call that resulted in this voicemail
|
|
110
128
|
#
|
|
111
129
|
# @param id [String] The unique identifier for the call
|
|
@@ -117,6 +135,12 @@ module SurgeAPI
|
|
|
117
135
|
# @param initiated_at [Time] When the call was initiated
|
|
118
136
|
#
|
|
119
137
|
# @param status [Symbol, SurgeAPI::Models::VoicemailReceivedWebhookEvent::Data::Call::Status] The status of the call
|
|
138
|
+
#
|
|
139
|
+
# @param from [String, nil] The E.164 phone number of the caller
|
|
140
|
+
#
|
|
141
|
+
# @param phone_number_id [String, nil] The Surge phone number ID (e.g. pn\_...)
|
|
142
|
+
#
|
|
143
|
+
# @param to [String, nil] The E.164 phone number of the callee
|
|
120
144
|
|
|
121
145
|
# The status of the call
|
|
122
146
|
#
|
data/lib/surge_api/models.rb
CHANGED
|
@@ -125,12 +125,16 @@ module SurgeAPI
|
|
|
125
125
|
|
|
126
126
|
PhoneNumberAttachedToCampaignWebhookEvent = SurgeAPI::Models::PhoneNumberAttachedToCampaignWebhookEvent
|
|
127
127
|
|
|
128
|
+
PhoneNumberListAvailableNumbersParams = SurgeAPI::Models::PhoneNumberListAvailableNumbersParams
|
|
129
|
+
|
|
128
130
|
PhoneNumberListParams = SurgeAPI::Models::PhoneNumberListParams
|
|
129
131
|
|
|
130
132
|
PhoneNumberPurchaseParams = SurgeAPI::Models::PhoneNumberPurchaseParams
|
|
131
133
|
|
|
132
134
|
PhoneNumberReleaseParams = SurgeAPI::Models::PhoneNumberReleaseParams
|
|
133
135
|
|
|
136
|
+
PhoneNumberRetrieveParams = SurgeAPI::Models::PhoneNumberRetrieveParams
|
|
137
|
+
|
|
134
138
|
PhoneNumberUpdateParams = SurgeAPI::Models::PhoneNumberUpdateParams
|
|
135
139
|
|
|
136
140
|
RecordingCompletedWebhookEvent = SurgeAPI::Models::RecordingCompletedWebhookEvent
|