Class: Hachi::Clients::Artifact

Inherits:
Base
  • Object
show all
Defined in:
lib/hachi/clients/artifact.rb

Instance Attribute Summary

Attributes inherited from Base

#api_endpoint, #api_key, #api_version

Instance Method Summary collapse

Methods inherited from Base

#delete, #get, #initialize, #patch, #post

Methods included from Awrence::Methods

#to_camel_keys, #to_camelback_keys

Constructor Details

This class inherits a constructor from Hachi::Clients::Base

Instance Method Details

#create(case_id, **payload) ⇒ Hash

Create an artifact

Parameters:

  • case_id (String)

    Artifact ID

  • payload (Hash)

Returns:

  • (Hash)


14
15
16
# File 'lib/hachi/clients/artifact.rb', line 14

def create(case_id, **payload)
  post("/api/case/#{case_id}/artifact", json: payload) { |json| json }
end

#delete_by_id(id) ⇒ String

Delete an artifact

Parameters:

  • id (String)

    Artifact ID

Returns:

  • (String)


36
37
38
# File 'lib/hachi/clients/artifact.rb', line 36

def delete_by_id(id)
  delete("/api/case/artifact/#{id}") { |json| json }
end

#get_by_id(id) ⇒ Hash

Get an artifact

Parameters:

  • id (String)

    Artifact ID

Returns:

  • (Hash)


25
26
27
# File 'lib/hachi/clients/artifact.rb', line 25

def get_by_id(id)
  get("/api/case/artifact/#{id}") { |json| json }
end