Class: Exa::Services::Websets::DeleteImport
- Inherits:
-
Object
- Object
- Exa::Services::Websets::DeleteImport
- Defined in:
- lib/exa/services/websets/import_delete.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(connection, id:) ⇒ DeleteImport
constructor
A new instance of DeleteImport.
Constructor Details
#initialize(connection, id:) ⇒ DeleteImport
Returns a new instance of DeleteImport.
7 8 9 10 |
# File 'lib/exa/services/websets/import_delete.rb', line 7 def initialize(connection, id:) @connection = connection @id = id 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 |
# File 'lib/exa/services/websets/import_delete.rb', line 12 def call response = @connection.delete("/websets/v0/imports/#{@id}") 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 |