surge_api 0.19.0 → 0.21.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 +20 -0
- data/README.md +7 -7
- data/lib/surge_api/models/campaign_resend_brand_verification_message_params.rb +22 -0
- data/lib/surge_api/models/campaign_resend_brand_verification_message_response.rb +31 -0
- 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 +7 -0
- data/lib/surge_api/resources/campaigns.rb +20 -0
- data/lib/surge_api/resources/phone_numbers.rb +66 -3
- data/lib/surge_api/version.rb +1 -1
- data/lib/surge_api.rb +5 -0
- data/rbi/surge_api/models/campaign_resend_brand_verification_message_params.rbi +43 -0
- data/rbi/surge_api/models/campaign_resend_brand_verification_message_response.rbi +77 -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 +8 -0
- data/rbi/surge_api/resources/campaigns.rbi +16 -0
- data/rbi/surge_api/resources/phone_numbers.rbi +59 -2
- data/sig/surge_api/models/campaign_resend_brand_verification_message_params.rbs +23 -0
- data/sig/surge_api/models/campaign_resend_brand_verification_message_response.rbs +30 -0
- 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 +6 -0
- data/sig/surge_api/resources/campaigns.rbs +5 -0
- data/sig/surge_api/resources/phone_numbers.rbs +16 -0
- metadata +17 -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
|
data/rbi/surge_api/models.rbi
CHANGED
|
@@ -39,6 +39,9 @@ module SurgeAPI
|
|
|
39
39
|
|
|
40
40
|
CampaignParams = SurgeAPI::Models::CampaignParams
|
|
41
41
|
|
|
42
|
+
CampaignResendBrandVerificationMessageParams =
|
|
43
|
+
SurgeAPI::Models::CampaignResendBrandVerificationMessageParams
|
|
44
|
+
|
|
42
45
|
CampaignRetrieveParams = SurgeAPI::Models::CampaignRetrieveParams
|
|
43
46
|
|
|
44
47
|
CampaignUpdateParams = SurgeAPI::Models::CampaignUpdateParams
|
|
@@ -89,12 +92,17 @@ module SurgeAPI
|
|
|
89
92
|
PhoneNumberAttachedToCampaignWebhookEvent =
|
|
90
93
|
SurgeAPI::Models::PhoneNumberAttachedToCampaignWebhookEvent
|
|
91
94
|
|
|
95
|
+
PhoneNumberListAvailableNumbersParams =
|
|
96
|
+
SurgeAPI::Models::PhoneNumberListAvailableNumbersParams
|
|
97
|
+
|
|
92
98
|
PhoneNumberListParams = SurgeAPI::Models::PhoneNumberListParams
|
|
93
99
|
|
|
94
100
|
PhoneNumberPurchaseParams = SurgeAPI::Models::PhoneNumberPurchaseParams
|
|
95
101
|
|
|
96
102
|
PhoneNumberReleaseParams = SurgeAPI::Models::PhoneNumberReleaseParams
|
|
97
103
|
|
|
104
|
+
PhoneNumberRetrieveParams = SurgeAPI::Models::PhoneNumberRetrieveParams
|
|
105
|
+
|
|
98
106
|
PhoneNumberUpdateParams = SurgeAPI::Models::PhoneNumberUpdateParams
|
|
99
107
|
|
|
100
108
|
RecordingCompletedWebhookEvent =
|
|
@@ -85,6 +85,22 @@ module SurgeAPI
|
|
|
85
85
|
)
|
|
86
86
|
end
|
|
87
87
|
|
|
88
|
+
# Enqueues an SMS OTP for a sole proprietor brand awaiting identity verification.
|
|
89
|
+
sig do
|
|
90
|
+
params(
|
|
91
|
+
account_id: String,
|
|
92
|
+
request_options: SurgeAPI::RequestOptions::OrHash
|
|
93
|
+
).returns(
|
|
94
|
+
SurgeAPI::Models::CampaignResendBrandVerificationMessageResponse
|
|
95
|
+
)
|
|
96
|
+
end
|
|
97
|
+
def resend_brand_verification_message(
|
|
98
|
+
# The account whose brand verification OTP should be sent.
|
|
99
|
+
account_id,
|
|
100
|
+
request_options: {}
|
|
101
|
+
)
|
|
102
|
+
end
|
|
103
|
+
|
|
88
104
|
# @api private
|
|
89
105
|
sig { params(client: SurgeAPI::Client).returns(T.attached_class) }
|
|
90
106
|
def self.new(client:)
|
|
@@ -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,
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
module SurgeAPI
|
|
2
|
+
module Models
|
|
3
|
+
type campaign_resend_brand_verification_message_params =
|
|
4
|
+
{ account_id: String } & SurgeAPI::Internal::Type::request_parameters
|
|
5
|
+
|
|
6
|
+
class CampaignResendBrandVerificationMessageParams < SurgeAPI::Internal::Type::BaseModel
|
|
7
|
+
extend SurgeAPI::Internal::Type::RequestParameters::Converter
|
|
8
|
+
include SurgeAPI::Internal::Type::RequestParameters
|
|
9
|
+
|
|
10
|
+
attr_accessor account_id: String
|
|
11
|
+
|
|
12
|
+
def initialize: (
|
|
13
|
+
account_id: String,
|
|
14
|
+
?request_options: SurgeAPI::request_opts
|
|
15
|
+
) -> void
|
|
16
|
+
|
|
17
|
+
def to_hash: -> {
|
|
18
|
+
account_id: String,
|
|
19
|
+
request_options: SurgeAPI::RequestOptions
|
|
20
|
+
}
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
module SurgeAPI
|
|
2
|
+
module Models
|
|
3
|
+
type campaign_resend_brand_verification_message_response =
|
|
4
|
+
{
|
|
5
|
+
status: SurgeAPI::Models::CampaignResendBrandVerificationMessageResponse::status
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
class CampaignResendBrandVerificationMessageResponse < SurgeAPI::Internal::Type::BaseModel
|
|
9
|
+
attr_accessor status: SurgeAPI::Models::CampaignResendBrandVerificationMessageResponse::status
|
|
10
|
+
|
|
11
|
+
def initialize: (
|
|
12
|
+
status: SurgeAPI::Models::CampaignResendBrandVerificationMessageResponse::status
|
|
13
|
+
) -> void
|
|
14
|
+
|
|
15
|
+
def to_hash: -> {
|
|
16
|
+
status: SurgeAPI::Models::CampaignResendBrandVerificationMessageResponse::status
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
type status = :enqueued
|
|
20
|
+
|
|
21
|
+
module Status
|
|
22
|
+
extend SurgeAPI::Internal::Type::Enum
|
|
23
|
+
|
|
24
|
+
ENQUEUED: :enqueued
|
|
25
|
+
|
|
26
|
+
def self?.values: -> ::Array[SurgeAPI::Models::CampaignResendBrandVerificationMessageResponse::status]
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
@@ -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
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
module SurgeAPI
|
|
2
|
+
module Models
|
|
3
|
+
type phone_number_list_available_numbers_params =
|
|
4
|
+
{
|
|
5
|
+
account_id: String,
|
|
6
|
+
type: SurgeAPI::Models::PhoneNumberListAvailableNumbersParams::type_,
|
|
7
|
+
after: String,
|
|
8
|
+
area_code: String,
|
|
9
|
+
before: String,
|
|
10
|
+
country: SurgeAPI::Models::PhoneNumberListAvailableNumbersParams::country
|
|
11
|
+
}
|
|
12
|
+
& SurgeAPI::Internal::Type::request_parameters
|
|
13
|
+
|
|
14
|
+
class PhoneNumberListAvailableNumbersParams < SurgeAPI::Internal::Type::BaseModel
|
|
15
|
+
extend SurgeAPI::Internal::Type::RequestParameters::Converter
|
|
16
|
+
include SurgeAPI::Internal::Type::RequestParameters
|
|
17
|
+
|
|
18
|
+
attr_accessor account_id: String
|
|
19
|
+
|
|
20
|
+
attr_accessor type: SurgeAPI::Models::PhoneNumberListAvailableNumbersParams::type_
|
|
21
|
+
|
|
22
|
+
attr_reader after: String?
|
|
23
|
+
|
|
24
|
+
def after=: (String) -> String
|
|
25
|
+
|
|
26
|
+
attr_reader area_code: String?
|
|
27
|
+
|
|
28
|
+
def area_code=: (String) -> String
|
|
29
|
+
|
|
30
|
+
attr_reader before: String?
|
|
31
|
+
|
|
32
|
+
def before=: (String) -> String
|
|
33
|
+
|
|
34
|
+
attr_reader country: SurgeAPI::Models::PhoneNumberListAvailableNumbersParams::country?
|
|
35
|
+
|
|
36
|
+
def country=: (
|
|
37
|
+
SurgeAPI::Models::PhoneNumberListAvailableNumbersParams::country
|
|
38
|
+
) -> SurgeAPI::Models::PhoneNumberListAvailableNumbersParams::country
|
|
39
|
+
|
|
40
|
+
def initialize: (
|
|
41
|
+
account_id: String,
|
|
42
|
+
type: SurgeAPI::Models::PhoneNumberListAvailableNumbersParams::type_,
|
|
43
|
+
?after: String,
|
|
44
|
+
?area_code: String,
|
|
45
|
+
?before: String,
|
|
46
|
+
?country: SurgeAPI::Models::PhoneNumberListAvailableNumbersParams::country,
|
|
47
|
+
?request_options: SurgeAPI::request_opts
|
|
48
|
+
) -> void
|
|
49
|
+
|
|
50
|
+
def to_hash: -> {
|
|
51
|
+
account_id: String,
|
|
52
|
+
type: SurgeAPI::Models::PhoneNumberListAvailableNumbersParams::type_,
|
|
53
|
+
after: String,
|
|
54
|
+
area_code: String,
|
|
55
|
+
before: String,
|
|
56
|
+
country: SurgeAPI::Models::PhoneNumberListAvailableNumbersParams::country,
|
|
57
|
+
request_options: SurgeAPI::RequestOptions
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
type type_ = :local | :toll_free
|
|
61
|
+
|
|
62
|
+
module Type
|
|
63
|
+
extend SurgeAPI::Internal::Type::Enum
|
|
64
|
+
|
|
65
|
+
LOCAL: :local
|
|
66
|
+
TOLL_FREE: :toll_free
|
|
67
|
+
|
|
68
|
+
def self?.values: -> ::Array[SurgeAPI::Models::PhoneNumberListAvailableNumbersParams::type_]
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
type country = :US | :CA
|
|
72
|
+
|
|
73
|
+
module Country
|
|
74
|
+
extend SurgeAPI::Internal::Type::Enum
|
|
75
|
+
|
|
76
|
+
US: :US
|
|
77
|
+
CA: :CA
|
|
78
|
+
|
|
79
|
+
def self?.values: -> ::Array[SurgeAPI::Models::PhoneNumberListAvailableNumbersParams::country]
|
|
80
|
+
end
|
|
81
|
+
end
|
|
82
|
+
end
|
|
83
|
+
end
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
module SurgeAPI
|
|
2
|
+
module Models
|
|
3
|
+
type phone_number_list_available_numbers_response =
|
|
4
|
+
{
|
|
5
|
+
country: SurgeAPI::Models::PhoneNumberListAvailableNumbersResponse::country,
|
|
6
|
+
number: String,
|
|
7
|
+
type: SurgeAPI::Models::PhoneNumberListAvailableNumbersResponse::type_
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
class PhoneNumberListAvailableNumbersResponse < SurgeAPI::Internal::Type::BaseModel
|
|
11
|
+
attr_accessor country: SurgeAPI::Models::PhoneNumberListAvailableNumbersResponse::country
|
|
12
|
+
|
|
13
|
+
attr_accessor number: String
|
|
14
|
+
|
|
15
|
+
attr_accessor type: SurgeAPI::Models::PhoneNumberListAvailableNumbersResponse::type_
|
|
16
|
+
|
|
17
|
+
def initialize: (
|
|
18
|
+
country: SurgeAPI::Models::PhoneNumberListAvailableNumbersResponse::country,
|
|
19
|
+
number: String,
|
|
20
|
+
type: SurgeAPI::Models::PhoneNumberListAvailableNumbersResponse::type_
|
|
21
|
+
) -> void
|
|
22
|
+
|
|
23
|
+
def to_hash: -> {
|
|
24
|
+
country: SurgeAPI::Models::PhoneNumberListAvailableNumbersResponse::country,
|
|
25
|
+
number: String,
|
|
26
|
+
type: SurgeAPI::Models::PhoneNumberListAvailableNumbersResponse::type_
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
type country = :US | :CA
|
|
30
|
+
|
|
31
|
+
module Country
|
|
32
|
+
extend SurgeAPI::Internal::Type::Enum
|
|
33
|
+
|
|
34
|
+
US: :US
|
|
35
|
+
CA: :CA
|
|
36
|
+
|
|
37
|
+
def self?.values: -> ::Array[SurgeAPI::Models::PhoneNumberListAvailableNumbersResponse::country]
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
type type_ = :local | :toll_free
|
|
41
|
+
|
|
42
|
+
module Type
|
|
43
|
+
extend SurgeAPI::Internal::Type::Enum
|
|
44
|
+
|
|
45
|
+
LOCAL: :local
|
|
46
|
+
TOLL_FREE: :toll_free
|
|
47
|
+
|
|
48
|
+
def self?.values: -> ::Array[SurgeAPI::Models::PhoneNumberListAvailableNumbersResponse::type_]
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
end
|