Class: PassiveTotal::Client::Tag

Inherits:
Base
  • Object
show all
Defined in:
lib/passivetotal/clients/tag.rb

Constant Summary

Constants inherited from Base

Base::BASE_URL, Base::HOST, Base::VERSION

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from PassiveTotal::Client::Base

Instance Method Details

#delete(artifact, tags) ⇒ Hash

Remove a set of tags from an artifact or artifacts. api.passivetotal.org/api/docs/#api-Tag_Artifact-DeleteV2ArtifactTag

Parameters:

  • artifact (String)

    the artifact id or ids to update

  • tags (Array<String>)

    the tags or tag to delete (list or str)

Returns:

  • (Hash)


31
32
33
34
35
36
37
38
# File 'lib/passivetotal/clients/tag.rb', line 31

def delete(artifact, tags)
  params = {
    artifact: artifact,
    tags: tags,
  }.compact

  _delete("/artifact/tag", params) { |json| json }
end

#get(artifact) ⇒ Hash

Retrieve the tags of an artifact or artifacts. api.passivetotal.org/api/docs/#api-Tag_Artifact-GetV2ArtifactTag

Parameters:

  • artifact (String)

    the artifact id or ids to list

Returns:

  • (Hash)


14
15
16
17
18
19
20
# File 'lib/passivetotal/clients/tag.rb', line 14

def get(artifact)
  params = {
    artifact: artifact,
  }.compact

  _get("/artifact/tag", params) { |json| json }
end

#set(artifact, tags) ⇒ Hash

Set the tags of an artifact or artifacts. api.passivetotal.org/api/docs/#api-Tag_Artifact-PutV2ArtifactTag

Parameters:

  • artifact (String)

    the artifact id or ids to update

  • tags (Array<String>)

    the tags or tag to set (list or str)

Returns:

  • (Hash)


49
50
51
52
53
54
55
56
# File 'lib/passivetotal/clients/tag.rb', line 49

def set(artifact, tags)
  params = {
    artifact: artifact,
    tags: tags,
  }.compact

  _put("/artifact/tag", params) { |json| json }
end

#update(artifact, tags) ⇒ Hash

Parameters:

  • artifact (String)

    the artifact id or ids to update

  • tags (Array<String>)

    the tags or tag to add (list or str)

Returns:

  • (Hash)


67
68
69
70
71
72
73
74
# File 'lib/passivetotal/clients/tag.rb', line 67

def update(artifact, tags)
  params = {
    artifact: artifact,
    tags: tags,
  }.compact

  _post("/artifact/tag", params) { |json| json }
end