pingram 1.0.12 → 1.0.14
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/Gemfile.lock +1 -1
- data/lib/pingram/api/numbers_api.rb +120 -4
- data/lib/pingram/api/sms_api.rb +2 -2
- data/lib/pingram/api_client.rb +1 -1
- data/lib/pingram/models/a2p_registration.rb +1 -1
- data/lib/pingram/models/list_phone_numbers_response.rb +0 -1
- data/lib/pingram/models/list_phone_numbers_response_numbers_inner.rb +196 -5
- data/lib/pingram/models/list_released_phone_numbers_response.rb +166 -0
- data/lib/pingram/models/order_phone_number_request.rb +0 -1
- data/lib/pingram/models/order_phone_number_response.rb +0 -1
- data/lib/pingram/models/organization_usage.rb +29 -2
- data/lib/pingram/models/organization_usage_history_items_inner.rb +29 -2
- data/lib/pingram/models/release_phone_number_response.rb +200 -0
- data/lib/pingram/models/search_available_phone_numbers_response.rb +0 -1
- data/lib/pingram/models/search_available_phone_numbers_response_numbers_inner.rb +31 -4
- data/lib/pingram/models/send_sms_request.rb +19 -33
- data/lib/pingram/version.rb +1 -1
- data/lib/pingram.rb +2 -0
- metadata +4 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 8b0da74b04be34652ce4772d960f635a00fd4de9282f579a2b4f2b5fff340e22
|
|
4
|
+
data.tar.gz: a830cb772656fc43455340ef6f7bc447c3a4ad8ecb096ffd6ceded61aa2e8dce
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 91ee7f634122374ab81a9cea5187eef7ca4ee3b207f9fc1b5f1eb993cf16049bd39a8b429d932be7e99a5bc4ffac9247324987e8bb03702016981c9591aaf24d
|
|
7
|
+
data.tar.gz: a0cbcb303e77a518f768df2fa83f4f96c81a423db53e5ac41bc0b1221911be75f3b0b31f04a6a48e28d4c32f40ed33e2609c693f9e230d7342fbc3f4d8e0a3e5
|
data/Gemfile.lock
CHANGED
|
@@ -19,7 +19,7 @@ module Pingram
|
|
|
19
19
|
def initialize(api_client = ApiClient.default)
|
|
20
20
|
@api_client = api_client
|
|
21
21
|
end
|
|
22
|
-
# List
|
|
22
|
+
# List active phone numbers registered for the account
|
|
23
23
|
# @param [Hash] opts the optional parameters
|
|
24
24
|
# @return [ListPhoneNumbersResponse]
|
|
25
25
|
def numbers_list(opts = {})
|
|
@@ -27,7 +27,7 @@ module Pingram
|
|
|
27
27
|
data
|
|
28
28
|
end
|
|
29
29
|
|
|
30
|
-
# List
|
|
30
|
+
# List active phone numbers registered for the account
|
|
31
31
|
# @param [Hash] opts the optional parameters
|
|
32
32
|
# @return [Array<(ListPhoneNumbersResponse, Integer, Hash)>] ListPhoneNumbersResponse data, response status code and response headers
|
|
33
33
|
def numbers_list_with_http_info(opts = {})
|
|
@@ -74,7 +74,62 @@ module Pingram
|
|
|
74
74
|
return data, status_code, headers
|
|
75
75
|
end
|
|
76
76
|
|
|
77
|
-
#
|
|
77
|
+
# List released phone numbers. Released numbers may be purchased again with 2 weeks of being released. Released numbers may be removed from released list after 2 weeks.
|
|
78
|
+
# @param [Hash] opts the optional parameters
|
|
79
|
+
# @return [ListReleasedPhoneNumbersResponse]
|
|
80
|
+
def numbers_list_released(opts = {})
|
|
81
|
+
data, _status_code, _headers = numbers_list_released_with_http_info(opts)
|
|
82
|
+
data
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
# List released phone numbers. Released numbers may be purchased again with 2 weeks of being released. Released numbers may be removed from released list after 2 weeks.
|
|
86
|
+
# @param [Hash] opts the optional parameters
|
|
87
|
+
# @return [Array<(ListReleasedPhoneNumbersResponse, Integer, Hash)>] ListReleasedPhoneNumbersResponse data, response status code and response headers
|
|
88
|
+
def numbers_list_released_with_http_info(opts = {})
|
|
89
|
+
if @api_client.config.debugging
|
|
90
|
+
@api_client.config.logger.debug 'Calling API: NumbersApi.numbers_list_released ...'
|
|
91
|
+
end
|
|
92
|
+
# resource path
|
|
93
|
+
local_var_path = '/numbers/released'
|
|
94
|
+
|
|
95
|
+
# query parameters
|
|
96
|
+
query_params = opts[:query_params] || {}
|
|
97
|
+
|
|
98
|
+
# header parameters
|
|
99
|
+
header_params = opts[:header_params] || {}
|
|
100
|
+
# HTTP header 'Accept' (if needed)
|
|
101
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
102
|
+
|
|
103
|
+
# form parameters
|
|
104
|
+
form_params = opts[:form_params] || {}
|
|
105
|
+
|
|
106
|
+
# http body (model)
|
|
107
|
+
post_body = opts[:debug_body]
|
|
108
|
+
|
|
109
|
+
# return_type
|
|
110
|
+
return_type = opts[:debug_return_type] || 'ListReleasedPhoneNumbersResponse'
|
|
111
|
+
|
|
112
|
+
# auth_names (apiKey last so Bearer wins when multiple schemes set Authorization)
|
|
113
|
+
auth_names = opts[:debug_auth_names] || ['endUserHashed', 'endUser', 'clientCredentials', 'apiKey']
|
|
114
|
+
|
|
115
|
+
new_options = opts.merge(
|
|
116
|
+
:operation => :"NumbersApi.numbers_list_released",
|
|
117
|
+
:header_params => header_params,
|
|
118
|
+
:query_params => query_params,
|
|
119
|
+
:form_params => form_params,
|
|
120
|
+
:body => post_body,
|
|
121
|
+
:auth_names => auth_names,
|
|
122
|
+
:return_type => return_type
|
|
123
|
+
)
|
|
124
|
+
|
|
125
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
126
|
+
if @api_client.config.debugging
|
|
127
|
+
@api_client.config.logger.debug "API called: NumbersApi#numbers_list_released\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
128
|
+
end
|
|
129
|
+
return data, status_code, headers
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
# Purchase a phone number for the authenticated account, or reactivate a released number owned by the account (preserves original createdAt).
|
|
78
133
|
# @param order_phone_number_request [OrderPhoneNumberRequest]
|
|
79
134
|
# @param [Hash] opts the optional parameters
|
|
80
135
|
# @return [OrderPhoneNumberResponse]
|
|
@@ -83,7 +138,7 @@ module Pingram
|
|
|
83
138
|
data
|
|
84
139
|
end
|
|
85
140
|
|
|
86
|
-
# Purchase a phone number for the authenticated account
|
|
141
|
+
# Purchase a phone number for the authenticated account, or reactivate a released number owned by the account (preserves original createdAt).
|
|
87
142
|
# @param order_phone_number_request [OrderPhoneNumberRequest]
|
|
88
143
|
# @param [Hash] opts the optional parameters
|
|
89
144
|
# @return [Array<(OrderPhoneNumberResponse, Integer, Hash)>] OrderPhoneNumberResponse data, response status code and response headers
|
|
@@ -140,6 +195,67 @@ module Pingram
|
|
|
140
195
|
return data, status_code, headers
|
|
141
196
|
end
|
|
142
197
|
|
|
198
|
+
# Release a phone number from the account. No refund for the current billing month.
|
|
199
|
+
# @param phone_number [String] E.164 phone number to release
|
|
200
|
+
# @param [Hash] opts the optional parameters
|
|
201
|
+
# @return [ReleasePhoneNumberResponse]
|
|
202
|
+
def numbers_release_number(phone_number, opts = {})
|
|
203
|
+
data, _status_code, _headers = numbers_release_number_with_http_info(phone_number, opts)
|
|
204
|
+
data
|
|
205
|
+
end
|
|
206
|
+
|
|
207
|
+
# Release a phone number from the account. No refund for the current billing month.
|
|
208
|
+
# @param phone_number [String] E.164 phone number to release
|
|
209
|
+
# @param [Hash] opts the optional parameters
|
|
210
|
+
# @return [Array<(ReleasePhoneNumberResponse, Integer, Hash)>] ReleasePhoneNumberResponse data, response status code and response headers
|
|
211
|
+
def numbers_release_number_with_http_info(phone_number, opts = {})
|
|
212
|
+
if @api_client.config.debugging
|
|
213
|
+
@api_client.config.logger.debug 'Calling API: NumbersApi.numbers_release_number ...'
|
|
214
|
+
end
|
|
215
|
+
# verify the required parameter 'phone_number' is set
|
|
216
|
+
if @api_client.config.client_side_validation && phone_number.nil?
|
|
217
|
+
fail ArgumentError, "Missing the required parameter 'phone_number' when calling NumbersApi.numbers_release_number"
|
|
218
|
+
end
|
|
219
|
+
# resource path
|
|
220
|
+
local_var_path = '/numbers/{phoneNumber}'.sub('{' + 'phoneNumber' + '}', CGI.escape(phone_number.to_s))
|
|
221
|
+
|
|
222
|
+
# query parameters
|
|
223
|
+
query_params = opts[:query_params] || {}
|
|
224
|
+
|
|
225
|
+
# header parameters
|
|
226
|
+
header_params = opts[:header_params] || {}
|
|
227
|
+
# HTTP header 'Accept' (if needed)
|
|
228
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
229
|
+
|
|
230
|
+
# form parameters
|
|
231
|
+
form_params = opts[:form_params] || {}
|
|
232
|
+
|
|
233
|
+
# http body (model)
|
|
234
|
+
post_body = opts[:debug_body]
|
|
235
|
+
|
|
236
|
+
# return_type
|
|
237
|
+
return_type = opts[:debug_return_type] || 'ReleasePhoneNumberResponse'
|
|
238
|
+
|
|
239
|
+
# auth_names (apiKey last so Bearer wins when multiple schemes set Authorization)
|
|
240
|
+
auth_names = opts[:debug_auth_names] || ['endUserHashed', 'endUser', 'clientCredentials', 'apiKey']
|
|
241
|
+
|
|
242
|
+
new_options = opts.merge(
|
|
243
|
+
:operation => :"NumbersApi.numbers_release_number",
|
|
244
|
+
:header_params => header_params,
|
|
245
|
+
:query_params => query_params,
|
|
246
|
+
:form_params => form_params,
|
|
247
|
+
:body => post_body,
|
|
248
|
+
:auth_names => auth_names,
|
|
249
|
+
:return_type => return_type
|
|
250
|
+
)
|
|
251
|
+
|
|
252
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
|
253
|
+
if @api_client.config.debugging
|
|
254
|
+
@api_client.config.logger.debug "API called: NumbersApi#numbers_release_number\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
255
|
+
end
|
|
256
|
+
return data, status_code, headers
|
|
257
|
+
end
|
|
258
|
+
|
|
143
259
|
# Search for available phone numbers
|
|
144
260
|
# @param country_code [String] ISO 3166-1 alpha-2 country code (e.g., US, CA)
|
|
145
261
|
# @param [Hash] opts the optional parameters
|
data/lib/pingram/api/sms_api.rb
CHANGED
|
@@ -19,7 +19,7 @@ module Pingram
|
|
|
19
19
|
def initialize(api_client = ApiClient.default)
|
|
20
20
|
@api_client = api_client
|
|
21
21
|
end
|
|
22
|
-
# Send an SMS notification directly without templates
|
|
22
|
+
# Send an SMS or MMS notification directly without templates
|
|
23
23
|
# @param send_sms_request [SendSmsRequest]
|
|
24
24
|
# @param [Hash] opts the optional parameters
|
|
25
25
|
# @return [SendSmsResponse]
|
|
@@ -28,7 +28,7 @@ module Pingram
|
|
|
28
28
|
data
|
|
29
29
|
end
|
|
30
30
|
|
|
31
|
-
# Send an SMS notification directly without templates
|
|
31
|
+
# Send an SMS or MMS notification directly without templates
|
|
32
32
|
# @param send_sms_request [SendSmsRequest]
|
|
33
33
|
# @param [Hash] opts the optional parameters
|
|
34
34
|
# @return [Array<(SendSmsResponse, Integer, Hash)>] SendSmsResponse data, response status code and response headers
|
data/lib/pingram/api_client.rb
CHANGED
|
@@ -32,7 +32,7 @@ module Pingram
|
|
|
32
32
|
# @option config [Configuration] Configuration for initializing the object, default to Configuration.default
|
|
33
33
|
def initialize(config = Configuration.default)
|
|
34
34
|
@config = config
|
|
35
|
-
@user_agent = "pingram-ruby/1.0.
|
|
35
|
+
@user_agent = "pingram-ruby/1.0.14"
|
|
36
36
|
@default_headers = {
|
|
37
37
|
'Content-Type' => 'application/json',
|
|
38
38
|
'User-Agent' => @user_agent
|
|
@@ -14,7 +14,7 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module Pingram
|
|
17
|
-
#
|
|
17
|
+
# Represents a phone number in the account
|
|
18
18
|
class ListPhoneNumbersResponseNumbersInner < ApiModelBase
|
|
19
19
|
# E.164
|
|
20
20
|
attr_accessor :phone_number
|
|
@@ -24,12 +24,62 @@ module Pingram
|
|
|
24
24
|
# ISO timestamp when the number was registered
|
|
25
25
|
attr_accessor :created_at
|
|
26
26
|
|
|
27
|
+
# ISO 3166-1 alpha-2 country code
|
|
28
|
+
attr_accessor :country_code
|
|
29
|
+
|
|
30
|
+
# e.g. local, toll_free
|
|
31
|
+
attr_accessor :number_type
|
|
32
|
+
|
|
33
|
+
# active or released
|
|
34
|
+
attr_accessor :billing_status
|
|
35
|
+
|
|
36
|
+
# YYYY-MM-DD next monthly rent charge
|
|
37
|
+
attr_accessor :next_billing_date
|
|
38
|
+
|
|
39
|
+
# Monthly cost in USD
|
|
40
|
+
attr_accessor :monthly_price
|
|
41
|
+
|
|
42
|
+
# US 10DLC readiness derived from stored campaign assignment
|
|
43
|
+
attr_accessor :a2p_status
|
|
44
|
+
|
|
45
|
+
# ISO timestamp when the number was released (released numbers only)
|
|
46
|
+
attr_accessor :released_at
|
|
47
|
+
|
|
48
|
+
class EnumAttributeValidator
|
|
49
|
+
attr_reader :datatype
|
|
50
|
+
attr_reader :allowable_values
|
|
51
|
+
|
|
52
|
+
def initialize(datatype, allowable_values)
|
|
53
|
+
@allowable_values = allowable_values.map do |value|
|
|
54
|
+
case datatype.to_s
|
|
55
|
+
when /Integer/i
|
|
56
|
+
value.to_i
|
|
57
|
+
when /Float/i
|
|
58
|
+
value.to_f
|
|
59
|
+
else
|
|
60
|
+
value
|
|
61
|
+
end
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
def valid?(value)
|
|
66
|
+
!value || allowable_values.include?(value)
|
|
67
|
+
end
|
|
68
|
+
end
|
|
69
|
+
|
|
27
70
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
28
71
|
def self.attribute_map
|
|
29
72
|
{
|
|
30
73
|
:'phone_number' => :'phoneNumber',
|
|
31
74
|
:'label' => :'label',
|
|
32
|
-
:'created_at' => :'createdAt'
|
|
75
|
+
:'created_at' => :'createdAt',
|
|
76
|
+
:'country_code' => :'countryCode',
|
|
77
|
+
:'number_type' => :'numberType',
|
|
78
|
+
:'billing_status' => :'billingStatus',
|
|
79
|
+
:'next_billing_date' => :'nextBillingDate',
|
|
80
|
+
:'monthly_price' => :'monthlyPrice',
|
|
81
|
+
:'a2p_status' => :'a2pStatus',
|
|
82
|
+
:'released_at' => :'releasedAt'
|
|
33
83
|
}
|
|
34
84
|
end
|
|
35
85
|
|
|
@@ -48,7 +98,14 @@ module Pingram
|
|
|
48
98
|
{
|
|
49
99
|
:'phone_number' => :'String',
|
|
50
100
|
:'label' => :'String',
|
|
51
|
-
:'created_at' => :'String'
|
|
101
|
+
:'created_at' => :'String',
|
|
102
|
+
:'country_code' => :'String',
|
|
103
|
+
:'number_type' => :'String',
|
|
104
|
+
:'billing_status' => :'String',
|
|
105
|
+
:'next_billing_date' => :'String',
|
|
106
|
+
:'monthly_price' => :'Float',
|
|
107
|
+
:'a2p_status' => :'String',
|
|
108
|
+
:'released_at' => :'String'
|
|
52
109
|
}
|
|
53
110
|
end
|
|
54
111
|
|
|
@@ -89,6 +146,44 @@ module Pingram
|
|
|
89
146
|
else
|
|
90
147
|
self.created_at = nil
|
|
91
148
|
end
|
|
149
|
+
|
|
150
|
+
if attributes.key?(:'country_code')
|
|
151
|
+
self.country_code = attributes[:'country_code']
|
|
152
|
+
else
|
|
153
|
+
self.country_code = nil
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
if attributes.key?(:'number_type')
|
|
157
|
+
self.number_type = attributes[:'number_type']
|
|
158
|
+
else
|
|
159
|
+
self.number_type = nil
|
|
160
|
+
end
|
|
161
|
+
|
|
162
|
+
if attributes.key?(:'billing_status')
|
|
163
|
+
self.billing_status = attributes[:'billing_status']
|
|
164
|
+
else
|
|
165
|
+
self.billing_status = nil
|
|
166
|
+
end
|
|
167
|
+
|
|
168
|
+
if attributes.key?(:'next_billing_date')
|
|
169
|
+
self.next_billing_date = attributes[:'next_billing_date']
|
|
170
|
+
else
|
|
171
|
+
self.next_billing_date = nil
|
|
172
|
+
end
|
|
173
|
+
|
|
174
|
+
if attributes.key?(:'monthly_price')
|
|
175
|
+
self.monthly_price = attributes[:'monthly_price']
|
|
176
|
+
else
|
|
177
|
+
self.monthly_price = nil
|
|
178
|
+
end
|
|
179
|
+
|
|
180
|
+
if attributes.key?(:'a2p_status')
|
|
181
|
+
self.a2p_status = attributes[:'a2p_status']
|
|
182
|
+
end
|
|
183
|
+
|
|
184
|
+
if attributes.key?(:'released_at')
|
|
185
|
+
self.released_at = attributes[:'released_at']
|
|
186
|
+
end
|
|
92
187
|
end
|
|
93
188
|
|
|
94
189
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
@@ -104,6 +199,26 @@ module Pingram
|
|
|
104
199
|
invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
|
|
105
200
|
end
|
|
106
201
|
|
|
202
|
+
if @country_code.nil?
|
|
203
|
+
invalid_properties.push('invalid value for "country_code", country_code cannot be nil.')
|
|
204
|
+
end
|
|
205
|
+
|
|
206
|
+
if @number_type.nil?
|
|
207
|
+
invalid_properties.push('invalid value for "number_type", number_type cannot be nil.')
|
|
208
|
+
end
|
|
209
|
+
|
|
210
|
+
if @billing_status.nil?
|
|
211
|
+
invalid_properties.push('invalid value for "billing_status", billing_status cannot be nil.')
|
|
212
|
+
end
|
|
213
|
+
|
|
214
|
+
if @next_billing_date.nil?
|
|
215
|
+
invalid_properties.push('invalid value for "next_billing_date", next_billing_date cannot be nil.')
|
|
216
|
+
end
|
|
217
|
+
|
|
218
|
+
if @monthly_price.nil?
|
|
219
|
+
invalid_properties.push('invalid value for "monthly_price", monthly_price cannot be nil.')
|
|
220
|
+
end
|
|
221
|
+
|
|
107
222
|
invalid_properties
|
|
108
223
|
end
|
|
109
224
|
|
|
@@ -113,6 +228,15 @@ module Pingram
|
|
|
113
228
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
114
229
|
return false if @phone_number.nil?
|
|
115
230
|
return false if @created_at.nil?
|
|
231
|
+
return false if @country_code.nil?
|
|
232
|
+
return false if @number_type.nil?
|
|
233
|
+
return false if @billing_status.nil?
|
|
234
|
+
billing_status_validator = EnumAttributeValidator.new('String', ["active", "released"])
|
|
235
|
+
return false unless billing_status_validator.valid?(@billing_status)
|
|
236
|
+
return false if @next_billing_date.nil?
|
|
237
|
+
return false if @monthly_price.nil?
|
|
238
|
+
a2p_status_validator = EnumAttributeValidator.new('String', ["pending", "testing", "approved"])
|
|
239
|
+
return false unless a2p_status_validator.valid?(@a2p_status)
|
|
116
240
|
true
|
|
117
241
|
end
|
|
118
242
|
|
|
@@ -136,6 +260,66 @@ module Pingram
|
|
|
136
260
|
@created_at = created_at
|
|
137
261
|
end
|
|
138
262
|
|
|
263
|
+
# Custom attribute writer method with validation
|
|
264
|
+
# @param [Object] country_code Value to be assigned
|
|
265
|
+
def country_code=(country_code)
|
|
266
|
+
if country_code.nil?
|
|
267
|
+
fail ArgumentError, 'country_code cannot be nil'
|
|
268
|
+
end
|
|
269
|
+
|
|
270
|
+
@country_code = country_code
|
|
271
|
+
end
|
|
272
|
+
|
|
273
|
+
# Custom attribute writer method with validation
|
|
274
|
+
# @param [Object] number_type Value to be assigned
|
|
275
|
+
def number_type=(number_type)
|
|
276
|
+
if number_type.nil?
|
|
277
|
+
fail ArgumentError, 'number_type cannot be nil'
|
|
278
|
+
end
|
|
279
|
+
|
|
280
|
+
@number_type = number_type
|
|
281
|
+
end
|
|
282
|
+
|
|
283
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
284
|
+
# @param [Object] billing_status Object to be assigned
|
|
285
|
+
def billing_status=(billing_status)
|
|
286
|
+
validator = EnumAttributeValidator.new('String', ["active", "released"])
|
|
287
|
+
unless validator.valid?(billing_status)
|
|
288
|
+
fail ArgumentError, "invalid value for \"billing_status\", must be one of #{validator.allowable_values}."
|
|
289
|
+
end
|
|
290
|
+
@billing_status = billing_status
|
|
291
|
+
end
|
|
292
|
+
|
|
293
|
+
# Custom attribute writer method with validation
|
|
294
|
+
# @param [Object] next_billing_date Value to be assigned
|
|
295
|
+
def next_billing_date=(next_billing_date)
|
|
296
|
+
if next_billing_date.nil?
|
|
297
|
+
fail ArgumentError, 'next_billing_date cannot be nil'
|
|
298
|
+
end
|
|
299
|
+
|
|
300
|
+
@next_billing_date = next_billing_date
|
|
301
|
+
end
|
|
302
|
+
|
|
303
|
+
# Custom attribute writer method with validation
|
|
304
|
+
# @param [Object] monthly_price Value to be assigned
|
|
305
|
+
def monthly_price=(monthly_price)
|
|
306
|
+
if monthly_price.nil?
|
|
307
|
+
fail ArgumentError, 'monthly_price cannot be nil'
|
|
308
|
+
end
|
|
309
|
+
|
|
310
|
+
@monthly_price = monthly_price
|
|
311
|
+
end
|
|
312
|
+
|
|
313
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
314
|
+
# @param [Object] a2p_status Object to be assigned
|
|
315
|
+
def a2p_status=(a2p_status)
|
|
316
|
+
validator = EnumAttributeValidator.new('String', ["pending", "testing", "approved"])
|
|
317
|
+
unless validator.valid?(a2p_status)
|
|
318
|
+
fail ArgumentError, "invalid value for \"a2p_status\", must be one of #{validator.allowable_values}."
|
|
319
|
+
end
|
|
320
|
+
@a2p_status = a2p_status
|
|
321
|
+
end
|
|
322
|
+
|
|
139
323
|
# Checks equality by comparing each attribute.
|
|
140
324
|
# @param [Object] Object to be compared
|
|
141
325
|
def ==(o)
|
|
@@ -143,7 +327,14 @@ module Pingram
|
|
|
143
327
|
self.class == o.class &&
|
|
144
328
|
phone_number == o.phone_number &&
|
|
145
329
|
label == o.label &&
|
|
146
|
-
created_at == o.created_at
|
|
330
|
+
created_at == o.created_at &&
|
|
331
|
+
country_code == o.country_code &&
|
|
332
|
+
number_type == o.number_type &&
|
|
333
|
+
billing_status == o.billing_status &&
|
|
334
|
+
next_billing_date == o.next_billing_date &&
|
|
335
|
+
monthly_price == o.monthly_price &&
|
|
336
|
+
a2p_status == o.a2p_status &&
|
|
337
|
+
released_at == o.released_at
|
|
147
338
|
end
|
|
148
339
|
|
|
149
340
|
# @see the `==` method
|
|
@@ -155,7 +346,7 @@ module Pingram
|
|
|
155
346
|
# Calculates hash code according to all attributes.
|
|
156
347
|
# @return [Integer] Hash code
|
|
157
348
|
def hash
|
|
158
|
-
[phone_number, label, created_at].hash
|
|
349
|
+
[phone_number, label, created_at, country_code, number_type, billing_status, next_billing_date, monthly_price, a2p_status, released_at].hash
|
|
159
350
|
end
|
|
160
351
|
|
|
161
352
|
# Builds the object from hash
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Pingram
|
|
3
|
+
|
|
4
|
+
#Internal API for notification delivery and management
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.19.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module Pingram
|
|
17
|
+
class ListReleasedPhoneNumbersResponse < ApiModelBase
|
|
18
|
+
attr_accessor :numbers
|
|
19
|
+
|
|
20
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
21
|
+
def self.attribute_map
|
|
22
|
+
{
|
|
23
|
+
:'numbers' => :'numbers'
|
|
24
|
+
}
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
# Returns attribute mapping this model knows about
|
|
28
|
+
def self.acceptable_attribute_map
|
|
29
|
+
attribute_map
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# Returns all the JSON keys this model knows about
|
|
33
|
+
def self.acceptable_attributes
|
|
34
|
+
acceptable_attribute_map.values
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
# Attribute type mapping.
|
|
38
|
+
def self.openapi_types
|
|
39
|
+
{
|
|
40
|
+
:'numbers' => :'Array<ListPhoneNumbersResponseNumbersInner>'
|
|
41
|
+
}
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
# List of attributes with nullable: true
|
|
45
|
+
def self.openapi_nullable
|
|
46
|
+
Set.new([
|
|
47
|
+
])
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# Initializes the object
|
|
51
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
52
|
+
def initialize(attributes = {})
|
|
53
|
+
if (!attributes.is_a?(Hash))
|
|
54
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Pingram::ListReleasedPhoneNumbersResponse` initialize method"
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
58
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
59
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
60
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
61
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Pingram::ListReleasedPhoneNumbersResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
62
|
+
end
|
|
63
|
+
h[k.to_sym] = v
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
if attributes.key?(:'numbers')
|
|
67
|
+
if (value = attributes[:'numbers']).is_a?(Array)
|
|
68
|
+
self.numbers = value
|
|
69
|
+
end
|
|
70
|
+
else
|
|
71
|
+
self.numbers = nil
|
|
72
|
+
end
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
76
|
+
# @return Array for valid properties with the reasons
|
|
77
|
+
def list_invalid_properties
|
|
78
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
79
|
+
invalid_properties = Array.new
|
|
80
|
+
if @numbers.nil?
|
|
81
|
+
invalid_properties.push('invalid value for "numbers", numbers cannot be nil.')
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
invalid_properties
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
# Check to see if the all the properties in the model are valid
|
|
88
|
+
# @return true if the model is valid
|
|
89
|
+
def valid?
|
|
90
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
91
|
+
return false if @numbers.nil?
|
|
92
|
+
true
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
# Custom attribute writer method with validation
|
|
96
|
+
# @param [Object] numbers Value to be assigned
|
|
97
|
+
def numbers=(numbers)
|
|
98
|
+
if numbers.nil?
|
|
99
|
+
fail ArgumentError, 'numbers cannot be nil'
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
@numbers = numbers
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
# Checks equality by comparing each attribute.
|
|
106
|
+
# @param [Object] Object to be compared
|
|
107
|
+
def ==(o)
|
|
108
|
+
return true if self.equal?(o)
|
|
109
|
+
self.class == o.class &&
|
|
110
|
+
numbers == o.numbers
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
# @see the `==` method
|
|
114
|
+
# @param [Object] Object to be compared
|
|
115
|
+
def eql?(o)
|
|
116
|
+
self == o
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
# Calculates hash code according to all attributes.
|
|
120
|
+
# @return [Integer] Hash code
|
|
121
|
+
def hash
|
|
122
|
+
[numbers].hash
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
# Builds the object from hash
|
|
126
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
127
|
+
# @return [Object] Returns the model itself
|
|
128
|
+
def self.build_from_hash(attributes)
|
|
129
|
+
return nil unless attributes.is_a?(Hash)
|
|
130
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
131
|
+
transformed_hash = {}
|
|
132
|
+
openapi_types.each_pair do |key, type|
|
|
133
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
134
|
+
transformed_hash["#{key}"] = nil
|
|
135
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
136
|
+
# check to ensure the input is an array given that the attribute
|
|
137
|
+
# is documented as an array but the input is not
|
|
138
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
139
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
140
|
+
end
|
|
141
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
142
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
143
|
+
end
|
|
144
|
+
end
|
|
145
|
+
new(transformed_hash)
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
# Returns the object in the form of hash
|
|
149
|
+
# @return [Hash] Returns the object in the form of hash
|
|
150
|
+
def to_hash
|
|
151
|
+
hash = {}
|
|
152
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
153
|
+
value = self.send(attr)
|
|
154
|
+
if value.nil?
|
|
155
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
156
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
hash[param] = _to_hash(value)
|
|
160
|
+
end
|
|
161
|
+
hash
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
end
|