Class: CandidApiClient::Encounters::V4::Types::IntakeFollowUp

Inherits:
Object
  • Object
show all
Defined in:
lib/candidhealth/encounters/v_4/types/intake_follow_up.rb

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id:, text:, response: OMIT, additional_properties: nil) ⇒ CandidApiClient::Encounters::V4::Types::IntakeFollowUp

Parameters:

  • id (String)
  • text (String)
  • response (String) (defaults to: OMIT)
  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



30
31
32
33
34
35
36
37
38
# File 'lib/candidhealth/encounters/v_4/types/intake_follow_up.rb', line 30

def initialize(id:, text:, response: OMIT, additional_properties: nil)
  @id = id
  @text = text
  @response = response if response != OMIT
  @additional_properties = additional_properties
  @_field_set = { "id": id, "text": text, "response": response }.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



18
19
20
# File 'lib/candidhealth/encounters/v_4/types/intake_follow_up.rb', line 18

def additional_properties
  @additional_properties
end

#idString (readonly)

Returns:

  • (String)


12
13
14
# File 'lib/candidhealth/encounters/v_4/types/intake_follow_up.rb', line 12

def id
  @id
end

#responseString (readonly)

Returns:

  • (String)


16
17
18
# File 'lib/candidhealth/encounters/v_4/types/intake_follow_up.rb', line 16

def response
  @response
end

#textString (readonly)

Returns:

  • (String)


14
15
16
# File 'lib/candidhealth/encounters/v_4/types/intake_follow_up.rb', line 14

def text
  @text
end

Class Method Details

.from_json(json_object:) ⇒ CandidApiClient::Encounters::V4::Types::IntakeFollowUp

Deserialize a JSON object to an instance of IntakeFollowUp

Parameters:

  • json_object (String)

Returns:



44
45
46
47
48
49
50
51
52
53
54
55
# File 'lib/candidhealth/encounters/v_4/types/intake_follow_up.rb', line 44

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  id = struct["id"]
  text = struct["text"]
  response = struct["response"]
  new(
    id: id,
    text: text,
    response: response,
    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)


70
71
72
73
74
# File 'lib/candidhealth/encounters/v_4/types/intake_follow_up.rb', line 70

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

Instance Method Details

#to_json(*_args) ⇒ String

Serialize an instance of IntakeFollowUp to a JSON object

Returns:

  • (String)


60
61
62
# File 'lib/candidhealth/encounters/v_4/types/intake_follow_up.rb', line 60

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