Sha256: 1e344f16d10be399cf677a9237d6b957f85f35de2271115b48e19f8eef68d98e

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 PackagePickups
      def initialize
        @client = ShipEngine::Client.new
      end

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

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

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

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

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

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

      def delete_schedule_pickup(pickup_id:, params: {})
        response = @client.delete(
          path: "#{ShipEngine::Constants::PATHS.v1.package_pickups.root}/#{pickup_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/package_pickups.rb
shipengine_ruby-0.0.6 lib/shipengine/domains/package_pickups.rb
shipengine_ruby-0.0.5 lib/shipengine/domains/package_pickups.rb
shipengine_ruby-0.0.4 lib/shipengine/domains/package_pickups.rb
shipengine_ruby-0.0.3 lib/shipengine/domains/package_pickups.rb
shipengine_ruby-0.0.2 lib/shipengine/domains/package_pickups.rb
shipengine_ruby-0.0.1 lib/shipengine/domains/package_pickups.rb