Class: CandidApiClient::PreEncounter::Coverages::V1::Types::LatestEligibilityCheck
- Inherits:
-
Object
- Object
- CandidApiClient::PreEncounter::Coverages::V1::Types::LatestEligibilityCheck
- Defined in:
- lib/candidhealth/pre_encounter/coverages/v_1/types/latest_eligibility_check.rb
Overview
A type to represent the latest eligibility check status of a coverage.
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
- #check_id ⇒ String readonly
- #initiated_at ⇒ DateTime readonly
- #status ⇒ CandidApiClient::PreEncounter::Coverages::V1::Types::EligibilityStatus readonly
Class Method Summary collapse
-
.from_json(json_object:) ⇒ CandidApiClient::PreEncounter::Coverages::V1::Types::LatestEligibilityCheck
Deserialize a JSON object to an instance of LatestEligibilityCheck.
-
.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(check_id:, status:, initiated_at:, additional_properties: nil) ⇒ CandidApiClient::PreEncounter::Coverages::V1::Types::LatestEligibilityCheck constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of LatestEligibilityCheck to a JSON object.
Constructor Details
#initialize(check_id:, status:, initiated_at:, additional_properties: nil) ⇒ CandidApiClient::PreEncounter::Coverages::V1::Types::LatestEligibilityCheck
34 35 36 37 38 39 40 |
# File 'lib/candidhealth/pre_encounter/coverages/v_1/types/latest_eligibility_check.rb', line 34 def initialize(check_id:, status:, initiated_at:, additional_properties: nil) @check_id = check_id @status = status @initiated_at = initiated_at @additional_properties = additional_properties @_field_set = { "check_id": check_id, "status": status, "initiated_at": initiated_at } end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
22 23 24 |
# File 'lib/candidhealth/pre_encounter/coverages/v_1/types/latest_eligibility_check.rb', line 22 def additional_properties @additional_properties end |
#check_id ⇒ String (readonly)
16 17 18 |
# File 'lib/candidhealth/pre_encounter/coverages/v_1/types/latest_eligibility_check.rb', line 16 def check_id @check_id end |
#initiated_at ⇒ DateTime (readonly)
20 21 22 |
# File 'lib/candidhealth/pre_encounter/coverages/v_1/types/latest_eligibility_check.rb', line 20 def initiated_at @initiated_at end |
#status ⇒ CandidApiClient::PreEncounter::Coverages::V1::Types::EligibilityStatus (readonly)
18 19 20 |
# File 'lib/candidhealth/pre_encounter/coverages/v_1/types/latest_eligibility_check.rb', line 18 def status @status end |
Class Method Details
.from_json(json_object:) ⇒ CandidApiClient::PreEncounter::Coverages::V1::Types::LatestEligibilityCheck
Deserialize a JSON object to an instance of LatestEligibilityCheck
46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/candidhealth/pre_encounter/coverages/v_1/types/latest_eligibility_check.rb', line 46 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) check_id = struct["check_id"] status = struct["status"] initiated_at = (DateTime.parse(parsed_json["initiated_at"]) unless parsed_json["initiated_at"].nil?) new( check_id: check_id, status: status, initiated_at: initiated_at, 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.
73 74 75 76 77 |
# File 'lib/candidhealth/pre_encounter/coverages/v_1/types/latest_eligibility_check.rb', line 73 def self.validate_raw(obj:) obj.check_id.is_a?(String) != false || raise("Passed value for field obj.check_id is not the expected type, validation failed.") obj.status.is_a?(CandidApiClient::PreEncounter::Coverages::V1::Types::EligibilityStatus) != false || raise("Passed value for field obj.status is not the expected type, validation failed.") obj.initiated_at.is_a?(DateTime) != false || raise("Passed value for field obj.initiated_at is not the expected type, validation failed.") end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of LatestEligibilityCheck to a JSON object
63 64 65 |
# File 'lib/candidhealth/pre_encounter/coverages/v_1/types/latest_eligibility_check.rb', line 63 def to_json(*_args) @_field_set&.to_json end |