Class: Exa::Services::Websets::CreateImport
- Inherits:
-
Object
- Object
- Exa::Services::Websets::CreateImport
- Defined in:
- lib/exa/services/websets/import_create.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(connection, **params) ⇒ CreateImport
constructor
A new instance of CreateImport.
Constructor Details
#initialize(connection, **params) ⇒ CreateImport
Returns a new instance of CreateImport.
7 8 9 10 |
# File 'lib/exa/services/websets/import_create.rb', line 7 def initialize(connection, **params) @connection = connection @params = params end |
Instance Method Details
#call ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/exa/services/websets/import_create.rb', line 12 def call response = @connection.post( "/websets/v0/imports", @params ) body = response.body Resources::Import.new( id: body["id"], object: body["object"], status: body["status"], format: body["format"], entity: body["entity"], title: body["title"], count: body["count"], metadata: body["metadata"], failed_reason: body["failedReason"], failed_at: body["failedAt"], failed_message: body["failedMessage"], created_at: body["createdAt"], updated_at: body["updatedAt"], upload_url: body["uploadUrl"], upload_valid_until: body["uploadValidUntil"] ) end |