Class: CandidApiClient::PreEncounter::Coverages::V1::Types::LatestEligibilityCheck

Inherits:
Object
  • Object
show all
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

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(check_id:, status:, initiated_at:, additional_properties: nil) ⇒ CandidApiClient::PreEncounter::Coverages::V1::Types::LatestEligibilityCheck

Parameters:



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_propertiesOpenStruct (readonly)

Returns Additional properties unmapped to the current class definition.

Returns:

  • (OpenStruct)

    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_idString (readonly)

Returns:

  • (String)


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_atDateTime (readonly)

Returns:

  • (DateTime)


20
21
22
# File 'lib/candidhealth/pre_encounter/coverages/v_1/types/latest_eligibility_check.rb', line 20

def initiated_at
  @initiated_at
end

#statusCandidApiClient::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.

Parameters:

  • obj (Object)

Returns:

  • (Void)


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

Returns:

  • (String)


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