Class: CandidApiClient::Encounters::V4::Types::IntakeResponseAndFollowUps
- Inherits:
-
Object
- Object
- CandidApiClient::Encounters::V4::Types::IntakeResponseAndFollowUps
- Defined in:
- lib/candidhealth/encounters/v_4/types/intake_response_and_follow_ups.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
- #follow_ups ⇒ Array<CandidApiClient::Encounters::V4::Types::IntakeFollowUp> readonly
- #response ⇒ String readonly
Class Method Summary collapse
-
.from_json(json_object:) ⇒ CandidApiClient::Encounters::V4::Types::IntakeResponseAndFollowUps
Deserialize a JSON object to an instance of IntakeResponseAndFollowUps.
-
.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(response: OMIT, follow_ups: OMIT, additional_properties: nil) ⇒ CandidApiClient::Encounters::V4::Types::IntakeResponseAndFollowUps constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of IntakeResponseAndFollowUps to a JSON object.
Constructor Details
#initialize(response: OMIT, follow_ups: OMIT, additional_properties: nil) ⇒ CandidApiClient::Encounters::V4::Types::IntakeResponseAndFollowUps
28 29 30 31 32 33 34 35 |
# File 'lib/candidhealth/encounters/v_4/types/intake_response_and_follow_ups.rb', line 28 def initialize(response: OMIT, follow_ups: OMIT, additional_properties: nil) @response = response if response != OMIT @follow_ups = follow_ups if follow_ups != OMIT @additional_properties = additional_properties @_field_set = { "response": response, "follow_ups": follow_ups }.reject do |_k, v| v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
17 18 19 |
# File 'lib/candidhealth/encounters/v_4/types/intake_response_and_follow_ups.rb', line 17 def additional_properties @additional_properties end |
#follow_ups ⇒ Array<CandidApiClient::Encounters::V4::Types::IntakeFollowUp> (readonly)
15 16 17 |
# File 'lib/candidhealth/encounters/v_4/types/intake_response_and_follow_ups.rb', line 15 def follow_ups @follow_ups end |
#response ⇒ String (readonly)
13 14 15 |
# File 'lib/candidhealth/encounters/v_4/types/intake_response_and_follow_ups.rb', line 13 def response @response end |
Class Method Details
.from_json(json_object:) ⇒ CandidApiClient::Encounters::V4::Types::IntakeResponseAndFollowUps
Deserialize a JSON object to an instance of IntakeResponseAndFollowUps
41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/candidhealth/encounters/v_4/types/intake_response_and_follow_ups.rb', line 41 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) response = struct["response"] follow_ups = parsed_json["follow_ups"]&.map do |item| item = item.to_json CandidApiClient::Encounters::V4::Types::IntakeFollowUp.from_json(json_object: item) end new( response: response, follow_ups: follow_ups, 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.
69 70 71 72 |
# File 'lib/candidhealth/encounters/v_4/types/intake_response_and_follow_ups.rb', line 69 def self.validate_raw(obj:) obj.response&.is_a?(String) != false || raise("Passed value for field obj.response is not the expected type, validation failed.") obj.follow_ups&.is_a?(Array) != false || raise("Passed value for field obj.follow_ups is not the expected type, validation failed.") end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of IntakeResponseAndFollowUps to a JSON object
59 60 61 |
# File 'lib/candidhealth/encounters/v_4/types/intake_response_and_follow_ups.rb', line 59 def to_json(*_args) @_field_set&.to_json end |