authress-sdk 2.0.36.0 → 2.0.39.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/authress-sdk/api/access_records_api.rb +6 -6
- data/lib/authress-sdk/api/accounts_api.rb +9 -9
- data/lib/authress-sdk/api/metadata_api.rb +6 -6
- data/lib/authress-sdk/api/resource_permissions_api.rb +9 -9
- data/lib/authress-sdk/api/roles_api.rb +9 -9
- data/lib/authress-sdk/api/service_clients_api.rb +15 -15
- data/lib/authress-sdk/api/user_permissions_api.rb +9 -9
- data/lib/authress-sdk/api/users_api.rb +134 -0
- data/lib/authress-sdk/models/{permission_response.rb → permission_collection.rb} +3 -3
- data/lib/authress-sdk/models/{v1resourcesresource_uri_permissions.rb → user_identity.rb} +40 -38
- data/lib/authress-sdk/models/{inline_response_200_6.rb → user_identity_collection.rb} +5 -5
- metadata +6 -28
- data/lib/authress-sdk/models/inline_response_200.rb +0 -240
- data/lib/authress-sdk/models/inline_response_200_1.rb +0 -229
- data/lib/authress-sdk/models/inline_response_200_10.rb +0 -248
- data/lib/authress-sdk/models/inline_response_200_11.rb +0 -204
- data/lib/authress-sdk/models/inline_response_200_12.rb +0 -206
- data/lib/authress-sdk/models/inline_response_200_13.rb +0 -222
- data/lib/authress-sdk/models/inline_response_200_14.rb +0 -239
- data/lib/authress-sdk/models/inline_response_200_15.rb +0 -235
- data/lib/authress-sdk/models/inline_response_200_2.rb +0 -231
- data/lib/authress-sdk/models/inline_response_200_3.rb +0 -253
- data/lib/authress-sdk/models/inline_response_200_4.rb +0 -221
- data/lib/authress-sdk/models/inline_response_200_5.rb +0 -206
- data/lib/authress-sdk/models/inline_response_200_7.rb +0 -222
- data/lib/authress-sdk/models/inline_response_200_9.rb +0 -261
- data/lib/authress-sdk/models/v1clients_options.rb +0 -211
- data/lib/authress-sdk/models/v1records_account.rb +0 -204
- data/lib/authress-sdk/models/v1records_links.rb +0 -204
- data/lib/authress-sdk/models/v1records_links_self.rb +0 -216
- data/lib/authress-sdk/models/v1records_users.rb +0 -205
- data/lib/authress-sdk/models/v1roles_permissions.rb +0 -251
- data/lib/authress-sdk/models/v1usersuser_idresourcesresource_urimetadata_account.rb +0 -199
- data/lib/authress-sdk/models/v1usersuser_idtokens_resources.rb +0 -205
- data/lib/authress-sdk/models/v1usersuser_idtokens_statements.rb +0 -222
@@ -1,261 +0,0 @@
|
|
1
|
-
=begin
|
2
|
-
|
3
|
-
=end
|
4
|
-
|
5
|
-
require 'date'
|
6
|
-
|
7
|
-
module AuthressSdk
|
8
|
-
class InlineResponse2009
|
9
|
-
attr_accessor :account_id
|
10
|
-
|
11
|
-
attr_accessor :created_time
|
12
|
-
|
13
|
-
# The top authress sub domain specific for this account to be used with this API.
|
14
|
-
attr_accessor :domain
|
15
|
-
|
16
|
-
attr_accessor :company
|
17
|
-
|
18
|
-
attr_accessor :links
|
19
|
-
|
20
|
-
# Attribute mapping from ruby-style variable name to JSON key.
|
21
|
-
def self.attribute_map
|
22
|
-
{
|
23
|
-
:'account_id' => :'accountId',
|
24
|
-
:'created_time' => :'createdTime',
|
25
|
-
:'domain' => :'domain',
|
26
|
-
:'company' => :'company',
|
27
|
-
:'links' => :'links'
|
28
|
-
}
|
29
|
-
end
|
30
|
-
|
31
|
-
# Attribute type mapping.
|
32
|
-
def self.openapi_types
|
33
|
-
{
|
34
|
-
:'account_id' => :'Object',
|
35
|
-
:'created_time' => :'Object',
|
36
|
-
:'domain' => :'Object',
|
37
|
-
:'company' => :'Object',
|
38
|
-
:'links' => :'Object'
|
39
|
-
}
|
40
|
-
end
|
41
|
-
|
42
|
-
# List of attributes with nullable: true
|
43
|
-
def self.openapi_nullable
|
44
|
-
Set.new([
|
45
|
-
])
|
46
|
-
end
|
47
|
-
|
48
|
-
# Initializes the object
|
49
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
50
|
-
def initialize(attributes = {})
|
51
|
-
if (!attributes.is_a?(Hash))
|
52
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `AuthressSdk::InlineResponse2009` initialize method"
|
53
|
-
end
|
54
|
-
|
55
|
-
# check to see if the attribute exists and convert string to symbol for hash key
|
56
|
-
attributes = attributes.each_with_object({}) { |(k, v), h|
|
57
|
-
if (!self.class.attribute_map.key?(k.to_sym))
|
58
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `AuthressSdk::InlineResponse2009`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
59
|
-
end
|
60
|
-
h[k.to_sym] = v
|
61
|
-
}
|
62
|
-
|
63
|
-
if attributes.key?(:'account_id')
|
64
|
-
self.account_id = attributes[:'account_id']
|
65
|
-
end
|
66
|
-
|
67
|
-
if attributes.key?(:'created_time')
|
68
|
-
self.created_time = attributes[:'created_time']
|
69
|
-
end
|
70
|
-
|
71
|
-
if attributes.key?(:'domain')
|
72
|
-
self.domain = attributes[:'domain']
|
73
|
-
end
|
74
|
-
|
75
|
-
if attributes.key?(:'company')
|
76
|
-
self.company = attributes[:'company']
|
77
|
-
end
|
78
|
-
|
79
|
-
if attributes.key?(:'links')
|
80
|
-
self.links = attributes[:'links']
|
81
|
-
end
|
82
|
-
end
|
83
|
-
|
84
|
-
# Show invalid properties with the reasons. Usually used together with valid?
|
85
|
-
# @return Array for valid properties with the reasons
|
86
|
-
def list_invalid_properties
|
87
|
-
invalid_properties = Array.new
|
88
|
-
if @account_id.nil?
|
89
|
-
invalid_properties.push('invalid value for "account_id", account_id cannot be nil.')
|
90
|
-
end
|
91
|
-
|
92
|
-
if @created_time.nil?
|
93
|
-
invalid_properties.push('invalid value for "created_time", created_time cannot be nil.')
|
94
|
-
end
|
95
|
-
|
96
|
-
if @domain.nil?
|
97
|
-
invalid_properties.push('invalid value for "domain", domain cannot be nil.')
|
98
|
-
end
|
99
|
-
|
100
|
-
if @company.nil?
|
101
|
-
invalid_properties.push('invalid value for "company", company cannot be nil.')
|
102
|
-
end
|
103
|
-
|
104
|
-
if @links.nil?
|
105
|
-
invalid_properties.push('invalid value for "links", links cannot be nil.')
|
106
|
-
end
|
107
|
-
|
108
|
-
invalid_properties
|
109
|
-
end
|
110
|
-
|
111
|
-
# Check to see if the all the properties in the model are valid
|
112
|
-
# @return true if the model is valid
|
113
|
-
def valid?
|
114
|
-
return false if @account_id.nil?
|
115
|
-
return false if @created_time.nil?
|
116
|
-
return false if @domain.nil?
|
117
|
-
return false if @company.nil?
|
118
|
-
return false if @links.nil?
|
119
|
-
true
|
120
|
-
end
|
121
|
-
|
122
|
-
# Checks equality by comparing each attribute.
|
123
|
-
# @param [Object] Object to be compared
|
124
|
-
def ==(o)
|
125
|
-
return true if self.equal?(o)
|
126
|
-
self.class == o.class &&
|
127
|
-
account_id == o.account_id &&
|
128
|
-
created_time == o.created_time &&
|
129
|
-
domain == o.domain &&
|
130
|
-
company == o.company &&
|
131
|
-
links == o.links
|
132
|
-
end
|
133
|
-
|
134
|
-
# @see the `==` method
|
135
|
-
# @param [Object] Object to be compared
|
136
|
-
def eql?(o)
|
137
|
-
self == o
|
138
|
-
end
|
139
|
-
|
140
|
-
# Calculates hash code according to all attributes.
|
141
|
-
# @return [Integer] Hash code
|
142
|
-
def hash
|
143
|
-
[account_id, created_time, domain, company, links].hash
|
144
|
-
end
|
145
|
-
|
146
|
-
# Builds the object from hash
|
147
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
148
|
-
# @return [Object] Returns the model itself
|
149
|
-
def self.build_from_hash(attributes)
|
150
|
-
new.build_from_hash(attributes)
|
151
|
-
end
|
152
|
-
|
153
|
-
# Builds the object from hash
|
154
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
155
|
-
# @return [Object] Returns the model itself
|
156
|
-
def build_from_hash(attributes)
|
157
|
-
return nil unless attributes.is_a?(Hash)
|
158
|
-
self.class.openapi_types.each_pair do |key, type|
|
159
|
-
if type =~ /\AArray<(.*)>/i
|
160
|
-
# check to ensure the input is an array given that the attribute
|
161
|
-
# is documented as an array but the input is not
|
162
|
-
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
163
|
-
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
164
|
-
end
|
165
|
-
elsif !attributes[self.class.attribute_map[key]].nil?
|
166
|
-
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
167
|
-
elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
168
|
-
self.send("#{key}=", nil)
|
169
|
-
end
|
170
|
-
end
|
171
|
-
|
172
|
-
self
|
173
|
-
end
|
174
|
-
|
175
|
-
# Deserializes the data based on type
|
176
|
-
# @param string type Data type
|
177
|
-
# @param string value Value to be deserialized
|
178
|
-
# @return [Object] Deserialized data
|
179
|
-
def _deserialize(type, value)
|
180
|
-
case type.to_sym
|
181
|
-
when :DateTime
|
182
|
-
DateTime.parse(value)
|
183
|
-
when :Date
|
184
|
-
Date.parse(value)
|
185
|
-
when :String
|
186
|
-
value.to_s
|
187
|
-
when :Integer
|
188
|
-
value.to_i
|
189
|
-
when :Float
|
190
|
-
value.to_f
|
191
|
-
when :Boolean
|
192
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
193
|
-
true
|
194
|
-
else
|
195
|
-
false
|
196
|
-
end
|
197
|
-
when :Object
|
198
|
-
# generic object (usually a Hash), return directly
|
199
|
-
value
|
200
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
201
|
-
inner_type = Regexp.last_match[:inner_type]
|
202
|
-
value.map { |v| _deserialize(inner_type, v) }
|
203
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
204
|
-
k_type = Regexp.last_match[:k_type]
|
205
|
-
v_type = Regexp.last_match[:v_type]
|
206
|
-
{}.tap do |hash|
|
207
|
-
value.each do |k, v|
|
208
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
209
|
-
end
|
210
|
-
end
|
211
|
-
else # model
|
212
|
-
AuthressSdk.const_get(type).build_from_hash(value)
|
213
|
-
end
|
214
|
-
end
|
215
|
-
|
216
|
-
# Returns the string representation of the object
|
217
|
-
# @return [String] String presentation of the object
|
218
|
-
def to_s
|
219
|
-
to_hash.to_s
|
220
|
-
end
|
221
|
-
|
222
|
-
# to_body is an alias to to_hash (backward compatibility)
|
223
|
-
# @return [Hash] Returns the object in the form of hash
|
224
|
-
def to_body
|
225
|
-
to_hash
|
226
|
-
end
|
227
|
-
|
228
|
-
# Returns the object in the form of hash
|
229
|
-
# @return [Hash] Returns the object in the form of hash
|
230
|
-
def to_hash
|
231
|
-
hash = {}
|
232
|
-
self.class.attribute_map.each_pair do |attr, param|
|
233
|
-
value = self.send(attr)
|
234
|
-
if value.nil?
|
235
|
-
is_nullable = self.class.openapi_nullable.include?(attr)
|
236
|
-
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
237
|
-
end
|
238
|
-
|
239
|
-
hash[param] = _to_hash(value)
|
240
|
-
end
|
241
|
-
hash
|
242
|
-
end
|
243
|
-
|
244
|
-
# Outputs non-array value in the form of hash
|
245
|
-
# For object, use to_hash. Otherwise, just return the value
|
246
|
-
# @param [Object] value Any valid value
|
247
|
-
# @return [Hash] Returns the value in the form of hash
|
248
|
-
def _to_hash(value)
|
249
|
-
if value.is_a?(Array)
|
250
|
-
value.compact.map { |v| _to_hash(v) }
|
251
|
-
elsif value.is_a?(Hash)
|
252
|
-
{}.tap do |hash|
|
253
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
254
|
-
end
|
255
|
-
elsif value.respond_to? :to_hash
|
256
|
-
value.to_hash
|
257
|
-
else
|
258
|
-
value
|
259
|
-
end
|
260
|
-
end end
|
261
|
-
end
|
@@ -1,211 +0,0 @@
|
|
1
|
-
=begin
|
2
|
-
|
3
|
-
=end
|
4
|
-
|
5
|
-
require 'date'
|
6
|
-
|
7
|
-
module AuthressSdk
|
8
|
-
# A map of client specific options
|
9
|
-
class V1clientsOptions
|
10
|
-
# Grant the client access to verify authorization on behalf of any user.
|
11
|
-
attr_accessor :grant_user_permissions_access
|
12
|
-
|
13
|
-
# Grant the client access to read and write user data on behalf of any user
|
14
|
-
attr_accessor :grant_metadata_access
|
15
|
-
|
16
|
-
# Attribute mapping from ruby-style variable name to JSON key.
|
17
|
-
def self.attribute_map
|
18
|
-
{
|
19
|
-
:'grant_user_permissions_access' => :'grantUserPermissionsAccess',
|
20
|
-
:'grant_metadata_access' => :'grantMetadataAccess'
|
21
|
-
}
|
22
|
-
end
|
23
|
-
|
24
|
-
# Attribute type mapping.
|
25
|
-
def self.openapi_types
|
26
|
-
{
|
27
|
-
:'grant_user_permissions_access' => :'Object',
|
28
|
-
:'grant_metadata_access' => :'Object'
|
29
|
-
}
|
30
|
-
end
|
31
|
-
|
32
|
-
# List of attributes with nullable: true
|
33
|
-
def self.openapi_nullable
|
34
|
-
Set.new([
|
35
|
-
])
|
36
|
-
end
|
37
|
-
|
38
|
-
# Initializes the object
|
39
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
40
|
-
def initialize(attributes = {})
|
41
|
-
if (!attributes.is_a?(Hash))
|
42
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `AuthressSdk::V1clientsOptions` initialize method"
|
43
|
-
end
|
44
|
-
|
45
|
-
# check to see if the attribute exists and convert string to symbol for hash key
|
46
|
-
attributes = attributes.each_with_object({}) { |(k, v), h|
|
47
|
-
if (!self.class.attribute_map.key?(k.to_sym))
|
48
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `AuthressSdk::V1clientsOptions`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
49
|
-
end
|
50
|
-
h[k.to_sym] = v
|
51
|
-
}
|
52
|
-
|
53
|
-
if attributes.key?(:'grant_user_permissions_access')
|
54
|
-
self.grant_user_permissions_access = attributes[:'grant_user_permissions_access']
|
55
|
-
end
|
56
|
-
|
57
|
-
if attributes.key?(:'grant_metadata_access')
|
58
|
-
self.grant_metadata_access = attributes[:'grant_metadata_access']
|
59
|
-
end
|
60
|
-
end
|
61
|
-
|
62
|
-
# Show invalid properties with the reasons. Usually used together with valid?
|
63
|
-
# @return Array for valid properties with the reasons
|
64
|
-
def list_invalid_properties
|
65
|
-
invalid_properties = Array.new
|
66
|
-
invalid_properties
|
67
|
-
end
|
68
|
-
|
69
|
-
# Check to see if the all the properties in the model are valid
|
70
|
-
# @return true if the model is valid
|
71
|
-
def valid?
|
72
|
-
true
|
73
|
-
end
|
74
|
-
|
75
|
-
# Checks equality by comparing each attribute.
|
76
|
-
# @param [Object] Object to be compared
|
77
|
-
def ==(o)
|
78
|
-
return true if self.equal?(o)
|
79
|
-
self.class == o.class &&
|
80
|
-
grant_user_permissions_access == o.grant_user_permissions_access &&
|
81
|
-
grant_metadata_access == o.grant_metadata_access
|
82
|
-
end
|
83
|
-
|
84
|
-
# @see the `==` method
|
85
|
-
# @param [Object] Object to be compared
|
86
|
-
def eql?(o)
|
87
|
-
self == o
|
88
|
-
end
|
89
|
-
|
90
|
-
# Calculates hash code according to all attributes.
|
91
|
-
# @return [Integer] Hash code
|
92
|
-
def hash
|
93
|
-
[grant_user_permissions_access, grant_metadata_access].hash
|
94
|
-
end
|
95
|
-
|
96
|
-
# Builds the object from hash
|
97
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
98
|
-
# @return [Object] Returns the model itself
|
99
|
-
def self.build_from_hash(attributes)
|
100
|
-
new.build_from_hash(attributes)
|
101
|
-
end
|
102
|
-
|
103
|
-
# Builds the object from hash
|
104
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
105
|
-
# @return [Object] Returns the model itself
|
106
|
-
def build_from_hash(attributes)
|
107
|
-
return nil unless attributes.is_a?(Hash)
|
108
|
-
self.class.openapi_types.each_pair do |key, type|
|
109
|
-
if type =~ /\AArray<(.*)>/i
|
110
|
-
# check to ensure the input is an array given that the attribute
|
111
|
-
# is documented as an array but the input is not
|
112
|
-
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
113
|
-
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
114
|
-
end
|
115
|
-
elsif !attributes[self.class.attribute_map[key]].nil?
|
116
|
-
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
117
|
-
elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
118
|
-
self.send("#{key}=", nil)
|
119
|
-
end
|
120
|
-
end
|
121
|
-
|
122
|
-
self
|
123
|
-
end
|
124
|
-
|
125
|
-
# Deserializes the data based on type
|
126
|
-
# @param string type Data type
|
127
|
-
# @param string value Value to be deserialized
|
128
|
-
# @return [Object] Deserialized data
|
129
|
-
def _deserialize(type, value)
|
130
|
-
case type.to_sym
|
131
|
-
when :DateTime
|
132
|
-
DateTime.parse(value)
|
133
|
-
when :Date
|
134
|
-
Date.parse(value)
|
135
|
-
when :String
|
136
|
-
value.to_s
|
137
|
-
when :Integer
|
138
|
-
value.to_i
|
139
|
-
when :Float
|
140
|
-
value.to_f
|
141
|
-
when :Boolean
|
142
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
143
|
-
true
|
144
|
-
else
|
145
|
-
false
|
146
|
-
end
|
147
|
-
when :Object
|
148
|
-
# generic object (usually a Hash), return directly
|
149
|
-
value
|
150
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
151
|
-
inner_type = Regexp.last_match[:inner_type]
|
152
|
-
value.map { |v| _deserialize(inner_type, v) }
|
153
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
154
|
-
k_type = Regexp.last_match[:k_type]
|
155
|
-
v_type = Regexp.last_match[:v_type]
|
156
|
-
{}.tap do |hash|
|
157
|
-
value.each do |k, v|
|
158
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
159
|
-
end
|
160
|
-
end
|
161
|
-
else # model
|
162
|
-
AuthressSdk.const_get(type).build_from_hash(value)
|
163
|
-
end
|
164
|
-
end
|
165
|
-
|
166
|
-
# Returns the string representation of the object
|
167
|
-
# @return [String] String presentation of the object
|
168
|
-
def to_s
|
169
|
-
to_hash.to_s
|
170
|
-
end
|
171
|
-
|
172
|
-
# to_body is an alias to to_hash (backward compatibility)
|
173
|
-
# @return [Hash] Returns the object in the form of hash
|
174
|
-
def to_body
|
175
|
-
to_hash
|
176
|
-
end
|
177
|
-
|
178
|
-
# Returns the object in the form of hash
|
179
|
-
# @return [Hash] Returns the object in the form of hash
|
180
|
-
def to_hash
|
181
|
-
hash = {}
|
182
|
-
self.class.attribute_map.each_pair do |attr, param|
|
183
|
-
value = self.send(attr)
|
184
|
-
if value.nil?
|
185
|
-
is_nullable = self.class.openapi_nullable.include?(attr)
|
186
|
-
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
187
|
-
end
|
188
|
-
|
189
|
-
hash[param] = _to_hash(value)
|
190
|
-
end
|
191
|
-
hash
|
192
|
-
end
|
193
|
-
|
194
|
-
# Outputs non-array value in the form of hash
|
195
|
-
# For object, use to_hash. Otherwise, just return the value
|
196
|
-
# @param [Object] value Any valid value
|
197
|
-
# @return [Hash] Returns the value in the form of hash
|
198
|
-
def _to_hash(value)
|
199
|
-
if value.is_a?(Array)
|
200
|
-
value.compact.map { |v| _to_hash(v) }
|
201
|
-
elsif value.is_a?(Hash)
|
202
|
-
{}.tap do |hash|
|
203
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
204
|
-
end
|
205
|
-
elsif value.respond_to? :to_hash
|
206
|
-
value.to_hash
|
207
|
-
else
|
208
|
-
value
|
209
|
-
end
|
210
|
-
end end
|
211
|
-
end
|
@@ -1,204 +0,0 @@
|
|
1
|
-
=begin
|
2
|
-
|
3
|
-
=end
|
4
|
-
|
5
|
-
require 'date'
|
6
|
-
|
7
|
-
module AuthressSdk
|
8
|
-
class V1recordsAccount
|
9
|
-
attr_accessor :account_id
|
10
|
-
|
11
|
-
# Attribute mapping from ruby-style variable name to JSON key.
|
12
|
-
def self.attribute_map
|
13
|
-
{
|
14
|
-
:'account_id' => :'accountId'
|
15
|
-
}
|
16
|
-
end
|
17
|
-
|
18
|
-
# Attribute type mapping.
|
19
|
-
def self.openapi_types
|
20
|
-
{
|
21
|
-
:'account_id' => :'Object'
|
22
|
-
}
|
23
|
-
end
|
24
|
-
|
25
|
-
# List of attributes with nullable: true
|
26
|
-
def self.openapi_nullable
|
27
|
-
Set.new([
|
28
|
-
])
|
29
|
-
end
|
30
|
-
|
31
|
-
# Initializes the object
|
32
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
33
|
-
def initialize(attributes = {})
|
34
|
-
if (!attributes.is_a?(Hash))
|
35
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `AuthressSdk::V1recordsAccount` initialize method"
|
36
|
-
end
|
37
|
-
|
38
|
-
# check to see if the attribute exists and convert string to symbol for hash key
|
39
|
-
attributes = attributes.each_with_object({}) { |(k, v), h|
|
40
|
-
if (!self.class.attribute_map.key?(k.to_sym))
|
41
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `AuthressSdk::V1recordsAccount`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
42
|
-
end
|
43
|
-
h[k.to_sym] = v
|
44
|
-
}
|
45
|
-
|
46
|
-
if attributes.key?(:'account_id')
|
47
|
-
self.account_id = attributes[:'account_id']
|
48
|
-
end
|
49
|
-
end
|
50
|
-
|
51
|
-
# Show invalid properties with the reasons. Usually used together with valid?
|
52
|
-
# @return Array for valid properties with the reasons
|
53
|
-
def list_invalid_properties
|
54
|
-
invalid_properties = Array.new
|
55
|
-
if @account_id.nil?
|
56
|
-
invalid_properties.push('invalid value for "account_id", account_id cannot be nil.')
|
57
|
-
end
|
58
|
-
|
59
|
-
invalid_properties
|
60
|
-
end
|
61
|
-
|
62
|
-
# Check to see if the all the properties in the model are valid
|
63
|
-
# @return true if the model is valid
|
64
|
-
def valid?
|
65
|
-
return false if @account_id.nil?
|
66
|
-
true
|
67
|
-
end
|
68
|
-
|
69
|
-
# Checks equality by comparing each attribute.
|
70
|
-
# @param [Object] Object to be compared
|
71
|
-
def ==(o)
|
72
|
-
return true if self.equal?(o)
|
73
|
-
self.class == o.class &&
|
74
|
-
account_id == o.account_id
|
75
|
-
end
|
76
|
-
|
77
|
-
# @see the `==` method
|
78
|
-
# @param [Object] Object to be compared
|
79
|
-
def eql?(o)
|
80
|
-
self == o
|
81
|
-
end
|
82
|
-
|
83
|
-
# Calculates hash code according to all attributes.
|
84
|
-
# @return [Integer] Hash code
|
85
|
-
def hash
|
86
|
-
[account_id].hash
|
87
|
-
end
|
88
|
-
|
89
|
-
# Builds the object from hash
|
90
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
91
|
-
# @return [Object] Returns the model itself
|
92
|
-
def self.build_from_hash(attributes)
|
93
|
-
new.build_from_hash(attributes)
|
94
|
-
end
|
95
|
-
|
96
|
-
# Builds the object from hash
|
97
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
98
|
-
# @return [Object] Returns the model itself
|
99
|
-
def build_from_hash(attributes)
|
100
|
-
return nil unless attributes.is_a?(Hash)
|
101
|
-
self.class.openapi_types.each_pair do |key, type|
|
102
|
-
if type =~ /\AArray<(.*)>/i
|
103
|
-
# check to ensure the input is an array given that the attribute
|
104
|
-
# is documented as an array but the input is not
|
105
|
-
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
106
|
-
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
107
|
-
end
|
108
|
-
elsif !attributes[self.class.attribute_map[key]].nil?
|
109
|
-
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
110
|
-
elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
111
|
-
self.send("#{key}=", nil)
|
112
|
-
end
|
113
|
-
end
|
114
|
-
|
115
|
-
self
|
116
|
-
end
|
117
|
-
|
118
|
-
# Deserializes the data based on type
|
119
|
-
# @param string type Data type
|
120
|
-
# @param string value Value to be deserialized
|
121
|
-
# @return [Object] Deserialized data
|
122
|
-
def _deserialize(type, value)
|
123
|
-
case type.to_sym
|
124
|
-
when :DateTime
|
125
|
-
DateTime.parse(value)
|
126
|
-
when :Date
|
127
|
-
Date.parse(value)
|
128
|
-
when :String
|
129
|
-
value.to_s
|
130
|
-
when :Integer
|
131
|
-
value.to_i
|
132
|
-
when :Float
|
133
|
-
value.to_f
|
134
|
-
when :Boolean
|
135
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
136
|
-
true
|
137
|
-
else
|
138
|
-
false
|
139
|
-
end
|
140
|
-
when :Object
|
141
|
-
# generic object (usually a Hash), return directly
|
142
|
-
value
|
143
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
144
|
-
inner_type = Regexp.last_match[:inner_type]
|
145
|
-
value.map { |v| _deserialize(inner_type, v) }
|
146
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
147
|
-
k_type = Regexp.last_match[:k_type]
|
148
|
-
v_type = Regexp.last_match[:v_type]
|
149
|
-
{}.tap do |hash|
|
150
|
-
value.each do |k, v|
|
151
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
152
|
-
end
|
153
|
-
end
|
154
|
-
else # model
|
155
|
-
AuthressSdk.const_get(type).build_from_hash(value)
|
156
|
-
end
|
157
|
-
end
|
158
|
-
|
159
|
-
# Returns the string representation of the object
|
160
|
-
# @return [String] String presentation of the object
|
161
|
-
def to_s
|
162
|
-
to_hash.to_s
|
163
|
-
end
|
164
|
-
|
165
|
-
# to_body is an alias to to_hash (backward compatibility)
|
166
|
-
# @return [Hash] Returns the object in the form of hash
|
167
|
-
def to_body
|
168
|
-
to_hash
|
169
|
-
end
|
170
|
-
|
171
|
-
# Returns the object in the form of hash
|
172
|
-
# @return [Hash] Returns the object in the form of hash
|
173
|
-
def to_hash
|
174
|
-
hash = {}
|
175
|
-
self.class.attribute_map.each_pair do |attr, param|
|
176
|
-
value = self.send(attr)
|
177
|
-
if value.nil?
|
178
|
-
is_nullable = self.class.openapi_nullable.include?(attr)
|
179
|
-
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
180
|
-
end
|
181
|
-
|
182
|
-
hash[param] = _to_hash(value)
|
183
|
-
end
|
184
|
-
hash
|
185
|
-
end
|
186
|
-
|
187
|
-
# Outputs non-array value in the form of hash
|
188
|
-
# For object, use to_hash. Otherwise, just return the value
|
189
|
-
# @param [Object] value Any valid value
|
190
|
-
# @return [Hash] Returns the value in the form of hash
|
191
|
-
def _to_hash(value)
|
192
|
-
if value.is_a?(Array)
|
193
|
-
value.compact.map { |v| _to_hash(v) }
|
194
|
-
elsif value.is_a?(Hash)
|
195
|
-
{}.tap do |hash|
|
196
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
197
|
-
end
|
198
|
-
elsif value.respond_to? :to_hash
|
199
|
-
value.to_hash
|
200
|
-
else
|
201
|
-
value
|
202
|
-
end
|
203
|
-
end end
|
204
|
-
end
|