pingram 1.0.11 → 1.0.13
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/organization_api.rb +55 -0
- data/lib/pingram/api_client.rb +1 -1
- data/lib/pingram/models/a2p_registration.rb +1 -1
- data/lib/pingram/models/create_organization_response.rb +216 -0
- 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 +5 -14
- data/lib/pingram/version.rb +1 -1
- data/lib/pingram.rb +3 -0
- metadata +5 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: cc0f817becd9705b1ebb50e8fcd710b93b8d3be965fff1a52d84f020679ad67e
|
|
4
|
+
data.tar.gz: 2a752eb8e38f74db65cdab431ca94994329777bfbafec3834a40aafdc8388336
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 66ae5af2606968823cf5520930996b68c7eebf151ff988f863a7c524b0adea59787d077e270a1157f1e6efedcbe31e231b8eceffada53c8a17df9c44297d52a2
|
|
7
|
+
data.tar.gz: 9d0156592f907eb044f86002f987e3196e4bd89a161608cf765d9f66f316b42a39fa52bcee8d22b9ee176b0d4419986adbcfa9b0d4b297aeffd8234da1ae664e
|
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
|
|
@@ -19,6 +19,61 @@ module Pingram
|
|
|
19
19
|
def initialize(api_client = ApiClient.default)
|
|
20
20
|
@api_client = api_client
|
|
21
21
|
end
|
|
22
|
+
# Create organization after SMS verification bypass
|
|
23
|
+
# @param [Hash] opts the optional parameters
|
|
24
|
+
# @return [CreateOrganizationResponse]
|
|
25
|
+
def organization_create(opts = {})
|
|
26
|
+
data, _status_code, _headers = organization_create_with_http_info(opts)
|
|
27
|
+
data
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
# Create organization after SMS verification bypass
|
|
31
|
+
# @param [Hash] opts the optional parameters
|
|
32
|
+
# @return [Array<(CreateOrganizationResponse, Integer, Hash)>] CreateOrganizationResponse data, response status code and response headers
|
|
33
|
+
def organization_create_with_http_info(opts = {})
|
|
34
|
+
if @api_client.config.debugging
|
|
35
|
+
@api_client.config.logger.debug 'Calling API: OrganizationApi.organization_create ...'
|
|
36
|
+
end
|
|
37
|
+
# resource path
|
|
38
|
+
local_var_path = '/organizations'
|
|
39
|
+
|
|
40
|
+
# query parameters
|
|
41
|
+
query_params = opts[:query_params] || {}
|
|
42
|
+
|
|
43
|
+
# header parameters
|
|
44
|
+
header_params = opts[:header_params] || {}
|
|
45
|
+
# HTTP header 'Accept' (if needed)
|
|
46
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
47
|
+
|
|
48
|
+
# form parameters
|
|
49
|
+
form_params = opts[:form_params] || {}
|
|
50
|
+
|
|
51
|
+
# http body (model)
|
|
52
|
+
post_body = opts[:debug_body]
|
|
53
|
+
|
|
54
|
+
# return_type
|
|
55
|
+
return_type = opts[:debug_return_type] || 'CreateOrganizationResponse'
|
|
56
|
+
|
|
57
|
+
# auth_names (apiKey last so Bearer wins when multiple schemes set Authorization)
|
|
58
|
+
auth_names = opts[:debug_auth_names] || ['endUserHashed', 'endUser', 'clientCredentials', 'apiKey']
|
|
59
|
+
|
|
60
|
+
new_options = opts.merge(
|
|
61
|
+
:operation => :"OrganizationApi.organization_create",
|
|
62
|
+
:header_params => header_params,
|
|
63
|
+
:query_params => query_params,
|
|
64
|
+
:form_params => form_params,
|
|
65
|
+
:body => post_body,
|
|
66
|
+
:auth_names => auth_names,
|
|
67
|
+
:return_type => return_type
|
|
68
|
+
)
|
|
69
|
+
|
|
70
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
71
|
+
if @api_client.config.debugging
|
|
72
|
+
@api_client.config.logger.debug "API called: OrganizationApi#organization_create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
73
|
+
end
|
|
74
|
+
return data, status_code, headers
|
|
75
|
+
end
|
|
76
|
+
|
|
22
77
|
# Get usage for the authenticated account's organization (new billing model).
|
|
23
78
|
# @param [Hash] opts the optional parameters
|
|
24
79
|
# @return [OrganizationUsage]
|
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.13"
|
|
36
36
|
@default_headers = {
|
|
37
37
|
'Content-Type' => 'application/json',
|
|
38
38
|
'User-Agent' => @user_agent
|
|
@@ -0,0 +1,216 @@
|
|
|
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 CreateOrganizationResponse < ApiModelBase
|
|
18
|
+
attr_accessor :success
|
|
19
|
+
|
|
20
|
+
attr_accessor :account_id
|
|
21
|
+
|
|
22
|
+
attr_accessor :organization_id
|
|
23
|
+
|
|
24
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
25
|
+
def self.attribute_map
|
|
26
|
+
{
|
|
27
|
+
:'success' => :'success',
|
|
28
|
+
:'account_id' => :'accountId',
|
|
29
|
+
:'organization_id' => :'organizationId'
|
|
30
|
+
}
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# Returns attribute mapping this model knows about
|
|
34
|
+
def self.acceptable_attribute_map
|
|
35
|
+
attribute_map
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
# Returns all the JSON keys this model knows about
|
|
39
|
+
def self.acceptable_attributes
|
|
40
|
+
acceptable_attribute_map.values
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
# Attribute type mapping.
|
|
44
|
+
def self.openapi_types
|
|
45
|
+
{
|
|
46
|
+
:'success' => :'Boolean',
|
|
47
|
+
:'account_id' => :'String',
|
|
48
|
+
:'organization_id' => :'String'
|
|
49
|
+
}
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
# List of attributes with nullable: true
|
|
53
|
+
def self.openapi_nullable
|
|
54
|
+
Set.new([
|
|
55
|
+
])
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
# Initializes the object
|
|
59
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
60
|
+
def initialize(attributes = {})
|
|
61
|
+
if (!attributes.is_a?(Hash))
|
|
62
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Pingram::CreateOrganizationResponse` initialize method"
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
66
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
67
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
68
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
69
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Pingram::CreateOrganizationResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
70
|
+
end
|
|
71
|
+
h[k.to_sym] = v
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
if attributes.key?(:'success')
|
|
75
|
+
self.success = attributes[:'success']
|
|
76
|
+
else
|
|
77
|
+
self.success = nil
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
if attributes.key?(:'account_id')
|
|
81
|
+
self.account_id = attributes[:'account_id']
|
|
82
|
+
else
|
|
83
|
+
self.account_id = nil
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
if attributes.key?(:'organization_id')
|
|
87
|
+
self.organization_id = attributes[:'organization_id']
|
|
88
|
+
else
|
|
89
|
+
self.organization_id = nil
|
|
90
|
+
end
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
94
|
+
# @return Array for valid properties with the reasons
|
|
95
|
+
def list_invalid_properties
|
|
96
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
97
|
+
invalid_properties = Array.new
|
|
98
|
+
if @success.nil?
|
|
99
|
+
invalid_properties.push('invalid value for "success", success cannot be nil.')
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
if @account_id.nil?
|
|
103
|
+
invalid_properties.push('invalid value for "account_id", account_id cannot be nil.')
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
if @organization_id.nil?
|
|
107
|
+
invalid_properties.push('invalid value for "organization_id", organization_id cannot be nil.')
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
invalid_properties
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
# Check to see if the all the properties in the model are valid
|
|
114
|
+
# @return true if the model is valid
|
|
115
|
+
def valid?
|
|
116
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
117
|
+
return false if @success.nil?
|
|
118
|
+
return false if @account_id.nil?
|
|
119
|
+
return false if @organization_id.nil?
|
|
120
|
+
true
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
# Custom attribute writer method with validation
|
|
124
|
+
# @param [Object] success Value to be assigned
|
|
125
|
+
def success=(success)
|
|
126
|
+
if success.nil?
|
|
127
|
+
fail ArgumentError, 'success cannot be nil'
|
|
128
|
+
end
|
|
129
|
+
|
|
130
|
+
@success = success
|
|
131
|
+
end
|
|
132
|
+
|
|
133
|
+
# Custom attribute writer method with validation
|
|
134
|
+
# @param [Object] account_id Value to be assigned
|
|
135
|
+
def account_id=(account_id)
|
|
136
|
+
if account_id.nil?
|
|
137
|
+
fail ArgumentError, 'account_id cannot be nil'
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
@account_id = account_id
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
# Custom attribute writer method with validation
|
|
144
|
+
# @param [Object] organization_id Value to be assigned
|
|
145
|
+
def organization_id=(organization_id)
|
|
146
|
+
if organization_id.nil?
|
|
147
|
+
fail ArgumentError, 'organization_id cannot be nil'
|
|
148
|
+
end
|
|
149
|
+
|
|
150
|
+
@organization_id = organization_id
|
|
151
|
+
end
|
|
152
|
+
|
|
153
|
+
# Checks equality by comparing each attribute.
|
|
154
|
+
# @param [Object] Object to be compared
|
|
155
|
+
def ==(o)
|
|
156
|
+
return true if self.equal?(o)
|
|
157
|
+
self.class == o.class &&
|
|
158
|
+
success == o.success &&
|
|
159
|
+
account_id == o.account_id &&
|
|
160
|
+
organization_id == o.organization_id
|
|
161
|
+
end
|
|
162
|
+
|
|
163
|
+
# @see the `==` method
|
|
164
|
+
# @param [Object] Object to be compared
|
|
165
|
+
def eql?(o)
|
|
166
|
+
self == o
|
|
167
|
+
end
|
|
168
|
+
|
|
169
|
+
# Calculates hash code according to all attributes.
|
|
170
|
+
# @return [Integer] Hash code
|
|
171
|
+
def hash
|
|
172
|
+
[success, account_id, organization_id].hash
|
|
173
|
+
end
|
|
174
|
+
|
|
175
|
+
# Builds the object from hash
|
|
176
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
177
|
+
# @return [Object] Returns the model itself
|
|
178
|
+
def self.build_from_hash(attributes)
|
|
179
|
+
return nil unless attributes.is_a?(Hash)
|
|
180
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
181
|
+
transformed_hash = {}
|
|
182
|
+
openapi_types.each_pair do |key, type|
|
|
183
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
184
|
+
transformed_hash["#{key}"] = nil
|
|
185
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
186
|
+
# check to ensure the input is an array given that the attribute
|
|
187
|
+
# is documented as an array but the input is not
|
|
188
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
189
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
190
|
+
end
|
|
191
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
192
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
193
|
+
end
|
|
194
|
+
end
|
|
195
|
+
new(transformed_hash)
|
|
196
|
+
end
|
|
197
|
+
|
|
198
|
+
# Returns the object in the form of hash
|
|
199
|
+
# @return [Hash] Returns the object in the form of hash
|
|
200
|
+
def to_hash
|
|
201
|
+
hash = {}
|
|
202
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
203
|
+
value = self.send(attr)
|
|
204
|
+
if value.nil?
|
|
205
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
206
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
207
|
+
end
|
|
208
|
+
|
|
209
|
+
hash[param] = _to_hash(value)
|
|
210
|
+
end
|
|
211
|
+
hash
|
|
212
|
+
end
|
|
213
|
+
|
|
214
|
+
end
|
|
215
|
+
|
|
216
|
+
end
|