Class: Inttegro::File::ApiError

Inherits:
T::Struct
  • Object
show all
Defined in:
lib/inttegro/file/api_error.rb

Overview

Standard error response shape for file API endpoints.

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 ⇒ Inttegro::Shared::ErrorCause? (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.



70
71
72
73
74
75
76
77
78
# File 'lib/inttegro/file/api_error.rb', line 70

class ApiError < T::Struct
  const :message, T.nilable(String), default: nil
  const :fix_code, T.nilable(Inttegro::Shared::ErrorFixCode), default: nil
  const :detail, T.nilable(String), default: nil
  const :cause, T.nilable(Inttegro::Shared::ErrorCause), default: nil
  const :type, Inttegro::Shared::ErrorType
  const :code, Inttegro::Shared::ErrorCode
  const :url, Inttegro::Shared::ErrorDocumentationURL
end

#code ⇒ Inttegro::Shared::ErrorCode (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.



70
71
72
73
74
75
76
77
78
# File 'lib/inttegro/file/api_error.rb', line 70

class ApiError < T::Struct
  const :message, T.nilable(String), default: nil
  const :fix_code, T.nilable(Inttegro::Shared::ErrorFixCode), default: nil
  const :detail, T.nilable(String), default: nil
  const :cause, T.nilable(Inttegro::Shared::ErrorCause), default: nil
  const :type, Inttegro::Shared::ErrorType
  const :code, Inttegro::Shared::ErrorCode
  const :url, Inttegro::Shared::ErrorDocumentationURL
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)


70
71
72
73
74
75
76
77
78
# File 'lib/inttegro/file/api_error.rb', line 70

class ApiError < T::Struct
  const :message, T.nilable(String), default: nil
  const :fix_code, T.nilable(Inttegro::Shared::ErrorFixCode), default: nil
  const :detail, T.nilable(String), default: nil
  const :cause, T.nilable(Inttegro::Shared::ErrorCause), default: nil
  const :type, Inttegro::Shared::ErrorType
  const :code, Inttegro::Shared::ErrorCode
  const :url, Inttegro::Shared::ErrorDocumentationURL
end

#fix_code ⇒ Inttegro::Shared::ErrorFixCode? (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.



70
71
72
73
74
75
76
77
78
# File 'lib/inttegro/file/api_error.rb', line 70

class ApiError < T::Struct
  const :message, T.nilable(String), default: nil
  const :fix_code, T.nilable(Inttegro::Shared::ErrorFixCode), default: nil
  const :detail, T.nilable(String), default: nil
  const :cause, T.nilable(Inttegro::Shared::ErrorCause), default: nil
  const :type, Inttegro::Shared::ErrorType
  const :code, Inttegro::Shared::ErrorCode
  const :url, Inttegro::Shared::ErrorDocumentationURL
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)


70
71
72
73
74
75
76
77
78
# File 'lib/inttegro/file/api_error.rb', line 70

class ApiError < T::Struct
  const :message, T.nilable(String), default: nil
  const :fix_code, T.nilable(Inttegro::Shared::ErrorFixCode), default: nil
  const :detail, T.nilable(String), default: nil
  const :cause, T.nilable(Inttegro::Shared::ErrorCause), default: nil
  const :type, Inttegro::Shared::ErrorType
  const :code, Inttegro::Shared::ErrorCode
  const :url, Inttegro::Shared::ErrorDocumentationURL
end

#type ⇒ Inttegro::Shared::ErrorType (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.



70
71
72
73
74
75
76
77
78
# File 'lib/inttegro/file/api_error.rb', line 70

class ApiError < T::Struct
  const :message, T.nilable(String), default: nil
  const :fix_code, T.nilable(Inttegro::Shared::ErrorFixCode), default: nil
  const :detail, T.nilable(String), default: nil
  const :cause, T.nilable(Inttegro::Shared::ErrorCause), default: nil
  const :type, Inttegro::Shared::ErrorType
  const :code, Inttegro::Shared::ErrorCode
  const :url, Inttegro::Shared::ErrorDocumentationURL
end

#url ⇒ Inttegro::Shared::ErrorDocumentationURL (readonly)

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

Required in the API payload. Wire name: url.



70
71
72
73
74
75
76
77
78
# File 'lib/inttegro/file/api_error.rb', line 70

class ApiError < T::Struct
  const :message, T.nilable(String), default: nil
  const :fix_code, T.nilable(Inttegro::Shared::ErrorFixCode), default: nil
  const :detail, T.nilable(String), default: nil
  const :cause, T.nilable(Inttegro::Shared::ErrorCause), default: nil
  const :type, Inttegro::Shared::ErrorType
  const :code, Inttegro::Shared::ErrorCode
  const :url, Inttegro::Shared::ErrorDocumentationURL
end