Class: CandidApiClient::PreEncounter::Coverages::V1::Types::CoverageEligibilityCheckResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/candidhealth/pre_encounter/coverages/v_1/types/coverage_eligibility_check_response.rb

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(metadata:, check: OMIT, additional_properties: nil) ⇒ CandidApiClient::PreEncounter::Coverages::V1::Types::CoverageEligibilityCheckResponse

Parameters:



30
31
32
33
34
35
36
37
# File 'lib/candidhealth/pre_encounter/coverages/v_1/types/coverage_eligibility_check_response.rb', line 30

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



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

def additional_properties
  @additional_properties
end

#checkCandidApiClient::PreEncounter::Coverages::V1::Types::EligibilityCheck (readonly)



17
18
19
# File 'lib/candidhealth/pre_encounter/coverages/v_1/types/coverage_eligibility_check_response.rb', line 17

def check
  @check
end

#metadataCandidApiClient::PreEncounter::Coverages::V1::Types::EligibilityCheckMetadata (readonly)



15
16
17
# File 'lib/candidhealth/pre_encounter/coverages/v_1/types/coverage_eligibility_check_response.rb', line 15

def 
  @metadata
end

Class Method Details

.from_json(json_object:) ⇒ CandidApiClient::PreEncounter::Coverages::V1::Types::CoverageEligibilityCheckResponse

Deserialize a JSON object to an instance of CoverageEligibilityCheckResponse



43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# File 'lib/candidhealth/pre_encounter/coverages/v_1/types/coverage_eligibility_check_response.rb', line 43

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  if parsed_json["metadata"].nil?
     = nil
  else
     = parsed_json["metadata"].to_json
     = CandidApiClient::PreEncounter::Coverages::V1::Types::EligibilityCheckMetadata.from_json(json_object: )
  end
  if parsed_json["check"].nil?
    check = nil
  else
    check = parsed_json["check"].to_json
    check = CandidApiClient::PreEncounter::Coverages::V1::Types::EligibilityCheck.from_json(json_object: check)
  end
  new(
    metadata: ,
    check: check,
    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)


78
79
80
81
# File 'lib/candidhealth/pre_encounter/coverages/v_1/types/coverage_eligibility_check_response.rb', line 78

def self.validate_raw(obj:)
  CandidApiClient::PreEncounter::Coverages::V1::Types::EligibilityCheckMetadata.validate_raw(obj: obj.)
  obj.check.nil? || CandidApiClient::PreEncounter::Coverages::V1::Types::EligibilityCheck.validate_raw(obj: obj.check)
end

Instance Method Details

#to_json(*_args) ⇒ String

Serialize an instance of CoverageEligibilityCheckResponse to a JSON object

Returns:

  • (String)


68
69
70
# File 'lib/candidhealth/pre_encounter/coverages/v_1/types/coverage_eligibility_check_response.rb', line 68

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