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.
- checksums.yaml +7 -0
- data/Gemfile +9 -0
- data/README.md +193 -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/api/authentication_api.rb +220 -0
- data/lib/pescheck/api/checks_api.rb +144 -0
- data/lib/pescheck/api/divisions_api.rb +365 -0
- data/lib/pescheck/api/o_auth_api.rb +202 -0
- data/lib/pescheck/api/profiles_api.rb +432 -0
- data/lib/pescheck/api/screenings_api.rb +288 -0
- data/lib/pescheck/api/webhooks_api.rb +278 -0
- data/lib/pescheck/api_client.rb +441 -0
- data/lib/pescheck/api_error.rb +58 -0
- data/lib/pescheck/api_model_base.rb +88 -0
- data/lib/pescheck/configuration.rb +429 -0
- data/lib/pescheck/models/custom_token_obtain_pair.rb +191 -0
- data/lib/pescheck/models/division_read_only.rb +469 -0
- data/lib/pescheck/models/division_write.rb +436 -0
- data/lib/pescheck/models/jwt_generation.rb +213 -0
- data/lib/pescheck/models/jwt_response.rb +285 -0
- data/lib/pescheck/models/o_auth_application.rb +265 -0
- data/lib/pescheck/models/o_auth_application_response.rb +379 -0
- data/lib/pescheck/models/paginated_division_read_only_list.rb +216 -0
- data/lib/pescheck/models/paginated_v2_profile_list_item_list.rb +216 -0
- data/lib/pescheck/models/paginated_v2_screening_list_item_list.rb +216 -0
- data/lib/pescheck/models/patched_division_write.rb +360 -0
- data/lib/pescheck/models/patched_v2_profile_partial_update.rb +176 -0
- data/lib/pescheck/models/token_refresh.rb +173 -0
- data/lib/pescheck/models/v2_candidate.rb +390 -0
- data/lib/pescheck/models/v2_check_field.rb +246 -0
- data/lib/pescheck/models/v2_check_info.rb +438 -0
- data/lib/pescheck/models/v2_document.rb +308 -0
- data/lib/pescheck/models/v2_document_content.rb +175 -0
- data/lib/pescheck/models/v2_money.rb +210 -0
- data/lib/pescheck/models/v2_profile_check.rb +201 -0
- data/lib/pescheck/models/v2_profile_check_entry.rb +349 -0
- data/lib/pescheck/models/v2_profile_create.rb +212 -0
- data/lib/pescheck/models/v2_profile_detail.rb +401 -0
- data/lib/pescheck/models/v2_profile_list_item.rb +291 -0
- data/lib/pescheck/models/v2_profile_update.rb +213 -0
- data/lib/pescheck/models/v2_profile_update_check.rb +210 -0
- data/lib/pescheck/models/v2_screening_check.rb +221 -0
- data/lib/pescheck/models/v2_screening_check_entry.rb +376 -0
- data/lib/pescheck/models/v2_screening_check_list_item.rb +242 -0
- data/lib/pescheck/models/v2_screening_create.rb +201 -0
- data/lib/pescheck/models/v2_screening_detail.rb +348 -0
- data/lib/pescheck/models/v2_screening_detail_profile.rb +156 -0
- data/lib/pescheck/models/v2_screening_list_item.rb +330 -0
- data/lib/pescheck/models/verify_webhook.rb +166 -0
- data/lib/pescheck/models/webhook.rb +265 -0
- data/lib/pescheck/models/webhook_response.rb +353 -0
- data/lib/pescheck/version.rb +15 -0
- data/lib/pescheck.rb +83 -0
- data/pescheck.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 +302 -0
|
@@ -0,0 +1,390 @@
|
|
|
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
|
+
# Bucket-level candidate facts. Required-ness varies per profile; serializer is lenient. Note: v2 tightens nationality vs v1 - v1 accepted any free-form string, v2 requires an ISO 3166-1 alpha-2 code so downstream consumers (watchlist matching, document readers, etc.) can rely on the value.
|
|
18
|
+
class V2Candidate < ApiModelBase
|
|
19
|
+
attr_accessor :first_name
|
|
20
|
+
|
|
21
|
+
attr_accessor :last_name
|
|
22
|
+
|
|
23
|
+
attr_accessor :email
|
|
24
|
+
|
|
25
|
+
attr_accessor :initials
|
|
26
|
+
|
|
27
|
+
attr_accessor :date_of_birth
|
|
28
|
+
|
|
29
|
+
attr_accessor :gender
|
|
30
|
+
|
|
31
|
+
# ISO 3166-1 alpha-2 country code (e.g. \"NL\", \"DE\", \"US\"). * `AD` - AD * `AE` - AE * `AF` - AF * `AG` - AG * `AI` - AI * `AL` - AL * `AM` - AM * `AN` - AN * `AO` - AO * `AQ` - AQ * `AR` - AR * `AS` - AS * `AT` - AT * `AU` - AU * `AW` - AW * `AX` - AX * `AZ` - AZ * `BA` - BA * `BB` - BB * `BD` - BD * `BE` - BE * `BF` - BF * `BG` - BG * `BH` - BH * `BI` - BI * `BJ` - BJ * `BL` - BL * `BM` - BM * `BN` - BN * `BO` - BO * `BR` - BR * `BS` - BS * `BT` - BT * `BV` - BV * `BW` - BW * `BY` - BY * `BZ` - BZ * `CA` - CA * `CC` - CC * `CD` - CD * `CF` - CF * `CG` - CG * `CH` - CH * `CI` - CI * `CK` - CK * `CL` - CL * `CM` - CM * `CN` - CN * `CO` - CO * `CR` - CR * `CU` - CU * `CV` - CV * `CW` - CW * `CX` - CX * `CY` - CY * `CZ` - CZ * `DE` - DE * `DJ` - DJ * `DK` - DK * `DM` - DM * `DO` - DO * `DZ` - DZ * `EC` - EC * `EE` - EE * `EG` - EG * `EH` - EH * `ER` - ER * `ES` - ES * `ET` - ET * `FI` - FI * `FJ` - FJ * `FK` - FK * `FM` - FM * `FO` - FO * `FR` - FR * `GA` - GA * `GB` - GB * `GD` - GD * `GE` - GE * `GF` - GF * `GG` - GG * `GH` - GH * `GI` - GI * `GL` - GL * `GM` - GM * `GN` - GN * `GP` - GP * `GQ` - GQ * `GR` - GR * `GS` - GS * `GT` - GT * `GU` - GU * `GW` - GW * `GY` - GY * `HK` - HK * `HM` - HM * `HN` - HN * `HR` - HR * `HT` - HT * `HU` - HU * `ID` - ID * `IE` - IE * `IL` - IL * `IM` - IM * `IN` - IN * `IO` - IO * `IQ` - IQ * `IR` - IR * `IS` - IS * `IT` - IT * `JE` - JE * `JM` - JM * `JO` - JO * `JP` - JP * `KE` - KE * `KG` - KG * `KH` - KH * `KI` - KI * `KM` - KM * `KN` - KN * `KP` - KP * `KR` - KR * `KW` - KW * `KY` - KY * `KZ` - KZ * `LA` - LA * `LB` - LB * `LC` - LC * `LI` - LI * `LK` - LK * `LR` - LR * `LS` - LS * `LT` - LT * `LU` - LU * `LV` - LV * `LY` - LY * `MA` - MA * `MC` - MC * `MD` - MD * `ME` - ME * `MG` - MG * `MH` - MH * `MK` - MK * `ML` - ML * `MM` - MM * `MN` - MN * `MO` - MO * `MP` - MP * `MQ` - MQ * `MR` - MR * `MS` - MS * `MT` - MT * `MU` - MU * `MV` - MV * `MW` - MW * `MX` - MX * `MY` - MY * `MZ` - MZ * `NA` - NA * `NC` - NC * `NE` - NE * `NF` - NF * `NG` - NG * `NI` - NI * `NL` - NL * `NO` - NO * `NP` - NP * `NR` - NR * `NU` - NU * `NZ` - NZ * `OM` - OM * `PA` - PA * `PE` - PE * `PF` - PF * `PG` - PG * `PH` - PH * `PK` - PK * `PL` - PL * `PM` - PM * `PN` - PN * `PR` - PR * `PS` - PS * `PT` - PT * `PW` - PW * `PY` - PY * `QA` - QA * `RE` - RE * `RO` - RO * `RS` - RS * `RU` - RU * `RW` - RW * `SA` - SA * `SB` - SB * `SC` - SC * `SD` - SD * `SE` - SE * `SG` - SG * `SH` - SH * `SI` - SI * `SJ` - SJ * `SK` - SK * `SL` - SL * `SM` - SM * `SN` - SN * `SO` - SO * `SR` - SR * `ST` - ST * `SV` - SV * `SY` - SY * `SZ` - SZ * `TC` - TC * `TD` - TD * `TF` - TF * `TG` - TG * `TH` - TH * `TJ` - TJ * `TK` - TK * `TL` - TL * `TM` - TM * `TN` - TN * `TO` - TO * `TR` - TR * `TT` - TT * `TV` - TV * `TW` - TW * `TZ` - TZ * `UA` - UA * `UG` - UG * `UM` - UM * `US` - US * `UY` - UY * `UZ` - UZ * `VA` - VA * `VC` - VC * `VE` - VE * `VG` - VG * `VI` - VI * `VN` - VN * `VU` - VU * `WF` - WF * `WS` - WS * `XK` - XK * `YE` - YE * `YT` - YT * `ZA` - ZA * `ZM` - ZM * `ZW` - ZW
|
|
32
|
+
attr_accessor :nationality
|
|
33
|
+
|
|
34
|
+
attr_accessor :postal_code
|
|
35
|
+
|
|
36
|
+
attr_accessor :house_number
|
|
37
|
+
|
|
38
|
+
attr_accessor :extension
|
|
39
|
+
|
|
40
|
+
class EnumAttributeValidator
|
|
41
|
+
attr_reader :datatype
|
|
42
|
+
attr_reader :allowable_values
|
|
43
|
+
|
|
44
|
+
def initialize(datatype, allowable_values)
|
|
45
|
+
@allowable_values = allowable_values.map do |value|
|
|
46
|
+
case datatype.to_s
|
|
47
|
+
when /Integer/i
|
|
48
|
+
value.to_i
|
|
49
|
+
when /Float/i
|
|
50
|
+
value.to_f
|
|
51
|
+
else
|
|
52
|
+
value
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
def valid?(value)
|
|
58
|
+
!value || allowable_values.include?(value)
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
63
|
+
def self.attribute_map
|
|
64
|
+
{
|
|
65
|
+
:'first_name' => :'first_name',
|
|
66
|
+
:'last_name' => :'last_name',
|
|
67
|
+
:'email' => :'email',
|
|
68
|
+
:'initials' => :'initials',
|
|
69
|
+
:'date_of_birth' => :'date_of_birth',
|
|
70
|
+
:'gender' => :'gender',
|
|
71
|
+
:'nationality' => :'nationality',
|
|
72
|
+
:'postal_code' => :'postal_code',
|
|
73
|
+
:'house_number' => :'house_number',
|
|
74
|
+
:'extension' => :'extension'
|
|
75
|
+
}
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
# Returns attribute mapping this model knows about
|
|
79
|
+
def self.acceptable_attribute_map
|
|
80
|
+
attribute_map
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
# Returns all the JSON keys this model knows about
|
|
84
|
+
def self.acceptable_attributes
|
|
85
|
+
acceptable_attribute_map.values
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
# Attribute type mapping.
|
|
89
|
+
def self.openapi_types
|
|
90
|
+
{
|
|
91
|
+
:'first_name' => :'String',
|
|
92
|
+
:'last_name' => :'String',
|
|
93
|
+
:'email' => :'String',
|
|
94
|
+
:'initials' => :'String',
|
|
95
|
+
:'date_of_birth' => :'String',
|
|
96
|
+
:'gender' => :'String',
|
|
97
|
+
:'nationality' => :'String',
|
|
98
|
+
:'postal_code' => :'String',
|
|
99
|
+
:'house_number' => :'String',
|
|
100
|
+
:'extension' => :'String'
|
|
101
|
+
}
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
# List of attributes with nullable: true
|
|
105
|
+
def self.openapi_nullable
|
|
106
|
+
Set.new([
|
|
107
|
+
])
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
# Initializes the object
|
|
111
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
112
|
+
def initialize(attributes = {})
|
|
113
|
+
if (!attributes.is_a?(Hash))
|
|
114
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Pescheck::V2Candidate` initialize method"
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
118
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
119
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
120
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
121
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Pescheck::V2Candidate`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
122
|
+
end
|
|
123
|
+
h[k.to_sym] = v
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
if attributes.key?(:'first_name')
|
|
127
|
+
self.first_name = attributes[:'first_name']
|
|
128
|
+
else
|
|
129
|
+
self.first_name = nil
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
if attributes.key?(:'last_name')
|
|
133
|
+
self.last_name = attributes[:'last_name']
|
|
134
|
+
else
|
|
135
|
+
self.last_name = nil
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
if attributes.key?(:'email')
|
|
139
|
+
self.email = attributes[:'email']
|
|
140
|
+
else
|
|
141
|
+
self.email = nil
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
if attributes.key?(:'initials')
|
|
145
|
+
self.initials = attributes[:'initials']
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
if attributes.key?(:'date_of_birth')
|
|
149
|
+
self.date_of_birth = attributes[:'date_of_birth']
|
|
150
|
+
end
|
|
151
|
+
|
|
152
|
+
if attributes.key?(:'gender')
|
|
153
|
+
self.gender = attributes[:'gender']
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
if attributes.key?(:'nationality')
|
|
157
|
+
self.nationality = attributes[:'nationality']
|
|
158
|
+
end
|
|
159
|
+
|
|
160
|
+
if attributes.key?(:'postal_code')
|
|
161
|
+
self.postal_code = attributes[:'postal_code']
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
if attributes.key?(:'house_number')
|
|
165
|
+
self.house_number = attributes[:'house_number']
|
|
166
|
+
end
|
|
167
|
+
|
|
168
|
+
if attributes.key?(:'extension')
|
|
169
|
+
self.extension = attributes[:'extension']
|
|
170
|
+
end
|
|
171
|
+
end
|
|
172
|
+
|
|
173
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
174
|
+
# @return Array for valid properties with the reasons
|
|
175
|
+
def list_invalid_properties
|
|
176
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
177
|
+
invalid_properties = Array.new
|
|
178
|
+
if @first_name.nil?
|
|
179
|
+
invalid_properties.push('invalid value for "first_name", first_name cannot be nil.')
|
|
180
|
+
end
|
|
181
|
+
|
|
182
|
+
if @first_name.to_s.length > 255
|
|
183
|
+
invalid_properties.push('invalid value for "first_name", the character length must be smaller than or equal to 255.')
|
|
184
|
+
end
|
|
185
|
+
|
|
186
|
+
if @last_name.nil?
|
|
187
|
+
invalid_properties.push('invalid value for "last_name", last_name cannot be nil.')
|
|
188
|
+
end
|
|
189
|
+
|
|
190
|
+
if @last_name.to_s.length > 255
|
|
191
|
+
invalid_properties.push('invalid value for "last_name", the character length must be smaller than or equal to 255.')
|
|
192
|
+
end
|
|
193
|
+
|
|
194
|
+
if @email.nil?
|
|
195
|
+
invalid_properties.push('invalid value for "email", email cannot be nil.')
|
|
196
|
+
end
|
|
197
|
+
|
|
198
|
+
if !@date_of_birth.nil? && @date_of_birth.to_s.length > 10
|
|
199
|
+
invalid_properties.push('invalid value for "date_of_birth", the character length must be smaller than or equal to 10.')
|
|
200
|
+
end
|
|
201
|
+
|
|
202
|
+
if !@postal_code.nil? && @postal_code.to_s.length > 255
|
|
203
|
+
invalid_properties.push('invalid value for "postal_code", the character length must be smaller than or equal to 255.')
|
|
204
|
+
end
|
|
205
|
+
|
|
206
|
+
if !@house_number.nil? && @house_number.to_s.length > 50
|
|
207
|
+
invalid_properties.push('invalid value for "house_number", the character length must be smaller than or equal to 50.')
|
|
208
|
+
end
|
|
209
|
+
|
|
210
|
+
invalid_properties
|
|
211
|
+
end
|
|
212
|
+
|
|
213
|
+
# Check to see if the all the properties in the model are valid
|
|
214
|
+
# @return true if the model is valid
|
|
215
|
+
def valid?
|
|
216
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
217
|
+
return false if @first_name.nil?
|
|
218
|
+
return false if @first_name.to_s.length > 255
|
|
219
|
+
return false if @last_name.nil?
|
|
220
|
+
return false if @last_name.to_s.length > 255
|
|
221
|
+
return false if @email.nil?
|
|
222
|
+
return false if !@date_of_birth.nil? && @date_of_birth.to_s.length > 10
|
|
223
|
+
nationality_validator = EnumAttributeValidator.new('String', ["AD", "AE", "AF", "AG", "AI", "AL", "AM", "AN", "AO", "AQ", "AR", "AS", "AT", "AU", "AW", "AX", "AZ", "BA", "BB", "BD", "BE", "BF", "BG", "BH", "BI", "BJ", "BL", "BM", "BN", "BO", "BR", "BS", "BT", "BV", "BW", "BY", "BZ", "CA", "CC", "CD", "CF", "CG", "CH", "CI", "CK", "CL", "CM", "CN", "CO", "CR", "CU", "CV", "CW", "CX", "CY", "CZ", "DE", "DJ", "DK", "DM", "DO", "DZ", "EC", "EE", "EG", "EH", "ER", "ES", "ET", "FI", "FJ", "FK", "FM", "FO", "FR", "GA", "GB", "GD", "GE", "GF", "GG", "GH", "GI", "GL", "GM", "GN", "GP", "GQ", "GR", "GS", "GT", "GU", "GW", "GY", "HK", "HM", "HN", "HR", "HT", "HU", "ID", "IE", "IL", "IM", "IN", "IO", "IQ", "IR", "IS", "IT", "JE", "JM", "JO", "JP", "KE", "KG", "KH", "KI", "KM", "KN", "KP", "KR", "KW", "KY", "KZ", "LA", "LB", "LC", "LI", "LK", "LR", "LS", "LT", "LU", "LV", "LY", "MA", "MC", "MD", "ME", "MG", "MH", "MK", "ML", "MM", "MN", "MO", "MP", "MQ", "MR", "MS", "MT", "MU", "MV", "MW", "MX", "MY", "MZ", "NA", "NC", "NE", "NF", "NG", "NI", "NL", "NO", "NP", "NR", "NU", "NZ", "OM", "PA", "PE", "PF", "PG", "PH", "PK", "PL", "PM", "PN", "PR", "PS", "PT", "PW", "PY", "QA", "RE", "RO", "RS", "RU", "RW", "SA", "SB", "SC", "SD", "SE", "SG", "SH", "SI", "SJ", "SK", "SL", "SM", "SN", "SO", "SR", "ST", "SV", "SY", "SZ", "TC", "TD", "TF", "TG", "TH", "TJ", "TK", "TL", "TM", "TN", "TO", "TR", "TT", "TV", "TW", "TZ", "UA", "UG", "UM", "US", "UY", "UZ", "VA", "VC", "VE", "VG", "VI", "VN", "VU", "WF", "WS", "XK", "YE", "YT", "ZA", "ZM", "ZW", ""])
|
|
224
|
+
return false unless nationality_validator.valid?(@nationality)
|
|
225
|
+
return false if !@postal_code.nil? && @postal_code.to_s.length > 255
|
|
226
|
+
return false if !@house_number.nil? && @house_number.to_s.length > 50
|
|
227
|
+
true
|
|
228
|
+
end
|
|
229
|
+
|
|
230
|
+
# Custom attribute writer method with validation
|
|
231
|
+
# @param [Object] first_name Value to be assigned
|
|
232
|
+
def first_name=(first_name)
|
|
233
|
+
if first_name.nil?
|
|
234
|
+
fail ArgumentError, 'first_name cannot be nil'
|
|
235
|
+
end
|
|
236
|
+
|
|
237
|
+
if first_name.to_s.length > 255
|
|
238
|
+
fail ArgumentError, 'invalid value for "first_name", the character length must be smaller than or equal to 255.'
|
|
239
|
+
end
|
|
240
|
+
|
|
241
|
+
@first_name = first_name
|
|
242
|
+
end
|
|
243
|
+
|
|
244
|
+
# Custom attribute writer method with validation
|
|
245
|
+
# @param [Object] last_name Value to be assigned
|
|
246
|
+
def last_name=(last_name)
|
|
247
|
+
if last_name.nil?
|
|
248
|
+
fail ArgumentError, 'last_name cannot be nil'
|
|
249
|
+
end
|
|
250
|
+
|
|
251
|
+
if last_name.to_s.length > 255
|
|
252
|
+
fail ArgumentError, 'invalid value for "last_name", the character length must be smaller than or equal to 255.'
|
|
253
|
+
end
|
|
254
|
+
|
|
255
|
+
@last_name = last_name
|
|
256
|
+
end
|
|
257
|
+
|
|
258
|
+
# Custom attribute writer method with validation
|
|
259
|
+
# @param [Object] email Value to be assigned
|
|
260
|
+
def email=(email)
|
|
261
|
+
if email.nil?
|
|
262
|
+
fail ArgumentError, 'email cannot be nil'
|
|
263
|
+
end
|
|
264
|
+
|
|
265
|
+
@email = email
|
|
266
|
+
end
|
|
267
|
+
|
|
268
|
+
# Custom attribute writer method with validation
|
|
269
|
+
# @param [Object] date_of_birth Value to be assigned
|
|
270
|
+
def date_of_birth=(date_of_birth)
|
|
271
|
+
if date_of_birth.nil?
|
|
272
|
+
fail ArgumentError, 'date_of_birth cannot be nil'
|
|
273
|
+
end
|
|
274
|
+
|
|
275
|
+
if date_of_birth.to_s.length > 10
|
|
276
|
+
fail ArgumentError, 'invalid value for "date_of_birth", the character length must be smaller than or equal to 10.'
|
|
277
|
+
end
|
|
278
|
+
|
|
279
|
+
@date_of_birth = date_of_birth
|
|
280
|
+
end
|
|
281
|
+
|
|
282
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
283
|
+
# @param [Object] nationality Object to be assigned
|
|
284
|
+
def nationality=(nationality)
|
|
285
|
+
validator = EnumAttributeValidator.new('String', ["AD", "AE", "AF", "AG", "AI", "AL", "AM", "AN", "AO", "AQ", "AR", "AS", "AT", "AU", "AW", "AX", "AZ", "BA", "BB", "BD", "BE", "BF", "BG", "BH", "BI", "BJ", "BL", "BM", "BN", "BO", "BR", "BS", "BT", "BV", "BW", "BY", "BZ", "CA", "CC", "CD", "CF", "CG", "CH", "CI", "CK", "CL", "CM", "CN", "CO", "CR", "CU", "CV", "CW", "CX", "CY", "CZ", "DE", "DJ", "DK", "DM", "DO", "DZ", "EC", "EE", "EG", "EH", "ER", "ES", "ET", "FI", "FJ", "FK", "FM", "FO", "FR", "GA", "GB", "GD", "GE", "GF", "GG", "GH", "GI", "GL", "GM", "GN", "GP", "GQ", "GR", "GS", "GT", "GU", "GW", "GY", "HK", "HM", "HN", "HR", "HT", "HU", "ID", "IE", "IL", "IM", "IN", "IO", "IQ", "IR", "IS", "IT", "JE", "JM", "JO", "JP", "KE", "KG", "KH", "KI", "KM", "KN", "KP", "KR", "KW", "KY", "KZ", "LA", "LB", "LC", "LI", "LK", "LR", "LS", "LT", "LU", "LV", "LY", "MA", "MC", "MD", "ME", "MG", "MH", "MK", "ML", "MM", "MN", "MO", "MP", "MQ", "MR", "MS", "MT", "MU", "MV", "MW", "MX", "MY", "MZ", "NA", "NC", "NE", "NF", "NG", "NI", "NL", "NO", "NP", "NR", "NU", "NZ", "OM", "PA", "PE", "PF", "PG", "PH", "PK", "PL", "PM", "PN", "PR", "PS", "PT", "PW", "PY", "QA", "RE", "RO", "RS", "RU", "RW", "SA", "SB", "SC", "SD", "SE", "SG", "SH", "SI", "SJ", "SK", "SL", "SM", "SN", "SO", "SR", "ST", "SV", "SY", "SZ", "TC", "TD", "TF", "TG", "TH", "TJ", "TK", "TL", "TM", "TN", "TO", "TR", "TT", "TV", "TW", "TZ", "UA", "UG", "UM", "US", "UY", "UZ", "VA", "VC", "VE", "VG", "VI", "VN", "VU", "WF", "WS", "XK", "YE", "YT", "ZA", "ZM", "ZW", ""])
|
|
286
|
+
unless validator.valid?(nationality)
|
|
287
|
+
fail ArgumentError, "invalid value for \"nationality\", must be one of #{validator.allowable_values}."
|
|
288
|
+
end
|
|
289
|
+
@nationality = nationality
|
|
290
|
+
end
|
|
291
|
+
|
|
292
|
+
# Custom attribute writer method with validation
|
|
293
|
+
# @param [Object] postal_code Value to be assigned
|
|
294
|
+
def postal_code=(postal_code)
|
|
295
|
+
if postal_code.nil?
|
|
296
|
+
fail ArgumentError, 'postal_code cannot be nil'
|
|
297
|
+
end
|
|
298
|
+
|
|
299
|
+
if postal_code.to_s.length > 255
|
|
300
|
+
fail ArgumentError, 'invalid value for "postal_code", the character length must be smaller than or equal to 255.'
|
|
301
|
+
end
|
|
302
|
+
|
|
303
|
+
@postal_code = postal_code
|
|
304
|
+
end
|
|
305
|
+
|
|
306
|
+
# Custom attribute writer method with validation
|
|
307
|
+
# @param [Object] house_number Value to be assigned
|
|
308
|
+
def house_number=(house_number)
|
|
309
|
+
if house_number.nil?
|
|
310
|
+
fail ArgumentError, 'house_number cannot be nil'
|
|
311
|
+
end
|
|
312
|
+
|
|
313
|
+
if house_number.to_s.length > 50
|
|
314
|
+
fail ArgumentError, 'invalid value for "house_number", the character length must be smaller than or equal to 50.'
|
|
315
|
+
end
|
|
316
|
+
|
|
317
|
+
@house_number = house_number
|
|
318
|
+
end
|
|
319
|
+
|
|
320
|
+
# Checks equality by comparing each attribute.
|
|
321
|
+
# @param [Object] Object to be compared
|
|
322
|
+
def ==(o)
|
|
323
|
+
return true if self.equal?(o)
|
|
324
|
+
self.class == o.class &&
|
|
325
|
+
first_name == o.first_name &&
|
|
326
|
+
last_name == o.last_name &&
|
|
327
|
+
email == o.email &&
|
|
328
|
+
initials == o.initials &&
|
|
329
|
+
date_of_birth == o.date_of_birth &&
|
|
330
|
+
gender == o.gender &&
|
|
331
|
+
nationality == o.nationality &&
|
|
332
|
+
postal_code == o.postal_code &&
|
|
333
|
+
house_number == o.house_number &&
|
|
334
|
+
extension == o.extension
|
|
335
|
+
end
|
|
336
|
+
|
|
337
|
+
# @see the `==` method
|
|
338
|
+
# @param [Object] Object to be compared
|
|
339
|
+
def eql?(o)
|
|
340
|
+
self == o
|
|
341
|
+
end
|
|
342
|
+
|
|
343
|
+
# Calculates hash code according to all attributes.
|
|
344
|
+
# @return [Integer] Hash code
|
|
345
|
+
def hash
|
|
346
|
+
[first_name, last_name, email, initials, date_of_birth, gender, nationality, postal_code, house_number, extension].hash
|
|
347
|
+
end
|
|
348
|
+
|
|
349
|
+
# Builds the object from hash
|
|
350
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
351
|
+
# @return [Object] Returns the model itself
|
|
352
|
+
def self.build_from_hash(attributes)
|
|
353
|
+
return nil unless attributes.is_a?(Hash)
|
|
354
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
355
|
+
transformed_hash = {}
|
|
356
|
+
openapi_types.each_pair do |key, type|
|
|
357
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
358
|
+
transformed_hash["#{key}"] = nil
|
|
359
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
360
|
+
# check to ensure the input is an array given that the attribute
|
|
361
|
+
# is documented as an array but the input is not
|
|
362
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
363
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
364
|
+
end
|
|
365
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
366
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
367
|
+
end
|
|
368
|
+
end
|
|
369
|
+
new(transformed_hash)
|
|
370
|
+
end
|
|
371
|
+
|
|
372
|
+
# Returns the object in the form of hash
|
|
373
|
+
# @return [Hash] Returns the object in the form of hash
|
|
374
|
+
def to_hash
|
|
375
|
+
hash = {}
|
|
376
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
377
|
+
value = self.send(attr)
|
|
378
|
+
if value.nil?
|
|
379
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
380
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
381
|
+
end
|
|
382
|
+
|
|
383
|
+
hash[param] = _to_hash(value)
|
|
384
|
+
end
|
|
385
|
+
hash
|
|
386
|
+
end
|
|
387
|
+
|
|
388
|
+
end
|
|
389
|
+
|
|
390
|
+
end
|
|
@@ -0,0 +1,246 @@
|
|
|
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
|
+
# One config or input field a check accepts via the API.
|
|
18
|
+
class V2CheckField < ApiModelBase
|
|
19
|
+
attr_accessor :name
|
|
20
|
+
|
|
21
|
+
# \"string\" | \"integer\" | \"number\" | \"boolean\" | \"array\" | \"object\"
|
|
22
|
+
attr_accessor :type
|
|
23
|
+
|
|
24
|
+
# Whether the request body must include this field.
|
|
25
|
+
attr_accessor :required
|
|
26
|
+
|
|
27
|
+
# Allowed values, or null if the field isn't constrained to a set.
|
|
28
|
+
attr_accessor :choices
|
|
29
|
+
|
|
30
|
+
attr_accessor :help_text
|
|
31
|
+
|
|
32
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
33
|
+
def self.attribute_map
|
|
34
|
+
{
|
|
35
|
+
:'name' => :'name',
|
|
36
|
+
:'type' => :'type',
|
|
37
|
+
:'required' => :'required',
|
|
38
|
+
:'choices' => :'choices',
|
|
39
|
+
:'help_text' => :'help_text'
|
|
40
|
+
}
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
# Returns attribute mapping this model knows about
|
|
44
|
+
def self.acceptable_attribute_map
|
|
45
|
+
attribute_map
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
# Returns all the JSON keys this model knows about
|
|
49
|
+
def self.acceptable_attributes
|
|
50
|
+
acceptable_attribute_map.values
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
# Attribute type mapping.
|
|
54
|
+
def self.openapi_types
|
|
55
|
+
{
|
|
56
|
+
:'name' => :'String',
|
|
57
|
+
:'type' => :'String',
|
|
58
|
+
:'required' => :'Boolean',
|
|
59
|
+
:'choices' => :'Array<String>',
|
|
60
|
+
:'help_text' => :'String'
|
|
61
|
+
}
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
# List of attributes with nullable: true
|
|
65
|
+
def self.openapi_nullable
|
|
66
|
+
Set.new([
|
|
67
|
+
:'choices',
|
|
68
|
+
:'help_text'
|
|
69
|
+
])
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
# Initializes the object
|
|
73
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
74
|
+
def initialize(attributes = {})
|
|
75
|
+
if (!attributes.is_a?(Hash))
|
|
76
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Pescheck::V2CheckField` initialize method"
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
80
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
81
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
82
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
83
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Pescheck::V2CheckField`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
84
|
+
end
|
|
85
|
+
h[k.to_sym] = v
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
if attributes.key?(:'name')
|
|
89
|
+
self.name = attributes[:'name']
|
|
90
|
+
else
|
|
91
|
+
self.name = nil
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
if attributes.key?(:'type')
|
|
95
|
+
self.type = attributes[:'type']
|
|
96
|
+
else
|
|
97
|
+
self.type = nil
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
if attributes.key?(:'required')
|
|
101
|
+
self.required = attributes[:'required']
|
|
102
|
+
else
|
|
103
|
+
self.required = nil
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
if attributes.key?(:'choices')
|
|
107
|
+
if (value = attributes[:'choices']).is_a?(Array)
|
|
108
|
+
self.choices = value
|
|
109
|
+
end
|
|
110
|
+
else
|
|
111
|
+
self.choices = nil
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
if attributes.key?(:'help_text')
|
|
115
|
+
self.help_text = attributes[:'help_text']
|
|
116
|
+
else
|
|
117
|
+
self.help_text = nil
|
|
118
|
+
end
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
122
|
+
# @return Array for valid properties with the reasons
|
|
123
|
+
def list_invalid_properties
|
|
124
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
125
|
+
invalid_properties = Array.new
|
|
126
|
+
if @name.nil?
|
|
127
|
+
invalid_properties.push('invalid value for "name", name cannot be nil.')
|
|
128
|
+
end
|
|
129
|
+
|
|
130
|
+
if @type.nil?
|
|
131
|
+
invalid_properties.push('invalid value for "type", type cannot be nil.')
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
if @required.nil?
|
|
135
|
+
invalid_properties.push('invalid value for "required", required cannot be nil.')
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
invalid_properties
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
# Check to see if the all the properties in the model are valid
|
|
142
|
+
# @return true if the model is valid
|
|
143
|
+
def valid?
|
|
144
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
145
|
+
return false if @name.nil?
|
|
146
|
+
return false if @type.nil?
|
|
147
|
+
return false if @required.nil?
|
|
148
|
+
true
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
# Custom attribute writer method with validation
|
|
152
|
+
# @param [Object] name Value to be assigned
|
|
153
|
+
def name=(name)
|
|
154
|
+
if name.nil?
|
|
155
|
+
fail ArgumentError, 'name cannot be nil'
|
|
156
|
+
end
|
|
157
|
+
|
|
158
|
+
@name = name
|
|
159
|
+
end
|
|
160
|
+
|
|
161
|
+
# Custom attribute writer method with validation
|
|
162
|
+
# @param [Object] type Value to be assigned
|
|
163
|
+
def type=(type)
|
|
164
|
+
if type.nil?
|
|
165
|
+
fail ArgumentError, 'type cannot be nil'
|
|
166
|
+
end
|
|
167
|
+
|
|
168
|
+
@type = type
|
|
169
|
+
end
|
|
170
|
+
|
|
171
|
+
# Custom attribute writer method with validation
|
|
172
|
+
# @param [Object] required Value to be assigned
|
|
173
|
+
def required=(required)
|
|
174
|
+
if required.nil?
|
|
175
|
+
fail ArgumentError, 'required cannot be nil'
|
|
176
|
+
end
|
|
177
|
+
|
|
178
|
+
@required = required
|
|
179
|
+
end
|
|
180
|
+
|
|
181
|
+
# Checks equality by comparing each attribute.
|
|
182
|
+
# @param [Object] Object to be compared
|
|
183
|
+
def ==(o)
|
|
184
|
+
return true if self.equal?(o)
|
|
185
|
+
self.class == o.class &&
|
|
186
|
+
name == o.name &&
|
|
187
|
+
type == o.type &&
|
|
188
|
+
required == o.required &&
|
|
189
|
+
choices == o.choices &&
|
|
190
|
+
help_text == o.help_text
|
|
191
|
+
end
|
|
192
|
+
|
|
193
|
+
# @see the `==` method
|
|
194
|
+
# @param [Object] Object to be compared
|
|
195
|
+
def eql?(o)
|
|
196
|
+
self == o
|
|
197
|
+
end
|
|
198
|
+
|
|
199
|
+
# Calculates hash code according to all attributes.
|
|
200
|
+
# @return [Integer] Hash code
|
|
201
|
+
def hash
|
|
202
|
+
[name, type, required, choices, help_text].hash
|
|
203
|
+
end
|
|
204
|
+
|
|
205
|
+
# Builds the object from hash
|
|
206
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
207
|
+
# @return [Object] Returns the model itself
|
|
208
|
+
def self.build_from_hash(attributes)
|
|
209
|
+
return nil unless attributes.is_a?(Hash)
|
|
210
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
211
|
+
transformed_hash = {}
|
|
212
|
+
openapi_types.each_pair do |key, type|
|
|
213
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
214
|
+
transformed_hash["#{key}"] = nil
|
|
215
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
216
|
+
# check to ensure the input is an array given that the attribute
|
|
217
|
+
# is documented as an array but the input is not
|
|
218
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
219
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
220
|
+
end
|
|
221
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
222
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
223
|
+
end
|
|
224
|
+
end
|
|
225
|
+
new(transformed_hash)
|
|
226
|
+
end
|
|
227
|
+
|
|
228
|
+
# Returns the object in the form of hash
|
|
229
|
+
# @return [Hash] Returns the object in the form of hash
|
|
230
|
+
def to_hash
|
|
231
|
+
hash = {}
|
|
232
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
233
|
+
value = self.send(attr)
|
|
234
|
+
if value.nil?
|
|
235
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
236
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
237
|
+
end
|
|
238
|
+
|
|
239
|
+
hash[param] = _to_hash(value)
|
|
240
|
+
end
|
|
241
|
+
hash
|
|
242
|
+
end
|
|
243
|
+
|
|
244
|
+
end
|
|
245
|
+
|
|
246
|
+
end
|