Class: Merge::Ats::ScreeningQuestion

Inherits:
Object
  • Object
show all
Defined in:
lib/merge_ruby_client/ats/types/screening_question.rb

Overview

# The ScreeningQuestion Object

### Description
The `ScreeningQuestion` object is used to represent questions asked to screen
candidates for a job.
### Usage Example
TODO

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id: OMIT, remote_id: OMIT, created_at: OMIT, modified_at: OMIT, job: OMIT, description: OMIT, title: OMIT, type: OMIT, required: OMIT, options: OMIT, remote_was_deleted: OMIT, additional_properties: nil) ⇒ Merge::Ats::ScreeningQuestion

Parameters:

  • id (String) (defaults to: OMIT)
  • remote_id (String) (defaults to: OMIT)

    The third-party API ID of the matching object.

  • created_at (DateTime) (defaults to: OMIT)

    The datetime that this object was created by Merge.

  • modified_at (DateTime) (defaults to: OMIT)

    The datetime that this object was modified by Merge.

  • job (Merge::Ats::ScreeningQuestionJob) (defaults to: OMIT)

    The job associated with the screening question.

  • description (String) (defaults to: OMIT)

    The description of the screening question

  • title (String) (defaults to: OMIT)

    The title of the screening question

  • type (Merge::Ats::ScreeningQuestionTypeEnum) (defaults to: OMIT)

    The data type for the screening question.

    • ‘DATE` - DATE

    • ‘FILE` - FILE

    • ‘SINGLE_SELECT` - SINGLE_SELECT

    • ‘MULTI_SELECT` - MULTI_SELECT

    • ‘SINGLE_LINE_TEXT` - SINGLE_LINE_TEXT

    • ‘MULTI_LINE_TEXT` - MULTI_LINE_TEXT

    • ‘NUMERIC` - NUMERIC

    • ‘BOOLEAN` - BOOLEAN

  • required (Boolean) (defaults to: OMIT)

    Whether or not the screening question is required.

  • options (Array<Object>) (defaults to: OMIT)
  • remote_was_deleted (Boolean) (defaults to: OMIT)

    Indicates whether or not this object has been deleted in the third party platform.

  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
# File 'lib/merge_ruby_client/ats/types/screening_question.rb', line 79

def initialize(id: OMIT, remote_id: OMIT, created_at: OMIT, modified_at: OMIT, job: OMIT, description: OMIT,
               title: OMIT, type: OMIT, required: OMIT, options: OMIT, remote_was_deleted: OMIT, additional_properties: nil)
  @id = id if id != OMIT
  @remote_id = remote_id if remote_id != OMIT
  @created_at = created_at if created_at != OMIT
  @modified_at = modified_at if modified_at != OMIT
  @job = job if job != OMIT
  @description = description if description != OMIT
  @title = title if title != OMIT
  @type = type if type != OMIT
  @required = required if required != OMIT
  @options = options if options != OMIT
  @remote_was_deleted = remote_was_deleted if remote_was_deleted != OMIT
  @additional_properties = additional_properties
  @_field_set = {
    "id": id,
    "remote_id": remote_id,
    "created_at": created_at,
    "modified_at": modified_at,
    "job": job,
    "description": description,
    "title": title,
    "type": type,
    "required": required,
    "options": options,
    "remote_was_deleted": remote_was_deleted
  }.reject do |_k, v|
    v == OMIT
  end
end

Instance Attribute Details

#additional_propertiesOpenStruct (readonly)

Returns Additional properties unmapped to the current class definition.

Returns:

  • (OpenStruct)

    Additional properties unmapped to the current class definition



50
51
52
# File 'lib/merge_ruby_client/ats/types/screening_question.rb', line 50

def additional_properties
  @additional_properties
end

#created_atDateTime (readonly)

Returns The datetime that this object was created by Merge.

Returns:

  • (DateTime)

    The datetime that this object was created by Merge.



23
24
25
# File 'lib/merge_ruby_client/ats/types/screening_question.rb', line 23

def created_at
  @created_at
end

#descriptionString (readonly)

Returns The description of the screening question.

Returns:

  • (String)

    The description of the screening question



29
30
31
# File 'lib/merge_ruby_client/ats/types/screening_question.rb', line 29

def description
  @description
end

#idString (readonly)

Returns:

  • (String)


19
20
21
# File 'lib/merge_ruby_client/ats/types/screening_question.rb', line 19

def id
  @id
end

#jobMerge::Ats::ScreeningQuestionJob (readonly)

Returns The job associated with the screening question.

Returns:



27
28
29
# File 'lib/merge_ruby_client/ats/types/screening_question.rb', line 27

def job
  @job
end

#modified_atDateTime (readonly)

Returns The datetime that this object was modified by Merge.

Returns:

  • (DateTime)

    The datetime that this object was modified by Merge.



25
26
27
# File 'lib/merge_ruby_client/ats/types/screening_question.rb', line 25

def modified_at
  @modified_at
end

#optionsArray<Object> (readonly)

Returns:

  • (Array<Object>)


45
46
47
# File 'lib/merge_ruby_client/ats/types/screening_question.rb', line 45

def options
  @options
end

#remote_idString (readonly)

Returns The third-party API ID of the matching object.

Returns:

  • (String)

    The third-party API ID of the matching object.



21
22
23
# File 'lib/merge_ruby_client/ats/types/screening_question.rb', line 21

def remote_id
  @remote_id
end

#remote_was_deletedBoolean (readonly)

