Class: Pescheck::V2CheckInfo

Inherits:
ApiModelBase show all
Defined in:
lib/pescheck-client/models/v2_check_info.rb

Overview

Everything a client needs to know to use a check type via the API.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from ApiModelBase

_deserialize, #_to_hash, #to_body, #to_s

Constructor Details

#initialize(attributes = {}) ⇒ V2CheckInfo

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash



102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
# File 'lib/pescheck-client/models/v2_check_info.rb', line 102

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `Pescheck::V2CheckInfo` initialize method"
  end

  # check to see if the attribute exists and convert string to symbol for hash key
  acceptable_attribute_map = self.class.acceptable_attribute_map
  attributes = attributes.each_with_object({}) { |(k, v), h|
    if (!acceptable_attribute_map.key?(k.to_sym))
      fail ArgumentError, "`#{k}` is not a valid attribute in `Pescheck::V2CheckInfo`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
    end
    h[k.to_sym] = v
  }

  if attributes.key?(:'check_type')
    self.check_type = attributes[:'check_type']
  else
    self.check_type = nil
  end

  if attributes.key?(:'display_name')
    self.display_name = attributes[:'display_name']
  else
    self.display_name = nil
  end

  if attributes.key?(:'description')
    self.description = attributes[:'description']
  else
    self.description = nil
  end

  if attributes.key?(:'has_config')
    self.has_config = attributes[:'has_config']
  else
    self.has_config = nil
  end

  if attributes.key?(:'is_system_managed')
    self.is_system_managed = attributes[:'is_system_managed']
  else
    self.is_system_managed = nil
  end

  if attributes.key?(:'requires_checks')
    if (value = attributes[:'requires_checks']).is_a?(Array)
      self.requires_checks = value
    end
  else
    self.requires_checks = nil
  end

  if attributes.key?(:'supported_countries_of_work')
    if (value = attributes[:'supported_countries_of_work']).is_a?(Array)
      self.supported_countries_of_work = value
    end
  else
    self.supported_countries_of_work = nil
  end

  if attributes.key?(:'supported_countries_of_residence')
    if (value = attributes[:'supported_countries_of_residence']).is_a?(Array)
      self.supported_countries_of_residence = value
    end
  else
    self.supported_countries_of_residence = nil
  end

  if attributes.key?(:'default_price')
    self.default_price = attributes[:'default_price']
  else
    self.default_price = nil
  end

  if attributes.key?(:'config_fields')
    if (value = attributes[:'config_fields']).is_a?(Array)
      self.config_fields = value
    end
  else
    self.config_fields = nil
  end

  if attributes.key?(:'input_fields')
    if (value = attributes[:'input_fields']).is_a?(Array)
      self.input_fields = value
    end
  else
    self.input_fields = nil
  end

  if attributes.key?(:'candidate_fields')
    if (value = attributes[:'candidate_fields']).is_a?(Array)
      self.candidate_fields = value
    end
  else
    self.candidate_fields = nil
  end
end

Instance Attribute Details

#candidate_fieldsObject

Screening-level candidate facts this check needs (name, email, sometimes date of birth, etc.).



44
45
46
# File 'lib/pescheck-client/models/v2_check_info.rb', line 44

def candidate_fields
  @candidate_fields
end

#check_typeObject

Returns the value of attribute check_type.



19
20
21
# File 'lib/pescheck-client/models/v2_check_info.rb', line 19

def check_type
  @check_type
end

#config_fieldsObject

Returns the value of attribute config_fields.



39
40
41
# File 'lib/pescheck-client/models/v2_check_info.rb', line 39

def config_fields
  @config_fields
end

#default_priceObject

Returns the value of attribute default_price.



37
38
39
# File 'lib/pescheck-client/models/v2_check_info.rb', line 37

def default_price
  @default_price
end

#descriptionObject

Returns the value of attribute description.



23
24
25
# File 'lib/pescheck-client/models/v2_check_info.rb', line 23

def description
  @description
end

