Class: CandidApiClient::Individual::Types::SubscriberCreateOptional
- Inherits:
-
Object
- Object
- CandidApiClient::Individual::Types::SubscriberCreateOptional
- Defined in:
- lib/candidhealth/individual/types/subscriber_create_optional.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
- #address ⇒ CandidApiClient::Commons::Types::StreetAddressShortZipOptional readonly
- #date_of_birth ⇒ Date readonly
- #first_name ⇒ String readonly
- #gender ⇒ CandidApiClient::Individual::Types::Gender readonly
-
#insurance_card ⇒ CandidApiClient::InsuranceCards::V2::Types::InsuranceCardCreateOptional
readonly
Please reference our [Payer Information](docs.joincandidhealth.com/introduction/payer-information) documentation for more details on how to populate the ‘insurance_card` fields.
- #last_name ⇒ String readonly
- #patient_relationship_to_subscriber_code ⇒ CandidApiClient::Commons::Types::PatientRelationshipToInsuredCodeAll readonly
Class Method Summary collapse
-
.from_json(json_object:) ⇒ CandidApiClient::Individual::Types::SubscriberCreateOptional
Deserialize a JSON object to an instance of SubscriberCreateOptional.
-
.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_card: OMIT, patient_relationship_to_subscriber_code: OMIT, date_of_birth: OMIT, address: OMIT, first_name: OMIT, last_name: OMIT, gender: OMIT, additional_properties: nil) ⇒ CandidApiClient::Individual::Types::SubscriberCreateOptional constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of SubscriberCreateOptional to a JSON object.
Constructor Details
#initialize(insurance_card: OMIT, patient_relationship_to_subscriber_code: OMIT, date_of_birth: OMIT, address: OMIT, first_name: OMIT, last_name: OMIT, gender: OMIT, additional_properties: nil) ⇒ CandidApiClient::Individual::Types::SubscriberCreateOptional
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
# File 'lib/candidhealth/individual/types/subscriber_create_optional.rb', line 50 def initialize(insurance_card: OMIT, patient_relationship_to_subscriber_code: OMIT, date_of_birth: OMIT, address: OMIT, first_name: OMIT, last_name: OMIT, gender: OMIT, additional_properties: nil) @insurance_card = insurance_card if insurance_card != OMIT if patient_relationship_to_subscriber_code != OMIT @patient_relationship_to_subscriber_code = patient_relationship_to_subscriber_code end @date_of_birth = date_of_birth if date_of_birth != OMIT @address = address if address != OMIT @first_name = first_name if first_name != OMIT @last_name = last_name if last_name != OMIT @gender = gender if gender != OMIT @additional_properties = additional_properties @_field_set = { "insurance_card": insurance_card, "patient_relationship_to_subscriber_code": patient_relationship_to_subscriber_code, "date_of_birth": date_of_birth, "address": address, "first_name": first_name, "last_name": last_name, "gender": gender }.reject do |_k, v| v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
32 33 34 |
# File 'lib/candidhealth/individual/types/subscriber_create_optional.rb', line 32 def additional_properties @additional_properties end |
#address ⇒ CandidApiClient::Commons::Types::StreetAddressShortZipOptional (readonly)
24 25 26 |
# File 'lib/candidhealth/individual/types/subscriber_create_optional.rb', line 24 def address @address end |
#date_of_birth ⇒ Date (readonly)
22 23 24 |
# File 'lib/candidhealth/individual/types/subscriber_create_optional.rb', line 22 def date_of_birth @date_of_birth end |
#first_name ⇒ String (readonly)
26 27 28 |
# File 'lib/candidhealth/individual/types/subscriber_create_optional.rb', line 26 def first_name @first_name end |
#gender ⇒ CandidApiClient::Individual::Types::Gender (readonly)
30 31 32 |
# File 'lib/candidhealth/individual/types/subscriber_create_optional.rb', line 30 def gender @gender end |
#insurance_card ⇒ CandidApiClient::InsuranceCards::V2::Types::InsuranceCardCreateOptional (readonly)
Returns Please reference our [Payer Information](docs.joincandidhealth.com/introduction/payer-information) documentation for more details on how to populate the ‘insurance_card` fields.
18 19 20 |
# File 'lib/candidhealth/individual/types/subscriber_create_optional.rb', line 18 def insurance_card @insurance_card end |
#last_name ⇒ String (readonly)
28 29 30 |
# File 'lib/candidhealth/individual/types/subscriber_create_optional.rb', line 28 def last_name @last_name end |
#patient_relationship_to_subscriber_code ⇒ CandidApiClient::Commons::Types::PatientRelationshipToInsuredCodeAll (readonly)
20 21 22 |
# File 'lib/candidhealth/individual/types/subscriber_create_optional.rb', line 20 def patient_relationship_to_subscriber_code @patient_relationship_to_subscriber_code end |
Class Method Details
.from_json(json_object:) ⇒ CandidApiClient::Individual::Types::SubscriberCreateOptional
Deserialize a JSON object to an instance of SubscriberCreateOptional
79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 |
# File 'lib/candidhealth/individual/types/subscriber_create_optional.rb', line 79 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) if parsed_json["insurance_card"].nil? insurance_card = nil else insurance_card = parsed_json["insurance_card"].to_json insurance_card = CandidApiClient::InsuranceCards::V2::Types::InsuranceCardCreateOptional.from_json(json_object: insurance_card) end patient_relationship_to_subscriber_code = struct["patient_relationship_to_subscriber_code"] date_of_birth = (Date.parse(parsed_json["date_of_birth"]) unless parsed_json["date_of_birth"].nil?) if parsed_json["address"].nil? address = nil else address = parsed_json["address"].to_json address = CandidApiClient::Commons::Types::StreetAddressShortZipOptional.from_json(json_object: address) end first_name = struct["first_name"] last_name = struct["last_name"] gender = struct["gender"] new( insurance_card: insurance_card, patient_relationship_to_subscriber_code: patient_relationship_to_subscriber_code, date_of_birth: date_of_birth, address: address, first_name: first_name, last_name: last_name, gender: gender, 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.
124 125 126 127 128 129 130 131 132 |
# File 'lib/candidhealth/individual/types/subscriber_create_optional.rb', line 124 def self.validate_raw(obj:) obj.insurance_card.nil? || CandidApiClient::InsuranceCards::V2::Types::InsuranceCardCreateOptional.validate_raw(obj: obj.insurance_card) obj.patient_relationship_to_subscriber_code&.is_a?(CandidApiClient::Commons::Types::PatientRelationshipToInsuredCodeAll) != false || raise("Passed value for field obj.patient_relationship_to_subscriber_code is not the expected type, validation failed.") obj.date_of_birth&.is_a?(Date) != false || raise("Passed value for field obj.date_of_birth is not the expected type, validation failed.") obj.address.nil? || CandidApiClient::Commons::Types::StreetAddressShortZipOptional.validate_raw(obj: obj.address) obj.first_name&.is_a?(String) != false || raise("Passed value for field obj.first_name is not the expected type, validation failed.") obj.last_name&.is_a?(String) != false || raise("Passed value for field obj.last_name is not the expected type, validation failed.") obj.gender&.is_a?(CandidApiClient::Individual::Types::Gender) != false || raise("Passed value for field obj.gender is not the expected type, validation failed.") end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of SubscriberCreateOptional to a JSON object
114 115 116 |
# File 'lib/candidhealth/individual/types/subscriber_create_optional.rb', line 114 def to_json(*_args) @_field_set&.to_json end |