Sha256: ec3bd1ced7f521f75854ff8bf41f17deb027574607e899ca3a2c6e09188709f3

Contents?: true

Size: 739 Bytes

Versions: 6

Compression:

Stored size: 739 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

6 entries across 6 versions & 1 rubygems

Version Path
mrkt-1.2.2 lib/mrkt/concerns/import_custom_objects.rb
mrkt-1.2.1 lib/mrkt/concerns/import_custom_objects.rb
mrkt-1.2.0 lib/mrkt/concerns/import_custom_objects.rb
mrkt-1.1.1 lib/mrkt/concerns/import_custom_objects.rb
mrkt-1.1.0 lib/mrkt/concerns/import_custom_objects.rb
mrkt-1.0.1 lib/mrkt/concerns/import_custom_objects.rb