Class: ShopifyCLI::Theme::Syncer::Uploader::BulkRequest

Inherits:
Object
  • Object
show all
Defined in:
lib/shopify_cli/theme/syncer/uploader/bulk_request.rb

Instance Method Summary collapse

Constructor Details

#initialize(theme, bulk_items) ⇒ BulkRequest

Returns a new instance of BulkRequest.



8
9
10
11
# File 'lib/shopify_cli/theme/syncer/uploader/bulk_request.rb', line 8

def initialize(theme, bulk_items)
  @theme = theme
  @bulk_items = bulk_items
end

Instance Method Details

#to_hObject



13
14
15
16
17
18
19
# File 'lib/shopify_cli/theme/syncer/uploader/bulk_request.rb', line 13

def to_h
  {
    path: "themes/#{@theme.id}/assets/bulk.json",
    method: "PUT",
    body: JSON.generate({ assets: assets }),
  }
end