Sha256: d678181cc2e8690ce2677e8ee2b6a26e2cd6279a260922d11149b39493f8df46

Contents?: true

Size: 737 Bytes

Versions: 5

Compression:

Stored size: 737 Bytes

Contents

module Mrkt
  module ImportCustomObjects
    def import_custom_object(file, custom_object, format = 'csv')
      params = {
        format: format,
        file: Faraday::UploadIO.new(file, 'text/csv')
      }

      post("/bulk/v1/customobjects/#{custom_object}/import.json", params)
    end

    def import_custom_object_status(id, custom_object)
      get("/bulk/v1/customobjects/#{custom_object}/import/#{id}/status.json")
    end

    def import_custom_object_failures(id, custom_object)
      get("/bulk/v1/customobjects/#{custom_object}/import/#{id}/failures.json")
    end

    def import_custom_object_warnings(id, custom_object)
      get("/bulk/v1/customobjects/#{custom_object}/import/#{id}/warnings.json")
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
mrkt-1.0.0 lib/mrkt/concerns/import_custom_objects.rb
mrkt-0.11.1 lib/mrkt/concerns/import_custom_objects.rb
mrkt-0.11.0 lib/mrkt/concerns/import_custom_objects.rb
mrkt-0.10.0 lib/mrkt/concerns/import_custom_objects.rb
mrkt-0.9.0 lib/mrkt/concerns/import_custom_objects.rb