Class: Inttegro::Shared::ErrorPayload
- Inherits:
-
T::Struct
- Object
- T::Struct
- Inttegro::Shared::ErrorPayload
- 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
-
#cause ⇒ String?
readonly
Stable category describing the reason for failure, such as invalid input, an unmet precondition, or a state conflict.
-
#code ⇒ String
readonly
Unique machine-readable identifier for this specific error condition.
-
#detail ⇒ String?
readonly
Explanation of the relevant rule and next safe action.
-
#fix_code ⇒ String?
readonly
Machine-readable suggestion for how to resolve the error (e.g., "retry_with_exponential_backoff", "change_request_parameters").
-
#message ⇒ String?
readonly
Concise, caller-safe explanation of why the request was rejected or could not finish.
-
#type ⇒ String
readonly
Broad error category to help clients determine retry strategies (e.g., "invalid_request_parameter", "transient_error").
-
#url ⇒ String
readonly
Link to error reference documentation with detailed explanation, common causes, and resolution guidance.
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.
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.
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.
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.
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.
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.
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.
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 |