pingram 1.0.5 → 1.0.6
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 +2 -2
- data/lib/pingram/api/members_api.rb +10 -10
- data/lib/pingram/api/numbers_api.rb +214 -0
- data/lib/pingram/api_client.rb +1 -1
- data/lib/pingram/client_wrapper.rb +10 -0
- data/lib/pingram/models/account_get_response.rb +19 -53
- data/lib/pingram/models/auto_join_get_response.rb +16 -16
- data/lib/pingram/models/auto_join_post_response.rb +16 -16
- data/lib/pingram/models/billing_post_response_body.rb +1 -1
- data/lib/pingram/models/get_members_response_inner.rb +27 -1
- data/lib/pingram/models/list_phone_numbers_response.rb +167 -0
- data/lib/pingram/models/list_phone_numbers_response_numbers_inner.rb +202 -0
- data/lib/pingram/models/order_phone_number_request.rb +166 -0
- data/lib/pingram/models/order_phone_number_response.rb +217 -0
- data/lib/pingram/models/organization.rb +74 -222
- data/lib/pingram/models/phone_verify_confirm_request.rb +190 -0
- data/lib/pingram/models/phone_verify_confirm_response.rb +164 -0
- data/lib/pingram/models/phone_verify_start_request.rb +190 -0
- data/lib/pingram/models/phone_verify_start_response.rb +164 -0
- data/lib/pingram/models/search_available_phone_numbers_response.rb +167 -0
- data/lib/pingram/models/search_available_phone_numbers_response_numbers_inner.rb +206 -0
- data/lib/pingram/models/sender_post_body.rb +2 -0
- data/lib/pingram/models/sender_post_body_sms.rb +15 -5
- data/lib/pingram/version.rb +1 -1
- data/lib/pingram.rb +11 -0
- data/vendor/bundle/ruby/3.2.0/cache/parallel-1.28.0.gem +0 -0
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/byebug-13.0.0/gem_make.out +5 -5
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/date-3.5.1/gem_make.out +5 -5
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/io-console-0.8.2/gem_make.out +5 -5
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/io-console-0.8.2/mkmf.log +3 -3
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/jaro_winkler-1.5.6/gem_make.out +5 -5
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/psych-5.3.1/gem_make.out +5 -5
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/racc-1.8.1/gem_make.out +5 -5
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/stringio-3.2.0/gem_make.out +5 -5
- data/vendor/bundle/ruby/3.2.0/gems/parallel-1.28.0/lib/parallel/version.rb +4 -0
- data/vendor/bundle/ruby/3.2.0/gems/{parallel-1.27.0 → parallel-1.28.0}/lib/parallel.rb +11 -0
- data/vendor/bundle/ruby/3.2.0/specifications/{parallel-1.27.0.gemspec → parallel-1.28.0.gemspec} +4 -4
- metadata +18 -7
- data/vendor/bundle/ruby/3.2.0/cache/parallel-1.27.0.gem +0 -0
- data/vendor/bundle/ruby/3.2.0/gems/parallel-1.27.0/lib/parallel/version.rb +0 -4
- /data/vendor/bundle/ruby/3.2.0/gems/{parallel-1.27.0 → parallel-1.28.0}/MIT-LICENSE.txt +0 -0
|
@@ -15,14 +15,14 @@ require 'time'
|
|
|
15
15
|
|
|
16
16
|
module Pingram
|
|
17
17
|
class AutoJoinPostResponse < ApiModelBase
|
|
18
|
-
attr_accessor :
|
|
18
|
+
attr_accessor :organization_id
|
|
19
19
|
|
|
20
20
|
attr_accessor :domains
|
|
21
21
|
|
|
22
22
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
23
23
|
def self.attribute_map
|
|
24
24
|
{
|
|
25
|
-
:'
|
|
25
|
+
:'organization_id' => :'organizationId',
|
|
26
26
|
:'domains' => :'domains'
|
|
27
27
|
}
|
|
28
28
|
end
|
|
@@ -40,7 +40,7 @@ module Pingram
|
|
|
40
40
|
# Attribute type mapping.
|
|
41
41
|
def self.openapi_types
|
|
42
42
|
{
|
|
43
|
-
:'
|
|
43
|
+
:'organization_id' => :'String',
|
|
44
44
|
:'domains' => :'Array<String>'
|
|
45
45
|
}
|
|
46
46
|
end
|
|
@@ -67,10 +67,10 @@ module Pingram
|
|
|
67
67
|
h[k.to_sym] = v
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
-
if attributes.key?(:'
|
|
71
|
-
self.
|
|
70
|
+
if attributes.key?(:'organization_id')
|
|
71
|
+
self.organization_id = attributes[:'organization_id']
|
|
72
72
|
else
|
|
73
|
-
self.
|
|
73
|
+
self.organization_id = nil
|
|
74
74
|
end
|
|
75
75
|
|
|
76
76
|
if attributes.key?(:'domains')
|
|
@@ -87,8 +87,8 @@ module Pingram
|
|
|
87
87
|
def list_invalid_properties
|
|
88
88
|
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
89
89
|
invalid_properties = Array.new
|
|
90
|
-
if @
|
|
91
|
-
invalid_properties.push('invalid value for "
|
|
90
|
+
if @organization_id.nil?
|
|
91
|
+
invalid_properties.push('invalid value for "organization_id", organization_id cannot be nil.')
|
|
92
92
|
end
|
|
93
93
|
|
|
94
94
|
if @domains.nil?
|
|
@@ -102,19 +102,19 @@ module Pingram
|
|
|
102
102
|
# @return true if the model is valid
|
|
103
103
|
def valid?
|
|
104
104
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
105
|
-
return false if @
|
|
105
|
+
return false if @organization_id.nil?
|
|
106
106
|
return false if @domains.nil?
|
|
107
107
|
true
|
|
108
108
|
end
|
|
109
109
|
|
|
110
110
|
# Custom attribute writer method with validation
|
|
111
|
-
# @param [Object]
|
|
112
|
-
def
|
|
113
|
-
if
|
|
114
|
-
fail ArgumentError, '
|
|
111
|
+
# @param [Object] organization_id Value to be assigned
|
|
112
|
+
def organization_id=(organization_id)
|
|
113
|
+
if organization_id.nil?
|
|
114
|
+
fail ArgumentError, 'organization_id cannot be nil'
|
|
115
115
|
end
|
|
116
116
|
|
|
117
|
-
@
|
|
117
|
+
@organization_id = organization_id
|
|
118
118
|
end
|
|
119
119
|
|
|
120
120
|
# Custom attribute writer method with validation
|
|
@@ -132,7 +132,7 @@ module Pingram
|
|
|
132
132
|
def ==(o)
|
|
133
133
|
return true if self.equal?(o)
|
|
134
134
|
self.class == o.class &&
|
|
135
|
-
|
|
135
|
+
organization_id == o.organization_id &&
|
|
136
136
|
domains == o.domains
|
|
137
137
|
end
|
|
138
138
|
|
|
@@ -145,7 +145,7 @@ module Pingram
|
|
|
145
145
|
# Calculates hash code according to all attributes.
|
|
146
146
|
# @return [Integer] Hash code
|
|
147
147
|
def hash
|
|
148
|
-
[
|
|
148
|
+
[organization_id, domains].hash
|
|
149
149
|
end
|
|
150
150
|
|
|
151
151
|
# Builds the object from hash
|
|
@@ -15,6 +15,8 @@ require 'time'
|
|
|
15
15
|
|
|
16
16
|
module Pingram
|
|
17
17
|
class GetMembersResponseInner < ApiModelBase
|
|
18
|
+
attr_accessor :organization_id
|
|
19
|
+
|
|
18
20
|
attr_accessor :account_id
|
|
19
21
|
|
|
20
22
|
attr_accessor :user_id
|
|
@@ -28,6 +30,7 @@ module Pingram
|
|
|
28
30
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
29
31
|
def self.attribute_map
|
|
30
32
|
{
|
|
33
|
+
:'organization_id' => :'organizationId',
|
|
31
34
|
:'account_id' => :'accountId',
|
|
32
35
|
:'user_id' => :'userId',
|
|
33
36
|
:'created_at' => :'createdAt',
|
|
@@ -49,6 +52,7 @@ module Pingram
|
|
|
49
52
|
# Attribute type mapping.
|
|
50
53
|
def self.openapi_types
|
|
51
54
|
{
|
|
55
|
+
:'organization_id' => :'String',
|
|
52
56
|
:'account_id' => :'String',
|
|
53
57
|
:'user_id' => :'String',
|
|
54
58
|
:'created_at' => :'String',
|
|
@@ -79,6 +83,12 @@ module Pingram
|
|
|
79
83
|
h[k.to_sym] = v
|
|
80
84
|
}
|
|
81
85
|
|
|
86
|
+
if attributes.key?(:'organization_id')
|
|
87
|
+
self.organization_id = attributes[:'organization_id']
|
|
88
|
+
else
|
|
89
|
+
self.organization_id = nil
|
|
90
|
+
end
|
|
91
|
+
|
|
82
92
|
if attributes.key?(:'account_id')
|
|
83
93
|
self.account_id = attributes[:'account_id']
|
|
84
94
|
else
|
|
@@ -113,6 +123,10 @@ module Pingram
|
|
|
113
123
|
def list_invalid_properties
|
|
114
124
|
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
115
125
|
invalid_properties = Array.new
|
|
126
|
+
if @organization_id.nil?
|
|
127
|
+
invalid_properties.push('invalid value for "organization_id", organization_id cannot be nil.')
|
|
128
|
+
end
|
|
129
|
+
|
|
116
130
|
if @account_id.nil?
|
|
117
131
|
invalid_properties.push('invalid value for "account_id", account_id cannot be nil.')
|
|
118
132
|
end
|
|
@@ -132,12 +146,23 @@ module Pingram
|
|
|
132
146
|
# @return true if the model is valid
|
|
133
147
|
def valid?
|
|
134
148
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
149
|
+
return false if @organization_id.nil?
|
|
135
150
|
return false if @account_id.nil?
|
|
136
151
|
return false if @user_id.nil?
|
|
137
152
|
return false if @created_at.nil?
|
|
138
153
|
true
|
|
139
154
|
end
|
|
140
155
|
|
|
156
|
+
# Custom attribute writer method with validation
|
|
157
|
+
# @param [Object] organization_id Value to be assigned
|
|
158
|
+
def organization_id=(organization_id)
|
|
159
|
+
if organization_id.nil?
|
|
160
|
+
fail ArgumentError, 'organization_id cannot be nil'
|
|
161
|
+
end
|
|
162
|
+
|
|
163
|
+
@organization_id = organization_id
|
|
164
|
+
end
|
|
165
|
+
|
|
141
166
|
# Custom attribute writer method with validation
|
|
142
167
|
# @param [Object] account_id Value to be assigned
|
|
143
168
|
def account_id=(account_id)
|
|
@@ -173,6 +198,7 @@ module Pingram
|
|
|
173
198
|
def ==(o)
|
|
174
199
|
return true if self.equal?(o)
|
|
175
200
|
self.class == o.class &&
|
|
201
|
+
organization_id == o.organization_id &&
|
|
176
202
|
account_id == o.account_id &&
|
|
177
203
|
user_id == o.user_id &&
|
|
178
204
|
created_at == o.created_at &&
|
|
@@ -189,7 +215,7 @@ module Pingram
|
|
|
189
215
|
# Calculates hash code according to all attributes.
|
|
190
216
|
# @return [Integer] Hash code
|
|
191
217
|
def hash
|
|
192
|
-
[account_id, user_id, created_at, email, groups].hash
|
|
218
|
+
[organization_id, account_id, user_id, created_at, email, groups].hash
|
|
193
219
|
end
|
|
194
220
|
|
|
195
221
|
# Builds the object from hash
|
|
@@ -0,0 +1,167 @@
|
|
|
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
|
+
# Response for GET /numbers/list
|
|
18
|
+
class ListPhoneNumbersResponse < ApiModelBase
|
|
19
|
+
attr_accessor :numbers
|
|
20
|
+
|
|
21
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
22
|
+
def self.attribute_map
|
|
23
|
+
{
|
|
24
|
+
:'numbers' => :'numbers'
|
|
25
|
+
}
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# Returns attribute mapping this model knows about
|
|
29
|
+
def self.acceptable_attribute_map
|
|
30
|
+
attribute_map
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# Returns all the JSON keys this model knows about
|
|
34
|
+
def self.acceptable_attributes
|
|
35
|
+
acceptable_attribute_map.values
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
# Attribute type mapping.
|
|
39
|
+
def self.openapi_types
|
|
40
|
+
{
|
|
41
|
+
:'numbers' => :'Array<ListPhoneNumbersResponseNumbersInner>'
|
|
42
|
+
}
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
# List of attributes with nullable: true
|
|
46
|
+
def self.openapi_nullable
|
|
47
|
+
Set.new([
|
|
48
|
+
])
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
# Initializes the object
|
|
52
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
53
|
+
def initialize(attributes = {})
|
|
54
|
+
if (!attributes.is_a?(Hash))
|
|
55
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Pingram::ListPhoneNumbersResponse` initialize method"
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
59
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
60
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
61
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
62
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Pingram::ListPhoneNumbersResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
63
|
+
end
|
|
64
|
+
h[k.to_sym] = v
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
if attributes.key?(:'numbers')
|
|
68
|
+
if (value = attributes[:'numbers']).is_a?(Array)
|
|
69
|
+
self.numbers = value
|
|
70
|
+
end
|
|
71
|
+
else
|
|
72
|
+
self.numbers = nil
|
|
73
|
+
end
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
77
|
+
# @return Array for valid properties with the reasons
|
|
78
|
+
def list_invalid_properties
|
|
79
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
80
|
+
invalid_properties = Array.new
|
|
81
|
+
if @numbers.nil?
|
|
82
|
+
invalid_properties.push('invalid value for "numbers", numbers cannot be nil.')
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
invalid_properties
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
# Check to see if the all the properties in the model are valid
|
|
89
|
+
# @return true if the model is valid
|
|
90
|
+
def valid?
|
|
91
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
92
|
+
return false if @numbers.nil?
|
|
93
|
+
true
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
# Custom attribute writer method with validation
|
|
97
|
+
# @param [Object] numbers Value to be assigned
|
|
98
|
+
def numbers=(numbers)
|
|
99
|
+
if numbers.nil?
|
|
100
|
+
fail ArgumentError, 'numbers cannot be nil'
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
@numbers = numbers
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
# Checks equality by comparing each attribute.
|
|
107
|
+
# @param [Object] Object to be compared
|
|
108
|
+
def ==(o)
|
|
109
|
+
return true if self.equal?(o)
|
|
110
|
+
self.class == o.class &&
|
|
111
|
+
numbers == o.numbers
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
# @see the `==` method
|
|
115
|
+
# @param [Object] Object to be compared
|
|
116
|
+
def eql?(o)
|
|
117
|
+
self == o
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
# Calculates hash code according to all attributes.
|
|
121
|
+
# @return [Integer] Hash code
|
|
122
|
+
def hash
|
|
123
|
+
[numbers].hash
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
# Builds the object from hash
|
|
127
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
128
|
+
# @return [Object] Returns the model itself
|
|
129
|
+
def self.build_from_hash(attributes)
|
|
130
|
+
return nil unless attributes.is_a?(Hash)
|
|
131
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
132
|
+
transformed_hash = {}
|
|
133
|
+
openapi_types.each_pair do |key, type|
|
|
134
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
135
|
+
transformed_hash["#{key}"] = nil
|
|
136
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
137
|
+
# check to ensure the input is an array given that the attribute
|
|
138
|
+
# is documented as an array but the input is not
|
|
139
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
140
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
141
|
+
end
|
|
142
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
143
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
144
|
+
end
|
|
145
|
+
end
|
|
146
|
+
new(transformed_hash)
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
# Returns the object in the form of hash
|
|
150
|
+
# @return [Hash] Returns the object in the form of hash
|
|
151
|
+
def to_hash
|
|
152
|
+
hash = {}
|
|
153
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
154
|
+
value = self.send(attr)
|
|
155
|
+
if value.nil?
|
|
156
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
157
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
158
|
+
end
|
|
159
|
+
|
|
160
|
+
hash[param] = _to_hash(value)
|
|
161
|
+
end
|
|
162
|
+
hash
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
end
|
|
166
|
+
|
|
167
|
+
end
|
|
@@ -0,0 +1,202 @@
|
|
|
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
|
+
# One phone number owned by the account
|
|
18
|
+
class ListPhoneNumbersResponseNumbersInner < ApiModelBase
|
|
19
|
+
# E.164
|
|
20
|
+
attr_accessor :phone_number
|
|
21
|
+
|
|
22
|
+
attr_accessor :label
|
|
23
|
+
|
|
24
|
+
# ISO timestamp when the number was registered
|
|
25
|
+
attr_accessor :created_at
|
|
26
|
+
|
|
27
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
28
|
+
def self.attribute_map
|
|
29
|
+
{
|
|
30
|
+
:'phone_number' => :'phoneNumber',
|
|
31
|
+
:'label' => :'label',
|
|
32
|
+
:'created_at' => :'createdAt'
|
|
33
|
+
}
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# Returns attribute mapping this model knows about
|
|
37
|
+
def self.acceptable_attribute_map
|
|
38
|
+
attribute_map
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
# Returns all the JSON keys this model knows about
|
|
42
|
+
def self.acceptable_attributes
|
|
43
|
+
acceptable_attribute_map.values
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
# Attribute type mapping.
|
|
47
|
+
def self.openapi_types
|
|
48
|
+
{
|
|
49
|
+
:'phone_number' => :'String',
|
|
50
|
+
:'label' => :'String',
|
|
51
|
+
:'created_at' => :'String'
|
|
52
|
+
}
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
# List of attributes with nullable: true
|
|
56
|
+
def self.openapi_nullable
|
|
57
|
+
Set.new([
|
|
58
|
+
])
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
# Initializes the object
|
|
62
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
63
|
+
def initialize(attributes = {})
|
|
64
|
+
if (!attributes.is_a?(Hash))
|
|
65
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Pingram::ListPhoneNumbersResponseNumbersInner` initialize method"
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
69
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
70
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
71
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
72
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Pingram::ListPhoneNumbersResponseNumbersInner`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
73
|
+
end
|
|
74
|
+
h[k.to_sym] = v
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
if attributes.key?(:'phone_number')
|
|
78
|
+
self.phone_number = attributes[:'phone_number']
|
|
79
|
+
else
|
|
80
|
+
self.phone_number = nil
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
if attributes.key?(:'label')
|
|
84
|
+
self.label = attributes[:'label']
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
if attributes.key?(:'created_at')
|
|
88
|
+
self.created_at = attributes[:'created_at']
|
|
89
|
+
else
|
|
90
|
+
self.created_at = nil
|
|
91
|
+
end
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
95
|
+
# @return Array for valid properties with the reasons
|
|
96
|
+
def list_invalid_properties
|
|
97
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
98
|
+
invalid_properties = Array.new
|
|
99
|
+
if @phone_number.nil?
|
|
100
|
+
invalid_properties.push('invalid value for "phone_number", phone_number cannot be nil.')
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
if @created_at.nil?
|
|
104
|
+
invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
invalid_properties
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
# Check to see if the all the properties in the model are valid
|
|
111
|
+
# @return true if the model is valid
|
|
112
|
+
def valid?
|
|
113
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
114
|
+
return false if @phone_number.nil?
|
|
115
|
+
return false if @created_at.nil?
|
|
116
|
+
true
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
# Custom attribute writer method with validation
|
|
120
|
+
# @param [Object] phone_number Value to be assigned
|
|
121
|
+
def phone_number=(phone_number)
|
|
122
|
+
if phone_number.nil?
|
|
123
|
+
fail ArgumentError, 'phone_number cannot be nil'
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
@phone_number = phone_number
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
# Custom attribute writer method with validation
|
|
130
|
+
# @param [Object] created_at Value to be assigned
|
|
131
|
+
def created_at=(created_at)
|
|
132
|
+
if created_at.nil?
|
|
133
|
+
fail ArgumentError, 'created_at cannot be nil'
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
@created_at = created_at
|
|
137
|
+
end
|
|
138
|
+
|
|
139
|
+
# Checks equality by comparing each attribute.
|
|
140
|
+
# @param [Object] Object to be compared
|
|
141
|
+
def ==(o)
|
|
142
|
+
return true if self.equal?(o)
|
|
143
|
+
self.class == o.class &&
|
|
144
|
+
phone_number == o.phone_number &&
|
|
145
|
+
label == o.label &&
|
|
146
|
+
created_at == o.created_at
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
# @see the `==` method
|
|
150
|
+
# @param [Object] Object to be compared
|
|
151
|
+
def eql?(o)
|
|
152
|
+
self == o
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
# Calculates hash code according to all attributes.
|
|
156
|
+
# @return [Integer] Hash code
|
|
157
|
+
def hash
|
|
158
|
+
[phone_number, label, created_at].hash
|
|
159
|
+
end
|
|
160
|
+
|
|
161
|
+
# Builds the object from hash
|
|
162
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
163
|
+
# @return [Object] Returns the model itself
|
|
164
|
+
def self.build_from_hash(attributes)
|
|
165
|
+
return nil unless attributes.is_a?(Hash)
|
|
166
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
167
|
+
transformed_hash = {}
|
|
168
|
+
openapi_types.each_pair do |key, type|
|
|
169
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
170
|
+
transformed_hash["#{key}"] = nil
|
|
171
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
172
|
+
# check to ensure the input is an array given that the attribute
|
|
173
|
+
# is documented as an array but the input is not
|
|
174
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
175
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
176
|
+
end
|
|
177
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
178
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
179
|
+
end
|
|
180
|
+
end
|
|
181
|
+
new(transformed_hash)
|
|
182
|
+
end
|
|
183
|
+
|
|
184
|
+
# Returns the object in the form of hash
|
|
185
|
+
# @return [Hash] Returns the object in the form of hash
|
|
186
|
+
def to_hash
|
|
187
|
+
hash = {}
|
|
188
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
189
|
+
value = self.send(attr)
|
|
190
|
+
if value.nil?
|
|
191
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
192
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
193
|
+
end
|
|
194
|
+
|
|
195
|
+
hash[param] = _to_hash(value)
|
|
196
|
+
end
|
|
197
|
+
hash
|
|
198
|
+
end
|
|
199
|
+
|
|
200
|
+
end
|
|
201
|
+
|
|
202
|
+
end
|