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.
- checksums.yaml +7 -0
- data/Gemfile +9 -0
- data/README.md +182 -0
- data/Rakefile +10 -0
- data/docs/AuthenticationApi.md +217 -0
- data/docs/ChecksApi.md +147 -0
- data/docs/CustomTokenObtainPair.md +20 -0
- data/docs/DivisionReadOnly.md +46 -0
- data/docs/DivisionWrite.md +40 -0
- data/docs/DivisionsApi.md +369 -0
- data/docs/JWTGeneration.md +24 -0
- data/docs/JWTResponse.md +28 -0
- data/docs/OAuthApi.md +213 -0
- data/docs/OAuthApplication.md +26 -0
- data/docs/OAuthApplicationResponse.md +32 -0
- data/docs/PaginatedDivisionReadOnlyList.md +24 -0
- data/docs/PaginatedV2ProfileListItemList.md +24 -0
- data/docs/PaginatedV2ScreeningListItemList.md +24 -0
- data/docs/PatchedDivisionWrite.md +40 -0
- data/docs/PatchedV2ProfilePartialUpdate.md +20 -0
- data/docs/ProfilesApi.md +438 -0
- data/docs/ScreeningsApi.md +293 -0
- data/docs/TokenRefresh.md +20 -0
- data/docs/V2Candidate.md +36 -0
- data/docs/V2CheckField.md +26 -0
- data/docs/V2CheckInfo.md +40 -0
- data/docs/V2Document.md +28 -0
- data/docs/V2DocumentContent.md +20 -0
- data/docs/V2Money.md +20 -0
- data/docs/V2ProfileCheck.md +20 -0
- data/docs/V2ProfileCheckEntry.md +30 -0
- data/docs/V2ProfileCreate.md +22 -0
- data/docs/V2ProfileDetail.md +38 -0
- data/docs/V2ProfileListItem.md +30 -0
- data/docs/V2ProfileUpdate.md +22 -0
- data/docs/V2ProfileUpdateCheck.md +22 -0
- data/docs/V2ScreeningCheck.md +24 -0
- data/docs/V2ScreeningCheckEntry.md +34 -0
- data/docs/V2ScreeningCheckListItem.md +22 -0
- data/docs/V2ScreeningCreate.md +22 -0
- data/docs/V2ScreeningDetail.md +34 -0
- data/docs/V2ScreeningDetailProfile.md +20 -0
- data/docs/V2ScreeningListItem.md +34 -0
- data/docs/VerifyWebhook.md +18 -0
- data/docs/Webhook.md +26 -0
- data/docs/WebhookResponse.md +36 -0
- data/docs/WebhooksApi.md +290 -0
- data/git_push.sh +57 -0
- data/lib/pescheck-client/api/authentication_api.rb +220 -0
- data/lib/pescheck-client/api/checks_api.rb +144 -0
- data/lib/pescheck-client/api/divisions_api.rb +365 -0
- data/lib/pescheck-client/api/o_auth_api.rb +202 -0
- data/lib/pescheck-client/api/profiles_api.rb +432 -0
- data/lib/pescheck-client/api/screenings_api.rb +288 -0
- data/lib/pescheck-client/api/webhooks_api.rb +278 -0
- data/lib/pescheck-client/api_client.rb +441 -0
- data/lib/pescheck-client/api_error.rb +58 -0
- data/lib/pescheck-client/api_model_base.rb +88 -0
- data/lib/pescheck-client/configuration.rb +429 -0
- data/lib/pescheck-client/models/custom_token_obtain_pair.rb +191 -0
- data/lib/pescheck-client/models/division_read_only.rb +469 -0
- data/lib/pescheck-client/models/division_write.rb +436 -0
- data/lib/pescheck-client/models/jwt_generation.rb +213 -0
- data/lib/pescheck-client/models/jwt_response.rb +285 -0
- data/lib/pescheck-client/models/o_auth_application.rb +265 -0
- data/lib/pescheck-client/models/o_auth_application_response.rb +379 -0
- data/lib/pescheck-client/models/paginated_division_read_only_list.rb +216 -0
- data/lib/pescheck-client/models/paginated_v2_profile_list_item_list.rb +216 -0
- data/lib/pescheck-client/models/paginated_v2_screening_list_item_list.rb +216 -0
- data/lib/pescheck-client/models/patched_division_write.rb +360 -0
- data/lib/pescheck-client/models/patched_v2_profile_partial_update.rb +176 -0
- data/lib/pescheck-client/models/token_refresh.rb +173 -0
- data/lib/pescheck-client/models/v2_candidate.rb +390 -0
- data/lib/pescheck-client/models/v2_check_field.rb +246 -0
- data/lib/pescheck-client/models/v2_check_info.rb +438 -0
- data/lib/pescheck-client/models/v2_document.rb +308 -0
- data/lib/pescheck-client/models/v2_document_content.rb +175 -0
- data/lib/pescheck-client/models/v2_money.rb +210 -0
- data/lib/pescheck-client/models/v2_profile_check.rb +201 -0
- data/lib/pescheck-client/models/v2_profile_check_entry.rb +349 -0
- data/lib/pescheck-client/models/v2_profile_create.rb +212 -0
- data/lib/pescheck-client/models/v2_profile_detail.rb +401 -0
- data/lib/pescheck-client/models/v2_profile_list_item.rb +291 -0
- data/lib/pescheck-client/models/v2_profile_update.rb +213 -0
- data/lib/pescheck-client/models/v2_profile_update_check.rb +210 -0
- data/lib/pescheck-client/models/v2_screening_check.rb +221 -0
- data/lib/pescheck-client/models/v2_screening_check_entry.rb +376 -0
- data/lib/pescheck-client/models/v2_screening_check_list_item.rb +242 -0
- data/lib/pescheck-client/models/v2_screening_create.rb +201 -0
- data/lib/pescheck-client/models/v2_screening_detail.rb +348 -0
- data/lib/pescheck-client/models/v2_screening_detail_profile.rb +156 -0
- data/lib/pescheck-client/models/v2_screening_list_item.rb +330 -0
- data/lib/pescheck-client/models/verify_webhook.rb +166 -0
- data/lib/pescheck-client/models/webhook.rb +265 -0
- data/lib/pescheck-client/models/webhook_response.rb +353 -0
- data/lib/pescheck-client/version.rb +15 -0
- data/lib/pescheck-client.rb +83 -0
- data/pescheck-client.gemspec +41 -0
- data/spec/api/authentication_api_spec.rb +68 -0
- data/spec/api/checks_api_spec.rb +56 -0
- data/spec/api/divisions_api_spec.rb +94 -0
- data/spec/api/o_auth_api_spec.rb +67 -0
- data/spec/api/profiles_api_spec.rb +105 -0
- data/spec/api/screenings_api_spec.rb +81 -0
- data/spec/api/webhooks_api_spec.rb +81 -0
- data/spec/models/custom_token_obtain_pair_spec.rb +42 -0
- data/spec/models/division_read_only_spec.rb +120 -0
- data/spec/models/division_write_spec.rb +102 -0
- data/spec/models/jwt_generation_spec.rb +54 -0
- data/spec/models/jwt_response_spec.rb +66 -0
- data/spec/models/o_auth_application_response_spec.rb +86 -0
- data/spec/models/o_auth_application_spec.rb +68 -0
- data/spec/models/paginated_division_read_only_list_spec.rb +54 -0
- data/spec/models/paginated_v2_profile_list_item_list_spec.rb +54 -0
- data/spec/models/paginated_v2_screening_list_item_list_spec.rb +54 -0
- data/spec/models/patched_division_write_spec.rb +102 -0
- data/spec/models/patched_v2_profile_partial_update_spec.rb +42 -0
- data/spec/models/token_refresh_spec.rb +42 -0
- data/spec/models/v2_candidate_spec.rb +94 -0
- data/spec/models/v2_check_field_spec.rb +60 -0
- data/spec/models/v2_check_info_spec.rb +102 -0
- data/spec/models/v2_document_content_spec.rb +42 -0
- data/spec/models/v2_document_spec.rb +70 -0
- data/spec/models/v2_money_spec.rb +42 -0
- data/spec/models/v2_profile_check_entry_spec.rb +76 -0
- data/spec/models/v2_profile_check_spec.rb +46 -0
- data/spec/models/v2_profile_create_spec.rb +48 -0
- data/spec/models/v2_profile_detail_spec.rb +96 -0
- data/spec/models/v2_profile_list_item_spec.rb +72 -0
- data/spec/models/v2_profile_update_check_spec.rb +52 -0
- data/spec/models/v2_profile_update_spec.rb +48 -0
- data/spec/models/v2_screening_check_entry_spec.rb +88 -0
- data/spec/models/v2_screening_check_list_item_spec.rb +52 -0
- data/spec/models/v2_screening_check_spec.rb +58 -0
- data/spec/models/v2_screening_create_spec.rb +48 -0
- data/spec/models/v2_screening_detail_profile_spec.rb +42 -0
- data/spec/models/v2_screening_detail_spec.rb +84 -0
- data/spec/models/v2_screening_list_item_spec.rb +84 -0
- data/spec/models/verify_webhook_spec.rb +36 -0
- data/spec/models/webhook_response_spec.rb +90 -0
- data/spec/models/webhook_spec.rb +64 -0
- data/spec/spec_helper.rb +111 -0
- metadata +299 -0
|
@@ -0,0 +1,330 @@
|
|
|
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
|
+
# List shape for GET /screenings/. Same candidate as detail; the only thing we slim here is per-check info (status only), since config/input/output are heavy and rarely needed at list time.
|
|
18
|
+
class V2ScreeningListItem < ApiModelBase
|
|
19
|
+
attr_accessor :id
|
|
20
|
+
|
|
21
|
+
attr_accessor :status
|
|
22
|
+
|
|
23
|
+
attr_accessor :profile
|
|
24
|
+
|
|
25
|
+
attr_accessor :candidate
|
|
26
|
+
|
|
27
|
+
attr_accessor :checks
|
|
28
|
+
|
|
29
|
+
attr_accessor :candidate_wizard_url
|
|
30
|
+
|
|
31
|
+
attr_accessor :dashboard_url
|
|
32
|
+
|
|
33
|
+
attr_accessor :created_at
|
|
34
|
+
|
|
35
|
+
attr_accessor :updated_at
|
|
36
|
+
|
|
37
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
38
|
+
def self.attribute_map
|
|
39
|
+
{
|
|
40
|
+
:'id' => :'id',
|
|
41
|
+
:'status' => :'status',
|
|
42
|
+
:'profile' => :'profile',
|
|
43
|
+
:'candidate' => :'candidate',
|
|
44
|
+
:'checks' => :'checks',
|
|
45
|
+
:'candidate_wizard_url' => :'candidate_wizard_url',
|
|
46
|
+
:'dashboard_url' => :'dashboard_url',
|
|
47
|
+
:'created_at' => :'created_at',
|
|
48
|
+
:'updated_at' => :'updated_at'
|
|
49
|
+
}
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
# Returns attribute mapping this model knows about
|
|
53
|
+
def self.acceptable_attribute_map
|
|
54
|
+
attribute_map
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
# Returns all the JSON keys this model knows about
|
|
58
|
+
def self.acceptable_attributes
|
|
59
|
+
acceptable_attribute_map.values
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
# Attribute type mapping.
|
|
63
|
+
def self.openapi_types
|
|
64
|
+
{
|
|
65
|
+
:'id' => :'String',
|
|
66
|
+
:'status' => :'String',
|
|
67
|
+
:'profile' => :'V2ScreeningDetailProfile',
|
|
68
|
+
:'candidate' => :'V2Candidate',
|
|
69
|
+
:'checks' => :'Array<V2ScreeningCheckListItem>',
|
|
70
|
+
:'candidate_wizard_url' => :'String',
|
|
71
|
+
:'dashboard_url' => :'String',
|
|
72
|
+
:'created_at' => :'Time',
|
|
73
|
+
:'updated_at' => :'Time'
|
|
74
|
+
}
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
# List of attributes with nullable: true
|
|
78
|
+
def self.openapi_nullable
|
|
79
|
+
Set.new([
|
|
80
|
+
:'profile',
|
|
81
|
+
:'candidate_wizard_url',
|
|
82
|
+
])
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
# Initializes the object
|
|
86
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
87
|
+
def initialize(attributes = {})
|
|
88
|
+
if (!attributes.is_a?(Hash))
|
|
89
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Pescheck::V2ScreeningListItem` initialize method"
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
93
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
94
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
95
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
96
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Pescheck::V2ScreeningListItem`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
97
|
+
end
|
|
98
|
+
h[k.to_sym] = v
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
if attributes.key?(:'id')
|
|
102
|
+
self.id = attributes[:'id']
|
|
103
|
+
else
|
|
104
|
+
self.id = nil
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
if attributes.key?(:'status')
|
|
108
|
+
self.status = attributes[:'status']
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
if attributes.key?(:'profile')
|
|
112
|
+
self.profile = attributes[:'profile']
|
|
113
|
+
else
|
|
114
|
+
self.profile = nil
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
if attributes.key?(:'candidate')
|
|
118
|
+
self.candidate = attributes[:'candidate']
|
|
119
|
+
else
|
|
120
|
+
self.candidate = nil
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
if attributes.key?(:'checks')
|
|
124
|
+
if (value = attributes[:'checks']).is_a?(Array)
|
|
125
|
+
self.checks = value
|
|
126
|
+
end
|
|
127
|
+
else
|
|
128
|
+
self.checks = nil
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
if attributes.key?(:'candidate_wizard_url')
|
|
132
|
+
self.candidate_wizard_url = attributes[:'candidate_wizard_url']
|
|
133
|
+
else
|
|
134
|
+
self.candidate_wizard_url = nil
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
if attributes.key?(:'dashboard_url')
|
|
138
|
+
self.dashboard_url = attributes[:'dashboard_url']
|
|
139
|
+
else
|
|
140
|
+
self.dashboard_url = nil
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
if attributes.key?(:'created_at')
|
|
144
|
+
self.created_at = attributes[:'created_at']
|
|
145
|
+
else
|
|
146
|
+
self.created_at = nil
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
if attributes.key?(:'updated_at')
|
|
150
|
+
self.updated_at = attributes[:'updated_at']
|
|
151
|
+
else
|
|
152
|
+
self.updated_at = nil
|
|
153
|
+
end
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
157
|
+
# @return Array for valid properties with the reasons
|
|
158
|
+
def list_invalid_properties
|
|
159
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
160
|
+
invalid_properties = Array.new
|
|
161
|
+
if @id.nil?
|
|
162
|
+
invalid_properties.push('invalid value for "id", id cannot be nil.')
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
if @candidate.nil?
|
|
166
|
+
invalid_properties.push('invalid value for "candidate", candidate cannot be nil.')
|
|
167
|
+
end
|
|
168
|
+
|
|
169
|
+
if @checks.nil?
|
|
170
|
+
invalid_properties.push('invalid value for "checks", checks cannot be nil.')
|
|
171
|
+
end
|
|
172
|
+
|
|
173
|
+
if @dashboard_url.nil?
|
|
174
|
+
invalid_properties.push('invalid value for "dashboard_url", dashboard_url cannot be nil.')
|
|
175
|
+
end
|
|
176
|
+
|
|
177
|
+
if @created_at.nil?
|
|
178
|
+
invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
|
|
179
|
+
end
|
|
180
|
+
|
|
181
|
+
if @updated_at.nil?
|
|
182
|
+
invalid_properties.push('invalid value for "updated_at", updated_at cannot be nil.')
|
|
183
|
+
end
|
|
184
|
+
|
|
185
|
+
invalid_properties
|
|
186
|
+
end
|
|
187
|
+
|
|
188
|
+
# Check to see if the all the properties in the model are valid
|
|
189
|
+
# @return true if the model is valid
|
|
190
|
+
def valid?
|
|
191
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
192
|
+
return false if @id.nil?
|
|
193
|
+
return false if @candidate.nil?
|
|
194
|
+
return false if @checks.nil?
|
|
195
|
+
return false if @dashboard_url.nil?
|
|
196
|
+
return false if @created_at.nil?
|
|
197
|
+
return false if @updated_at.nil?
|
|
198
|
+
true
|
|
199
|
+
end
|
|
200
|
+
|
|
201
|
+
# Custom attribute writer method with validation
|
|
202
|
+
# @param [Object] id Value to be assigned
|
|
203
|
+
def id=(id)
|
|
204
|
+
if id.nil?
|
|
205
|
+
fail ArgumentError, 'id cannot be nil'
|
|
206
|
+
end
|
|
207
|
+
|
|
208
|
+
@id = id
|
|
209
|
+
end
|
|
210
|
+
|
|
211
|
+
# Custom attribute writer method with validation
|
|
212
|
+
# @param [Object] candidate Value to be assigned
|
|
213
|
+
def candidate=(candidate)
|
|
214
|
+
if candidate.nil?
|
|
215
|
+
fail ArgumentError, 'candidate cannot be nil'
|
|
216
|
+
end
|
|
217
|
+
|
|
218
|
+
@candidate = candidate
|
|
219
|
+
end
|
|
220
|
+
|
|
221
|
+
# Custom attribute writer method with validation
|
|
222
|
+
# @param [Object] checks Value to be assigned
|
|
223
|
+
def checks=(checks)
|
|
224
|
+
if checks.nil?
|
|
225
|
+
fail ArgumentError, 'checks cannot be nil'
|
|
226
|
+
end
|
|
227
|
+
|
|
228
|
+
@checks = checks
|
|
229
|
+
end
|
|
230
|
+
|
|
231
|
+
# Custom attribute writer method with validation
|
|
232
|
+
# @param [Object] dashboard_url Value to be assigned
|
|
233
|
+
def dashboard_url=(dashboard_url)
|
|
234
|
+
if dashboard_url.nil?
|
|
235
|
+
fail ArgumentError, 'dashboard_url cannot be nil'
|
|
236
|
+
end
|
|
237
|
+
|
|
238
|
+
@dashboard_url = dashboard_url
|
|
239
|
+
end
|
|
240
|
+
|
|
241
|
+
# Custom attribute writer method with validation
|
|
242
|
+
# @param [Object] created_at Value to be assigned
|
|
243
|
+
def created_at=(created_at)
|
|
244
|
+
if created_at.nil?
|
|
245
|
+
fail ArgumentError, 'created_at cannot be nil'
|
|
246
|
+
end
|
|
247
|
+
|
|
248
|
+
@created_at = created_at
|
|
249
|
+
end
|
|
250
|
+
|
|
251
|
+
# Custom attribute writer method with validation
|
|
252
|
+
# @param [Object] updated_at Value to be assigned
|
|
253
|
+
def updated_at=(updated_at)
|
|
254
|
+
if updated_at.nil?
|
|
255
|
+
fail ArgumentError, 'updated_at cannot be nil'
|
|
256
|
+
end
|
|
257
|
+
|
|
258
|
+
@updated_at = updated_at
|
|
259
|
+
end
|
|
260
|
+
|
|
261
|
+
# Checks equality by comparing each attribute.
|
|
262
|
+
# @param [Object] Object to be compared
|
|
263
|
+
def ==(o)
|
|
264
|
+
return true if self.equal?(o)
|
|
265
|
+
self.class == o.class &&
|
|
266
|
+
id == o.id &&
|
|
267
|
+
status == o.status &&
|
|
268
|
+
profile == o.profile &&
|
|
269
|
+
candidate == o.candidate &&
|
|
270
|
+
checks == o.checks &&
|
|
271
|
+
candidate_wizard_url == o.candidate_wizard_url &&
|
|
272
|
+
dashboard_url == o.dashboard_url &&
|
|
273
|
+
created_at == o.created_at &&
|
|
274
|
+
updated_at == o.updated_at
|
|
275
|
+
end
|
|
276
|
+
|
|
277
|
+
# @see the `==` method
|
|
278
|
+
# @param [Object] Object to be compared
|
|
279
|
+
def eql?(o)
|
|
280
|
+
self == o
|
|
281
|
+
end
|
|
282
|
+
|
|
283
|
+
# Calculates hash code according to all attributes.
|
|
284
|
+
# @return [Integer] Hash code
|
|
285
|
+
def hash
|
|
286
|
+
[id, status, profile, candidate, checks, candidate_wizard_url, dashboard_url, created_at, updated_at].hash
|
|
287
|
+
end
|
|
288
|
+
|
|
289
|
+
# Builds the object from hash
|
|
290
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
291
|
+
# @return [Object] Returns the model itself
|
|
292
|
+
def self.build_from_hash(attributes)
|
|
293
|
+
return nil unless attributes.is_a?(Hash)
|
|
294
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
295
|
+
transformed_hash = {}
|
|
296
|
+
openapi_types.each_pair do |key, type|
|
|
297
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
298
|
+
transformed_hash["#{key}"] = nil
|
|
299
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
300
|
+
# check to ensure the input is an array given that the attribute
|
|
301
|
+
# is documented as an array but the input is not
|
|
302
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
303
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
304
|
+
end
|
|
305
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
306
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
307
|
+
end
|
|
308
|
+
end
|
|
309
|
+
new(transformed_hash)
|
|
310
|
+
end
|
|
311
|
+
|
|
312
|
+
# Returns the object in the form of hash
|
|
313
|
+
# @return [Hash] Returns the object in the form of hash
|
|
314
|
+
def to_hash
|
|
315
|
+
hash = {}
|
|
316
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
317
|
+
value = self.send(attr)
|
|
318
|
+
if value.nil?
|
|
319
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
320
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
321
|
+
end
|
|
322
|
+
|
|
323
|
+
hash[param] = _to_hash(value)
|
|
324
|
+
end
|
|
325
|
+
hash
|
|
326
|
+
end
|
|
327
|
+
|
|
328
|
+
end
|
|
329
|
+
|
|
330
|
+
end
|
|
@@ -0,0 +1,166 @@
|
|
|
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
|
+
# Body shape for POST /webhooks/{id}/verify/. The verification code is the one sent to the webhook URL when the webhook was created; the receiver POSTs it back here to confirm ownership.
|
|
18
|
+
class VerifyWebhook < ApiModelBase
|
|
19
|
+
# The verification code delivered to the webhook URL on creation.
|
|
20
|
+
attr_accessor :verification_code
|
|
21
|
+
|
|
22
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
23
|
+
def self.attribute_map
|
|
24
|
+
{
|
|
25
|
+
:'verification_code' => :'verification_code'
|
|
26
|
+
}
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
# Returns attribute mapping this model knows about
|
|
30
|
+
def self.acceptable_attribute_map
|
|
31
|
+
attribute_map
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
# Returns all the JSON keys this model knows about
|
|
35
|
+
def self.acceptable_attributes
|
|
36
|
+
acceptable_attribute_map.values
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
# Attribute type mapping.
|
|
40
|
+
def self.openapi_types
|
|
41
|
+
{
|
|
42
|
+
:'verification_code' => :'String'
|
|
43
|
+
}
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
# List of attributes with nullable: true
|
|
47
|
+
def self.openapi_nullable
|
|
48
|
+
Set.new([
|
|
49
|
+
])
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
# Initializes the object
|
|
53
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
54
|
+
def initialize(attributes = {})
|
|
55
|
+
if (!attributes.is_a?(Hash))
|
|
56
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Pescheck::VerifyWebhook` initialize method"
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
60
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
61
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
62
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
63
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Pescheck::VerifyWebhook`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
64
|
+
end
|
|
65
|
+
h[k.to_sym] = v
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
if attributes.key?(:'verification_code')
|
|
69
|
+
self.verification_code = attributes[:'verification_code']
|
|
70
|
+
else
|
|
71
|
+
self.verification_code = nil
|
|
72
|
+
end
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
76
|
+
# @return Array for valid properties with the reasons
|
|
77
|
+
def list_invalid_properties
|
|
78
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
79
|
+
invalid_properties = Array.new
|
|
80
|
+
if @verification_code.nil?
|
|
81
|
+
invalid_properties.push('invalid value for "verification_code", verification_code cannot be nil.')
|
|
82
|
+
end
|
|
83
|
+
|
|
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
|
+
return false if @verification_code.nil?
|
|
92
|
+
true
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
# Custom attribute writer method with validation
|
|
96
|
+
# @param [Object] verification_code Value to be assigned
|
|
97
|
+
def verification_code=(verification_code)
|
|
98
|
+
if verification_code.nil?
|
|
99
|
+
fail ArgumentError, 'verification_code cannot be nil'
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
@verification_code = verification_code
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
# Checks equality by comparing each attribute.
|
|
106
|
+
# @param [Object] Object to be compared
|
|
107
|
+
def ==(o)
|
|
108
|
+
return true if self.equal?(o)
|
|
109
|
+
self.class == o.class &&
|
|
110
|
+
verification_code == o.verification_code
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
# @see the `==` method
|
|
114
|
+
# @param [Object] Object to be compared
|
|
115
|
+
def eql?(o)
|
|
116
|
+
self == o
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
# Calculates hash code according to all attributes.
|
|
120
|
+
# @return [Integer] Hash code
|
|
121
|
+
def hash
|
|
122
|
+
[verification_code].hash
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
# Builds the object from hash
|
|
126
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
127
|
+
# @return [Object] Returns the model itself
|
|
128
|
+
def self.build_from_hash(attributes)
|
|
129
|
+
return nil unless attributes.is_a?(Hash)
|
|
130
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
131
|
+
transformed_hash = {}
|
|
132
|
+
openapi_types.each_pair do |key, type|
|
|
133
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
134
|
+
transformed_hash["#{key}"] = nil
|
|
135
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
136
|
+
# check to ensure the input is an array given that the attribute
|
|
137
|
+
# is documented as an array but the input is not
|
|
138
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
139
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
140
|
+
end
|
|
141
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
142
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
143
|
+
end
|
|
144
|
+
end
|
|
145
|
+
new(transformed_hash)
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
# Returns the object in the form of hash
|
|
149
|
+
# @return [Hash] Returns the object in the form of hash
|
|
150
|
+
def to_hash
|
|
151
|
+
hash = {}
|
|
152
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
153
|
+
value = self.send(attr)
|
|
154
|
+
if value.nil?
|
|
155
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
156
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
hash[param] = _to_hash(value)
|
|
160
|
+
end
|
|
161
|
+
hash
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
end
|