Sha256: 0d1e23a36fa642e68780d9757e816bafc4302c1ba80882f1b1cf2f5ed7e555cc

Contents?: true

Size: 1.16 KB

Versions: 7

Compression:

Stored size: 1.16 KB

Contents

# frozen_string_literal: true

require "hashie"

module ShipEngine
  module Domain
    class Manifests
      def initialize
        @client = ShipEngine::Client.new
      end

      def list_manifests(params: {})
        response = @client.get(
          path: ShipEngine::Constants::PATHS.v1.manifests.root,
          options: params
        )

        Hashie::Mash.new(response.body)
      end

      def create_manifest(params: {})
        response = @client.post(
          path: ShipEngine::Constants::PATHS.v1.manifests.root,
          options: params
        )

        Hashie::Mash.new(response.body)
      end

      def manifest_by_id(manifest_id:, params: {})
        response = @client.get(
          path: "#{ShipEngine::Constants::PATHS.v1.manifests.root}/#{manifest_id}",
          options: params
        )

        Hashie::Mash.new(response.body)
      end

      def manifest_request_by_id(manifest_request_id:, params: {})
        response = @client.get(
          path: "#{ShipEngine::Constants::PATHS.v1.manifests.manifest_request}/#{manifest_request_id}",
          options: params
        )

        Hashie::Mash.new(response.body)
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
shipengine_ruby-0.0.7 lib/shipengine/domains/manifests.rb
shipengine_ruby-0.0.6 lib/shipengine/domains/manifests.rb
shipengine_ruby-0.0.5 lib/shipengine/domains/manifests.rb
shipengine_ruby-0.0.4 lib/shipengine/domains/manifests.rb
shipengine_ruby-0.0.3 lib/shipengine/domains/manifests.rb
shipengine_ruby-0.0.2 lib/shipengine/domains/manifests.rb
shipengine_ruby-0.0.1 lib/shipengine/domains/manifests.rb