Class: CandidApiClient::Encounters::V4::Types::IntakeFollowUp
- Inherits:
-
Object
- Object
- CandidApiClient::Encounters::V4::Types::IntakeFollowUp
- Defined in:
- lib/candidhealth/encounters/v_4/types/intake_follow_up.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
- #id ⇒ String readonly
- #response ⇒ String readonly
- #text ⇒ String readonly
Class Method Summary collapse
-
.from_json(json_object:) ⇒ CandidApiClient::Encounters::V4::Types::IntakeFollowUp
Deserialize a JSON object to an instance of IntakeFollowUp.
-
.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:, text:, response: OMIT, additional_properties: nil) ⇒ CandidApiClient::Encounters::V4::Types::IntakeFollowUp constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of IntakeFollowUp to a JSON object.
Constructor Details
#initialize(id:, text:, response: OMIT, additional_properties: nil) ⇒ CandidApiClient::Encounters::V4::Types::IntakeFollowUp
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_properties ⇒ OpenStruct (readonly)
Returns 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 |
#id ⇒ String (readonly)
12 13 14 |
# File 'lib/candidhealth/encounters/v_4/types/intake_follow_up.rb', line 12 def id @id end |
#response ⇒ String (readonly)
16 17 18 |
# File 'lib/candidhealth/encounters/v_4/types/intake_follow_up.rb', line 16 def response @response end |
#text ⇒ String (readonly)
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
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.
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
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 |