pescheck-client 0.4.2 → 0.5.0
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 +4 -4
- data/README.md +54 -45
- data/docs/AddOnsApi.md +305 -0
- data/docs/AddonPrice.md +20 -0
- data/docs/AuthenticationApi.md +1 -71
- data/docs/DisabledDivision.md +20 -0
- data/docs/OAuthApplication.md +1 -1
- data/docs/OAuthApplicationResponse.md +6 -2
- data/docs/OrganisationAddon.md +32 -0
- data/docs/OrganisationAddonUpdate.md +18 -0
- data/docs/OrganisationAddonUpdateResult.md +34 -0
- data/docs/PatchedOrganisationAddonUpdate.md +18 -0
- data/docs/ScreeningsApi.md +72 -0
- data/docs/V2Candidate.md +1 -1
- data/docs/V2CheckField.md +1 -1
- data/docs/V2Document.md +1 -1
- data/docs/V2ProfileCheck.md +1 -1
- data/docs/V2ProfileCheckEntry.md +1 -1
- data/docs/V2ProfileDetail.md +4 -0
- data/docs/V2ProfileUpdateCheck.md +1 -1
- data/docs/V2ScreeningCheck.md +1 -1
- data/docs/V2ScreeningCheckEntry.md +1 -1
- data/docs/V2ScreeningCheckListItem.md +1 -1
- data/docs/V2ScreeningCreate.md +5 -1
- data/docs/V2ScreeningDetail.md +5 -1
- data/docs/{V2ScreeningDetailProfile.md → V2ScreeningDetailOrganisation.md} +2 -2
- data/docs/V2ScreeningListItem.md +3 -1
- data/docs/V2ScreeningNote.md +24 -0
- data/docs/V2ScreeningNoteInput.md +22 -0
- data/docs/WebhooksApi.md +1 -1
- data/lib/pescheck-client/api/add_ons_api.rb +305 -0
- data/lib/pescheck-client/api/authentication_api.rb +2 -68
- data/lib/pescheck-client/api/profiles_api.rb +1 -1
- data/lib/pescheck-client/api/screenings_api.rb +66 -0
- data/lib/pescheck-client/api/webhooks_api.rb +2 -2
- data/lib/pescheck-client/configuration.rb +8 -0
- data/lib/pescheck-client/models/addon_price.rb +202 -0
- data/lib/pescheck-client/models/{custom_token_obtain_pair.rb → disabled_division.rb} +34 -35
- data/lib/pescheck-client/models/o_auth_application.rb +3 -3
- data/lib/pescheck-client/models/o_auth_application_response.rb +70 -44
- data/lib/pescheck-client/models/organisation_addon.rb +339 -0
- data/lib/pescheck-client/models/organisation_addon_update.rb +165 -0
- data/lib/pescheck-client/models/organisation_addon_update_result.rb +368 -0
- data/lib/pescheck-client/models/patched_organisation_addon_update.rb +148 -0
- data/lib/pescheck-client/models/v2_candidate.rb +1 -35
- data/lib/pescheck-client/models/v2_check_field.rb +2 -2
- data/lib/pescheck-client/models/v2_document.rb +6 -30
- data/lib/pescheck-client/models/v2_profile_check.rb +3 -3
- data/lib/pescheck-client/models/v2_profile_check_entry.rb +6 -30
- data/lib/pescheck-client/models/v2_profile_detail.rb +55 -1
- data/lib/pescheck-client/models/v2_profile_update_check.rb +3 -3
- data/lib/pescheck-client/models/v2_screening_check.rb +3 -3
- data/lib/pescheck-client/models/v2_screening_check_entry.rb +6 -30
- data/lib/pescheck-client/models/v2_screening_check_list_item.rb +6 -30
- data/lib/pescheck-client/models/v2_screening_create.rb +25 -4
- data/lib/pescheck-client/models/v2_screening_detail.rb +42 -2
- data/lib/pescheck-client/models/{v2_screening_detail_profile.rb → v2_screening_detail_organisation.rb} +4 -3
- data/lib/pescheck-client/models/v2_screening_list_item.rb +14 -2
- data/lib/pescheck-client/models/v2_screening_note.rb +229 -0
- data/lib/pescheck-client/models/v2_screening_note_input.rb +220 -0
- data/lib/pescheck-client/models/webhook_response.rb +5 -5
- data/lib/pescheck-client/version.rb +1 -1
- data/lib/pescheck-client.rb +10 -2
- data/spec/api/add_ons_api_spec.rb +84 -0
- data/spec/api/authentication_api_spec.rb +1 -12
- data/spec/api/screenings_api_spec.rb +13 -0
- data/spec/api/webhooks_api_spec.rb +1 -1
- data/spec/models/{custom_token_obtain_pair_spec.rb → addon_price_spec.rb} +8 -8
- data/spec/models/disabled_division_spec.rb +42 -0
- data/spec/models/o_auth_application_response_spec.rb +12 -8
- data/spec/models/o_auth_application_spec.rb +1 -1
- data/spec/models/organisation_addon_spec.rb +78 -0
- data/spec/models/organisation_addon_update_result_spec.rb +84 -0
- data/spec/models/organisation_addon_update_spec.rb +36 -0
- data/spec/models/patched_organisation_addon_update_spec.rb +36 -0
- data/spec/models/v2_candidate_spec.rb +0 -4
- data/spec/models/v2_document_spec.rb +0 -4
- data/spec/models/v2_profile_check_entry_spec.rb +0 -4
- data/spec/models/v2_profile_check_spec.rb +1 -1
- data/spec/models/v2_profile_detail_spec.rb +12 -0
- data/spec/models/v2_profile_update_check_spec.rb +1 -1
- data/spec/models/v2_screening_check_entry_spec.rb +0 -4
- data/spec/models/v2_screening_check_list_item_spec.rb +0 -4
- data/spec/models/v2_screening_check_spec.rb +1 -1
- data/spec/models/v2_screening_create_spec.rb +12 -0
- data/spec/models/{v2_screening_detail_profile_spec.rb → v2_screening_detail_organisation_spec.rb} +6 -6
- data/spec/models/v2_screening_detail_spec.rb +12 -0
- data/spec/models/v2_screening_list_item_spec.rb +6 -0
- data/spec/models/v2_screening_note_input_spec.rb +52 -0
- data/spec/models/v2_screening_note_spec.rb +54 -0
- metadata +71 -39
- data/docs/CustomTokenObtainPair.md +0 -20
|
@@ -0,0 +1,339 @@
|
|
|
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 add-on for one organisation, built from ``addon_service.addon_cards``.
|
|
18
|
+
class OrganisationAddon < ApiModelBase
|
|
19
|
+
# Add-on identifier, used in the URL. * `branded_journey` - Branded Journey * `sso` - Single Sign-On (SSO) * `api_access` - API & MCP Access * `connected_ats` - Connected ATS - Click & Go Known values: branded_journey, sso, api_access, connected_ats. New values may be added; handle unknown values.
|
|
20
|
+
attr_accessor :addon
|
|
21
|
+
|
|
22
|
+
attr_accessor :name
|
|
23
|
+
|
|
24
|
+
attr_accessor :description
|
|
25
|
+
|
|
26
|
+
# Switched on (and billed) for this organisation.
|
|
27
|
+
attr_accessor :enabled
|
|
28
|
+
|
|
29
|
+
# Usable right now. A division also needs the add-on on its parent organisation.
|
|
30
|
+
attr_accessor :active
|
|
31
|
+
|
|
32
|
+
# Only the missing add-on on the parent organisation stands in the way.
|
|
33
|
+
attr_accessor :blocked_by_parent
|
|
34
|
+
|
|
35
|
+
# What this organisation pays per month; the division price for a division. Null when unpriced.
|
|
36
|
+
attr_accessor :monthly_price
|
|
37
|
+
|
|
38
|
+
# The price is a starting price (\"from\").
|
|
39
|
+
attr_accessor :price_is_indicative
|
|
40
|
+
|
|
41
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
42
|
+
def self.attribute_map
|
|
43
|
+
{
|
|
44
|
+
:'addon' => :'addon',
|
|
45
|
+
:'name' => :'name',
|
|
46
|
+
:'description' => :'description',
|
|
47
|
+
:'enabled' => :'enabled',
|
|
48
|
+
:'active' => :'active',
|
|
49
|
+
:'blocked_by_parent' => :'blocked_by_parent',
|
|
50
|
+
:'monthly_price' => :'monthly_price',
|
|
51
|
+
:'price_is_indicative' => :'price_is_indicative'
|
|
52
|
+
}
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
# Returns attribute mapping this model knows about
|
|
56
|
+
def self.acceptable_attribute_map
|
|
57
|
+
attribute_map
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
# Returns all the JSON keys this model knows about
|
|
61
|
+
def self.acceptable_attributes
|
|
62
|
+
acceptable_attribute_map.values
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
# Attribute type mapping.
|
|
66
|
+
def self.openapi_types
|
|
67
|
+
{
|
|
68
|
+
:'addon' => :'String',
|
|
69
|
+
:'name' => :'String',
|
|
70
|
+
:'description' => :'String',
|
|
71
|
+
:'enabled' => :'Boolean',
|
|
72
|
+
:'active' => :'Boolean',
|
|
73
|
+
:'blocked_by_parent' => :'Boolean',
|
|
74
|
+
:'monthly_price' => :'AddonPrice',
|
|
75
|
+
:'price_is_indicative' => :'Boolean'
|
|
76
|
+
}
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
# List of attributes with nullable: true
|
|
80
|
+
def self.openapi_nullable
|
|
81
|
+
Set.new([
|
|
82
|
+
:'monthly_price',
|
|
83
|
+
])
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
# Initializes the object
|
|
87
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
88
|
+
def initialize(attributes = {})
|
|
89
|
+
if (!attributes.is_a?(Hash))
|
|
90
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Pescheck::OrganisationAddon` initialize method"
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
94
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
95
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
96
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
97
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Pescheck::OrganisationAddon`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
98
|
+
end
|
|
99
|
+
h[k.to_sym] = v
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
if attributes.key?(:'addon')
|
|
103
|
+
self.addon = attributes[:'addon']
|
|
104
|
+
else
|
|
105
|
+
self.addon = nil
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
if attributes.key?(:'name')
|
|
109
|
+
self.name = attributes[:'name']
|
|
110
|
+
else
|
|
111
|
+
self.name = nil
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
if attributes.key?(:'description')
|
|
115
|
+
self.description = attributes[:'description']
|
|
116
|
+
else
|
|
117
|
+
self.description = nil
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
if attributes.key?(:'enabled')
|
|
121
|
+
self.enabled = attributes[:'enabled']
|
|
122
|
+
else
|
|
123
|
+
self.enabled = nil
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
if attributes.key?(:'active')
|
|
127
|
+
self.active = attributes[:'active']
|
|
128
|
+
else
|
|
129
|
+
self.active = nil
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
if attributes.key?(:'blocked_by_parent')
|
|
133
|
+
self.blocked_by_parent = attributes[:'blocked_by_parent']
|
|
134
|
+
else
|
|
135
|
+
self.blocked_by_parent = nil
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
if attributes.key?(:'monthly_price')
|
|
139
|
+
self.monthly_price = attributes[:'monthly_price']
|
|
140
|
+
else
|
|
141
|
+
self.monthly_price = nil
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
if attributes.key?(:'price_is_indicative')
|
|
145
|
+
self.price_is_indicative = attributes[:'price_is_indicative']
|
|
146
|
+
else
|
|
147
|
+
self.price_is_indicative = nil
|
|
148
|
+
end
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
152
|
+
# @return Array for valid properties with the reasons
|
|
153
|
+
def list_invalid_properties
|
|
154
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
155
|
+
invalid_properties = Array.new
|
|
156
|
+
if @addon.nil?
|
|
157
|
+
invalid_properties.push('invalid value for "addon", addon cannot be nil.')
|
|
158
|
+
end
|
|
159
|
+
|
|
160
|
+
if @name.nil?
|
|
161
|
+
invalid_properties.push('invalid value for "name", name cannot be nil.')
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
if @description.nil?
|
|
165
|
+
invalid_properties.push('invalid value for "description", description cannot be nil.')
|
|
166
|
+
end
|
|
167
|
+
|
|
168
|
+
if @enabled.nil?
|
|
169
|
+
invalid_properties.push('invalid value for "enabled", enabled cannot be nil.')
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
if @active.nil?
|
|
173
|
+
invalid_properties.push('invalid value for "active", active cannot be nil.')
|
|
174
|
+
end
|
|
175
|
+
|
|
176
|
+
if @blocked_by_parent.nil?
|
|
177
|
+
invalid_properties.push('invalid value for "blocked_by_parent", blocked_by_parent cannot be nil.')
|
|
178
|
+
end
|
|
179
|
+
|
|
180
|
+
if @price_is_indicative.nil?
|
|
181
|
+
invalid_properties.push('invalid value for "price_is_indicative", price_is_indicative cannot be nil.')
|
|
182
|
+
end
|
|
183
|
+
|
|
184
|
+
invalid_properties
|
|
185
|
+
end
|
|
186
|
+
|
|
187
|
+
# Check to see if the all the properties in the model are valid
|
|
188
|
+
# @return true if the model is valid
|
|
189
|
+
def valid?
|
|
190
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
191
|
+
return false if @addon.nil?
|
|
192
|
+
return false if @name.nil?
|
|
193
|
+
return false if @description.nil?
|
|
194
|
+
return false if @enabled.nil?
|
|
195
|
+
return false if @active.nil?
|
|
196
|
+
return false if @blocked_by_parent.nil?
|
|
197
|
+
return false if @price_is_indicative.nil?
|
|
198
|
+
true
|
|
199
|
+
end
|
|
200
|
+
|
|
201
|
+
# Custom attribute writer method with validation
|
|
202
|
+
# @param [Object] addon Value to be assigned
|
|
203
|
+
def addon=(addon)
|
|
204
|
+
if addon.nil?
|
|
205
|
+
fail ArgumentError, 'addon cannot be nil'
|
|
206
|
+
end
|
|
207
|
+
|
|
208
|
+
@addon = addon
|
|
209
|
+
end
|
|
210
|
+
|
|
211
|
+
# Custom attribute writer method with validation
|
|
212
|
+
# @param [Object] name Value to be assigned
|
|
213
|
+
def name=(name)
|
|
214
|
+
if name.nil?
|
|
215
|
+
fail ArgumentError, 'name cannot be nil'
|
|
216
|
+
end
|
|
217
|
+
|
|
218
|
+
@name = name
|
|
219
|
+
end
|
|
220
|
+
|
|
221
|
+
# Custom attribute writer method with validation
|
|
222
|
+
# @param [Object] description Value to be assigned
|
|
223
|
+
def description=(description)
|
|
224
|
+
if description.nil?
|
|
225
|
+
fail ArgumentError, 'description cannot be nil'
|
|
226
|
+
end
|
|
227
|
+
|
|
228
|
+
@description = description
|
|
229
|
+
end
|
|
230
|
+
|
|
231
|
+
# Custom attribute writer method with validation
|
|
232
|
+
# @param [Object] enabled Value to be assigned
|
|
233
|
+
def enabled=(enabled)
|
|
234
|
+
if enabled.nil?
|
|
235
|
+
fail ArgumentError, 'enabled cannot be nil'
|
|
236
|
+
end
|
|
237
|
+
|
|
238
|
+
@enabled = enabled
|
|
239
|
+
end
|
|
240
|
+
|
|
241
|
+
# Custom attribute writer method with validation
|
|
242
|
+
# @param [Object] active Value to be assigned
|
|
243
|
+
def active=(active)
|
|
244
|
+
if active.nil?
|
|
245
|
+
fail ArgumentError, 'active cannot be nil'
|
|
246
|
+
end
|
|
247
|
+
|
|
248
|
+
@active = active
|
|
249
|
+
end
|
|
250
|
+
|
|
251
|
+
# Custom attribute writer method with validation
|
|
252
|
+
# @param [Object] blocked_by_parent Value to be assigned
|
|
253
|
+
def blocked_by_parent=(blocked_by_parent)
|
|
254
|
+
if blocked_by_parent.nil?
|
|
255
|
+
fail ArgumentError, 'blocked_by_parent cannot be nil'
|
|
256
|
+
end
|
|
257
|
+
|
|
258
|
+
@blocked_by_parent = blocked_by_parent
|
|
259
|
+
end
|
|
260
|
+
|
|
261
|
+
# Custom attribute writer method with validation
|
|
262
|
+
# @param [Object] price_is_indicative Value to be assigned
|
|
263
|
+
def price_is_indicative=(price_is_indicative)
|
|
264
|
+
if price_is_indicative.nil?
|
|
265
|
+
fail ArgumentError, 'price_is_indicative cannot be nil'
|
|
266
|
+
end
|
|
267
|
+
|
|
268
|
+
@price_is_indicative = price_is_indicative
|
|
269
|
+
end
|
|
270
|
+
|
|
271
|
+
# Checks equality by comparing each attribute.
|
|
272
|
+
# @param [Object] Object to be compared
|
|
273
|
+
def ==(o)
|
|
274
|
+
return true if self.equal?(o)
|
|
275
|
+
self.class == o.class &&
|
|
276
|
+
addon == o.addon &&
|
|
277
|
+
name == o.name &&
|
|
278
|
+
description == o.description &&
|
|
279
|
+
enabled == o.enabled &&
|
|
280
|
+
active == o.active &&
|
|
281
|
+
blocked_by_parent == o.blocked_by_parent &&
|
|
282
|
+
monthly_price == o.monthly_price &&
|
|
283
|
+
price_is_indicative == o.price_is_indicative
|
|
284
|
+
end
|
|
285
|
+
|
|
286
|
+
# @see the `==` method
|
|
287
|
+
# @param [Object] Object to be compared
|
|
288
|
+
def eql?(o)
|
|
289
|
+
self == o
|
|
290
|
+
end
|
|
291
|
+
|
|
292
|
+
# Calculates hash code according to all attributes.
|
|
293
|
+
# @return [Integer] Hash code
|
|
294
|
+
def hash
|
|
295
|
+
[addon, name, description, enabled, active, blocked_by_parent, monthly_price, price_is_indicative].hash
|
|
296
|
+
end
|
|
297
|
+
|
|
298
|
+
# Builds the object from hash
|
|
299
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
300
|
+
# @return [Object] Returns the model itself
|
|
301
|
+
def self.build_from_hash(attributes)
|
|
302
|
+
return nil unless attributes.is_a?(Hash)
|
|
303
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
304
|
+
transformed_hash = {}
|
|
305
|
+
openapi_types.each_pair do |key, type|
|
|
306
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
307
|
+
transformed_hash["#{key}"] = nil
|
|
308
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
309
|
+
# check to ensure the input is an array given that the attribute
|
|
310
|
+
# is documented as an array but the input is not
|
|
311
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
312
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
313
|
+
end
|
|
314
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
315
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
316
|
+
end
|
|
317
|
+
end
|
|
318
|
+
new(transformed_hash)
|
|
319
|
+
end
|
|
320
|
+
|
|
321
|
+
# Returns the object in the form of hash
|
|
322
|
+
# @return [Hash] Returns the object in the form of hash
|
|
323
|
+
def to_hash
|
|
324
|
+
hash = {}
|
|
325
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
326
|
+
value = self.send(attr)
|
|
327
|
+
if value.nil?
|
|
328
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
329
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
330
|
+
end
|
|
331
|
+
|
|
332
|
+
hash[param] = _to_hash(value)
|
|
333
|
+
end
|
|
334
|
+
hash
|
|
335
|
+
end
|
|
336
|
+
|
|
337
|
+
end
|
|
338
|
+
|
|
339
|
+
end
|
|
@@ -0,0 +1,165 @@
|
|
|
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 OrganisationAddonUpdate < ApiModelBase
|
|
18
|
+
# Switch the add-on on (billed monthly from today) or off (billing stops at the end of the month).
|
|
19
|
+
attr_accessor :enabled
|
|
20
|
+
|
|
21
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
22
|
+
def self.attribute_map
|
|
23
|
+
{
|
|
24
|
+
:'enabled' => :'enabled'
|
|
25
|
+
}
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# Returns attribute mapping this model knows about
|
|
29
|
+
def self.acceptable_attribute_map
|
|
30
|
+
attribute_map
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# Returns all the JSON keys this model knows about
|
|
34
|
+
def self.acceptable_attributes
|
|
35
|
+
acceptable_attribute_map.values
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
# Attribute type mapping.
|
|
39
|
+
def self.openapi_types
|
|
40
|
+
{
|
|
41
|
+
:'enabled' => :'Boolean'
|
|
42
|
+
}
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
# List of attributes with nullable: true
|
|
46
|
+
def self.openapi_nullable
|
|
47
|
+
Set.new([
|
|
48
|
+
])
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
# Initializes the object
|
|
52
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
53
|
+
def initialize(attributes = {})
|
|
54
|
+
if (!attributes.is_a?(Hash))
|
|
55
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Pescheck::OrganisationAddonUpdate` initialize method"
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
59
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
60
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
61
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
62
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Pescheck::OrganisationAddonUpdate`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
63
|
+
end
|
|
64
|
+
h[k.to_sym] = v
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
if attributes.key?(:'enabled')
|
|
68
|
+
self.enabled = attributes[:'enabled']
|
|
69
|
+
else
|
|
70
|
+
self.enabled = nil
|
|
71
|
+
end
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
75
|
+
# @return Array for valid properties with the reasons
|
|
76
|
+
def list_invalid_properties
|
|
77
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
78
|
+
invalid_properties = Array.new
|
|
79
|
+
if @enabled.nil?
|
|
80
|
+
invalid_properties.push('invalid value for "enabled", enabled cannot be nil.')
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
invalid_properties
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
# Check to see if the all the properties in the model are valid
|
|
87
|
+
# @return true if the model is valid
|
|
88
|
+
def valid?
|
|
89
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
90
|
+
return false if @enabled.nil?
|
|
91
|
+
true
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
# Custom attribute writer method with validation
|
|
95
|
+
# @param [Object] enabled Value to be assigned
|
|
96
|
+
def enabled=(enabled)
|
|
97
|
+
if enabled.nil?
|
|
98
|
+
fail ArgumentError, 'enabled cannot be nil'
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
@enabled = enabled
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
# Checks equality by comparing each attribute.
|
|
105
|
+
# @param [Object] Object to be compared
|
|
106
|
+
def ==(o)
|
|
107
|
+
return true if self.equal?(o)
|
|
108
|
+
self.class == o.class &&
|
|
109
|
+
enabled == o.enabled
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
# @see the `==` method
|
|
113
|
+
# @param [Object] Object to be compared
|
|
114
|
+
def eql?(o)
|
|
115
|
+
self == o
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
# Calculates hash code according to all attributes.
|
|
119
|
+
# @return [Integer] Hash code
|
|
120
|
+
def hash
|
|
121
|
+
[enabled].hash
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
# Builds the object from hash
|
|
125
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
126
|
+
# @return [Object] Returns the model itself
|
|
127
|
+
def self.build_from_hash(attributes)
|
|
128
|
+
return nil unless attributes.is_a?(Hash)
|
|
129
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
130
|
+
transformed_hash = {}
|
|
131
|
+
openapi_types.each_pair do |key, type|
|
|
132
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
133
|
+
transformed_hash["#{key}"] = nil
|
|
134
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
135
|
+
# check to ensure the input is an array given that the attribute
|
|
136
|
+
# is documented as an array but the input is not
|
|
137
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
138
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
139
|
+
end
|
|
140
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
141
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
142
|
+
end
|
|
143
|
+
end
|
|
144
|
+
new(transformed_hash)
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
# Returns the object in the form of hash
|
|
148
|
+
# @return [Hash] Returns the object in the form of hash
|
|
149
|
+
def to_hash
|
|
150
|
+
hash = {}
|
|
151
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
152
|
+
value = self.send(attr)
|
|
153
|
+
if value.nil?
|
|
154
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
155
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
156
|
+
end
|
|
157
|
+
|
|
158
|
+
hash[param] = _to_hash(value)
|
|
159
|
+
end
|
|
160
|
+
hash
|
|
161
|
+
end
|
|
162
|
+
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
end
|