pescheck 0.0.1

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.
Files changed (143) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +9 -0
  3. data/README.md +193 -0
  4. data/Rakefile +10 -0
  5. data/docs/AuthenticationApi.md +217 -0
  6. data/docs/ChecksApi.md +147 -0
  7. data/docs/CustomTokenObtainPair.md +20 -0
  8. data/docs/DivisionReadOnly.md +46 -0
  9. data/docs/DivisionWrite.md +40 -0
  10. data/docs/DivisionsApi.md +369 -0
  11. data/docs/JWTGeneration.md +24 -0
  12. data/docs/JWTResponse.md +28 -0
  13. data/docs/OAuthApi.md +213 -0
  14. data/docs/OAuthApplication.md +26 -0
  15. data/docs/OAuthApplicationResponse.md +32 -0
  16. data/docs/PaginatedDivisionReadOnlyList.md +24 -0
  17. data/docs/PaginatedV2ProfileListItemList.md +24 -0
  18. data/docs/PaginatedV2ScreeningListItemList.md +24 -0
  19. data/docs/PatchedDivisionWrite.md +40 -0
  20. data/docs/PatchedV2ProfilePartialUpdate.md +20 -0
  21. data/docs/ProfilesApi.md +438 -0
  22. data/docs/ScreeningsApi.md +293 -0
  23. data/docs/TokenRefresh.md +20 -0
  24. data/docs/V2Candidate.md +36 -0
  25. data/docs/V2CheckField.md +26 -0
  26. data/docs/V2CheckInfo.md +40 -0
  27. data/docs/V2Document.md +28 -0
  28. data/docs/V2DocumentContent.md +20 -0
  29. data/docs/V2Money.md +20 -0
  30. data/docs/V2ProfileCheck.md +20 -0
  31. data/docs/V2ProfileCheckEntry.md +30 -0
  32. data/docs/V2ProfileCreate.md +22 -0
  33. data/docs/V2ProfileDetail.md +38 -0
  34. data/docs/V2ProfileListItem.md +30 -0
  35. data/docs/V2ProfileUpdate.md +22 -0
  36. data/docs/V2ProfileUpdateCheck.md +22 -0
  37. data/docs/V2ScreeningCheck.md +24 -0
  38. data/docs/V2ScreeningCheckEntry.md +34 -0
  39. data/docs/V2ScreeningCheckListItem.md +22 -0
  40. data/docs/V2ScreeningCreate.md +22 -0
  41. data/docs/V2ScreeningDetail.md +34 -0
  42. data/docs/V2ScreeningDetailProfile.md +20 -0
  43. data/docs/V2ScreeningListItem.md +34 -0
  44. data/docs/VerifyWebhook.md +18 -0
  45. data/docs/Webhook.md +26 -0
  46. data/docs/WebhookResponse.md +36 -0
  47. data/docs/WebhooksApi.md +290 -0
  48. data/git_push.sh +57 -0
  49. data/lib/pescheck/api/authentication_api.rb +220 -0
  50. data/lib/pescheck/api/checks_api.rb +144 -0
  51. data/lib/pescheck/api/divisions_api.rb +365 -0
  52. data/lib/pescheck/api/o_auth_api.rb +202 -0
  53. data/lib/pescheck/api/profiles_api.rb +432 -0
  54. data/lib/pescheck/api/screenings_api.rb +288 -0
  55. data/lib/pescheck/api/webhooks_api.rb +278 -0
  56. data/lib/pescheck/api_client.rb +441 -0
  57. data/lib/pescheck/api_error.rb +58 -0
  58. data/lib/pescheck/api_model_base.rb +88 -0
  59. data/lib/pescheck/configuration.rb +429 -0
  60. data/lib/pescheck/models/custom_token_obtain_pair.rb +191 -0
  61. data/lib/pescheck/models/division_read_only.rb +469 -0
  62. data/lib/pescheck/models/division_write.rb +436 -0
  63. data/lib/pescheck/models/jwt_generation.rb +213 -0
  64. data/lib/pescheck/models/jwt_response.rb +285 -0
  65. data/lib/pescheck/models/o_auth_application.rb +265 -0
  66. data/lib/pescheck/models/o_auth_application_response.rb +379 -0
  67. data/lib/pescheck/models/paginated_division_read_only_list.rb +216 -0
  68. data/lib/pescheck/models/paginated_v2_profile_list_item_list.rb +216 -0
  69. data/lib/pescheck/models/paginated_v2_screening_list_item_list.rb +216 -0
  70. data/lib/pescheck/models/patched_division_write.rb +360 -0
  71. data/lib/pescheck/models/patched_v2_profile_partial_update.rb +176 -0
  72. data/lib/pescheck/models/token_refresh.rb +173 -0
  73. data/lib/pescheck/models/v2_candidate.rb +390 -0
  74. data/lib/pescheck/models/v2_check_field.rb +246 -0
  75. data/lib/pescheck/models/v2_check_info.rb +438 -0
  76. data/lib/pescheck/models/v2_document.rb +308 -0
  77. data/lib/pescheck/models/v2_document_content.rb +175 -0
  78. data/lib/pescheck/models/v2_money.rb +210 -0
  79. data/lib/pescheck/models/v2_profile_check.rb +201 -0
  80. data/lib/pescheck/models/v2_profile_check_entry.rb +349 -0
  81. data/lib/pescheck/models/v2_profile_create.rb +212 -0
  82. data/lib/pescheck/models/v2_profile_detail.rb +401 -0
  83. data/lib/pescheck/models/v2_profile_list_item.rb +291 -0
  84. data/lib/pescheck/models/v2_profile_update.rb +213 -0
  85. data/lib/pescheck/models/v2_profile_update_check.rb +210 -0
  86. data/lib/pescheck/models/v2_screening_check.rb +221 -0
  87. data/lib/pescheck/models/v2_screening_check_entry.rb +376 -0
  88. data/lib/pescheck/models/v2_screening_check_list_item.rb +242 -0
  89. data/lib/pescheck/models/v2_screening_create.rb +201 -0
  90. data/lib/pescheck/models/v2_screening_detail.rb +348 -0
  91. data/lib/pescheck/models/v2_screening_detail_profile.rb +156 -0
  92. data/lib/pescheck/models/v2_screening_list_item.rb +330 -0
  93. data/lib/pescheck/models/verify_webhook.rb +166 -0
  94. data/lib/pescheck/models/webhook.rb +265 -0
  95. data/lib/pescheck/models/webhook_response.rb +353 -0
  96. data/lib/pescheck/version.rb +15 -0
  97. data/lib/pescheck.rb +83 -0
  98. data/pescheck.gemspec +41 -0
  99. data/spec/api/authentication_api_spec.rb +68 -0
  100. data/spec/api/checks_api_spec.rb +56 -0
  101. data/spec/api/divisions_api_spec.rb +94 -0
  102. data/spec/api/o_auth_api_spec.rb +67 -0
  103. data/spec/api/profiles_api_spec.rb +105 -0
  104. data/spec/api/screenings_api_spec.rb +81 -0
  105. data/spec/api/webhooks_api_spec.rb +81 -0
  106. data/spec/models/custom_token_obtain_pair_spec.rb +42 -0
  107. data/spec/models/division_read_only_spec.rb +120 -0
  108. data/spec/models/division_write_spec.rb +102 -0
  109. data/spec/models/jwt_generation_spec.rb +54 -0
  110. data/spec/models/jwt_response_spec.rb +66 -0
  111. data/spec/models/o_auth_application_response_spec.rb +86 -0
  112. data/spec/models/o_auth_application_spec.rb +68 -0
  113. data/spec/models/paginated_division_read_only_list_spec.rb +54 -0
  114. data/spec/models/paginated_v2_profile_list_item_list_spec.rb +54 -0
  115. data/spec/models/paginated_v2_screening_list_item_list_spec.rb +54 -0
  116. data/spec/models/patched_division_write_spec.rb +102 -0
  117. data/spec/models/patched_v2_profile_partial_update_spec.rb +42 -0
  118. data/spec/models/token_refresh_spec.rb +42 -0
  119. data/spec/models/v2_candidate_spec.rb +94 -0
  120. data/spec/models/v2_check_field_spec.rb +60 -0
  121. data/spec/models/v2_check_info_spec.rb +102 -0
  122. data/spec/models/v2_document_content_spec.rb +42 -0
  123. data/spec/models/v2_document_spec.rb +70 -0
  124. data/spec/models/v2_money_spec.rb +42 -0
  125. data/spec/models/v2_profile_check_entry_spec.rb +76 -0
  126. data/spec/models/v2_profile_check_spec.rb +46 -0
  127. data/spec/models/v2_profile_create_spec.rb +48 -0
  128. data/spec/models/v2_profile_detail_spec.rb +96 -0
  129. data/spec/models/v2_profile_list_item_spec.rb +72 -0
  130. data/spec/models/v2_profile_update_check_spec.rb +52 -0
  131. data/spec/models/v2_profile_update_spec.rb +48 -0
  132. data/spec/models/v2_screening_check_entry_spec.rb +88 -0
  133. data/spec/models/v2_screening_check_list_item_spec.rb +52 -0
  134. data/spec/models/v2_screening_check_spec.rb +58 -0
  135. data/spec/models/v2_screening_create_spec.rb +48 -0
  136. data/spec/models/v2_screening_detail_profile_spec.rb +42 -0
  137. data/spec/models/v2_screening_detail_spec.rb +84 -0
  138. data/spec/models/v2_screening_list_item_spec.rb +84 -0
  139. data/spec/models/verify_webhook_spec.rb +36 -0
  140. data/spec/models/webhook_response_spec.rb +90 -0
  141. data/spec/models/webhook_spec.rb +64 -0
  142. data/spec/spec_helper.rb +111 -0
  143. metadata +302 -0
