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,308 @@
|
|
|
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
|
+
# One document attached to a screening's check. `metadata` carries check-specific extras and may be empty.
|
|
18
|
+
class V2Document < ApiModelBase
|
|
19
|
+
attr_accessor :check_id
|
|
20
|
+
|
|
21
|
+
# * `addresscheck` - addresscheck * `adversemediacheck` - adversemediacheck * `bigcheck` - bigcheck * `criminalrecordscheck` - criminalrecordscheck * `criminalrecordsuploadcheck` - criminalrecordsuploadcheck * `customintegritycheck` - customintegritycheck * `cvcheck` - cvcheck * `edrcheck` - edrcheck * `focumcheck` - focumcheck * `id2check` - id2check * `idcheck` - idcheck * `integritycheck` - integritycheck * `openhealthcarecheck` - openhealthcarecheck * `permissioncheck` - permissioncheck * `pescheckadversemediacheck` - pescheckadversemediacheck * `qualificationcheck` - qualificationcheck * `righttoworkcheck` - righttoworkcheck * `vogcheck` - vogcheck * `watchlist2check` - watchlist2check * `watchlistcheck` - watchlistcheck * `workreferencecheck` - workreferencecheck * `worldwidecreditcheck` - worldwidecreditcheck
|
|
22
|
+
attr_accessor :check_type
|
|
23
|
+
|
|
24
|
+
attr_accessor :filename
|
|
25
|
+
|
|
26
|
+
attr_accessor :extension
|
|
27
|
+
|
|
28
|
+
attr_accessor :content
|
|
29
|
+
|
|
30
|
+
attr_accessor :metadata
|
|
31
|
+
|
|
32
|
+
class EnumAttributeValidator
|
|
33
|
+
attr_reader :datatype
|
|
34
|
+
attr_reader :allowable_values
|
|
35
|
+
|
|
36
|
+
def initialize(datatype, allowable_values)
|
|
37
|
+
@allowable_values = allowable_values.map do |value|
|
|
38
|
+
case datatype.to_s
|
|
39
|
+
when /Integer/i
|
|
40
|
+
value.to_i
|
|
41
|
+
when /Float/i
|
|
42
|
+
value.to_f
|
|
43
|
+
else
|
|
44
|
+
value
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
def valid?(value)
|
|
50
|
+
!value || allowable_values.include?(value)
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
55
|
+
def self.attribute_map
|
|
56
|
+
{
|
|
57
|
+
:'check_id' => :'check_id',
|
|
58
|
+
:'check_type' => :'check_type',
|
|
59
|
+
:'filename' => :'filename',
|
|
60
|
+
:'extension' => :'extension',
|
|
61
|
+
:'content' => :'content',
|
|
62
|
+
:'metadata' => :'metadata'
|
|
63
|
+
}
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
# Returns attribute mapping this model knows about
|
|
67
|
+
def self.acceptable_attribute_map
|
|
68
|
+
attribute_map
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
# Returns all the JSON keys this model knows about
|
|
72
|
+
def self.acceptable_attributes
|
|
73
|
+
acceptable_attribute_map.values
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
# Attribute type mapping.
|
|
77
|
+
def self.openapi_types
|
|
78
|
+
{
|
|
79
|
+
:'check_id' => :'String',
|
|
80
|
+
:'check_type' => :'String',
|
|
81
|
+
:'filename' => :'String',
|
|
82
|
+
:'extension' => :'String',
|
|
83
|
+
:'content' => :'V2DocumentContent',
|
|
84
|
+
:'metadata' => :'Hash<String, Object>'
|
|
85
|
+
}
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
# List of attributes with nullable: true
|
|
89
|
+
def self.openapi_nullable
|
|
90
|
+
Set.new([
|
|
91
|
+
:'check_id',
|
|
92
|
+
])
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
# Initializes the object
|
|
96
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
97
|
+
def initialize(attributes = {})
|
|
98
|
+
if (!attributes.is_a?(Hash))
|
|
99
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Pescheck::V2Document` initialize method"
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
103
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
104
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
105
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
106
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Pescheck::V2Document`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
107
|
+
end
|
|
108
|
+
h[k.to_sym] = v
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
if attributes.key?(:'check_id')
|
|
112
|
+
self.check_id = attributes[:'check_id']
|
|
113
|
+
else
|
|
114
|
+
self.check_id = nil
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
if attributes.key?(:'check_type')
|
|
118
|
+
self.check_type = attributes[:'check_type']
|
|
119
|
+
else
|
|
120
|
+
self.check_type = nil
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
if attributes.key?(:'filename')
|
|
124
|
+
self.filename = attributes[:'filename']
|
|
125
|
+
else
|
|
126
|
+
self.filename = nil
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
if attributes.key?(:'extension')
|
|
130
|
+
self.extension = attributes[:'extension']
|
|
131
|
+
else
|
|
132
|
+
self.extension = nil
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
if attributes.key?(:'content')
|
|
136
|
+
self.content = attributes[:'content']
|
|
137
|
+
else
|
|
138
|
+
self.content = nil
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
if attributes.key?(:'metadata')
|
|
142
|
+
if (value = attributes[:'metadata']).is_a?(Hash)
|
|
143
|
+
self.metadata = value
|
|
144
|
+
end
|
|
145
|
+
else
|
|
146
|
+
self.metadata = nil
|
|
147
|
+
end
|
|
148
|
+
end
|
|
149
|
+
|
|
150
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
151
|
+
# @return Array for valid properties with the reasons
|
|
152
|
+
def list_invalid_properties
|
|
153
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
154
|
+
invalid_properties = Array.new
|
|
155
|
+
if @check_type.nil?
|
|
156
|
+
invalid_properties.push('invalid value for "check_type", check_type cannot be nil.')
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
if @filename.nil?
|
|
160
|
+
invalid_properties.push('invalid value for "filename", filename cannot be nil.')
|
|
161
|
+
end
|
|
162
|
+
|
|
163
|
+
if @extension.nil?
|
|
164
|
+
invalid_properties.push('invalid value for "extension", extension cannot be nil.')
|
|
165
|
+
end
|
|
166
|
+
|
|
167
|
+
if @content.nil?
|
|
168
|
+
invalid_properties.push('invalid value for "content", content cannot be nil.')
|
|
169
|
+
end
|
|
170
|
+
|
|
171
|
+
if @metadata.nil?
|
|
172
|
+
invalid_properties.push('invalid value for "metadata", metadata cannot be nil.')
|
|
173
|
+
end
|
|
174
|
+
|
|
175
|
+
invalid_properties
|
|
176
|
+
end
|
|
177
|
+
|
|
178
|
+
# Check to see if the all the properties in the model are valid
|
|
179
|
+
# @return true if the model is valid
|
|
180
|
+
def valid?
|
|
181
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
182
|
+
return false if @check_type.nil?
|
|
183
|
+
check_type_validator = EnumAttributeValidator.new('String', ["addresscheck", "adversemediacheck", "bigcheck", "criminalrecordscheck", "criminalrecordsuploadcheck", "customintegritycheck", "cvcheck", "edrcheck", "focumcheck", "id2check", "idcheck", "integritycheck", "openhealthcarecheck", "permissioncheck", "pescheckadversemediacheck", "qualificationcheck", "righttoworkcheck", "vogcheck", "watchlist2check", "watchlistcheck", "workreferencecheck", "worldwidecreditcheck"])
|
|
184
|
+
return false unless check_type_validator.valid?(@check_type)
|
|
185
|
+
return false if @filename.nil?
|
|
186
|
+
return false if @extension.nil?
|
|
187
|
+
return false if @content.nil?
|
|
188
|
+
return false if @metadata.nil?
|
|
189
|
+
true
|
|
190
|
+
end
|
|
191
|
+
|
|
192
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
193
|
+
# @param [Object] check_type Object to be assigned
|
|
194
|
+
def check_type=(check_type)
|
|
195
|
+
validator = EnumAttributeValidator.new('String', ["addresscheck", "adversemediacheck", "bigcheck", "criminalrecordscheck", "criminalrecordsuploadcheck", "customintegritycheck", "cvcheck", "edrcheck", "focumcheck", "id2check", "idcheck", "integritycheck", "openhealthcarecheck", "permissioncheck", "pescheckadversemediacheck", "qualificationcheck", "righttoworkcheck", "vogcheck", "watchlist2check", "watchlistcheck", "workreferencecheck", "worldwidecreditcheck"])
|
|
196
|
+
unless validator.valid?(check_type)
|
|
197
|
+
fail ArgumentError, "invalid value for \"check_type\", must be one of #{validator.allowable_values}."
|
|
198
|
+
end
|
|
199
|
+
@check_type = check_type
|
|
200
|
+
end
|
|
201
|
+
|
|
202
|
+
# Custom attribute writer method with validation
|
|
203
|
+
# @param [Object] filename Value to be assigned
|
|
204
|
+
def filename=(filename)
|
|
205
|
+
if filename.nil?
|
|
206
|
+
fail ArgumentError, 'filename cannot be nil'
|
|
207
|
+
end
|
|
208
|
+
|
|
209
|
+
@filename = filename
|
|
210
|
+
end
|
|
211
|
+
|
|
212
|
+
# Custom attribute writer method with validation
|
|
213
|
+
# @param [Object] extension Value to be assigned
|
|
214
|
+
def extension=(extension)
|
|
215
|
+
if extension.nil?
|
|
216
|
+
fail ArgumentError, 'extension cannot be nil'
|
|
217
|
+
end
|
|
218
|
+
|
|
219
|
+
@extension = extension
|
|
220
|
+
end
|
|
221
|
+
|
|
222
|
+
# Custom attribute writer method with validation
|
|
223
|
+
# @param [Object] content Value to be assigned
|
|
224
|
+
def content=(content)
|
|
225
|
+
if content.nil?
|
|
226
|
+
fail ArgumentError, 'content cannot be nil'
|
|
227
|
+
end
|
|
228
|
+
|
|
229
|
+
@content = content
|
|
230
|
+
end
|
|
231
|
+
|
|
232
|
+
# Custom attribute writer method with validation
|
|
233
|
+
# @param [Object] metadata Value to be assigned
|
|
234
|
+
def metadata=(metadata)
|
|
235
|
+
if metadata.nil?
|
|
236
|
+
fail ArgumentError, 'metadata cannot be nil'
|
|
237
|
+
end
|
|
238
|
+
|
|
239
|
+
@metadata = metadata
|
|
240
|
+
end
|
|
241
|
+
|
|
242
|
+
# Checks equality by comparing each attribute.
|
|
243
|
+
# @param [Object] Object to be compared
|
|
244
|
+
def ==(o)
|
|
245
|
+
return true if self.equal?(o)
|
|
246
|
+
self.class == o.class &&
|
|
247
|
+
check_id == o.check_id &&
|
|
248
|
+
check_type == o.check_type &&
|
|
249
|
+
filename == o.filename &&
|
|
250
|
+
extension == o.extension &&
|
|
251
|
+
content == o.content &&
|
|
252
|
+
metadata == o.metadata
|
|
253
|
+
end
|
|
254
|
+
|
|
255
|
+
# @see the `==` method
|
|
256
|
+
# @param [Object] Object to be compared
|
|
257
|
+
def eql?(o)
|
|
258
|
+
self == o
|
|
259
|
+
end
|
|
260
|
+
|
|
261
|
+
# Calculates hash code according to all attributes.
|
|
262
|
+
# @return [Integer] Hash code
|
|
263
|
+
def hash
|
|
264
|
+
[check_id, check_type, filename, extension, content, metadata].hash
|
|
265
|
+
end
|
|
266
|
+
|
|
267
|
+
# Builds the object from hash
|
|
268
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
269
|
+
# @return [Object] Returns the model itself
|
|
270
|
+
def self.build_from_hash(attributes)
|
|
271
|
+
return nil unless attributes.is_a?(Hash)
|
|
272
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
273
|
+
transformed_hash = {}
|
|
274
|
+
openapi_types.each_pair do |key, type|
|
|
275
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
276
|
+
transformed_hash["#{key}"] = nil
|
|
277
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
278
|
+
# check to ensure the input is an array given that the attribute
|
|
279
|
+
# is documented as an array but the input is not
|
|
280
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
281
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
282
|
+
end
|
|
283
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
284
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
285
|
+
end
|
|
286
|
+
end
|
|
287
|
+
new(transformed_hash)
|
|
288
|
+
end
|
|
289
|
+
|
|
290
|
+
# Returns the object in the form of hash
|
|
291
|
+
# @return [Hash] Returns the object in the form of hash
|
|
292
|
+
def to_hash
|
|
293
|
+
hash = {}
|
|
294
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
295
|
+
value = self.send(attr)
|
|
296
|
+
if value.nil?
|
|
297
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
298
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
299
|
+
end
|
|
300
|
+
|
|
301
|
+
hash[param] = _to_hash(value)
|
|
302
|
+
end
|
|
303
|
+
hash
|
|
304
|
+
end
|
|
305
|
+
|
|
306
|
+
end
|
|
307
|
+
|
|
308
|
+
end
|
|
@@ -0,0 +1,175 @@
|
|
|
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
|
+
# How the file is delivered. `type` is the discriminator; today it is always `\"base64\"` and `data` holds the encoded bytes. Other delivery types may be added later without breaking this contract.
|
|
18
|
+
class V2DocumentContent < ApiModelBase
|
|
19
|
+
attr_accessor :type
|
|
20
|
+
|
|
21
|
+
# Base64-encoded file contents (type == base64).
|
|
22
|
+
attr_accessor :data
|
|
23
|
+
|
|
24
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
25
|
+
def self.attribute_map
|
|
26
|
+
{
|
|
27
|
+
:'type' => :'type',
|
|
28
|
+
:'data' => :'data'
|
|
29
|
+
}
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# Returns attribute mapping this model knows about
|
|
33
|
+
def self.acceptable_attribute_map
|
|
34
|
+
attribute_map
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
# Returns all the JSON keys this model knows about
|
|
38
|
+
def self.acceptable_attributes
|
|
39
|
+
acceptable_attribute_map.values
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
# Attribute type mapping.
|
|
43
|
+
def self.openapi_types
|
|
44
|
+
{
|
|
45
|
+
:'type' => :'String',
|
|
46
|
+
:'data' => :'String'
|
|
47
|
+
}
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# List of attributes with nullable: true
|
|
51
|
+
def self.openapi_nullable
|
|
52
|
+
Set.new([
|
|
53
|
+
])
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
# Initializes the object
|
|
57
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
58
|
+
def initialize(attributes = {})
|
|
59
|
+
if (!attributes.is_a?(Hash))
|
|
60
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Pescheck::V2DocumentContent` initialize method"
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
64
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
65
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
66
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
67
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Pescheck::V2DocumentContent`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
68
|
+
end
|
|
69
|
+
h[k.to_sym] = v
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
if attributes.key?(:'type')
|
|
73
|
+
self.type = attributes[:'type']
|
|
74
|
+
else
|
|
75
|
+
self.type = nil
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
if attributes.key?(:'data')
|
|
79
|
+
self.data = attributes[:'data']
|
|
80
|
+
end
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
84
|
+
# @return Array for valid properties with the reasons
|
|
85
|
+
def list_invalid_properties
|
|
86
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
87
|
+
invalid_properties = Array.new
|
|
88
|
+
if @type.nil?
|
|
89
|
+
invalid_properties.push('invalid value for "type", type cannot be nil.')
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
invalid_properties
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
# Check to see if the all the properties in the model are valid
|
|
96
|
+
# @return true if the model is valid
|
|
97
|
+
def valid?
|
|
98
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
99
|
+
return false if @type.nil?
|
|
100
|
+
true
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
# Custom attribute writer method with validation
|
|
104
|
+
# @param [Object] type Value to be assigned
|
|
105
|
+
def type=(type)
|
|
106
|
+
if type.nil?
|
|
107
|
+
fail ArgumentError, 'type cannot be nil'
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
@type = type
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
# Checks equality by comparing each attribute.
|
|
114
|
+
# @param [Object] Object to be compared
|
|
115
|
+
def ==(o)
|
|
116
|
+
return true if self.equal?(o)
|
|
117
|
+
self.class == o.class &&
|
|
118
|
+
type == o.type &&
|
|
119
|
+
data == o.data
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
# @see the `==` method
|
|
123
|
+
# @param [Object] Object to be compared
|
|
124
|
+
def eql?(o)
|
|
125
|
+
self == o
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
# Calculates hash code according to all attributes.
|
|
129
|
+
# @return [Integer] Hash code
|
|
130
|
+
def hash
|
|
131
|
+
[type, data].hash
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
# Builds the object from hash
|
|
135
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
136
|
+
# @return [Object] Returns the model itself
|
|
137
|
+
def self.build_from_hash(attributes)
|
|
138
|
+
return nil unless attributes.is_a?(Hash)
|
|
139
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
140
|
+
transformed_hash = {}
|
|
141
|
+
openapi_types.each_pair do |key, type|
|
|
142
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
143
|
+
transformed_hash["#{key}"] = nil
|
|
144
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
145
|
+
# check to ensure the input is an array given that the attribute
|
|
146
|
+
# is documented as an array but the input is not
|
|
147
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
148
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
149
|
+
end
|
|
150
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
151
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
152
|
+
end
|
|
153
|
+
end
|
|
154
|
+
new(transformed_hash)
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
# Returns the object in the form of hash
|
|
158
|
+
# @return [Hash] Returns the object in the form of hash
|
|
159
|
+
def to_hash
|
|
160
|
+
hash = {}
|
|
161
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
162
|
+
value = self.send(attr)
|
|
163
|
+
if value.nil?
|
|
164
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
165
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
166
|
+
end
|
|
167
|
+
|
|
168
|
+
hash[param] = _to_hash(value)
|
|
169
|
+
end
|
|
170
|
+
hash
|
|
171
|
+
end
|
|
172
|
+
|
|
173
|
+
end
|
|
174
|
+
|
|
175
|
+
end
|
|
@@ -0,0 +1,210 @@
|
|
|
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 V2Money < ApiModelBase
|
|
18
|
+
attr_accessor :amount
|
|
19
|
+
|
|
20
|
+
attr_accessor :currency
|
|
21
|
+
|
|
22
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
23
|
+
def self.attribute_map
|
|
24
|
+
{
|
|
25
|
+
:'amount' => :'amount',
|
|
26
|
+
:'currency' => :'currency'
|
|
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
|
+
:'amount' => :'String',
|
|
44
|
+
:'currency' => :'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::V2Money` 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::V2Money`. 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?(:'amount')
|
|
71
|
+
self.amount = attributes[:'amount']
|
|
72
|
+
else
|
|
73
|
+
self.amount = nil
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
if attributes.key?(:'currency')
|
|
77
|
+
self.currency = attributes[:'currency']
|
|
78
|
+
else
|
|
79
|
+
self.currency = nil
|
|
80
|
+
end
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
84
|
+
# @return Array for valid properties with the reasons
|
|
85
|
+
def list_invalid_properties
|
|
86
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
87
|
+
invalid_properties = Array.new
|
|
88
|
+
if @amount.nil?
|
|
89
|
+
invalid_properties.push('invalid value for "amount", amount cannot be nil.')
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
pattern = Regexp.new(/^-?\d{0,18}(?:\.\d{0,2})?$/)
|
|
93
|
+
if @amount !~ pattern
|
|
94
|
+
invalid_properties.push("invalid value for \"amount\", must conform to the pattern #{pattern}.")
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
if @currency.nil?
|
|
98
|
+
invalid_properties.push('invalid value for "currency", currency cannot be nil.')
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
if @currency.to_s.length > 3
|
|
102
|
+
invalid_properties.push('invalid value for "currency", the character length must be smaller than or equal to 3.')
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
invalid_properties
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
# Check to see if the all the properties in the model are valid
|
|
109
|
+
# @return true if the model is valid
|
|
110
|
+
def valid?
|
|
111
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
112
|
+
return false if @amount.nil?
|
|
113
|
+
return false if @amount !~ Regexp.new(/^-?\d{0,18}(?:\.\d{0,2})?$/)
|
|
114
|
+
return false if @currency.nil?
|
|
115
|
+
return false if @currency.to_s.length > 3
|
|
116
|
+
true
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
# Custom attribute writer method with validation
|
|
120
|
+
# @param [Object] amount Value to be assigned
|
|
121
|
+
def amount=(amount)
|
|
122
|
+
if amount.nil?
|
|
123
|
+
fail ArgumentError, 'amount cannot be nil'
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
pattern = Regexp.new(/^-?\d{0,18}(?:\.\d{0,2})?$/)
|
|
127
|
+
if amount !~ pattern
|
|
128
|
+
fail ArgumentError, "invalid value for \"amount\", must conform to the pattern #{pattern}."
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
@amount = amount
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
# Custom attribute writer method with validation
|
|
135
|
+
# @param [Object] currency Value to be assigned
|
|
136
|
+
def currency=(currency)
|
|
137
|
+
if currency.nil?
|
|
138
|
+
fail ArgumentError, 'currency cannot be nil'
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
if currency.to_s.length > 3
|
|
142
|
+
fail ArgumentError, 'invalid value for "currency", the character length must be smaller than or equal to 3.'
|
|
143
|
+
end
|
|
144
|
+
|
|
145
|
+
@currency = currency
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
# Checks equality by comparing each attribute.
|
|
149
|
+
# @param [Object] Object to be compared
|
|
150
|
+
def ==(o)
|
|
151
|
+
return true if self.equal?(o)
|
|
152
|
+
self.class == o.class &&
|
|
153
|
+
amount == o.amount &&
|
|
154
|
+
currency == o.currency
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
# @see the `==` method
|
|
158
|
+
# @param [Object] Object to be compared
|
|
159
|
+
def eql?(o)
|
|
160
|
+
self == o
|
|
161
|
+
end
|
|
162
|
+
|
|
163
|
+
# Calculates hash code according to all attributes.
|
|
164
|
+
# @return [Integer] Hash code
|
|
165
|
+
def hash
|
|
166
|
+
[amount, currency].hash
|
|
167
|
+
end
|
|
168
|
+
|
|
169
|
+
# Builds the object from hash
|
|
170
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
171
|
+
# @return [Object] Returns the model itself
|
|
172
|
+
def self.build_from_hash(attributes)
|
|
173
|
+
return nil unless attributes.is_a?(Hash)
|
|
174
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
175
|
+
transformed_hash = {}
|
|
176
|
+
openapi_types.each_pair do |key, type|
|
|
177
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
178
|
+
transformed_hash["#{key}"] = nil
|
|
179
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
180
|
+
# check to ensure the input is an array given that the attribute
|
|
181
|
+
# is documented as an array but the input is not
|
|
182
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
183
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
184
|
+
end
|
|
185
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
186
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
187
|
+
end
|
|
188
|
+
end
|
|
189
|
+
new(transformed_hash)
|
|
190
|
+
end
|
|
191
|
+
|
|
192
|
+
# Returns the object in the form of hash
|
|
193
|
+
# @return [Hash] Returns the object in the form of hash
|
|
194
|
+
def to_hash
|
|
195
|
+
hash = {}
|
|
196
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
197
|
+
value = self.send(attr)
|
|
198
|
+
if value.nil?
|
|
199
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
200
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
201
|
+
end
|
|
202
|
+
|
|
203
|
+
hash[param] = _to_hash(value)
|
|
204
|
+
end
|
|
205
|
+
hash
|
|
206
|
+
end
|
|
207
|
+
|
|
208
|
+
end
|
|
209
|
+
|
|
210
|
+
end
|