Class: CandidApiClient::X12::V1::Types::ClaimAdjustmentReasonCode

Inherits:
Object
  • Object
show all
Defined in:
lib/candidhealth/x_12/v_1/types/claim_adjustment_reason_code.rb

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(group_code:, reason_code:, amount_cents:, additional_properties: nil) ⇒ CandidApiClient::X12::V1::Types::ClaimAdjustmentReasonCode

Parameters:



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_propertiesOpenStruct (readonly)

Returns Additional properties unmapped to the current class definition.

Returns:

  • (OpenStruct)

    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_centsInteger (readonly)

Returns:

  • (Integer)


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_codeCandidApiClient::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_codeCandidApiClient::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

Parameters:

  • json_object (String)

Returns:



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.

Parameters:

  • obj (Object)

Returns:

  • (Void)


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

Returns:

  • (String)


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