pescheck-client 0.0.5

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 +182 -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-client/api/authentication_api.rb +220 -0
  50. data/lib/pescheck-client/api/checks_api.rb +144 -0
  51. data/lib/pescheck-client/api/divisions_api.rb +365 -0
  52. data/lib/pescheck-client/api/o_auth_api.rb +202 -0
  53. data/lib/pescheck-client/api/profiles_api.rb +432 -0
  54. data/lib/pescheck-client/api/screenings_api.rb +288 -0
  55. data/lib/pescheck-client/api/webhooks_api.rb +278 -0
  56. data/lib/pescheck-client/api_client.rb +441 -0
  57. data/lib/pescheck-client/api_error.rb +58 -0
  58. data/lib/pescheck-client/api_model_base.rb +88 -0
  59. data/lib/pescheck-client/configuration.rb +429 -0
  60. data/lib/pescheck-client/models/custom_token_obtain_pair.rb +191 -0
  61. data/lib/pescheck-client/models/division_read_only.rb +469 -0
  62. data/lib/pescheck-client/models/division_write.rb +436 -0
  63. data/lib/pescheck-client/models/jwt_generation.rb +213 -0
  64. data/lib/pescheck-client/models/jwt_response.rb +285 -0
  65. data/lib/pescheck-client/models/o_auth_application.rb +265 -0
  66. data/lib/pescheck-client/models/o_auth_application_response.rb +379 -0
  67. data/lib/pescheck-client/models/paginated_division_read_only_list.rb +216 -0
  68. data/lib/pescheck-client/models/paginated_v2_profile_list_item_list.rb +216 -0
  69. data/lib/pescheck-client/models/paginated_v2_screening_list_item_list.rb +216 -0
  70. data/lib/pescheck-client/models/patched_division_write.rb +360 -0
  71. data/lib/pescheck-client/models/patched_v2_profile_partial_update.rb +176 -0
  72. data/lib/pescheck-client/models/token_refresh.rb +173 -0
  73. data/lib/pescheck-client/models/v2_candidate.rb +390 -0
  74. data/lib/pescheck-client/models/v2_check_field.rb +246 -0
  75. data/lib/pescheck-client/models/v2_check_info.rb +438 -0
  76. data/lib/pescheck-client/models/v2_document.rb +308 -0
  77. data/lib/pescheck-client/models/v2_document_content.rb +175 -0
  78. data/lib/pescheck-client/models/v2_money.rb +210 -0
  79. data/lib/pescheck-client/models/v2_profile_check.rb +201 -0
  80. data/lib/pescheck-client/models/v2_profile_check_entry.rb +349 -0
  81. data/lib/pescheck-client/models/v2_profile_create.rb +212 -0
  82. data/lib/pescheck-client/models/v2_profile_detail.rb +401 -0
  83. data/lib/pescheck-client/models/v2_profile_list_item.rb +291 -0
  84. data/lib/pescheck-client/models/v2_profile_update.rb +213 -0
  85. data/lib/pescheck-client/models/v2_profile_update_check.rb +210 -0
  86. data/lib/pescheck-client/models/v2_screening_check.rb +221 -0
  87. data/lib/pescheck-client/models/v2_screening_check_entry.rb +376 -0
  88. data/lib/pescheck-client/models/v2_screening_check_list_item.rb +242 -0
  89. data/lib/pescheck-client/models/v2_screening_create.rb +201 -0
  90. data/lib/pescheck-client/models/v2_screening_detail.rb +348 -0
  91. data/lib/pescheck-client/models/v2_screening_detail_profile.rb +156 -0
  92. data/lib/pescheck-client/models/v2_screening_list_item.rb +330 -0
  93. data/lib/pescheck-client/models/verify_webhook.rb +166 -0
  94. data/lib/pescheck-client/models/webhook.rb +265 -0
  95. data/lib/pescheck-client/models/webhook_response.rb +353 -0
  96. data/lib/pescheck-client/version.rb +15 -0
  97. data/lib/pescheck-client.rb +83 -0
  98. data/pescheck-client.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 +299 -0
