Class: CandidApiClient::PreEncounter::Coverages::V1::Types::CoverageDetails
- Inherits:
-
Object
- Object
- CandidApiClient::PreEncounter::Coverages::V1::Types::CoverageDetails
- Defined in:
- lib/candidhealth/pre_encounter/coverages/v_1/types/coverage_details.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
- #additional_notes ⇒ String readonly
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
- #coverage_level ⇒ CandidApiClient::PreEncounter::Coverages::V1::Types::CoverageLevel readonly
- #type ⇒ CandidApiClient::PreEncounter::Coverages::V1::Types::BenefitType readonly
- #unit ⇒ CandidApiClient::PreEncounter::Coverages::V1::Types::CoverageValueUnit readonly
- #value ⇒ Float readonly
Class Method Summary collapse
-
.from_json(json_object:) ⇒ CandidApiClient::PreEncounter::Coverages::V1::Types::CoverageDetails
Deserialize a JSON object to an instance of CoverageDetails.
-
.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(type:, coverage_level:, unit:, value:, additional_notes: OMIT, additional_properties: nil) ⇒ CandidApiClient::PreEncounter::Coverages::V1::Types::CoverageDetails constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of CoverageDetails to a JSON object.
Constructor Details
#initialize(type:, coverage_level:, unit:, value:, additional_notes: OMIT, additional_properties: nil) ⇒ CandidApiClient::PreEncounter::Coverages::V1::Types::CoverageDetails
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/candidhealth/pre_encounter/coverages/v_1/types/coverage_details.rb', line 40 def initialize(type:, coverage_level:, unit:, value:, additional_notes: OMIT, additional_properties: nil) @type = type @coverage_level = coverage_level @unit = unit @value = value @additional_notes = additional_notes if additional_notes != OMIT @additional_properties = additional_properties @_field_set = { "type": type, "coverageLevel": coverage_level, "unit": unit, "value": value, "additional_notes": additional_notes }.reject do |_k, v| v == OMIT end end |
Instance Attribute Details
#additional_notes ⇒ String (readonly)
24 25 26 |
# File 'lib/candidhealth/pre_encounter/coverages/v_1/types/coverage_details.rb', line 24 def additional_notes @additional_notes end |
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
26 27 28 |
# File 'lib/candidhealth/pre_encounter/coverages/v_1/types/coverage_details.rb', line 26 def additional_properties @additional_properties end |
#coverage_level ⇒ CandidApiClient::PreEncounter::Coverages::V1::Types::CoverageLevel (readonly)
18 19 20 |
# File 'lib/candidhealth/pre_encounter/coverages/v_1/types/coverage_details.rb', line 18 def coverage_level @coverage_level end |
#type ⇒ CandidApiClient::PreEncounter::Coverages::V1::Types::BenefitType (readonly)
16 17 18 |
# File 'lib/candidhealth/pre_encounter/coverages/v_1/types/coverage_details.rb', line 16 def type @type end |
#unit ⇒ CandidApiClient::PreEncounter::Coverages::V1::Types::CoverageValueUnit (readonly)
20 21 22 |
# File 'lib/candidhealth/pre_encounter/coverages/v_1/types/coverage_details.rb', line 20 def unit @unit end |
#value ⇒ Float (readonly)
22 23 24 |
# File 'lib/candidhealth/pre_encounter/coverages/v_1/types/coverage_details.rb', line 22 def value @value end |
Class Method Details
.from_json(json_object:) ⇒ CandidApiClient::PreEncounter::Coverages::V1::Types::CoverageDetails
Deserialize a JSON object to an instance of CoverageDetails
62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 |
# File 'lib/candidhealth/pre_encounter/coverages/v_1/types/coverage_details.rb', line 62 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) type = struct["type"] coverage_level = struct["coverageLevel"] unit = struct["unit"] value = struct["value"] additional_notes = struct["additional_notes"] new( type: type, coverage_level: coverage_level, unit: unit, value: value, 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.
92 93 94 95 96 97 98 |
# File 'lib/candidhealth/pre_encounter/coverages/v_1/types/coverage_details.rb', line 92 def self.validate_raw(obj:) obj.type.is_a?(CandidApiClient::PreEncounter::Coverages::V1::Types::BenefitType) != false || raise("Passed value for field obj.type is not the expected type, validation failed.") obj.coverage_level.is_a?(CandidApiClient::PreEncounter::Coverages::V1::Types::CoverageLevel) != false || raise("Passed value for field obj.coverage_level is not the expected type, validation failed.") obj.unit.is_a?(CandidApiClient::PreEncounter::Coverages::V1::Types::CoverageValueUnit) != false || raise("Passed value for field obj.unit is not the expected type, validation failed.") obj.value.is_a?(Float) != false || raise("Passed value for field obj.value is not the expected type, validation failed.") 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 CoverageDetails to a JSON object
82 83 84 |
# File 'lib/candidhealth/pre_encounter/coverages/v_1/types/coverage_details.rb', line 82 def to_json(*_args) @_field_set&.to_json end |