Class: CandidApiClient::ChargeCapture::V1::Types::ChargeCaptureError

Inherits:
Object
  • Object
show all
Defined in:
lib/candidhealth/charge_capture/v_1/types/charge_capture_error.rb

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id:, message:, claim_creation_id:, charge_capture_id: OMIT, resolved: OMIT, resolved_by: OMIT, resolution_reason: OMIT, field_in_error: OMIT, additional_properties: nil) ⇒ CandidApiClient::ChargeCapture::V1::Types::ChargeCaptureError

Parameters:

  • id (String)
  • charge_capture_id (String) (defaults to: OMIT)

    The underlying Charge Capture that this error object references. The Charge Capture referenced will be a part of the Claim Creation tied to this error. Errors may also refer to all charge_captures present in a Claim Creation, in which case this field will be null.

  • message (String)

    A human readable error explaining why this charge capture Claim Creation failed to create a claim.

  • resolved (Boolean) (defaults to: OMIT)

    Whether or not the error has been resolved as part of user workflows

  • resolved_by (String) (defaults to: OMIT)

    A string denoting who resolved the error within candid’s system.

  • resolution_reason (String) (defaults to: OMIT)

    A string denoting how or why an error was resolved.

  • field_in_error (String) (defaults to: OMIT)

    The field of the corresponding underlying ChargeCapture that has a field that is failing validations, is not present but marked as required, or otherwise in error.

  • claim_creation_id (String)

    The ID of the ChargeCaptureClaimCreation associated with this Error.

  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# File 'lib/candidhealth/charge_capture/v_1/types/charge_capture_error.rb', line 59

def initialize(id:, message:, claim_creation_id:, charge_capture_id: OMIT, resolved: OMIT, resolved_by: OMIT,
               resolution_reason: OMIT, field_in_error: OMIT, additional_properties: nil)
  @id = id
  @charge_capture_id = charge_capture_id if charge_capture_id != OMIT
  @message = message
  @resolved = resolved if resolved != OMIT
  @resolved_by = resolved_by if resolved_by != OMIT
  @resolution_reason = resolution_reason if resolution_reason != OMIT
  @field_in_error = field_in_error if field_in_error != OMIT
  @claim_creation_id = claim_creation_id
  @additional_properties = additional_properties
  @_field_set = {
    "id": id,
    "charge_capture_id": charge_capture_id,
    "message": message,
    "resolved": resolved,
    "resolved_by": resolved_by,
    "resolution_reason": resolution_reason,
    "field_in_error": field_in_error,
    "claim_creation_id": claim_creation_id
  }.reject do |_k, v|
    v == OMIT
  end
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



35
36
37
# File 'lib/candidhealth/charge_capture/v_1/types/charge_capture_error.rb', line 35

def additional_properties
  @additional_properties
end

#charge_capture_idString (readonly)

Returns The underlying Charge Capture that this error object references. The Charge Capture referenced will be a part of the Claim Creation tied to this error. Errors may also refer to all charge_captures present in a Claim Creation, in which case this field will be null.

Returns:

  • (String)

    The underlying Charge Capture that this error object references. The Charge Capture referenced will be a part of the Claim Creation tied to this error. Errors may also refer to all charge_captures present in a Claim Creation, in which case this field will be null.



18
19
20
# File 'lib/candidhealth/charge_capture/v_1/types/charge_capture_error.rb', line 18

def charge_capture_id
  @charge_capture_id
end

#claim_creation_idString (readonly)

Returns The ID of the ChargeCaptureClaimCreation associated with this Error.

Returns:

  • (String)

    The ID of the ChargeCaptureClaimCreation associated with this Error.



33
34
35
# File 'lib/candidhealth/charge_capture/v_1/types/charge_capture_error.rb', line 33

def claim_creation_id
  @claim_creation_id
end

#field_in_errorString (readonly)

Returns The field of the corresponding underlying ChargeCapture that has a field that is failing validations, is not present but marked as required, or otherwise in error.

Returns:

  • (String)

    The field of the corresponding underlying ChargeCapture that has a field that is failing validations, is not present but marked as required, or otherwise in error.



