Class: CandidApiClient::PreEncounter::Coverages::V1::Types::ServiceCoverageDetails

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

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(copay: OMIT, coinsurance: OMIT, visits: OMIT, visits_remaining: OMIT, additional_notes: OMIT, additional_properties: nil) ⇒ CandidApiClient::PreEncounter::Coverages::V1::Types::ServiceCoverageDetails

Parameters:



38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# File 'lib/candidhealth/pre_encounter/coverages/v_1/types/service_coverage_details.rb', line 38

def initialize(copay: OMIT, coinsurance: OMIT, visits: OMIT, visits_remaining: OMIT,
               additional_notes: OMIT, additional_properties: nil)
  @copay = copay if copay != OMIT
  @coinsurance = coinsurance if coinsurance != OMIT
  @visits = visits if visits != OMIT
  @visits_remaining = visits_remaining if visits_remaining != OMIT
  @additional_notes = additional_notes if additional_notes != OMIT
  @additional_properties = additional_properties
  @_field_set = {
    "copay": copay,
    "coinsurance": coinsurance,
    "visits": visits,
    "visits_remaining": visits_remaining,
    "additional_notes": additional_notes
  }.reject do |_k, v|
    v == OMIT
  end
end

Instance Attribute Details

#additional_notesString (readonly)

Returns:

  • (String)


22
23
24
# File 'lib/candidhealth/pre_encounter/coverages/v_1/types/service_coverage_details.rb', line 22

def additional_notes
  @additional_notes
end

#additional_propertiesOpenStruct (readonly)

Returns Additional properties unmapped to the current class definition.

Returns:

  • (OpenStruct)

    Additional properties unmapped to the current class definition



24
25
26
# File 'lib/candidhealth/pre_encounter/coverages/v_1/types/service_coverage_details.rb', line 24

def additional_properties
  @additional_properties
end

#coinsuranceCandidApiClient::PreEncounter::Coverages::V1::Types::CoverageValue (readonly)



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

def coinsurance
  @coinsurance
end

#copayCandidApiClient::PreEncounter::Coverages::V1::Types::CoverageValue (readonly)



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

def copay
  @copay
end

#visitsCandidApiClient::PreEncounter::Coverages::V1::Types::CoverageValue (readonly)



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

def visits
  @visits
end

#visits_remainingCandidApiClient::PreEncounter::Coverages::V1::Types::CoverageValue (readonly)



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

def visits_remaining
  @visits_remaining
end

Class Method Details

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

Deserialize a JSON object to an instance of ServiceCoverageDetails



61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# File 'lib/candidhealth/pre_encounter/coverages/v_1/types/service_coverage_details.rb', line 61

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  if parsed_json["copay"].nil?
    copay = nil
  else
    copay = parsed_json["copay"].to_json
    copay = CandidApiClient::PreEncounter::Coverages::V1::Types::CoverageValue.from_json(json_object: copay)
  end
  if parsed_json["coinsurance"].nil?
    coinsurance = nil
  else
    coinsurance = parsed_json["coinsurance"].to_json
    coinsurance = CandidApiClient::PreEncounter::Coverages::V1::Types::CoverageValue.from_json(json_object: coinsurance)
  end
  if parsed_json["visits"].nil?
    visits = nil
  else
    visits = parsed_json["visits"].to_json
    visits = CandidApiClient::PreEncounter::Coverages::V1::Types::CoverageValue.from_json(json_object: visits)
  end
  if parsed_json["visits_remaining"].nil?
    visits_remaining = nil
  else
    visits_remaining = parsed_json["visits_remaining"].to_json
    visits_remaining = CandidApiClient::PreEncounter::Coverages::V1::Types::CoverageValue.from_json(json_object: visits_remaining)
  end
  additional_notes = struct["additional_notes"]
  new(
    copay: copay,
    coinsurance: coinsurance,
    visits: visits,
    visits_remaining: visits_remaining,
    additional_notes: additional_notes,
    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)


112
113
114
115
116
117
118
# File 'lib/candidhealth/pre_encounter/coverages/v_1/types/service_coverage_details.rb', line 112

def self.validate_raw(obj:)
  obj.copay.nil? || CandidApiClient::PreEncounter::Coverages::V1::Types::CoverageValue.validate_raw(obj: obj.copay)
  obj.coinsurance.nil? || CandidApiClient::PreEncounter::Coverages::V1::Types::CoverageValue.validate_raw(obj: obj.coinsurance)
  obj.visits.nil? || CandidApiClient::PreEncounter::Coverages::V1::Types::CoverageValue.validate_raw(obj: obj.visits)
  obj.visits_remaining.nil? || CandidApiClient::PreEncounter::Coverages::V1::Types::CoverageValue.validate_raw(obj: obj.visits_remaining)
  obj.additional_notes&.is_a?(String) != false || raise("Passed value for field obj.additional_notes is not the expected type, validation failed.")
end

Instance Method Details

#to_json(*_args) ⇒ String

Serialize an instance of ServiceCoverageDetails to a JSON object

Returns:

  • (String)


102
103
104
# File 'lib/candidhealth/pre_encounter/coverages/v_1/types/service_coverage_details.rb', line 102

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