Module: Mrkt::ImportCustomObjects

Included in:
Client
Defined in:
lib/mrkt/concerns/import_custom_objects.rb

Instance Method Summary collapse

Instance Method Details

#import_custom_object(file, custom_object, format = 'csv') ⇒ Object


3
4
5
6
7
8
9
10
# File 'lib/mrkt/concerns/import_custom_objects.rb', line 3

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

#import_custom_object_failures(id, custom_object) ⇒ Object


16
17
18
# File 'lib/mrkt/concerns/import_custom_objects.rb', line 16

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

#import_custom_object_status(id, custom_object) ⇒ Object


12
13
14
# File 'lib/mrkt/concerns/import_custom_objects.rb', line 12

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

#import_custom_object_warnings(id, custom_object) ⇒ Object


20
21
22
# File 'lib/mrkt/concerns/import_custom_objects.rb', line 20

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