Class: Merge::Ats::ScreeningQuestion
- Inherits:
-
Object
- Object
- Merge::Ats::ScreeningQuestion
- 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
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#created_at ⇒ DateTime
readonly
The datetime that this object was created by Merge.
-
#description ⇒ String
readonly
The description of the screening question.
- #id ⇒ String readonly
-
#job ⇒ Merge::Ats::ScreeningQuestionJob
readonly
The job associated with the screening question.
-
#modified_at ⇒ DateTime
readonly
The datetime that this object was modified by Merge.
- #options ⇒ Array<Object> readonly
-
#remote_id ⇒ String
readonly
The third-party API ID of the matching object.
-
#remote_was_deleted ⇒ Boolean
readonly
Indicates whether or not this object has been deleted in the third party platform.
-
#required ⇒ Boolean
readonly
Whether or not the screening question is required.
-
#title ⇒ String
readonly
The title of the screening question.
-
#type ⇒ Merge::Ats::ScreeningQuestionTypeEnum
readonly
The data type for the screening question.
Class Method Summary collapse
-
.from_json(json_object:) ⇒ Merge::Ats::ScreeningQuestion
Deserialize a JSON object to an instance of ScreeningQuestion.
-
.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.
Instance Method Summary collapse
- #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 constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of ScreeningQuestion to a JSON object.
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
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 = if != 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": , "remote_was_deleted": remote_was_deleted }.reject do |_k, v| v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns 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_at ⇒ DateTime (readonly)
Returns 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 |
#description ⇒ String (readonly)
Returns 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 |
#id ⇒ String (readonly)
19 20 21 |
# File 'lib/merge_ruby_client/ats/types/screening_question.rb', line 19 def id @id end |
#job ⇒ Merge::Ats::ScreeningQuestionJob (readonly)
Returns The job associated with the screening question.
27 28 29 |
# File 'lib/merge_ruby_client/ats/types/screening_question.rb', line 27 def job @job end |
#modified_at ⇒ DateTime (readonly)
Returns 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 |
#options ⇒ Array<Object> (readonly)
45 46 47 |
# File 'lib/merge_ruby_client/ats/types/screening_question.rb', line 45 def @options end |
#remote_id ⇒ String (readonly)
Returns 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_deleted ⇒ Boolean (readonly)
Returns 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 |
#required ⇒ Boolean (readonly)
Returns 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 |
#title ⇒ String (readonly)
Returns 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 |
#type ⇒ Merge::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.
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
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"] = 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: , 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.
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.&.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
152 153 154 |
# File 'lib/merge_ruby_client/ats/types/screening_question.rb', line 152 def to_json(*_args) @_field_set&.to_json end |