Class: CandidApiClient::InsuranceCards::V2::Types::InsuranceCardBase
- Inherits:
-
Object
- Object
- CandidApiClient::InsuranceCards::V2::Types::InsuranceCardBase
- Defined in:
- lib/candidhealth/insurance_cards/v_2/types/insurance_card_base.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#group_number ⇒ String
readonly
Box 11 on the CMS-1500 claim form.
- #insurance_type ⇒ CandidApiClient::Commons::Types::InsuranceTypeCode readonly
-
#plan_name ⇒ String
readonly
Box 11c on the CMS-1500 claim form.
- #plan_type ⇒ CandidApiClient::Commons::Types::SourceOfPaymentCode readonly
Class Method Summary collapse
-
.from_json(json_object:) ⇒ CandidApiClient::InsuranceCards::V2::Types::InsuranceCardBase
Deserialize a JSON object to an instance of InsuranceCardBase.
-
.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(group_number: OMIT, plan_name: OMIT, plan_type: OMIT, insurance_type: OMIT, additional_properties: nil) ⇒ CandidApiClient::InsuranceCards::V2::Types::InsuranceCardBase constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of InsuranceCardBase to a JSON object.
Constructor Details
#initialize(group_number: OMIT, plan_name: OMIT, plan_type: OMIT, insurance_type: OMIT, additional_properties: nil) ⇒ CandidApiClient::InsuranceCards::V2::Types::InsuranceCardBase
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/candidhealth/insurance_cards/v_2/types/insurance_card_base.rb', line 35 def initialize(group_number: OMIT, plan_name: OMIT, plan_type: OMIT, insurance_type: OMIT, additional_properties: nil) @group_number = group_number if group_number != OMIT @plan_name = plan_name if plan_name != OMIT @plan_type = plan_type if plan_type != OMIT @insurance_type = insurance_type if insurance_type != OMIT @additional_properties = additional_properties @_field_set = { "group_number": group_number, "plan_name": plan_name, "plan_type": plan_type, "insurance_type": insurance_type }.reject do |_k, v| v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
22 23 24 |
# File 'lib/candidhealth/insurance_cards/v_2/types/insurance_card_base.rb', line 22 def additional_properties @additional_properties end |
#group_number ⇒ String (readonly)
Returns Box 11 on the CMS-1500 claim form.
14 15 16 |
# File 'lib/candidhealth/insurance_cards/v_2/types/insurance_card_base.rb', line 14 def group_number @group_number end |
#insurance_type ⇒ CandidApiClient::Commons::Types::InsuranceTypeCode (readonly)
20 21 22 |
# File 'lib/candidhealth/insurance_cards/v_2/types/insurance_card_base.rb', line 20 def insurance_type @insurance_type end |
#plan_name ⇒ String (readonly)
Returns Box 11c on the CMS-1500 claim form.
16 17 18 |
# File 'lib/candidhealth/insurance_cards/v_2/types/insurance_card_base.rb', line 16 def plan_name @plan_name end |
#plan_type ⇒ CandidApiClient::Commons::Types::SourceOfPaymentCode (readonly)
18 19 20 |
# File 'lib/candidhealth/insurance_cards/v_2/types/insurance_card_base.rb', line 18 def plan_type @plan_type end |
Class Method Details
.from_json(json_object:) ⇒ CandidApiClient::InsuranceCards::V2::Types::InsuranceCardBase
Deserialize a JSON object to an instance of InsuranceCardBase
56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/candidhealth/insurance_cards/v_2/types/insurance_card_base.rb', line 56 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) group_number = struct["group_number"] plan_name = struct["plan_name"] plan_type = struct["plan_type"] insurance_type = struct["insurance_type"] new( group_number: group_number, plan_name: plan_name, plan_type: plan_type, insurance_type: insurance_type, 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.
84 85 86 87 88 89 |
# File 'lib/candidhealth/insurance_cards/v_2/types/insurance_card_base.rb', line 84 def self.validate_raw(obj:) obj.group_number&.is_a?(String) != false || raise("Passed value for field obj.group_number 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.plan_type&.is_a?(CandidApiClient::Commons::Types::SourceOfPaymentCode) != false || raise("Passed value for field obj.plan_type is not the expected type, validation failed.") obj.insurance_type&.is_a?(CandidApiClient::Commons::Types::InsuranceTypeCode) != false || raise("Passed value for field obj.insurance_type is not the expected type, validation failed.") end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of InsuranceCardBase to a JSON object
74 75 76 |
# File 'lib/candidhealth/insurance_cards/v_2/types/insurance_card_base.rb', line 74 def to_json(*_args) @_field_set&.to_json end |