Class: Superset::Dashboard::Import

Inherits:
Request
  • Object
show all
Defined in:
lib/superset/dashboard/import.rb

Constant Summary

Constants inherited from Request

Request::PAGE_SIZE

Instance Attribute Summary collapse

Attributes inherited from Request

#page_num

Instance Method Summary collapse

Methods inherited from Request

call, #query_params, #result, #superset_host

Methods included from Superset::Display

#display_headers, #headings, #list, #list_attributes, #result, #rows, #table, #title

Constructor Details

#initialize(source_zip_file:, overwrite: true) ⇒ Import

Returns a new instance of Import.



25
26
27
28
# File 'lib/superset/dashboard/import.rb', line 25

def initialize(source_zip_file: , overwrite: true)
  @source_zip_file = source_zip_file
  @overwrite = overwrite
end

Instance Attribute Details

#overwriteObject (readonly)

Returns the value of attribute overwrite.



23
24
25
# File 'lib/superset/dashboard/import.rb', line 23

def overwrite
  @overwrite
end

#source_zip_fileObject (readonly)

Returns the value of attribute source_zip_file.



23
24
25
# File 'lib/superset/dashboard/import.rb', line 23

def source_zip_file
  @source_zip_file
end

Instance Method Details

#performObject



30
31
32
33
# File 'lib/superset/dashboard/import.rb', line 30

def perform
  validate_params
  response
end

#responseObject



35
36
37
38
39
40
# File 'lib/superset/dashboard/import.rb', line 35

def response
  @response ||= client(use_json: false).post(
    route,
    payload
  )
end