#display_nameObject

Returns the value of attribute display_name.



21
22
23
# File 'lib/pescheck-client/models/v2_check_info.rb', line 21

def display_name
  @display_name
end

#has_configObject

Returns the value of attribute has_config.



25
26
27
# File 'lib/pescheck-client/models/v2_check_info.rb', line 25

def has_config
  @has_config
end

#input_fieldsObject

Returns the value of attribute input_fields.



41
42
43
# File 'lib/pescheck-client/models/v2_check_info.rb', line 41

def input_fields
  @input_fields
end

#is_system_managedObject

True for checks added automatically (e.g. as a dependency) - clients neither add nor configure these.



28
29
30
# File 'lib/pescheck-client/models/v2_check_info.rb', line 28

def is_system_managed
  @is_system_managed
end

#requires_checksObject

Other check types this check pulls in automatically when added.



31
32
33
# File 'lib/pescheck-client/models/v2_check_info.rb', line 31

def requires_checks
  @requires_checks
end

#supported_countries_of_residenceObject

Returns the value of attribute supported_countries_of_residence.



35
36
37
# File 'lib/pescheck-client/models/v2_check_info.rb', line 35

def supported_countries_of_residence
  @supported_countries_of_residence
end

#supported_countries_of_workObject

Returns the value of attribute supported_countries_of_work.



33
34
35
# File 'lib/pescheck-client/models/v2_check_info.rb', line 33

def supported_countries_of_work
  @supported_countries_of_work
end

Class Method Details

.acceptable_attribute_mapObject

Returns attribute mapping this model knows about



65
66
67
# File 'lib/pescheck-client/models/v2_check_info.rb', line 65

def self.acceptable_attribute_map
  attribute_map
end

.acceptable_attributesObject

Returns all the JSON keys this model knows about



70
71
72
# File 'lib/pescheck-client/models/v2_check_info.rb', line 70

def self.acceptable_attributes
  acceptable_attribute_map.values
end

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# File 'lib/pescheck-client/models/v2_check_info.rb', line 47

def self.attribute_map
  {
    :'check_type' => :'check_type',
    :'display_name' => :'display_name',
    :'description' => :'description',
    :'has_config' => :'has_config',
    :'is_system_managed' => :'is_system_managed',
    :'requires_checks' => :'requires_checks',
    :'supported_countries_of_work' => :'supported_countries_of_work',
    :'supported_countries_of_residence' => :'supported_countries_of_residence',
    :'default_price' => :'default_price',
    :'config_fields' => :'config_fields',
    :'input_fields' => :'input_fields',
    :'candidate_fields' => :'candidate_fields'
  }
end

.build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
# File 'lib/pescheck-client/models/v2_check_info.rb', line 400

def self.build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  attributes = attributes.transform_keys(&:to_sym)
  transformed_hash = {}
  openapi_types.each_pair do |key, type|
    if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
      transformed_hash["#{key}"] = nil
    elsif type =~ /\AArray<(.*)>/i
      # check to ensure the input is an array given that the attribute
      # is documented as an array but the input is not
      if attributes[attribute_map[key]].is_a?(Array)
        transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
      end
    elsif !attributes[attribute_map[key]].nil?
      transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
    end
  end
  new(transformed_hash)
end

.openapi_nullableObject

List of attributes with nullable: true



93
94
95
96
97
98
# File 'lib/pescheck-client/models/v2_check_info.rb', line 93

def self.openapi_nullable
  Set.new([
    :'description',
    :'default_price',
  ])
end

.openapi_typesObject

Attribute type mapping.



75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# File 'lib/pescheck-client/models/v2_check_info.rb', line 75

