Class: Superset::Dashboard::Import

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

Constant Summary

Constants inherited from Request

Request::DEFAULT_PAGE_SIZE

Instance Attribute Summary collapse

Attributes inherited from Request

#page_num, #page_size

Instance Method Summary collapse

Methods inherited from Request

call, #query_params, #result, #superset_host

Methods included from Superset::Display

#ids, #list, #list_attributes, #result, #rows, #table, #title, #to_h

Constructor Details

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

Returns a new instance of Import.



28
29
30
31
# File 'lib/superset/dashboard/import.rb', line 28

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

Instance Attribute Details

#overwriteObject (readonly)

Returns the value of attribute overwrite.



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

def overwrite
  @overwrite
end

#sourceObject (readonly)

Returns the value of attribute source.



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

def source
  @source
end

Instance Method Details

#performObject



33
34
35
36
# File 'lib/superset/dashboard/import.rb', line 33

def perform
  validate_params
  response
end

#responseObject



38
39
40
41
42
43
# File 'lib/superset/dashboard/import.rb', line 38

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