@@ -0,0 +1,201 @@
1
+ =begin
2
+ #Pescheck API
3
+
4
+ #Official client library for the Pescheck API (v2), generated from the OpenAPI specification. Authenticate with OAuth2 client credentials and use the checks, profiles, screenings, webhooks and divisions endpoints. See https://github.com/pescheckit/pescheck-clients for installation and usage.
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 V2ScreeningCreate < ApiModelBase
18
+ attr_accessor :profile_id
19
+
20
+ attr_accessor :candidate
21
+
22
+ attr_accessor :checks
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'profile_id' => :'profile_id',
28
+ :'candidate' => :'candidate',
29
+ :'checks' => :'checks'
30
+ }
31
+ end
32
+
33
+ # Returns attribute mapping this model knows about
34
+ def self.acceptable_attribute_map
35
+ attribute_map
36
+ end
37
+
38
+ # Returns all the JSON keys this model knows about
39
+ def self.acceptable_attributes
40
+ acceptable_attribute_map.values
41
+ end
42
+
43
+ # Attribute type mapping.
44
+ def self.openapi_types
45
+ {
46
+ :'profile_id' => :'String',
47
+ :'candidate' => :'V2Candidate',
48
+ :'checks' => :'Array<V2ScreeningCheck>'
49
+ }
50
+ end
51
+
52
+ # List of attributes with nullable: true
53
+ def self.openapi_nullable
54
+ Set.new([
55
+ ])
56
+ end
57
+
58
+ # Initializes the object
59
+ # @param [Hash] attributes Model attributes in the form of hash
60
+ def initialize(attributes = {})
61
+ if (!attributes.is_a?(Hash))
62
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Pescheck::V2ScreeningCreate` initialize method"
63
+ end
64
+
65
+ # check to see if the attribute exists and convert string to symbol for hash key
66
+ acceptable_attribute_map = self.class.acceptable_attribute_map
67
+ attributes = attributes.each_with_object({}) { |(k, v), h|
68
+ if (!acceptable_attribute_map.key?(k.to_sym))
69
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Pescheck::V2ScreeningCreate`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
70
+ end
71
+ h[k.to_sym] = v
72
+ }
73
+
74
+ if attributes.key?(:'profile_id')
75
+ self.profile_id = attributes[:'profile_id']
76
+ else
77
+ self.profile_id = nil
78
+ end
79
+
80
+ if attributes.key?(:'candidate')
81
+ self.candidate = attributes[:'candidate']
82
+ else
83
+ self.candidate = nil
84
+ end
85
+
86
+ if attributes.key?(:'checks')
87
+ if (value = attributes[:'checks']).is_a?(Array)
88
+ self.checks = value
89
+ end
90
+ end
91
+ end
92
+
93
+ # Show invalid properties with the reasons. Usually used together with valid?
94
+ # @return Array for valid properties with the reasons
95
+ def list_invalid_properties
96
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
97
+ invalid_properties = Array.new
98
+ if @profile_id.nil?
99
+ invalid_properties.push('invalid value for "profile_id", profile_id cannot be nil.')
100
+ end
101
+
102
+ if @candidate.nil?
103
+ invalid_properties.push('invalid value for "candidate", candidate cannot be nil.')
104
+ end
105
+
106
+ invalid_properties
107
+ end
108
+
109
+ # Check to see if the all the properties in the model are valid
110
+ # @return true if the model is valid
111
+ def valid?
112
+ warn '[DEPRECATED] the `valid?` method is obsolete'
113
+ return false if @profile_id.nil?
114
+ return false if @candidate.nil?
115
+ true
116
+ end
117
+
118
+ # Custom attribute writer method with validation
119
+ # @param [Object] profile_id Value to be assigned
120
+ def profile_id=(profile_id)
121
+ if profile_id.nil?
122
+ fail ArgumentError, 'profile_id cannot be nil'
123
+ end
124
+
125
+ @profile_id = profile_id
126
+ end
127
+
128
+ # Custom attribute writer method with validation
129
+ # @param [Object] candidate Value to be assigned
130
+ def candidate=(candidate)
131
+ if candidate.nil?
132
+ fail ArgumentError, 'candidate cannot be nil'
133
+ end
134
+
135
+ @candidate = candidate
136
+ end
137
+
138
+ # Checks equality by comparing each attribute.
139
+ # @param [Object] Object to be compared
140
+ def ==(o)
141
+ return true if self.equal?(o)
142
+ self.class == o.class &&
143
+ profile_id == o.profile_id &&
144
+ candidate == o.candidate &&
145
+ checks == o.checks
146
+ end
147
+
148
+ # @see the `==` method
149
+ # @param [Object] Object to be compared
150
+ def eql?(o)
151
+ self == o
152
+ end
153
+
154
+ # Calculates hash code according to all attributes.
155
+ # @return [Integer] Hash code
156
+ def hash
157
+ [profile_id, candidate, checks].hash
158
+ end
159
+
160
+ # Builds the object from hash
161
+ # @param [Hash] attributes Model attributes in the form of hash
162
+ # @return [Object] Returns the model itself
163
+ def self.build_from_hash(attributes)
164
+ return nil unless attributes.is_a?(Hash)
165
+ attributes = attributes.transform_keys(&:to_sym)
166
+ transformed_hash = {}
167
+ openapi_types.each_pair do |key, type|
168
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
169
+ transformed_hash["#{key}"] = nil
170
+ elsif type =~ /\AArray<(.*)>/i
171
+ # check to ensure the input is an array given that the attribute
172
+ # is documented as an array but the input is not
173
+ if attributes[attribute_map[key]].is_a?(Array)
174
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
175
+ end
176
+ elsif !attributes[attribute_map[key]].nil?
177
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
178
+ end
179
+ end
180
+ new(transformed_hash)
181
+ end
182
+
183
+ # Returns the object in the form of hash
184
+ # @return [Hash] Returns the object in the form of hash
185
+ def to_hash
186
+ hash = {}
187
+ self.class.attribute_map.each_pair do |attr, param|
188
+ value = self.send(attr)
189
+ if value.nil?
190
+ is_nullable = self.class.openapi_nullable.include?(attr)
191
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
192
+ end
193
+
194
+ hash[param] = _to_hash(value)
195
+ end
196
+ hash
197
+ end
198
+
199
+ end
200
+
201
+ end
@@ -0,0 +1,348 @@
1
+ =begin
2
+ #Pescheck API
3
+
4
+ #Official client library for the Pescheck API (v2), generated from the OpenAPI specification. Authenticate with OAuth2 client credentials and use the checks, profiles, screenings, webhooks and divisions endpoints. See https://github.com/pescheckit/pescheck-clients for installation and usage.
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 V2ScreeningDetail < ApiModelBase
18
+ attr_accessor :id
19
+
20
+ attr_accessor :status
21
+
22
+ attr_accessor :profile
23
+
24
+ attr_accessor :candidate
25
+
26
+ attr_accessor :checks
27
+
28
+ # Public wizard URL for the candidate. Null when no check needs candidate input.
29
+ attr_accessor :candidate_wizard_url
30
+
31
+ # Dashboard URL for this screening.
32
+ attr_accessor :dashboard_url
33
+
34
+ attr_accessor :created_at
35
+
36
+ attr_accessor :updated_at
37
+
38
+ # Attribute mapping from ruby-style variable name to JSON key.
39
+ def self.attribute_map
40
+ {
41
+ :'id' => :'id',
42
+ :'status' => :'status',
43
+ :'profile' => :'profile',
44
+ :'candidate' => :'candidate',
45
+ :'checks' => :'checks',
46
+ :'candidate_wizard_url' => :'candidate_wizard_url',
47
+ :'dashboard_url' => :'dashboard_url',
48
+ :'created_at' => :'created_at',
49
+ :'updated_at' => :'updated_at'
50
+ }
51
+ end
52
+
53
+ # Returns attribute mapping this model knows about
54
+ def self.acceptable_attribute_map
55
+ attribute_map
56
+ end
57
+
58
+ # Returns all the JSON keys this model knows about
59
+ def self.acceptable_attributes
60
+ acceptable_attribute_map.values
61
+ end
62
+
63
+ # Attribute type mapping.
64
+ def self.openapi_types
65
+ {
66
+ :'id' => :'String',
67
+ :'status' => :'String',
68
+ :'profile' => :'V2ScreeningDetailProfile',
69
+ :'candidate' => :'V2Candidate',
70
+ :'checks' => :'Array<V2ScreeningCheckEntry>',
71
+ :'candidate_wizard_url' => :'String',
72
+ :'dashboard_url' => :'String',
73
+ :'created_at' => :'Time',
74
+ :'updated_at' => :'Time'
75
+ }
76
+ end
77
+
78
+ # List of attributes with nullable: true
79
+ def self.openapi_nullable
80
+ Set.new([
81
+ :'profile',
82
+ :'candidate_wizard_url',
83
+ ])
84
+ end
85
+
86
+ # Initializes the object
87
+ # @param [Hash] attributes Model attributes in the form of hash
88
+ def initialize(attributes = {})
89
+ if (!attributes.is_a?(Hash))
90
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Pescheck::V2ScreeningDetail` initialize method"
91
+ end
92
+
93
+ # check to see if the attribute exists and convert string to symbol for hash key
94
+ acceptable_attribute_map = self.class.acceptable_attribute_map
95
+ attributes = attributes.each_with_object({}) { |(k, v), h|
96
+ if (!acceptable_attribute_map.key?(k.to_sym))
97
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Pescheck::V2ScreeningDetail`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
98
+ end
99
+ h[k.to_sym] = v
100
+ }
101
+
102
+ if attributes.key?(:'id')
103
+ self.id = attributes[:'id']
104
+ else
105
+ self.id = nil
106
+ end
107
+
108
+ if attributes.key?(:'status')
109
+ self.status = attributes[:'status']
110
+ else
111
+ self.status = nil
112
+ end
113
+
114
+ if attributes.key?(:'profile')
115
+ self.profile = attributes[:'profile']
116
+ else
117
+ self.profile = nil
118
+ end
119
+
120
+ if attributes.key?(:'candidate')
121
+ self.candidate = attributes[:'candidate']
122
+ else
123
+ self.candidate = nil
124
+ end
125
+
126
+ if attributes.key?(:'checks')
127
+ if (value = attributes[:'checks']).is_a?(Array)
128
+ self.checks = value
129
+ end
130
+ else
131
+ self.checks = nil
132
+ end
133
+
134
+ if attributes.key?(:'candidate_wizard_url')
135
+ self.candidate_wizard_url = attributes[:'candidate_wizard_url']
136
+ else
137
+ self.candidate_wizard_url = nil
138
+ end
139
+
140
+ if attributes.key?(:'dashboard_url')
141
+ self.dashboard_url = attributes[:'dashboard_url']
142
+ else
143
+ self.dashboard_url = nil
144
+ end
145
+
146
+ if attributes.key?(:'created_at')
147
+ self.created_at = attributes[:'created_at']
148
+ else
149
+ self.created_at = nil
150
+ end
151
+
152
+ if attributes.key?(:'updated_at')
153
+ self.updated_at = attributes[:'updated_at']
154
+ else
155
+ self.updated_at = nil
156
+ end
157
+ end
158
+
159
+ # Show invalid properties with the reasons. Usually used together with valid?
160
+ # @return Array for valid properties with the reasons
161
+ def list_invalid_properties
162
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
163
+ invalid_properties = Array.new
164
+ if @id.nil?
165
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
166
+ end
167
+
168
+ if @status.nil?
169
+ invalid_properties.push('invalid value for "status", status cannot be nil.')
170
+ end
171
+
172
+ if @candidate.nil?
173
+ invalid_properties.push('invalid value for "candidate", candidate cannot be nil.')
174
+ end
175
+
176
+ if @checks.nil?
177
+ invalid_properties.push('invalid value for "checks", checks cannot be nil.')
178
+ end
179
+
180
+ if @dashboard_url.nil?
181
+ invalid_properties.push('invalid value for "dashboard_url", dashboard_url cannot be nil.')
182
+ end
183
+
184
+ if @created_at.nil?
185
+ invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
186
+ end
187
+
188
+ if @updated_at.nil?
189
+ invalid_properties.push('invalid value for "updated_at", updated_at cannot be nil.')
190
+ end
191
+
192
+ invalid_properties
193
+ end
194
+
195
+ # Check to see if the all the properties in the model are valid
196
+ # @return true if the model is valid
197
+ def valid?
198
+ warn '[DEPRECATED] the `valid?` method is obsolete'
199
+ return false if @id.nil?
200
+ return false if @status.nil?
201
+ return false if @candidate.nil?
202
+ return false if @checks.nil?
203
+ return false if @dashboard_url.nil?
204
+ return false if @created_at.nil?
205
+ return false if @updated_at.nil?
206
+ true
207
+ end
208
+
209
+ # Custom attribute writer method with validation
210
+ # @param [Object] id Value to be assigned
211
+ def id=(id)
212
+ if id.nil?
213
+ fail ArgumentError, 'id cannot be nil'
214
+ end
215
+
216
+ @id = id
217
+ end
218
+
219
+ # Custom attribute writer method with validation
220
+ # @param [Object] status Value to be assigned
221
+ def status=(status)
222
+ if status.nil?
223
+ fail ArgumentError, 'status cannot be nil'
224
+ end
225
+
226
+ @status = status
227
+ end
228
+
229
+ # Custom attribute writer method with validation
230
+ # @param [Object] candidate Value to be assigned
231
+ def candidate=(candidate)
232
+ if candidate.nil?
233
+ fail ArgumentError, 'candidate cannot be nil'
234
+ end
235
+
236
+ @candidate = candidate
237
+ end
238
+
239
+ # Custom attribute writer method with validation
240
+ # @param [Object] checks Value to be assigned
241
+ def checks=(checks)
242
+ if checks.nil?
243
+ fail ArgumentError, 'checks cannot be nil'
244
+ end
245
+
246
+ @checks = checks
247
+ end
248
+
249
+ # Custom attribute writer method with validation
250
+ # @param [Object] dashboard_url Value to be assigned
251
+ def dashboard_url=(dashboard_url)
252
+ if dashboard_url.nil?
253
+ fail ArgumentError, 'dashboard_url cannot be nil'
254
+ end
255
+
256
+ @dashboard_url = dashboard_url
257
+ end
258
+
259
+ # Custom attribute writer method with validation
260
+ # @param [Object] created_at Value to be assigned
261
+ def created_at=(created_at)
262
+ if created_at.nil?
263
+ fail ArgumentError, 'created_at cannot be nil'
264
+ end
265
+
266
+ @created_at = created_at
267
+ end
268
+
269
+ # Custom attribute writer method with validation
270
+ # @param [Object] updated_at Value to be assigned
271
+ def updated_at=(updated_at)
272
+ if updated_at.nil?
273
+ fail ArgumentError, 'updated_at cannot be nil'
274
+ end
275
+
276
+ @updated_at = updated_at
277
+ end
278
+
279
+ # Checks equality by comparing each attribute.
280
+ # @param [Object] Object to be compared
281
+ def ==(o)
282
+ return true if self.equal?(o)
283
+ self.class == o.class &&
284
+ id == o.id &&
285
+ status == o.status &&
286
+ profile == o.profile &&
287
+ candidate == o.candidate &&
288
+ checks == o.checks &&
289
+ candidate_wizard_url == o.candidate_wizard_url &&
290
+ dashboard_url == o.dashboard_url &&
291
+ created_at == o.created_at &&
292
+ updated_at == o.updated_at
293
+ end
294
+
295
+ # @see the `==` method
296
+ # @param [Object] Object to be compared
297
+ def eql?(o)
298
+ self == o
299
+ end
300
+
301
+ # Calculates hash code according to all attributes.
302
+ # @return [Integer] Hash code
303
+ def hash
304
+ [id, status, profile, candidate, checks, candidate_wizard_url, dashboard_url, created_at, updated_at].hash
305
+ end
306
+
307
+ # Builds the object from hash
308
+ # @param [Hash] attributes Model attributes in the form of hash
309
+ # @return [Object] Returns the model itself
310
+ def self.build_from_hash(attributes)
311
+ return nil unless attributes.is_a?(Hash)
312
+ attributes = attributes.transform_keys(&:to_sym)
313
+ transformed_hash = {}
314
+ openapi_types.each_pair do |key, type|
315
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
316
+ transformed_hash["#{key}"] = nil
317
+ elsif type =~ /\AArray<(.*)>/i
318
+ # check to ensure the input is an array given that the attribute
319
+ # is documented as an array but the input is not
320
+ if attributes[attribute_map[key]].is_a?(Array)
321
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
322
+ end
323
+ elsif !attributes[attribute_map[key]].nil?
324
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
325
+ end
326
+ end
327
+ new(transformed_hash)
328
+ end
329
+
330
+ # Returns the object in the form of hash
331
+ # @return [Hash] Returns the object in the form of hash
332
+ def to_hash
333
+ hash = {}
334
+ self.class.attribute_map.each_pair do |attr, param|
335
+ value = self.send(attr)
336
+ if value.nil?
337
+ is_nullable = self.class.openapi_nullable.include?(attr)
338
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
339
+ end
340
+
341
+ hash[param] = _to_hash(value)
342
+ end
343
+ hash
344
+ end
345
+
346
+ end
347
+
348
+ end
@@ -0,0 +1,156 @@
1
+ =begin
2
+ #Pescheck API
3
+
4
+ #Official client library for the Pescheck API (v2), generated from the OpenAPI specification. Authenticate with OAuth2 client credentials and use the checks, profiles, screenings, webhooks and divisions endpoints. See https://github.com/pescheckit/pescheck-clients for installation and usage.
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 V2ScreeningDetailProfile < ApiModelBase
18
+ attr_accessor :id
19
+
20
+ attr_accessor :name
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'id' => :'id',
26
+ :'name' => :'name'
27
+ }
28
+ end
29
+
30
+ # Returns attribute mapping this model knows about
31
+ def self.acceptable_attribute_map
32
+ attribute_map
33
+ end
34
+
35
+ # Returns all the JSON keys this model knows about
36
+ def self.acceptable_attributes
37
+ acceptable_attribute_map.values
38
+ end
39
+
40
+ # Attribute type mapping.
41
+ def self.openapi_types
42
+ {
43
+ :'id' => :'String',
44
+ :'name' => :'String'
45
+ }
46
+ end
47
+
48
+ # List of attributes with nullable: true
49
+ def self.openapi_nullable
50
+ Set.new([
51
+ ])
52
+ end
53
+
54
+ # Initializes the object
55
+ # @param [Hash] attributes Model attributes in the form of hash
56
+ def initialize(attributes = {})
57
+ if (!attributes.is_a?(Hash))
58
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Pescheck::V2ScreeningDetailProfile` initialize method"
59
+ end
60
+
61
+ # check to see if the attribute exists and convert string to symbol for hash key
62
+ acceptable_attribute_map = self.class.acceptable_attribute_map
63
+ attributes = attributes.each_with_object({}) { |(k, v), h|
64
+ if (!acceptable_attribute_map.key?(k.to_sym))
65
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Pescheck::V2ScreeningDetailProfile`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
66
+ end
67
+ h[k.to_sym] = v
68
+ }
69
+
70
+ if attributes.key?(:'id')
71
+ self.id = attributes[:'id']
72
+ end
73
+
74
+ if attributes.key?(:'name')
75
+ self.name = attributes[:'name']
76
+ end
77
+ end
78
+
79
+ # Show invalid properties with the reasons. Usually used together with valid?
80
+ # @return Array for valid properties with the reasons
81
+ def list_invalid_properties
82
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
83
+ invalid_properties = Array.new
84
+ invalid_properties
85
+ end
86
+
87
+ # Check to see if the all the properties in the model are valid
88
+ # @return true if the model is valid
89
+ def valid?
90
+ warn '[DEPRECATED] the `valid?` method is obsolete'
91
+ true
92
+ end
93
+
94
+ # Checks equality by comparing each attribute.
95
+ # @param [Object] Object to be compared
96
+ def ==(o)
97
+ return true if self.equal?(o)
98
+ self.class == o.class &&
99
+ id == o.id &&
100
+ name == o.name
101
+ end
102
+
103
+ # @see the `==` method
104
+ # @param [Object] Object to be compared
105
+ def eql?(o)
106
+ self == o
107
+ end
108
+
109
+ # Calculates hash code according to all attributes.
110
+ # @return [Integer] Hash code
111
+ def hash
112
+ [id, name].hash
113
+ end
114
+
115
+ # Builds the object from hash
116
+ # @param [Hash] attributes Model attributes in the form of hash
117
+ # @return [Object] Returns the model itself
118
+ def self.build_from_hash(attributes)
119
+ return nil unless attributes.is_a?(Hash)
120
+ attributes = attributes.transform_keys(&:to_sym)
121
+ transformed_hash = {}
122
+ openapi_types.each_pair do |key, type|
123
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
124
+ transformed_hash["#{key}"] = nil
125
+ elsif type =~ /\AArray<(.*)>/i
126
+ # check to ensure the input is an array given that the attribute
127
+ # is documented as an array but the input is not
128
+ if attributes[attribute_map[key]].is_a?(Array)
129
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
130
+ end
131
+ elsif !attributes[attribute_map[key]].nil?
132
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
133
+ end
134
+ end
135
+ new(transformed_hash)
136
+ end
137
+
138
+ # Returns the object in the form of hash
139
+ # @return [Hash] Returns the object in the form of hash
140
+ def to_hash
141
+ hash = {}
142
+ self.class.attribute_map.each_pair do |attr, param|
143
+ value = self.send(attr)
144
+ if value.nil?
145
+ is_nullable = self.class.openapi_nullable.include?(attr)
146
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
147
+ end
148
+
149
+ hash[param] = _to_hash(value)
150
+ end
151
+ hash
152
+ end
153
+
154
+ end
155
+
156
+ end