Class: CandidApiClient::PreEncounter::Coverages::V1::Types::PlanMetadata
- Inherits:
-
Object
- Object
- CandidApiClient::PreEncounter::Coverages::V1::Types::PlanMetadata
- Defined in:
- lib/candidhealth/pre_encounter/coverages/v_1/types/plan_metadata.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
- #end_date ⇒ Date readonly
- #group_number ⇒ String readonly
- #insurance_type ⇒ String readonly
- #insurance_type_code ⇒ String readonly
- #member_id ⇒ String readonly
- #plan_dates ⇒ Array<CandidApiClient::PreEncounter::Coverages::V1::Types::PlanDate> readonly
- #plan_name ⇒ String readonly
- #start_date ⇒ Date readonly
Class Method Summary collapse
-
.from_json(json_object:) ⇒ CandidApiClient::PreEncounter::Coverages::V1::Types::PlanMetadata
Deserialize a JSON object to an instance of PlanMetadata.
-
.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(insurance_type: OMIT, insurance_type_code: OMIT, plan_name: OMIT, member_id: OMIT, group_number: OMIT, start_date: OMIT, end_date: OMIT, plan_dates: OMIT, additional_properties: nil) ⇒ CandidApiClient::PreEncounter::Coverages::V1::Types::PlanMetadata constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of PlanMetadata to a JSON object.
Constructor Details
#initialize(insurance_type: OMIT, insurance_type_code: OMIT, plan_name: OMIT, member_id: OMIT, group_number: OMIT, start_date: OMIT, end_date: OMIT, plan_dates: OMIT, additional_properties: nil) ⇒ CandidApiClient::PreEncounter::Coverages::V1::Types::PlanMetadata
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'lib/candidhealth/pre_encounter/coverages/v_1/types/plan_metadata.rb', line 48 def initialize(insurance_type: OMIT, insurance_type_code: OMIT, plan_name: OMIT, member_id: OMIT, group_number: OMIT, start_date: OMIT, end_date: OMIT, plan_dates: OMIT, additional_properties: nil) @insurance_type = insurance_type if insurance_type != OMIT @insurance_type_code = insurance_type_code if insurance_type_code != OMIT @plan_name = plan_name if plan_name != OMIT @member_id = member_id if member_id != OMIT @group_number = group_number if group_number != OMIT @start_date = start_date if start_date != OMIT @end_date = end_date if end_date != OMIT @plan_dates = plan_dates if plan_dates != OMIT @additional_properties = additional_properties @_field_set = { "insurance_type": insurance_type, "insurance_type_code": insurance_type_code, "plan_name": plan_name, "member_id": member_id, "group_number": group_number, "start_date": start_date, "end_date": end_date, "plan_dates": plan_dates }.reject do |_k, v| v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
31 32 33 |
# File 'lib/candidhealth/pre_encounter/coverages/v_1/types/plan_metadata.rb', line 31 def additional_properties @additional_properties end |
#end_date ⇒ Date (readonly)
27 28 29 |
# File 'lib/candidhealth/pre_encounter/coverages/v_1/types/plan_metadata.rb', line 27 def end_date @end_date end |
#group_number ⇒ String (readonly)
23 24 25 |
# File 'lib/candidhealth/pre_encounter/coverages/v_1/types/plan_metadata.rb', line 23 def group_number @group_number end |
#insurance_type ⇒ String (readonly)
15 16 17 |
# File 'lib/candidhealth/pre_encounter/coverages/v_1/types/plan_metadata.rb', line 15 def insurance_type @insurance_type end |
#insurance_type_code ⇒ String (readonly)
17 18 19 |
# File 'lib/candidhealth/pre_encounter/coverages/v_1/types/plan_metadata.rb', line 17 def insurance_type_code @insurance_type_code end |
#member_id ⇒ String (readonly)
21 22 23 |
# File 'lib/candidhealth/pre_encounter/coverages/v_1/types/plan_metadata.rb', line 21 def member_id @member_id end |
#plan_dates ⇒ Array<CandidApiClient::PreEncounter::Coverages::V1::Types::PlanDate> (readonly)
29 30 31 |
# File 'lib/candidhealth/pre_encounter/coverages/v_1/types/plan_metadata.rb', line 29 def plan_dates @plan_dates end |
#plan_name ⇒ String (readonly)
19 20 21 |
# File 'lib/candidhealth/pre_encounter/coverages/v_1/types/plan_metadata.rb', line 19 def plan_name @plan_name end |
#start_date ⇒ Date (readonly)
25 26 27 |
# File 'lib/candidhealth/pre_encounter/coverages/v_1/types/plan_metadata.rb', line 25 def start_date @start_date end |
Class Method Details
.from_json(json_object:) ⇒ CandidApiClient::PreEncounter::Coverages::V1::Types::PlanMetadata
Deserialize a JSON object to an instance of PlanMetadata
77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 |
# File 'lib/candidhealth/pre_encounter/coverages/v_1/types/plan_metadata.rb', line 77 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) insurance_type = struct["insurance_type"] insurance_type_code = struct["insurance_type_code"] plan_name = struct["plan_name"] member_id = struct["member_id"] group_number = struct["group_number"] start_date = (Date.parse(parsed_json["start_date"]) unless parsed_json["start_date"].nil?) end_date = (Date.parse(parsed_json["end_date"]) unless parsed_json["end_date"].nil?) plan_dates = parsed_json["plan_dates"]&.map do |item| item = item.to_json CandidApiClient::PreEncounter::Coverages::V1::Types::PlanDate.from_json(json_object: item) end new( insurance_type: insurance_type, insurance_type_code: insurance_type_code, plan_name: plan_name, member_id: member_id, group_number: group_number, start_date: start_date, end_date: end_date, plan_dates: plan_dates, 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.
117 118 119 120 121 122 123 124 125 126 |
# File 'lib/candidhealth/pre_encounter/coverages/v_1/types/plan_metadata.rb', line 117 def self.validate_raw(obj:) obj.insurance_type&.is_a?(String) != false || raise("Passed value for field obj.insurance_type is not the expected type, validation failed.") obj.insurance_type_code&.is_a?(String) != false || raise("Passed value for field obj.insurance_type_code is not the expected type, validation failed.") obj.plan_name&.is_a?(String) != false || raise("Passed value for field obj.plan_name is not the expected type, validation failed.") obj.member_id&.is_a?(String) != false || raise("Passed value for field obj.member_id is not the expected type, validation failed.") obj.group_number&.is_a?(String) != false || raise("Passed value for field obj.group_number is not the expected type, validation failed.") obj.start_date&.is_a?(Date) != false || raise("Passed value for field obj.start_date is not the expected type, validation failed.") obj.end_date&.is_a?(Date) != false || raise("Passed value for field obj.end_date is not the expected type, validation failed.") obj.plan_dates&.is_a?(Array) != false || raise("Passed value for field obj.plan_dates is not the expected type, validation failed.") end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of PlanMetadata to a JSON object
107 108 109 |
# File 'lib/candidhealth/pre_encounter/coverages/v_1/types/plan_metadata.rb', line 107 def to_json(*_args) @_field_set&.to_json end |