Class: CandidApiClient::Tasks::V3::Types::TaskNote

Inherits:
Object
  • Object
show all
Defined in:
lib/candidhealth/tasks/v_3/types/task_note.rb

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(task_note_id:, text:, created_at:, author_name:, author_organization_name:, additional_properties: nil) ⇒ CandidApiClient::Tasks::V3::Types::TaskNote

Parameters:

  • task_note_id (String)
  • text (String)
  • created_at (DateTime)
  • author_name (String)
  • author_organization_name (String)
  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



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_name
  @author_organization_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_name,
    "author_organization_name": author_organization_name
  }
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



23
24
25
# File 'lib/candidhealth/tasks/v_3/types/task_note.rb', line 23

def additional_properties
  @additional_properties
end

#author_nameString (readonly)

Returns:

  • (String)


19
20
21
# File 'lib/candidhealth/tasks/v_3/types/task_note.rb', line 19

def author_name
  @author_name
end

#author_organization_nameString (readonly)

Returns:

  • (String)


21
22
23
# File 'lib/candidhealth/tasks/v_3/types/task_note.rb', line 21

def author_organization_name
  @author_organization_name
end

#created_atDateTime (readonly)

Returns:

  • (DateTime)


17
18
19
# File 'lib/candidhealth/tasks/v_3/types/task_note.rb', line 17

def created_at
  @created_at
end

#task_note_idString (readonly)

Returns:

  • (String)


13
14
15
# File 'lib/candidhealth/tasks/v_3/types/task_note.rb', line 13

def task_note_id
  @task_note_id
end

#textString (readonly)

Returns:

  • (String)


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

Parameters:

  • json_object (String)

Returns:



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?)
  author_name = struct["author_name"]
  author_organization_name = struct["author_organization_name"]
  new(
    task_note_id: task_note_id,
    text: text,
    created_at: created_at,
    author_name: author_name,
    author_organization_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.

Parameters:

  • obj (Object)

Returns:

  • (Void)


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.author_name.is_a?(String) != false || raise("Passed value for field obj.author_name is not the expected type, validation failed.")
  obj.author_organization_name.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

Returns:

  • (String)


79
80
81
# File 'lib/candidhealth/tasks/v_3/types/task_note.rb', line 79

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