@@ -0,0 +1,379 @@
1
+ =begin
2
+ #Pescheck API
3
+
4
+ #API for Pescheck ## Authentication This API supports three authentication methods: 1. **OAuth2** (recommended for API clients) - Use client credentials flow 2. **JWT Bearer** (for user-based access) - Obtain tokens via /api/jwt/ endpoint 3. **Cookie** (for browser-based access) - Session authentication via web login ## Quick Start for API Clients 1. Select your environment from the servers dropdown 2. Use OAuth2 with client credentials flow 3. Scopes are automatically included: read:api, create:api, update:api
5
+
6
+ The version of the OpenAPI document: 2.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.23.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Pescheck
17
+ # Serializer for OAuth application responses
18
+ class OAuthApplicationResponse < ApiModelBase
19
+ attr_accessor :id
20
+
21
+ attr_accessor :name
22
+
23
+ attr_accessor :client_id
24
+
25
+ attr_accessor :client_secret
26
+
27
+ # * `confidential` - Confidential * `public` - Public
28
+ attr_accessor :client_type
29
+
30
+ # * `authorization-code` - Authorization code * `implicit` - Implicit * `password` - Resource owner password-based * `client-credentials` - Client credentials * `openid-hybrid` - OpenID connect hybrid
31
+ attr_accessor :authorization_grant_type
32
+
33
+ attr_accessor :created
34
+
35
+ attr_accessor :updated
36
+
37
+ class EnumAttributeValidator
38
+ attr_reader :datatype
39
+ attr_reader :allowable_values
40
+
41
+ def initialize(datatype, allowable_values)
42
+ @allowable_values = allowable_values.map do |value|
43
+ case datatype.to_s
44
+ when /Integer/i
45
+ value.to_i
46
+ when /Float/i
47
+ value.to_f
48
+ else
49
+ value
50
+ end
51
+ end
52
+ end
53
+
54
+ def valid?(value)
55
+ !value || allowable_values.include?(value)
56
+ end
57
+ end
58
+
59
+ # Attribute mapping from ruby-style variable name to JSON key.
60
+ def self.attribute_map
61
+ {
62
+ :'id' => :'id',
63
+ :'name' => :'name',
64
+ :'client_id' => :'client_id',
65
+ :'client_secret' => :'client_secret',
66
+ :'client_type' => :'client_type',
67
+ :'authorization_grant_type' => :'authorization_grant_type',
68
+ :'created' => :'created',
69
+ :'updated' => :'updated'
70
+ }
71
+ end
72
+
73
+ # Returns attribute mapping this model knows about
74
+ def self.acceptable_attribute_map
75
+ attribute_map
76
+ end
77
+
78
+ # Returns all the JSON keys this model knows about
79
+ def self.acceptable_attributes
80
+ acceptable_attribute_map.values
81
+ end
82
+
83
+ # Attribute type mapping.
84
+ def self.openapi_types
85
+ {
86
+ :'id' => :'String',
87
+ :'name' => :'String',
88
+ :'client_id' => :'String',
89
+ :'client_secret' => :'String',
90
+ :'client_type' => :'String',
91
+ :'authorization_grant_type' => :'String',
92
+ :'created' => :'Time',
93
+ :'updated' => :'Time'
94
+ }
95
+ end
96
+
97
+ # List of attributes with nullable: true
98
+ def self.openapi_nullable
99
+ Set.new([
100
+ ])
101
+ end
102
+
103
+ # Initializes the object
104
+ # @param [Hash] attributes Model attributes in the form of hash
105
+ def initialize(attributes = {})
106
+ if (!attributes.is_a?(Hash))
107
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Pescheck::OAuthApplicationResponse` initialize method"
108
+ end
109
+
110
+ # check to see if the attribute exists and convert string to symbol for hash key
111
+ acceptable_attribute_map = self.class.acceptable_attribute_map
112
+ attributes = attributes.each_with_object({}) { |(k, v), h|
113
+ if (!acceptable_attribute_map.key?(k.to_sym))
114
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Pescheck::OAuthApplicationResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
115
+ end
116
+ h[k.to_sym] = v
117
+ }
118
+
119
+ if attributes.key?(:'id')
120
+ self.id = attributes[:'id']
121
+ else
122
+ self.id = nil
123
+ end
124
+
125
+ if attributes.key?(:'name')
126
+ self.name = attributes[:'name']
127
+ end
128
+
129
+ if attributes.key?(:'client_id')
130
+ self.client_id = attributes[:'client_id']
131
+ end
132
+
133
+ if attributes.key?(:'client_secret')
134
+ self.client_secret = attributes[:'client_secret']
135
+ else
136
+ self.client_secret = nil
137
+ end
138
+
139
+ if attributes.key?(:'client_type')
140
+ self.client_type = attributes[:'client_type']
141
+ else
142
+ self.client_type = nil
143
+ end
144
+
145
+ if attributes.key?(:'authorization_grant_type')
146
+ self.authorization_grant_type = attributes[:'authorization_grant_type']
147
+ else
148
+ self.authorization_grant_type = nil
149
+ end
150
+
151
+ if attributes.key?(:'created')
152
+ self.created = attributes[:'created']
153
+ else
154
+ self.created = nil
155
+ end
156
+
157
+ if attributes.key?(:'updated')
158
+ self.updated = attributes[:'updated']
159
+ else
160
+ self.updated = nil
161
+ end
162
+ end
163
+
164
+ # Show invalid properties with the reasons. Usually used together with valid?
165
+ # @return Array for valid properties with the reasons
166
+ def list_invalid_properties
167
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
168
+ invalid_properties = Array.new
169
+ if @id.nil?
170
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
171
+ end
172
+
173
+ if !@name.nil? && @name.to_s.length > 255
174
+ invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 255.')
175
+ end
176
+
177
+ if !@client_id.nil? && @client_id.to_s.length > 100
178
+ invalid_properties.push('invalid value for "client_id", the character length must be smaller than or equal to 100.')
179
+ end
180
+
181
+ if @client_secret.nil?
182
+ invalid_properties.push('invalid value for "client_secret", client_secret cannot be nil.')
183
+ end
184
+
185
+ if @client_type.nil?
186
+ invalid_properties.push('invalid value for "client_type", client_type cannot be nil.')
187
+ end
188
+
189
+ if @authorization_grant_type.nil?
190
+ invalid_properties.push('invalid value for "authorization_grant_type", authorization_grant_type cannot be nil.')
191
+ end
192
+
193
+ if @created.nil?
194
+ invalid_properties.push('invalid value for "created", created cannot be nil.')
195
+ end
196
+
197
+ if @updated.nil?
198
+ invalid_properties.push('invalid value for "updated", updated cannot be nil.')
199
+ end
200
+
201
+ invalid_properties
202
+ end
203
+
204
+ # Check to see if the all the properties in the model are valid
205
+ # @return true if the model is valid
206
+ def valid?
207
+ warn '[DEPRECATED] the `valid?` method is obsolete'
208
+ return false if @id.nil?
209
+ return false if !@name.nil? && @name.to_s.length > 255
210
+ return false if !@client_id.nil? && @client_id.to_s.length > 100
211
+ return false if @client_secret.nil?
212
+ return false if @client_type.nil?
213
+ client_type_validator = EnumAttributeValidator.new('String', ["confidential", "public"])
214
+ return false unless client_type_validator.valid?(@client_type)
215
+ return false if @authorization_grant_type.nil?
216
+ authorization_grant_type_validator = EnumAttributeValidator.new('String', ["authorization-code", "implicit", "password", "client-credentials", "openid-hybrid"])
217
+ return false unless authorization_grant_type_validator.valid?(@authorization_grant_type)
218
+ return false if @created.nil?
219
+ return false if @updated.nil?
220
+ true
221
+ end
222
+
223
+ # Custom attribute writer method with validation
224
+ # @param [Object] id Value to be assigned
225
+ def id=(id)
226
+ if id.nil?
227
+ fail ArgumentError, 'id cannot be nil'
228
+ end
229
+
230
+ @id = id
231
+ end
232
+
233
+ # Custom attribute writer method with validation
234
+ # @param [Object] name Value to be assigned
235
+ def name=(name)
236
+ if name.nil?
237
+ fail ArgumentError, 'name cannot be nil'
238
+ end
239
+
240
+ if name.to_s.length > 255
241
+ fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 255.'
242
+ end
243
+
244
+ @name = name
245
+ end
246
+
247
+ # Custom attribute writer method with validation
248
+ # @param [Object] client_id Value to be assigned
249
+ def client_id=(client_id)
250
+ if client_id.nil?
251
+ fail ArgumentError, 'client_id cannot be nil'
252
+ end
253
+
254
+ if client_id.to_s.length > 100
255
+ fail ArgumentError, 'invalid value for "client_id", the character length must be smaller than or equal to 100.'
256
+ end
257
+
258
+ @client_id = client_id
259
+ end
260
+
261
+ # Custom attribute writer method with validation
262
+ # @param [Object] client_secret Value to be assigned
263
+ def client_secret=(client_secret)
264
+ if client_secret.nil?
265
+ fail ArgumentError, 'client_secret cannot be nil'
266
+ end
267
+
268
+ @client_secret = client_secret
269
+ end
270
+
271
+ # Custom attribute writer method checking allowed values (enum).
272
+ # @param [Object] client_type Object to be assigned
273
+ def client_type=(client_type)
274
+ validator = EnumAttributeValidator.new('String', ["confidential", "public"])
275
+ unless validator.valid?(client_type)
276
+ fail ArgumentError, "invalid value for \"client_type\", must be one of #{validator.allowable_values}."
277
+ end
278
+ @client_type = client_type
279
+ end
280
+
281
+ # Custom attribute writer method checking allowed values (enum).
282
+ # @param [Object] authorization_grant_type Object to be assigned
283
+ def authorization_grant_type=(authorization_grant_type)
284
+ validator = EnumAttributeValidator.new('String', ["authorization-code", "implicit", "password", "client-credentials", "openid-hybrid"])
285
+ unless validator.valid?(authorization_grant_type)
286
+ fail ArgumentError, "invalid value for \"authorization_grant_type\", must be one of #{validator.allowable_values}."
287
+ end
288
+ @authorization_grant_type = authorization_grant_type
289
+ end
290
+
291
+ # Custom attribute writer method with validation
292
+ # @param [Object] created Value to be assigned
293
+ def created=(created)
294
+ if created.nil?
295
+ fail ArgumentError, 'created cannot be nil'
296
+ end
297
+
298
+ @created = created
299
+ end
300
+
301
+ # Custom attribute writer method with validation
302
+ # @param [Object] updated Value to be assigned
303
+ def updated=(updated)
304
+ if updated.nil?
305
+ fail ArgumentError, 'updated cannot be nil'
306
+ end
307
+
308
+ @updated = updated
309
+ end
310
+
311
+ # Checks equality by comparing each attribute.
312
+ # @param [Object] Object to be compared
313
+ def ==(o)
314
+ return true if self.equal?(o)
315
+ self.class == o.class &&
316
+ id == o.id &&
317
+ name == o.name &&
318
+ client_id == o.client_id &&
319
+ client_secret == o.client_secret &&
320
+ client_type == o.client_type &&
321
+ authorization_grant_type == o.authorization_grant_type &&
322
+ created == o.created &&
323
+ updated == o.updated
324
+ end
325
+
326
+ # @see the `==` method
327
+ # @param [Object] Object to be compared
328
+ def eql?(o)
329
+ self == o
330
+ end
331
+
332
+ # Calculates hash code according to all attributes.
333
+ # @return [Integer] Hash code
334
+ def hash
335
+ [id, name, client_id, client_secret, client_type, authorization_grant_type, created, updated].hash
336
+ end
337
+
338
+ # Builds the object from hash
339
+ # @param [Hash] attributes Model attributes in the form of hash
340
+ # @return [Object] Returns the model itself
341
+ def self.build_from_hash(attributes)
342
+ return nil unless attributes.is_a?(Hash)
343
+ attributes = attributes.transform_keys(&:to_sym)
344
+ transformed_hash = {}
345
+ openapi_types.each_pair do |key, type|
346
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
347
+ transformed_hash["#{key}"] = nil
348
+ elsif type =~ /\AArray<(.*)>/i
349
+ # check to ensure the input is an array given that the attribute
350
+ # is documented as an array but the input is not
351
+ if attributes[attribute_map[key]].is_a?(Array)
352
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
353
+ end
354
+ elsif !attributes[attribute_map[key]].nil?
355
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
356
+ end
357
+ end
358
+ new(transformed_hash)
359
+ end
360
+
361
+ # Returns the object in the form of hash
362
+ # @return [Hash] Returns the object in the form of hash
363
+ def to_hash
364
+ hash = {}
365
+ self.class.attribute_map.each_pair do |attr, param|
366
+ value = self.send(attr)
367
+ if value.nil?
368
+ is_nullable = self.class.openapi_nullable.include?(attr)
369
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
370
+ end
371
+
372
+ hash[param] = _to_hash(value)
373
+ end
374
+ hash
375
+ end
376
+
377
+ end
378
+
379
+ end
@@ -0,0 +1,216 @@
1
+ =begin
2
+ #Pescheck API
3
+
4
+ #API for Pescheck ## Authentication This API supports three authentication methods: 1. **OAuth2** (recommended for API clients) - Use client credentials flow 2. **JWT Bearer** (for user-based access) - Obtain tokens via /api/jwt/ endpoint 3. **Cookie** (for browser-based access) - Session authentication via web login ## Quick Start for API Clients 1. Select your environment from the servers dropdown 2. Use OAuth2 with client credentials flow 3. Scopes are automatically included: read:api, create:api, update:api
5
+
6
+ The version of the OpenAPI document: 2.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.23.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Pescheck
17
+ class PaginatedDivisionReadOnlyList < ApiModelBase
18
+ attr_accessor :count
19
+
20
+ attr_accessor :_next
21
+
22
+ attr_accessor :previous
23
+
24
+ attr_accessor :results
25
+
26
+ # Attribute mapping from ruby-style variable name to JSON key.
27
+ def self.attribute_map
28
+ {
29
+ :'count' => :'count',
30
+ :'_next' => :'next',
31
+ :'previous' => :'previous',
32
+ :'results' => :'results'
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
+ :'count' => :'Integer',
50
+ :'_next' => :'String',
51
+ :'previous' => :'String',
52
+ :'results' => :'Array<DivisionReadOnly>'
53
+ }
54
+ end
55
+
56
+ # List of attributes with nullable: true
57
+ def self.openapi_nullable
58
+ Set.new([
59
+ :'_next',
60
+ :'previous',
61
+ ])
62
+ end
63
+
64
+ # Initializes the object
65
+ # @param [Hash] attributes Model attributes in the form of hash
66
+ def initialize(attributes = {})
67
+ if (!attributes.is_a?(Hash))
68
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Pescheck::PaginatedDivisionReadOnlyList` initialize method"
69
+ end
70
+
71
+ # check to see if the attribute exists and convert string to symbol for hash key
72
+ acceptable_attribute_map = self.class.acceptable_attribute_map
73
+ attributes = attributes.each_with_object({}) { |(k, v), h|
74
+ if (!acceptable_attribute_map.key?(k.to_sym))
75
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Pescheck::PaginatedDivisionReadOnlyList`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
76
+ end
77
+ h[k.to_sym] = v
78
+ }
79
+
80
+ if attributes.key?(:'count')
81
+ self.count = attributes[:'count']
82
+ else
83
+ self.count = nil
84
+ end
85
+
86
+ if attributes.key?(:'_next')
87
+ self._next = attributes[:'_next']
88
+ else
89
+ self._next = nil
90
+ end
91
+
92
+ if attributes.key?(:'previous')
93
+ self.previous = attributes[:'previous']
94
+ else
95
+ self.previous = nil
96
+ end
97
+
98
+ if attributes.key?(:'results')
99
+ if (value = attributes[:'results']).is_a?(Array)
100
+ self.results = value
101
+ end
102
+ else
103
+ self.results = nil
104
+ end
105
+ end
106
+
107
+ # Show invalid properties with the reasons. Usually used together with valid?
108
+ # @return Array for valid properties with the reasons
109
+ def list_invalid_properties
110
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
111
+ invalid_properties = Array.new
112
+ if @count.nil?
113
+ invalid_properties.push('invalid value for "count", count cannot be nil.')
114
+ end
115
+
116
+ if @results.nil?
117
+ invalid_properties.push('invalid value for "results", results cannot be nil.')
118
+ end
119
+
120
+ invalid_properties
121
+ end
122
+
123
+ # Check to see if the all the properties in the model are valid
124
+ # @return true if the model is valid
125
+ def valid?
126
+ warn '[DEPRECATED] the `valid?` method is obsolete'
127
+ return false if @count.nil?
128
+ return false if @results.nil?
129
+ true
130
+ end
131
+
132
+ # Custom attribute writer method with validation
133
+ # @param [Object] count Value to be assigned
134
+ def count=(count)
135
+ if count.nil?
136
+ fail ArgumentError, 'count cannot be nil'
137
+ end
138
+
139
+ @count = count
140
+ end
141
+
142
+ # Custom attribute writer method with validation
143
+ # @param [Object] results Value to be assigned
144
+ def results=(results)
145
+ if results.nil?
146
+ fail ArgumentError, 'results cannot be nil'
147
+ end
148
+
149
+ @results = results
150
+ end
151
+
152
+ # Checks equality by comparing each attribute.
153
+ # @param [Object] Object to be compared
154
+ def ==(o)
155
+ return true if self.equal?(o)
156
+ self.class == o.class &&
157
+ count == o.count &&
158
+ _next == o._next &&
159
+ previous == o.previous &&
160
+ results == o.results
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
+ [count, _next, previous, results].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