Sha256: ad6232b9b16b94c95a3d128702a1b37d1719651fbdcf686b7ed6e73dde8800ea

Contents?: true

Size: 1.06 KB

Versions: 1

Compression:

Stored size: 1.06 KB

Contents

module MakePrintable
  class Client
    # Upload a model to fix it later
    def upload(opts={})
      opts.assert_valid_keys(:file)
      post_request '/items', opts
    end

    # Return specific item information
    def find_item(id)
      get_request configure_payload("/items/#{id}")
    end

    # Delete a specific item from server.
    def delete_item(id)
      delete_request configure_payload("/items/#{id}")
    end

    # Return a list of previously uploaded models
    def items
      get_request configure_payload('/items')
    end

    # Repairs an uploaded item
    def repair(opts={})
      opts.assert_valid_keys(:item_id, :callback_url, :name, :wall_thickness, :print_quality, :pre_optimize, :post_optimize)
      post_request '/fixes', opts
    end

    # Returns repair information for a specific repair request, including status, progress and download links.
    def find_repaired(id)
      get_request configure_payload("/fixes/#{id}")
    end

    # Return a list of repaired items
    def repaired
      get_request configure_payload('/fixes')
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
makeprintable-1.0.0 lib/makeprintable/client/jobs.rb