def self.openapi_types
  {
    :'check_type' => :'String',
    :'display_name' => :'String',
    :'description' => :'String',
    :'has_config' => :'Boolean',
    :'is_system_managed' => :'Boolean',
    :'requires_checks' => :'Array<String>',
    :'supported_countries_of_work' => :'Array<String>',
    :'supported_countries_of_residence' => :'Array<String>',
    :'default_price' => :'V2Money',
    :'config_fields' => :'Array<V2CheckField>',
    :'input_fields' => :'Array<V2CheckField>',
    :'candidate_fields' => :'Array<V2CheckField>'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
# File 'lib/pescheck-client/models/v2_check_info.rb', line 368

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      check_type == o.check_type &&
      display_name == o.display_name &&
      description == o.description &&
      has_config == o.has_config &&
      is_system_managed == o.is_system_managed &&
      requires_checks == o.requires_checks &&
      supported_countries_of_work == o.supported_countries_of_work &&
      supported_countries_of_residence == o.supported_countries_of_residence &&
      default_price == o.default_price &&
      config_fields == o.config_fields &&
      input_fields == o.input_fields &&
      candidate_fields == o.candidate_fields
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


387
388
389
# File 'lib/pescheck-client/models/v2_check_info.rb', line 387

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



393
394
395
# File 'lib/pescheck-client/models/v2_check_info.rb', line 393

def hash
  [check_type, display_name, description, has_config, is_system_managed, requires_checks, supported_countries_of_work, supported_countries_of_residence, default_price, config_fields, input_fields, candidate_fields].hash
end

#list_invalid_propertiesObject

Show invalid properties with the reasons. Usually used together with valid?

Returns:

  • Array for valid properties with the reasons



203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
# File 'lib/pescheck-client/models/v2_check_info.rb', line 203

def list_invalid_properties
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
  invalid_properties = Array.new
  if @check_type.nil?
    invalid_properties.push('invalid value for "check_type", check_type cannot be nil.')
  end

  if @display_name.nil?
    invalid_properties.push('invalid value for "display_name", display_name cannot be nil.')
  end

  if @has_config.nil?
    invalid_properties.push('invalid value for "has_config", has_config cannot be nil.')
  end

  if @is_system_managed.nil?
    invalid_properties.push('invalid value for "is_system_managed", is_system_managed cannot be nil.')
  end

  if @requires_checks.nil?
    invalid_properties.push('invalid value for "requires_checks", requires_checks cannot be nil.')
  end

  if @supported_countries_of_work.nil?
    invalid_properties.push('invalid value for "supported_countries_of_work", supported_countries_of_work cannot be nil.')
  end

  if @supported_countries_of_residence.nil?
    invalid_properties.push('invalid value for "supported_countries_of_residence", supported_countries_of_residence cannot be nil.')
  end

  if @config_fields.nil?
    invalid_properties.push('invalid value for "config_fields", config_fields cannot be nil.')
  end

  if @input_fields.nil?
    invalid_properties.push('invalid value for "input_fields", input_fields cannot be nil.')
  end

  if @candidate_fields.nil?
    invalid_properties.push('invalid value for "candidate_fields", candidate_fields cannot be nil.')
  end

  invalid_properties
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



422
423
424
425
426
427
428
429
430
431
432
433
434
# File 'lib/pescheck-client/models/v2_check_info.rb', line 422

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = self.send(attr)
    if value.nil?
      is_nullable = self.class.openapi_nullable.include?(attr)
      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
    end

    hash[param] = _to_hash(value)
  end
  hash
end

#valid?Boolean

Check to see if the all the properties in the model are valid

Returns:

  • (Boolean)

    true if the model is valid



251
252
253
254
255
256
257
258
259
260
261
262
263
264
# File 'lib/pescheck-client/models/v2_check_info.rb', line 251

def valid?
  warn '[DEPRECATED] the `valid?` method is obsolete'
  return false if @check_type.nil?
  return false if @display_name.nil?
  return false if @has_config.nil?
  return false if @is_system_managed.nil?
  return false if @requires_checks.nil?
  return false if @supported_countries_of_work.nil?
  return false if @supported_countries_of_residence.nil?
  return false if @config_fields.nil?
  return false if @input_fields.nil?
  return false if @candidate_fields.nil?
  true
end