Class: CandidApiClient::X12::V1::Types::ClaimAdjustmentReasonCode
- Inherits:
-
Object
- Object
- CandidApiClient::X12::V1::Types::ClaimAdjustmentReasonCode
- Defined in:
- lib/candidhealth/x_12/v_1/types/claim_adjustment_reason_code.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
- #amount_cents ⇒ Integer readonly
- #group_code ⇒ CandidApiClient::Commons::Types::ClaimAdjustmentGroupCodes readonly
- #reason_code ⇒ CandidApiClient::X12::V1::Types::Carc readonly
Class Method Summary collapse
-
.from_json(json_object:) ⇒ CandidApiClient::X12::V1::Types::ClaimAdjustmentReasonCode
Deserialize a JSON object to an instance of ClaimAdjustmentReasonCode.
-
.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_code:, reason_code:, amount_cents:, additional_properties: nil) ⇒ CandidApiClient::X12::V1::Types::ClaimAdjustmentReasonCode constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of ClaimAdjustmentReasonCode to a JSON object.
Constructor Details
#initialize(group_code:, reason_code:, amount_cents:, additional_properties: nil) ⇒ CandidApiClient::X12::V1::Types::ClaimAdjustmentReasonCode
32 33 34 35 36 37 38 |
# File 'lib/candidhealth/x_12/v_1/types/claim_adjustment_reason_code.rb', line 32 def initialize(group_code:, reason_code:, amount_cents:, additional_properties: nil) @group_code = group_code @reason_code = reason_code @amount_cents = amount_cents @additional_properties = additional_properties @_field_set = { "group_code": group_code, "reason_code": reason_code, "amount_cents": amount_cents } end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
20 21 22 |
# File 'lib/candidhealth/x_12/v_1/types/claim_adjustment_reason_code.rb', line 20 def additional_properties @additional_properties end |
#amount_cents ⇒ Integer (readonly)
18 19 20 |
# File 'lib/candidhealth/x_12/v_1/types/claim_adjustment_reason_code.rb', line 18 def amount_cents @amount_cents end |
#group_code ⇒ CandidApiClient::Commons::Types::ClaimAdjustmentGroupCodes (readonly)
14 15 16 |
# File 'lib/candidhealth/x_12/v_1/types/claim_adjustment_reason_code.rb', line 14 def group_code @group_code end |
#reason_code ⇒ CandidApiClient::X12::V1::Types::Carc (readonly)
16 17 18 |
# File 'lib/candidhealth/x_12/v_1/types/claim_adjustment_reason_code.rb', line 16 def reason_code @reason_code end |
Class Method Details
.from_json(json_object:) ⇒ CandidApiClient::X12::V1::Types::ClaimAdjustmentReasonCode
Deserialize a JSON object to an instance of ClaimAdjustmentReasonCode
44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/candidhealth/x_12/v_1/types/claim_adjustment_reason_code.rb', line 44 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) group_code = struct["group_code"] reason_code = struct["reason_code"] amount_cents = struct["amount_cents"] new( group_code: group_code, reason_code: reason_code, amount_cents: amount_cents, 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.
70 71 72 73 74 |
# File 'lib/candidhealth/x_12/v_1/types/claim_adjustment_reason_code.rb', line 70 def self.validate_raw(obj:) obj.group_code.is_a?(CandidApiClient::Commons::Types::ClaimAdjustmentGroupCodes) != false || raise("Passed value for field obj.group_code is not the expected type, validation failed.") obj.reason_code.is_a?(CandidApiClient::X12::V1::Types::Carc) != false || raise("Passed value for field obj.reason_code is not the expected type, validation failed.") obj.amount_cents.is_a?(Integer) != false || raise("Passed value for field obj.amount_cents is not the expected type, validation failed.") end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of ClaimAdjustmentReasonCode to a JSON object
60 61 62 |
# File 'lib/candidhealth/x_12/v_1/types/claim_adjustment_reason_code.rb', line 60 def to_json(*_args) @_field_set&.to_json end |