Class: Exa::Services::Websets::Delete

Inherits:
Object
  • Object
show all
Defined in:
lib/exa/services/websets/delete.rb

Instance Method Summary collapse

Constructor Details

#initialize(connection, id:) ⇒ Delete



7
8
9
10
# File 'lib/exa/services/websets/delete.rb', line 7

def initialize(connection, id:)
  @connection = connection
  @id = id
end

Instance Method Details

#callObject



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/exa/services/websets/delete.rb', line 12

def call
  response = @connection.delete("/websets/v0/websets/#{@id}")
  body = response.body

  Resources::Webset.new(
    id: body["id"],
    object: body["object"],
    status: body["status"],
    external_id: body["externalId"],
    title: body["title"],
    searches: body["searches"],
    imports: body["imports"],
    enrichments: body["enrichments"],
    monitors: body["monitors"],
    excludes: body["excludes"],
    metadata: body["metadata"],
    created_at: body["createdAt"],
    updated_at: body["updatedAt"],
    items: body["items"]
  )
end