Class: CandidApiClient::PreEncounter::Coverages::V1::Types::CoverageBenefits
- Inherits:
-
Object
- Object
- CandidApiClient::PreEncounter::Coverages::V1::Types::CoverageBenefits
- Defined in:
- lib/candidhealth/pre_encounter/coverages/v_1/types/coverage_benefits.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
- #notes ⇒ String readonly
- #plan_coverage ⇒ CandidApiClient::PreEncounter::Coverages::V1::Types::PlanCoverage readonly
- #service_specific_coverage ⇒ Array<CandidApiClient::PreEncounter::Coverages::V1::Types::ServiceCoverage> readonly
Class Method Summary collapse
-
.from_json(json_object:) ⇒ CandidApiClient::PreEncounter::Coverages::V1::Types::CoverageBenefits
Deserialize a JSON object to an instance of CoverageBenefits.
-
.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(plan_coverage: OMIT, service_specific_coverage: OMIT, notes: OMIT, additional_properties: nil) ⇒ CandidApiClient::PreEncounter::Coverages::V1::Types::CoverageBenefits constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of CoverageBenefits to a JSON object.
Constructor Details
#initialize(plan_coverage: OMIT, service_specific_coverage: OMIT, notes: OMIT, additional_properties: nil) ⇒ CandidApiClient::PreEncounter::Coverages::V1::Types::CoverageBenefits
33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/candidhealth/pre_encounter/coverages/v_1/types/coverage_benefits.rb', line 33 def initialize(plan_coverage: OMIT, service_specific_coverage: OMIT, notes: OMIT, additional_properties: nil) @plan_coverage = plan_coverage if plan_coverage != OMIT @service_specific_coverage = service_specific_coverage if service_specific_coverage != OMIT @notes = notes if notes != OMIT @additional_properties = additional_properties @_field_set = { "plan_coverage": plan_coverage, "service_specific_coverage": service_specific_coverage, "notes": notes }.reject do |_k, v| v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
21 22 23 |
# File 'lib/candidhealth/pre_encounter/coverages/v_1/types/coverage_benefits.rb', line 21 def additional_properties @additional_properties end |
#notes ⇒ String (readonly)
19 20 21 |
# File 'lib/candidhealth/pre_encounter/coverages/v_1/types/coverage_benefits.rb', line 19 def notes @notes end |
#plan_coverage ⇒ CandidApiClient::PreEncounter::Coverages::V1::Types::PlanCoverage (readonly)
15 16 17 |
# File 'lib/candidhealth/pre_encounter/coverages/v_1/types/coverage_benefits.rb', line 15 def plan_coverage @plan_coverage end |
#service_specific_coverage ⇒ Array<CandidApiClient::PreEncounter::Coverages::V1::Types::ServiceCoverage> (readonly)
17 18 19 |
# File 'lib/candidhealth/pre_encounter/coverages/v_1/types/coverage_benefits.rb', line 17 def service_specific_coverage @service_specific_coverage end |
Class Method Details
.from_json(json_object:) ⇒ CandidApiClient::PreEncounter::Coverages::V1::Types::CoverageBenefits
Deserialize a JSON object to an instance of CoverageBenefits
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 |
# File 'lib/candidhealth/pre_encounter/coverages/v_1/types/coverage_benefits.rb', line 52 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) if parsed_json["plan_coverage"].nil? plan_coverage = nil else plan_coverage = parsed_json["plan_coverage"].to_json plan_coverage = CandidApiClient::PreEncounter::Coverages::V1::Types::PlanCoverage.from_json(json_object: plan_coverage) end service_specific_coverage = parsed_json["service_specific_coverage"]&.map do |item| item = item.to_json CandidApiClient::PreEncounter::Coverages::V1::Types::ServiceCoverage.from_json(json_object: item) end notes = struct["notes"] new( plan_coverage: plan_coverage, service_specific_coverage: service_specific_coverage, notes: 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.
87 88 89 90 91 |
# File 'lib/candidhealth/pre_encounter/coverages/v_1/types/coverage_benefits.rb', line 87 def self.validate_raw(obj:) obj.plan_coverage.nil? || CandidApiClient::PreEncounter::Coverages::V1::Types::PlanCoverage.validate_raw(obj: obj.plan_coverage) obj.service_specific_coverage&.is_a?(Array) != false || raise("Passed value for field obj.service_specific_coverage is not the expected type, validation failed.") obj.notes&.is_a?(String) != false || raise("Passed value for field obj.notes is not the expected type, validation failed.") end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of CoverageBenefits to a JSON object
77 78 79 |
# File 'lib/candidhealth/pre_encounter/coverages/v_1/types/coverage_benefits.rb', line 77 def to_json(*_args) @_field_set&.to_json end |