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,436 @@
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 DivisionWrite < ApiModelBase
18
+ attr_accessor :id
19
+
20
+ attr_accessor :name
21
+
22
+ attr_accessor :city
23
+
24
+ attr_accessor :address
25
+
26
+ attr_accessor :postal
27
+
28
+ attr_accessor :phone
29
+
30
+ attr_accessor :contact_name
31
+
32
+ attr_accessor :contact_email
33
+
34
+ attr_accessor :invoice_email
35
+
36
+ attr_accessor :use_parent_on_email
37
+
38
+ attr_accessor :use_parent_on_billing
39
+
40
+ attr_accessor :use_parent_on_report
41
+
42
+ # Attribute mapping from ruby-style variable name to JSON key.
43
+ def self.attribute_map
44
+ {
45
+ :'id' => :'id',
46
+ :'name' => :'name',
47
+ :'city' => :'city',
48
+ :'address' => :'address',
49
+ :'postal' => :'postal',
50
+ :'phone' => :'phone',
51
+ :'contact_name' => :'contact_name',
52
+ :'contact_email' => :'contact_email',
53
+ :'invoice_email' => :'invoice_email',
54
+ :'use_parent_on_email' => :'use_parent_on_email',
55
+ :'use_parent_on_billing' => :'use_parent_on_billing',
56
+ :'use_parent_on_report' => :'use_parent_on_report'
57
+ }
58
+ end
59
+
60
+ # Returns attribute mapping this model knows about
61
+ def self.acceptable_attribute_map
62
+ attribute_map
63
+ end
64
+
65
+ # Returns all the JSON keys this model knows about
66
+ def self.acceptable_attributes
67
+ acceptable_attribute_map.values
68
+ end
69
+
70
+ # Attribute type mapping.
71
+ def self.openapi_types
72
+ {
73
+ :'id' => :'String',
74
+ :'name' => :'String',
75
+ :'city' => :'String',
76
+ :'address' => :'String',
77
+ :'postal' => :'String',
78
+ :'phone' => :'String',
79
+ :'contact_name' => :'String',
80
+ :'contact_email' => :'String',
81
+ :'invoice_email' => :'String',
82
+ :'use_parent_on_email' => :'Boolean',
83
+ :'use_parent_on_billing' => :'Boolean',
84
+ :'use_parent_on_report' => :'Boolean'
85
+ }
86
+ end
87
+
88
+ # List of attributes with nullable: true
89
+ def self.openapi_nullable
90
+ Set.new([
91
+ ])
92
+ end
93
+
94
+ # Initializes the object
95
+ # @param [Hash] attributes Model attributes in the form of hash
96
+ def initialize(attributes = {})
97
+ if (!attributes.is_a?(Hash))
98
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Pescheck::DivisionWrite` initialize method"
99
+ end
100
+
101
+ # check to see if the attribute exists and convert string to symbol for hash key
102
+ acceptable_attribute_map = self.class.acceptable_attribute_map
103
+ attributes = attributes.each_with_object({}) { |(k, v), h|
104
+ if (!acceptable_attribute_map.key?(k.to_sym))
105
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Pescheck::DivisionWrite`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
106
+ end
107
+ h[k.to_sym] = v
108
+ }
109
+
110
+ if attributes.key?(:'id')
111
+ self.id = attributes[:'id']
112
+ end
113
+
114
+ if attributes.key?(:'name')
115
+ self.name = attributes[:'name']
116
+ else
117
+ self.name = nil
118
+ end
119
+
120
+ if attributes.key?(:'city')
121
+ self.city = attributes[:'city']
122
+ else
123
+ self.city = nil
124
+ end
125
+
126
+ if attributes.key?(:'address')
127
+ self.address = attributes[:'address']
128
+ else
129
+ self.address = nil
130
+ end
131
+
132
+ if attributes.key?(:'postal')
133
+ self.postal = attributes[:'postal']
134
+ else
135
+ self.postal = nil
136
+ end
137
+
138
+ if attributes.key?(:'phone')
139
+ self.phone = attributes[:'phone']
140
+ else
141
+ self.phone = nil
142
+ end
143
+
144
+ if attributes.key?(:'contact_name')
145
+ self.contact_name = attributes[:'contact_name']
146
+ else
147
+ self.contact_name = nil
148
+ end
149
+
150
+ if attributes.key?(:'contact_email')
151
+ self.contact_email = attributes[:'contact_email']
152
+ else
153
+ self.contact_email = nil
154
+ end
155
+
156
+ if attributes.key?(:'invoice_email')
157
+ self.invoice_email = attributes[:'invoice_email']
158
+ else
159
+ self.invoice_email = nil
160
+ end
161
+
162
+ if attributes.key?(:'use_parent_on_email')
163
+ self.use_parent_on_email = attributes[:'use_parent_on_email']
164
+ end
165
+
166
+ if attributes.key?(:'use_parent_on_billing')
167
+ self.use_parent_on_billing = attributes[:'use_parent_on_billing']
168
+ end
169
+
170
+ if attributes.key?(:'use_parent_on_report')
171
+ self.use_parent_on_report = attributes[:'use_parent_on_report']
172
+ end
173
+ end
174
+
175
+ # Show invalid properties with the reasons. Usually used together with valid?
176
+ # @return Array for valid properties with the reasons
177
+ def list_invalid_properties
178
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
179
+ invalid_properties = Array.new
180
+ if @name.nil?
181
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
182
+ end
183
+
184
+ if @name.to_s.length > 255
185
+ invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 255.')
186
+ end
187
+
188
+ if @city.nil?
189
+ invalid_properties.push('invalid value for "city", city cannot be nil.')
190
+ end
191
+
192
+ if @city.to_s.length > 255
193
+ invalid_properties.push('invalid value for "city", the character length must be smaller than or equal to 255.')
194
+ end
195
+
196
+ if @address.nil?
197
+ invalid_properties.push('invalid value for "address", address cannot be nil.')
198
+ end
199
+
200
+ if @address.to_s.length > 255
201
+ invalid_properties.push('invalid value for "address", the character length must be smaller than or equal to 255.')
202
+ end
203
+
204
+ if @postal.nil?
205
+ invalid_properties.push('invalid value for "postal", postal cannot be nil.')
206
+ end
207
+
208
+ if @postal.to_s.length > 20
209
+ invalid_properties.push('invalid value for "postal", the character length must be smaller than or equal to 20.')
210
+ end
211
+
212
+ if @phone.nil?
213
+ invalid_properties.push('invalid value for "phone", phone cannot be nil.')
214
+ end
215
+
216
+ if @phone.to_s.length > 20
217
+ invalid_properties.push('invalid value for "phone", the character length must be smaller than or equal to 20.')
218
+ end
219
+
220
+ if @contact_name.nil?
221
+ invalid_properties.push('invalid value for "contact_name", contact_name cannot be nil.')
222
+ end
223
+
224
+ if @contact_name.to_s.length > 255
225
+ invalid_properties.push('invalid value for "contact_name", the character length must be smaller than or equal to 255.')
226
+ end
227
+
228
+ if @contact_email.nil?
229
+ invalid_properties.push('invalid value for "contact_email", contact_email cannot be nil.')
230
+ end
231
+
232
+ if @invoice_email.nil?
233
+ invalid_properties.push('invalid value for "invoice_email", invoice_email cannot be nil.')
234
+ end
235
+
236
+ invalid_properties
237
+ end
238
+
239
+ # Check to see if the all the properties in the model are valid
240
+ # @return true if the model is valid
241
+ def valid?
242
+ warn '[DEPRECATED] the `valid?` method is obsolete'
243
+ return false if @name.nil?
244
+ return false if @name.to_s.length > 255
245
+ return false if @city.nil?
246
+ return false if @city.to_s.length > 255
247
+ return false if @address.nil?
248
+ return false if @address.to_s.length > 255
249
+ return false if @postal.nil?
250
+ return false if @postal.to_s.length > 20
251
+ return false if @phone.nil?
252
+ return false if @phone.to_s.length > 20
253
+ return false if @contact_name.nil?
254
+ return false if @contact_name.to_s.length > 255
255
+ return false if @contact_email.nil?
256
+ return false if @invoice_email.nil?
257
+ true
258
+ end
259
+
260
+ # Custom attribute writer method with validation
261
+ # @param [Object] name Value to be assigned
262
+ def name=(name)
263
+ if name.nil?
264
+ fail ArgumentError, 'name cannot be nil'
265
+ end
266
+
267
+ if name.to_s.length > 255
268
+ fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 255.'
269
+ end
270
+
271
+ @name = name
272
+ end
273
+
274
+ # Custom attribute writer method with validation
275
+ # @param [Object] city Value to be assigned
276
+ def city=(city)
277
+ if city.nil?
278
+ fail ArgumentError, 'city cannot be nil'
279
+ end
280
+
281
+ if city.to_s.length > 255
282
+ fail ArgumentError, 'invalid value for "city", the character length must be smaller than or equal to 255.'
283
+ end
284
+
285
+ @city = city
286
+ end
287
+
288
+ # Custom attribute writer method with validation
289
+ # @param [Object] address Value to be assigned
290
+ def address=(address)
291
+ if address.nil?
292
+ fail ArgumentError, 'address cannot be nil'
293
+ end
294
+
295
+ if address.to_s.length > 255
296
+ fail ArgumentError, 'invalid value for "address", the character length must be smaller than or equal to 255.'
297
+ end
298
+
299
+ @address = address
300
+ end
301
+
302
+ # Custom attribute writer method with validation
303
+ # @param [Object] postal Value to be assigned
304
+ def postal=(postal)
305
+ if postal.nil?
306
+ fail ArgumentError, 'postal cannot be nil'
307
+ end
308
+
309
+ if postal.to_s.length > 20
310
+ fail ArgumentError, 'invalid value for "postal", the character length must be smaller than or equal to 20.'
311
+ end
312
+
313
+ @postal = postal
314
+ end
315
+
316
+ # Custom attribute writer method with validation
317
+ # @param [Object] phone Value to be assigned
318
+ def phone=(phone)
319
+ if phone.nil?
320
+ fail ArgumentError, 'phone cannot be nil'
321
+ end
322
+
323
+ if phone.to_s.length > 20
324
+ fail ArgumentError, 'invalid value for "phone", the character length must be smaller than or equal to 20.'
325
+ end
326
+
327
+ @phone = phone
328
+ end
329
+
330
+ # Custom attribute writer method with validation
331
+ # @param [Object] contact_name Value to be assigned
332
+ def contact_name=(contact_name)
333
+ if contact_name.nil?
334
+ fail ArgumentError, 'contact_name cannot be nil'
335
+ end
336
+
337
+ if contact_name.to_s.length > 255
338
+ fail ArgumentError, 'invalid value for "contact_name", the character length must be smaller than or equal to 255.'
339
+ end
340
+
341
+ @contact_name = contact_name
342
+ end
343
+
344
+ # Custom attribute writer method with validation
345
+ # @param [Object] contact_email Value to be assigned
346
+ def contact_email=(contact_email)
347
+ if contact_email.nil?
348
+ fail ArgumentError, 'contact_email cannot be nil'
349
+ end
350
+
351
+ @contact_email = contact_email
352
+ end
353
+
354
+ # Custom attribute writer method with validation
355
+ # @param [Object] invoice_email Value to be assigned
356
+ def invoice_email=(invoice_email)
357
+ if invoice_email.nil?
358
+ fail ArgumentError, 'invoice_email cannot be nil'
359
+ end
360
+
361
+ @invoice_email = invoice_email
362
+ end
363
+
364
+ # Checks equality by comparing each attribute.
365
+ # @param [Object] Object to be compared
366
+ def ==(o)
367
+ return true if self.equal?(o)
368
+ self.class == o.class &&
369
+ id == o.id &&
370
+ name == o.name &&
371
+ city == o.city &&
372
+ address == o.address &&
373
+ postal == o.postal &&
374
+ phone == o.phone &&
375
+ contact_name == o.contact_name &&
376
+ contact_email == o.contact_email &&
377
+ invoice_email == o.invoice_email &&
378
+ use_parent_on_email == o.use_parent_on_email &&
379
+ use_parent_on_billing == o.use_parent_on_billing &&
380
+ use_parent_on_report == o.use_parent_on_report
381
+ end
382
+
383
+ # @see the `==` method
384
+ # @param [Object] Object to be compared
385
+ def eql?(o)
386
+ self == o
387
+ end
388
+
389
+ # Calculates hash code according to all attributes.
390
+ # @return [Integer] Hash code
391
+ def hash
392
+ [id, name, city, address, postal, phone, contact_name, contact_email, invoice_email, use_parent_on_email, use_parent_on_billing, use_parent_on_report].hash
393
+ end
394
+
395
+ # Builds the object from hash
396
+ # @param [Hash] attributes Model attributes in the form of hash
397
+ # @return [Object] Returns the model itself
398
+ def self.build_from_hash(attributes)
399
+ return nil unless attributes.is_a?(Hash)
400
+ attributes = attributes.transform_keys(&:to_sym)
401
+ transformed_hash = {}
402
+ openapi_types.each_pair do |key, type|
403
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
404
+ transformed_hash["#{key}"] = nil
405
+ elsif type =~ /\AArray<(.*)>/i
406
+ # check to ensure the input is an array given that the attribute
407
+ # is documented as an array but the input is not
408
+ if attributes[attribute_map[key]].is_a?(Array)
409
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
410
+ end
411
+ elsif !attributes[attribute_map[key]].nil?
412
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
413
+ end
414
+ end
415
+ new(transformed_hash)
416
+ end
417
+
418
+ # Returns the object in the form of hash
419
+ # @return [Hash] Returns the object in the form of hash
420
+ def to_hash
421
+ hash = {}
422
+ self.class.attribute_map.each_pair do |attr, param|
423
+ value = self.send(attr)
424
+ if value.nil?
425
+ is_nullable = self.class.openapi_nullable.include?(attr)
426
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
427
+ end
428
+
429
+ hash[param] = _to_hash(value)
430
+ end
431
+ hash
432
+ end
433
+
434
+ end
435
+
436
+ end
@@ -0,0 +1,213 @@
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 JWT token generation for API users
18
+ class JWTGeneration < ApiModelBase
19
+ # Email address of the API user
20
+ attr_accessor :email
21
+
22
+ # Password for the API user
23
+ attr_accessor :password
24
+
25
+ # Organization ID to generate token for
26
+ attr_accessor :organisation_id
27
+
28
+ # Division ID to generate token for (optional)
29
+ attr_accessor :division_id
30
+
31
+ # Attribute mapping from ruby-style variable name to JSON key.
32
+ def self.attribute_map
33
+ {
34
+ :'email' => :'email',
35
+ :'password' => :'password',
36
+ :'organisation_id' => :'organisation_id',
37
+ :'division_id' => :'division_id'
38
+ }
39
+ end
40
+
41
+ # Returns attribute mapping this model knows about
42
+ def self.acceptable_attribute_map
43
+ attribute_map
44
+ end
45
+
46
+ # Returns all the JSON keys this model knows about
47
+ def self.acceptable_attributes
48
+ acceptable_attribute_map.values
49
+ end
50
+
51
+ # Attribute type mapping.
52
+ def self.openapi_types
53
+ {
54
+ :'email' => :'String',
55
+ :'password' => :'String',
56
+ :'organisation_id' => :'String',
57
+ :'division_id' => :'String'
58
+ }
59
+ end
60
+
61
+ # List of attributes with nullable: true
62
+ def self.openapi_nullable
63
+ Set.new([
64
+ ])
65
+ end
66
+
67
+ # Initializes the object
68
+ # @param [Hash] attributes Model attributes in the form of hash
69
+ def initialize(attributes = {})
70
+ if (!attributes.is_a?(Hash))
71
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Pescheck::JWTGeneration` initialize method"
72
+ end
73
+
74
+ # check to see if the attribute exists and convert string to symbol for hash key
75
+ acceptable_attribute_map = self.class.acceptable_attribute_map
76
+ attributes = attributes.each_with_object({}) { |(k, v), h|
77
+ if (!acceptable_attribute_map.key?(k.to_sym))
78
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Pescheck::JWTGeneration`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
79
+ end
80
+ h[k.to_sym] = v
81
+ }
82
+
83
+ if attributes.key?(:'email')
84
+ self.email = attributes[:'email']
85
+ else
86
+ self.email = nil
87
+ end
88
+
89
+ if attributes.key?(:'password')
90
+ self.password = attributes[:'password']
91
+ else
92
+ self.password = nil
93
+ end
94
+
95
+ if attributes.key?(:'organisation_id')
96
+ self.organisation_id = attributes[:'organisation_id']
97
+ end
98
+
99
+ if attributes.key?(:'division_id')
100
+ self.division_id = attributes[:'division_id']
101
+ end
102
+ end
103
+
104
+ # Show invalid properties with the reasons. Usually used together with valid?
105
+ # @return Array for valid properties with the reasons
106
+ def list_invalid_properties
107
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
108
+ invalid_properties = Array.new
109
+ if @email.nil?
110
+ invalid_properties.push('invalid value for "email", email cannot be nil.')
111
+ end
112
+
113
+ if @password.nil?
114
+ invalid_properties.push('invalid value for "password", password cannot be nil.')
115
+ end
116
+
117
+ invalid_properties
118
+ end
119
+
120
+ # Check to see if the all the properties in the model are valid
121
+ # @return true if the model is valid
122
+ def valid?
123
+ warn '[DEPRECATED] the `valid?` method is obsolete'
124
+ return false if @email.nil?
125
+ return false if @password.nil?
126
+ true
127
+ end
128
+
129
+ # Custom attribute writer method with validation
130
+ # @param [Object] email Value to be assigned
131
+ def email=(email)
132
+ if email.nil?
133
+ fail ArgumentError, 'email cannot be nil'
134
+ end
135
+
136
+ @email = email
137
+ end
138
+
139
+ # Custom attribute writer method with validation
140
+ # @param [Object] password Value to be assigned
141
+ def password=(password)
142
+ if password.nil?
143
+ fail ArgumentError, 'password cannot be nil'
144
+ end
145
+
146
+ @password = password
147
+ end
148
+
149
+ # Checks equality by comparing each attribute.
150
+ # @param [Object] Object to be compared
151
+ def ==(o)
152
+ return true if self.equal?(o)
153
+ self.class == o.class &&
154
+ email == o.email &&
155
+ password == o.password &&
156
+ organisation_id == o.organisation_id &&
157
+ division_id == o.division_id
158
+ end
159
+
160
+ # @see the `==` method
161
+ # @param [Object] Object to be compared
162
+ def eql?(o)
163
+ self == o
164
+ end
165
+
166
+ # Calculates hash code according to all attributes.
167
+ # @return [Integer] Hash code
168
+ def hash
169
+ [email, password, organisation_id, division_id].hash
170
+ end
171
+
172
+ # Builds the object from hash
173
+ # @param [Hash] attributes Model attributes in the form of hash
174
+ # @return [Object] Returns the model itself
175
+ def self.build_from_hash(attributes)
176
+ return nil unless attributes.is_a?(Hash)
177
+ attributes = attributes.transform_keys(&:to_sym)
178
+ transformed_hash = {}
179
+ openapi_types.each_pair do |key, type|
180
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
181
+ transformed_hash["#{key}"] = nil
182
+ elsif type =~ /\AArray<(.*)>/i
183
+ # check to ensure the input is an array given that the attribute
184
+ # is documented as an array but the input is not
185
+ if attributes[attribute_map[key]].is_a?(Array)
186
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
187
+ end
188
+ elsif !attributes[attribute_map[key]].nil?
189
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
190
+ end
191
+ end
192
+ new(transformed_hash)
193
+ end
194
+
195
+ # Returns the object in the form of hash
196
+ # @return [Hash] Returns the object in the form of hash
197
+ def to_hash
198
+ hash = {}
199
+ self.class.attribute_map.each_pair do |attr, param|
200
+ value = self.send(attr)
201
+ if value.nil?
202
+ is_nullable = self.class.openapi_nullable.include?(attr)
203
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
204
+ end
205
+
206
+ hash[param] = _to_hash(value)
207
+ end
208
+ hash
209
+ end
210
+
211
+ end
212
+
213
+ end