Class: Inttegro::Shared::ErrorPayload

Inherits:
T::Struct
  • Object
show all
Defined in:
lib/inttegro/shared/error_payload.rb

Overview

Standard error response structure returned by all API endpoints. Provides machine-readable codes, human-readable messages, and actionable guidance for resolution.

This generated model is immutable. Construct it with .new, or decode a string-keyed API payload with .from_hash. #serialize produces a string-keyed hash using the original wire field names and serialized enum values.

Instance Attribute Summary collapse

Instance Attribute Details

#cause ⇒ String? (readonly)

Stable category describing the reason for failure, such as invalid input, an unmet precondition, or a state conflict.

Optional in the API payload; omitted values default to nil. Wire name: cause.

Returns:

  • (String, nil)


66
67
68
69
70
71
72
73
74
# File 'lib/inttegro/shared/error_payload.rb', line 66

class ErrorPayload < T::Struct
  const :message, T.nilable(String), default: nil
  const :fix_code, T.nilable(String), default: nil
  const :detail, T.nilable(String), default: nil
  const :cause, T.nilable(String), default: nil
  const :type, String
  const :code, String
  const :url, String
end

#code ⇒ String (readonly)

Unique machine-readable identifier for this specific error condition. Unlike type and cause which group errors, code pinpoints the exact problem.

Required in the API payload. Wire name: code.

Returns:

  • (String)


66
67
68
69
70
71
72
73
74
# File 'lib/inttegro/shared/error_payload.rb', line 66

class ErrorPayload < T::Struct
  const :message, T.nilable(String), default: nil
  const :fix_code, T.nilable(String), default: nil
  const :detail, T.nilable(String), default: nil
  const :cause, T.nilable(String), default: nil
  const :type, String
  const :code, String
  const :url, String
end

#detail ⇒ String? (readonly)

Explanation of the relevant rule and next safe action. It never contains raw dependency, storage, or implementation errors.

Optional in the API payload; omitted values default to nil. Wire name: detail.

Returns:

  • (String, nil)


66
67
68
69
70
71
72
73
74
# File 'lib/inttegro/shared/error_payload.rb', line 66

class ErrorPayload < T::Struct
  const :message, T.nilable(String), default: nil
  const :fix_code, T.nilable(String), default: nil
  const :detail, T.nilable(String), default: nil
  const :cause, T.nilable(String), default: nil
  const :type, String
  const :code, String
  const :url, String
end

#fix_code ⇒ String? (readonly)

Machine-readable suggestion for how to resolve the error (e.g., "retry_with_exponential_backoff", "change_request_parameters").

Optional in the API payload; omitted values default to nil. Wire name: fix_code.

Returns:

  • (String, nil)


66
67
68
69
70
71
72
73
74
# File 'lib/inttegro/shared/error_payload.rb', line 66

class ErrorPayload < T::Struct
  const :message, T.nilable(String), default: nil
  const :fix_code, T.nilable(String), default: nil
  const :detail, T.nilable(String), default: nil
  const :cause, T.nilable(String), default: nil
  const :type, String
  const :code, String
  const :url, String
end

#message ⇒ String? (readonly)

Concise, caller-safe explanation of why the request was rejected or could not finish.

Optional in the API payload; omitted values default to nil. Wire name: message.

Returns:

  • (String, nil)


66
67
68
69
70
71
72
73
74
# File 'lib/inttegro/shared/error_payload.rb', line 66

class ErrorPayload < T::Struct
  const :message, T.nilable(String), default: nil
  const :fix_code, T.nilable(String), default: nil
  const :detail, T.nilable(String), default: nil
  const :cause, T.nilable(String), default: nil
  const :type, String
  const :code, String
  const :url, String
end

#type ⇒ String (readonly)

Broad error category to help clients determine retry strategies (e.g., "invalid_request_parameter", "transient_error").

Required in the API payload. Wire name: type.

Returns:

  • (String)


66
67
68
69
70
71
72
73
74
# File 'lib/inttegro/shared/error_payload.rb', line 66

class ErrorPayload < T::Struct
  const :message, T.nilable(String), default: nil
  const :fix_code, T.nilable(String), default: nil
  const :detail, T.nilable(String), default: nil
  const :cause, T.nilable(String), default: nil
  const :type, String
  const :code, String
  const :url, String
end

#url ⇒ String (readonly)

Link to error reference documentation with detailed explanation, common causes, and resolution guidance.

Required in the API payload. Wire name: url.

Returns:

  • (String)


66
67
68
69
70
71
72
73
74
# File 'lib/inttegro/shared/error_payload.rb', line 66

class ErrorPayload < T::Struct
  const :message, T.nilable(String), default: nil
  const :fix_code, T.nilable(String), default: nil
  const :detail, T.nilable(String), default: nil
  const :cause, T.nilable(String), default: nil
  const :type, String
  const :code, String
  const :url, String
end