Class: CandidApiClient::Tasks::V3::Types::TaskNote
- Inherits:
-
Object
- Object
- CandidApiClient::Tasks::V3::Types::TaskNote
- Defined in:
- lib/candidhealth/tasks/v_3/types/task_note.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
- #author_name ⇒ String readonly
- #author_organization_name ⇒ String readonly
- #created_at ⇒ DateTime readonly
- #task_note_id ⇒ String readonly
- #text ⇒ String readonly
Class Method Summary collapse
-
.from_json(json_object:) ⇒ CandidApiClient::Tasks::V3::Types::TaskNote
Deserialize a JSON object to an instance of TaskNote.
-
.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(task_note_id:, text:, created_at:, author_name:, author_organization_name:, additional_properties: nil) ⇒ CandidApiClient::Tasks::V3::Types::TaskNote constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of TaskNote to a JSON object.
Constructor Details
#initialize(task_note_id:, text:, created_at:, author_name:, author_organization_name:, additional_properties: nil) ⇒ CandidApiClient::Tasks::V3::Types::TaskNote
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/candidhealth/tasks/v_3/types/task_note.rb', line 37 def initialize(task_note_id:, text:, created_at:, author_name:, author_organization_name:, additional_properties: nil) @task_note_id = task_note_id @text = text @created_at = created_at @author_name = @author_organization_name = @additional_properties = additional_properties @_field_set = { "task_note_id": task_note_id, "text": text, "created_at": created_at, "author_name": , "author_organization_name": } end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
23 24 25 |
# File 'lib/candidhealth/tasks/v_3/types/task_note.rb', line 23 def additional_properties @additional_properties end |
#author_name ⇒ String (readonly)
19 20 21 |
# File 'lib/candidhealth/tasks/v_3/types/task_note.rb', line 19 def @author_name end |
#author_organization_name ⇒ String (readonly)
21 22 23 |
# File 'lib/candidhealth/tasks/v_3/types/task_note.rb', line 21 def @author_organization_name end |
#created_at ⇒ DateTime (readonly)
17 18 19 |
# File 'lib/candidhealth/tasks/v_3/types/task_note.rb', line 17 def created_at @created_at end |
#task_note_id ⇒ String (readonly)
13 14 15 |
# File 'lib/candidhealth/tasks/v_3/types/task_note.rb', line 13 def task_note_id @task_note_id end |
#text ⇒ String (readonly)
15 16 17 |
# File 'lib/candidhealth/tasks/v_3/types/task_note.rb', line 15 def text @text end |
Class Method Details
.from_json(json_object:) ⇒ CandidApiClient::Tasks::V3::Types::TaskNote
Deserialize a JSON object to an instance of TaskNote
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/candidhealth/tasks/v_3/types/task_note.rb', line 58 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) task_note_id = struct["task_note_id"] text = struct["text"] created_at = (DateTime.parse(parsed_json["created_at"]) unless parsed_json["created_at"].nil?) = struct["author_name"] = struct["author_organization_name"] new( task_note_id: task_note_id, text: text, created_at: created_at, author_name: , author_organization_name: , 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.
89 90 91 92 93 94 95 |
# File 'lib/candidhealth/tasks/v_3/types/task_note.rb', line 89 def self.validate_raw(obj:) obj.task_note_id.is_a?(String) != false || raise("Passed value for field obj.task_note_id is not the expected type, validation failed.") obj.text.is_a?(String) != false || raise("Passed value for field obj.text 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..is_a?(String) != false || raise("Passed value for field obj.author_name is not the expected type, validation failed.") obj..is_a?(String) != false || raise("Passed value for field obj.author_organization_name is not the expected type, validation failed.") end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of TaskNote to a JSON object
79 80 81 |
# File 'lib/candidhealth/tasks/v_3/types/task_note.rb', line 79 def to_json(*_args) @_field_set&.to_json end |