31
32
33
# File 'lib/candidhealth/charge_capture/v_1/types/charge_capture_error.rb', line 31

def field_in_error
  @field_in_error
end

#idString (readonly)

Returns:

  • (String)


12
13
14
# File 'lib/candidhealth/charge_capture/v_1/types/charge_capture_error.rb', line 12

def id
  @id
end

#messageString (readonly)

Returns A human readable error explaining why this charge capture Claim Creation failed to create a claim.

Returns:

  • (String)

    A human readable error explaining why this charge capture Claim Creation failed to create a claim.



21
22
23
# File 'lib/candidhealth/charge_capture/v_1/types/charge_capture_error.rb', line 21

def message
  @message
end

#resolution_reasonString (readonly)

Returns A string denoting how or why an error was resolved.

Returns:

  • (String)

    A string denoting how or why an error was resolved.



27
28
29
# File 'lib/candidhealth/charge_capture/v_1/types/charge_capture_error.rb', line 27

def resolution_reason
  @resolution_reason
end

#resolvedBoolean (readonly)

Returns Whether or not the error has been resolved as part of user workflows.

Returns:

  • (Boolean)

    Whether or not the error has been resolved as part of user workflows



23
24
25
# File 'lib/candidhealth/charge_capture/v_1/types/charge_capture_error.rb', line 23

def resolved
  @resolved
end

#resolved_byString (readonly)

Returns A string denoting who resolved the error within candid’s system.

Returns:

  • (String)

    A string denoting who resolved the error within candid’s system.



25
26
27
# File 'lib/candidhealth/charge_capture/v_1/types/charge_capture_error.rb', line 25

def resolved_by
  @resolved_by
end

Class Method Details

.from_json(json_object:) ⇒ CandidApiClient::ChargeCapture::V1::Types::ChargeCaptureError

Deserialize a JSON object to an instance of ChargeCaptureError

Parameters:

  • json_object (String)

Returns:



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/charge_capture/v_1/types/charge_capture_error.rb', line 88

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  id = struct["id"]
  charge_capture_id = struct["charge_capture_id"]
  message = struct["message"]
  resolved = struct["resolved"]
  resolved_by = struct["resolved_by"]
  resolution_reason = struct["resolution_reason"]
  field_in_error = struct["field_in_error"]
  claim_creation_id = struct["claim_creation_id"]
  new(
    id: id,
    charge_capture_id: charge_capture_id,
    message: message,
    resolved: resolved,
    resolved_by: resolved_by,
    resolution_reason: resolution_reason,
    field_in_error: field_in_error,
    claim_creation_id: claim_creation_id,
    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)


124
125
126
127
128
129
130
131
132
133
# File 'lib/candidhealth/charge_capture/v_1/types/charge_capture_error.rb', line 124

def self.validate_raw(obj:)
  obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
  obj.charge_capture_id&.is_a?(String) != false || raise("Passed value for field obj.charge_capture_id is not the expected type, validation failed.")
  obj.message.is_a?(String) != false || raise("Passed value for field obj.message is not the expected type, validation failed.")
  obj.resolved&.is_a?(Boolean) != false || raise("Passed value for field obj.resolved is not the expected type, validation failed.")
  obj.resolved_by&.is_a?(String) != false || raise("Passed value for field obj.resolved_by is not the expected type, validation failed.")
  obj.resolution_reason&.is_a?(String) != false || raise("Passed value for field obj.resolution_reason is not the expected type, validation failed.")
  obj.field_in_error&.is_a?(String) != false || raise("Passed value for field obj.field_in_error is not the expected type, validation failed.")
  obj.claim_creation_id.is_a?(String) != false || raise("Passed value for field obj.claim_creation_id is not the expected type, validation failed.")
end

Instance Method Details

#to_json(*_args) ⇒ String

Serialize an instance of ChargeCaptureError to a JSON object

Returns:

  • (String)


114
115
116
# File 'lib/candidhealth/charge_capture/v_1/types/charge_capture_error.rb', line 114

def to_json(*_args)
  @_field_set&.to_json
end