Class: CandidApiClient::NonInsurancePayers::V1::Types::NonInsurancePayer
- Inherits:
-
Object
- Object
- CandidApiClient::NonInsurancePayers::V1::Types::NonInsurancePayer
- Defined in:
- lib/candidhealth/non_insurance_payers/v_1/types/non_insurance_payer.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::StreetAddressShortZip readonly
- #category ⇒ String readonly
- #description ⇒ String readonly
- #enabled ⇒ Boolean readonly
- #name ⇒ String readonly
- #non_insurance_payer_id ⇒ String readonly
Class Method Summary collapse
-
.from_json(json_object:) ⇒ CandidApiClient::NonInsurancePayers::V1::Types::NonInsurancePayer
Deserialize a JSON object to an instance of NonInsurancePayer.
-
.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(non_insurance_payer_id:, name:, enabled:, description: OMIT, category: OMIT, address: OMIT, additional_properties: nil) ⇒ CandidApiClient::NonInsurancePayers::V1::Types::NonInsurancePayer constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of NonInsurancePayer to a JSON object.
Constructor Details
#initialize(non_insurance_payer_id:, name:, enabled:, description: OMIT, category: OMIT, address: OMIT, additional_properties: nil) ⇒ CandidApiClient::NonInsurancePayers::V1::Types::NonInsurancePayer
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/candidhealth/non_insurance_payers/v_1/types/non_insurance_payer.rb', line 40 def initialize(non_insurance_payer_id:, name:, enabled:, description: OMIT, category: OMIT, address: OMIT, additional_properties: nil) @non_insurance_payer_id = non_insurance_payer_id @name = name @description = description if description != OMIT @category = category if category != OMIT @enabled = enabled @address = address if address != OMIT @additional_properties = additional_properties @_field_set = { "non_insurance_payer_id": non_insurance_payer_id, "name": name, "description": description, "category": category, "enabled": enabled, "address": address }.reject do |_k, v| v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
25 26 27 |
# File 'lib/candidhealth/non_insurance_payers/v_1/types/non_insurance_payer.rb', line 25 def additional_properties @additional_properties end |
#address ⇒ CandidApiClient::Commons::Types::StreetAddressShortZip (readonly)
23 24 25 |
# File 'lib/candidhealth/non_insurance_payers/v_1/types/non_insurance_payer.rb', line 23 def address @address end |
#category ⇒ String (readonly)
19 20 21 |
# File 'lib/candidhealth/non_insurance_payers/v_1/types/non_insurance_payer.rb', line 19 def category @category end |
#description ⇒ String (readonly)
17 18 19 |
# File 'lib/candidhealth/non_insurance_payers/v_1/types/non_insurance_payer.rb', line 17 def description @description end |
#enabled ⇒ Boolean (readonly)
21 22 23 |
# File 'lib/candidhealth/non_insurance_payers/v_1/types/non_insurance_payer.rb', line 21 def enabled @enabled end |
#name ⇒ String (readonly)
15 16 17 |
# File 'lib/candidhealth/non_insurance_payers/v_1/types/non_insurance_payer.rb', line 15 def name @name end |
#non_insurance_payer_id ⇒ String (readonly)
13 14 15 |
# File 'lib/candidhealth/non_insurance_payers/v_1/types/non_insurance_payer.rb', line 13 def non_insurance_payer_id @non_insurance_payer_id end |
Class Method Details
.from_json(json_object:) ⇒ CandidApiClient::NonInsurancePayers::V1::Types::NonInsurancePayer
Deserialize a JSON object to an instance of NonInsurancePayer
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 |
# File 'lib/candidhealth/non_insurance_payers/v_1/types/non_insurance_payer.rb', line 65 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) non_insurance_payer_id = struct["non_insurance_payer_id"] name = struct["name"] description = struct["description"] category = struct["category"] enabled = struct["enabled"] if parsed_json["address"].nil? address = nil else address = parsed_json["address"].to_json address = CandidApiClient::Commons::Types::StreetAddressShortZip.from_json(json_object: address) end new( non_insurance_payer_id: non_insurance_payer_id, name: name, description: description, category: category, enabled: enabled, address: address, 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.
103 104 105 106 107 108 109 110 |
# File 'lib/candidhealth/non_insurance_payers/v_1/types/non_insurance_payer.rb', line 103 def self.validate_raw(obj:) obj.non_insurance_payer_id.is_a?(String) != false || raise("Passed value for field obj.non_insurance_payer_id is not the expected type, validation failed.") obj.name.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.") obj.description&.is_a?(String) != false || raise("Passed value for field obj.description is not the expected type, validation failed.") obj.category&.is_a?(String) != false || raise("Passed value for field obj.category is not the expected type, validation failed.") obj.enabled.is_a?(Boolean) != false || raise("Passed value for field obj.enabled is not the expected type, validation failed.") obj.address.nil? || CandidApiClient::Commons::Types::StreetAddressShortZip.validate_raw(obj: obj.address) end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of NonInsurancePayer to a JSON object
93 94 95 |
# File 'lib/candidhealth/non_insurance_payers/v_1/types/non_insurance_payer.rb', line 93 def to_json(*_args) @_field_set&.to_json end |