Sha256: 913419ec7e69247652c2463065e3a22d67744a0a2e56ac82554c88135e2c1cb8

Contents?: true

Size: 768 Bytes

Versions: 9

Compression:

Stored size: 768 Bytes

Contents

# typed: strict
# frozen_string_literal: true

module Setsuzoku
  # The generic API response object that all API responses should return.
  class ApiResponse < T::Struct
    # the formatted response object for use in the application.
    prop :data, T.nilable(T.untyped), default: {}
    # whether the API request "succeeded" -- atm this is simply whether we hit the 3rd-party and received any kind of response.
    prop :success, T::Boolean, default: false
    # the error from the request -- this needs to manage codes and error messages in the future.
    prop :error, T.nilable(String), default: nil
    # the full object of the request/response. this is primarily for debugging purposes.
    prop :full_object, T::Hash[T.untyped, T.untyped], default: {}
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
setsuzoku-0.15.7 lib/setsuzoku/api_response.rb
setsuzoku-0.15.6 lib/setsuzoku/api_response.rb
setsuzoku-0.15.5 lib/setsuzoku/api_response.rb
setsuzoku-0.15.4 lib/setsuzoku/api_response.rb
setsuzoku-0.15.3 lib/setsuzoku/api_response.rb
setsuzoku-0.15.2 lib/setsuzoku/api_response.rb
setsuzoku-0.15.1 lib/setsuzoku/api_response.rb
setsuzoku-0.15.0 lib/setsuzoku/api_response.rb
setsuzoku-0.14.9 lib/setsuzoku/api_response.rb