Returns Indicates whether or not this object has been deleted in the third party platform.

Returns:

  • (Boolean)

    Indicates whether or not this object has been deleted in the third party platform.



48
49
50
# File 'lib/merge_ruby_client/ats/types/screening_question.rb', line 48

def remote_was_deleted
  @remote_was_deleted
end

#requiredBoolean (readonly)

Returns Whether or not the screening question is required.

Returns:

  • (Boolean)

    Whether or not the screening question is required.



43
44
45
# File 'lib/merge_ruby_client/ats/types/screening_question.rb', line 43

def required
  @required
end

#titleString (readonly)

Returns The title of the screening question.

Returns:

  • (String)

    The title of the screening question



31
32
33
# File 'lib/merge_ruby_client/ats/types/screening_question.rb', line 31

def title
  @title
end

#typeMerge::Ats::ScreeningQuestionTypeEnum (readonly)

Returns The data type for the screening question.

  • ‘DATE` - DATE

  • ‘FILE` - FILE

  • ‘SINGLE_SELECT` - SINGLE_SELECT

  • ‘MULTI_SELECT` - MULTI_SELECT

  • ‘SINGLE_LINE_TEXT` - SINGLE_LINE_TEXT

  • ‘MULTI_LINE_TEXT` - MULTI_LINE_TEXT

  • ‘NUMERIC` - NUMERIC

  • ‘BOOLEAN` - BOOLEAN.

Returns:

  • (Merge::Ats::ScreeningQuestionTypeEnum)

    The data type for the screening question.

    • ‘DATE` - DATE

    • ‘FILE` - FILE

    • ‘SINGLE_SELECT` - SINGLE_SELECT

    • ‘MULTI_SELECT` - MULTI_SELECT

    • ‘SINGLE_LINE_TEXT` - SINGLE_LINE_TEXT

    • ‘MULTI_LINE_TEXT` - MULTI_LINE_TEXT

    • ‘NUMERIC` - NUMERIC

    • ‘BOOLEAN` - BOOLEAN



41
42
43
# File 'lib/merge_ruby_client/ats/types/screening_question.rb', line 41

def type
  @type
end

Class Method Details

.from_json(json_object:) ⇒ Merge::Ats::ScreeningQuestion

Deserialize a JSON object to an instance of ScreeningQuestion

Parameters:

  • json_object (String)

Returns:



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
# File 'lib/merge_ruby_client/ats/types/screening_question.rb', line 114

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  id = parsed_json["id"]
  remote_id = parsed_json["remote_id"]
  created_at = (DateTime.parse(parsed_json["created_at"]) unless parsed_json["created_at"].nil?)
  modified_at = (DateTime.parse(parsed_json["modified_at"]) unless parsed_json["modified_at"].nil?)
  if parsed_json["job"].nil?
    job = nil
  else
    job = parsed_json["job"].to_json
    job = Merge::Ats::ScreeningQuestionJob.from_json(json_object: job)
  end
  description = parsed_json["description"]
  title = parsed_json["title"]
  type = parsed_json["type"]
  required = parsed_json["required"]
  options = parsed_json["options"]
  remote_was_deleted = parsed_json["remote_was_deleted"]
  new(
    id: id,
    remote_id: remote_id,
    created_at: created_at,
    modified_at: modified_at,
    job: job,
    description: description,
    title: title,
    type: type,
    required: required,
    options: options,
    remote_was_deleted: remote_was_deleted,
    additional_properties: struct
  )
end

.validate_raw(obj:) ⇒ Void

Leveraged for Union-type generation, validate_raw attempts to parse the given

hash and check each fields type against the current object's property
definitions.

Parameters:

  • obj (Object)

Returns:

  • (Void)


162
163
164
165
166
167
168
169
170
171
172
173
174
# File 'lib/merge_ruby_client/ats/types/screening_question.rb', line 162

def self.validate_raw(obj:)
  obj.id&.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
  obj.remote_id&.is_a?(String) != false || raise("Passed value for field obj.remote_id is not the expected type, validation failed.")
  obj.created_at&.is_a?(DateTime) != false || raise("Passed value for field obj.created_at is not the expected type, validation failed.")
  obj.modified_at&.is_a?(DateTime) != false || raise("Passed value for field obj.modified_at is not the expected type, validation failed.")
  obj.job.nil? || Merge::Ats::ScreeningQuestionJob.validate_raw(obj: obj.job)
  obj.description&.is_a?(String) != false || raise("Passed value for field obj.description is not the expected type, validation failed.")
  obj.title&.is_a?(String) != false || raise("Passed value for field obj.title is not the expected type, validation failed.")
  obj.type&.is_a?(Merge::Ats::ScreeningQuestionTypeEnum) != false || raise("Passed value for field obj.type is not the expected type, validation failed.")
  obj.required&.is_a?(Boolean) != false || raise("Passed value for field obj.required is not the expected type, validation failed.")
  obj.options&.is_a?(Array) != false || raise("Passed value for field obj.options is not the expected type, validation failed.")
  obj.remote_was_deleted&.is_a?(Boolean) != false || raise("Passed value for field obj.remote_was_deleted is not the expected type, validation failed.")
end

Instance Method Details

#to_json(*_args) ⇒ String

Serialize an instance of ScreeningQuestion to a JSON object

Returns:

  • (String)


152
153
154
# File 'lib/merge_ruby_client/ats/types/screening_question.rb', line 152

def to_json(*_args)
  @_field_set&.to_json
end