Class: VirusTotal::Client::Graph
- Includes:
- Action::Get, Action::Relationships
- Defined in:
- lib/virustotal/clients/graph.rb
Constant Summary
Constants inherited from Base
Base::BASE_URL, Base::CONVERT_TABLE, Base::HOST, Base::VERSION
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#add_editor(id, **params) ⇒ Hash
Add a user or group as a graph editor.
-
#add_viewer(id, **params) ⇒ Hash
Add a user or group as a graph viewer.
-
#check_editor(id, user_or_group_id) ⇒ Hash
Check if a user or group is a graph editor.
-
#check_viewer(id, user_or_group_id) ⇒ <Type>
Check if a user or group is a graph viewer.
-
#create(**params) ⇒ Hash
Create a graph with the given nodes and links.
-
#delete_editor(id, user_or_group_id) ⇒ Hash
Remove a user or group as editor of a graph.
-
#delete_viewer(id, user_or_group_id) ⇒ <Type>
Remove a user or group as viewer of a graph.
-
#editors(id, limit: nil, cursor: nil) ⇒ Hash
Retrieve graph editors.
-
#search(filter: nil, limit: nil, cursor: nil, order: nil, attributes: nil) ⇒ Hash
Return graphs.
-
#update(id, **params) ⇒ Hash
Update a graph.
-
#viewers(id, limit: nil, cursor: nil) ⇒ Hash
Retrieve graph viewers.
Methods included from Action::Relationships
#method_missing, #respond_to_missing?
Methods included from Action::Get
Methods inherited from Base
Constructor Details
This class inherits a constructor from VirusTotal::Client::Base
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class VirusTotal::Client::Action::Relationships
Instance Method Details
#add_editor(id, **params) ⇒ Hash
Add a user or group as a graph editor.
150 151 152 |
# File 'lib/virustotal/clients/graph.rb', line 150 def add_editor(id, **params) _post("/graphs/#{id}/relationships/editors", params) { |json| json } end |
#add_viewer(id, **params) ⇒ Hash
Add a user or group as a graph viewer.
89 90 91 |
# File 'lib/virustotal/clients/graph.rb', line 89 def add_viewer(id, **params) _post("/graphs/#{id}/relationships/viewers", params) { |json| json } end |
#check_editor(id, user_or_group_id) ⇒ Hash
Check if a user or group is a graph editor.
164 165 166 |
# File 'lib/virustotal/clients/graph.rb', line 164 def check_editor(id, user_or_group_id) _get("/graphs/#{id}/relationships/editors/#{user_or_group_id}") { |json| json } end |
#check_viewer(id, user_or_group_id) ⇒ <Type>
Check if a user or group is a graph viewer
103 104 105 |
# File 'lib/virustotal/clients/graph.rb', line 103 def check_viewer(id, user_or_group_id) _get("/graphs/#{id}/relationships/viewers/#{user_or_group_id}") { |json| json } end |
#create(**params) ⇒ Hash
Create a graph with the given nodes and links.
42 43 44 |
# File 'lib/virustotal/clients/graph.rb', line 42 def create(**params) _post("/graphs", params) { |json| json } end |
#delete_editor(id, user_or_group_id) ⇒ Hash
Remove a user or group as editor of a graph.
178 179 180 |
# File 'lib/virustotal/clients/graph.rb', line 178 def delete_editor(id, user_or_group_id) _delete("/graphs/#{id}/relationships/editors/#{user_or_group_id}") { |json| json } end |
#delete_viewer(id, user_or_group_id) ⇒ <Type>
Remove a user or group as viewer of a graph.
117 118 119 |
# File 'lib/virustotal/clients/graph.rb', line 117 def delete_viewer(id, user_or_group_id) _delete("/graphs/#{id}/relationships/viewers/#{user_or_group_id}") { |json| json } end |
#editors(id, limit: nil, cursor: nil) ⇒ Hash
Retrieve graph editors.
132 133 134 135 136 137 138 |
# File 'lib/virustotal/clients/graph.rb', line 132 def editors(id, limit: nil, cursor: nil) params = { limit: limit, cursor: cursor }.compact _get("/graphs/#{id}/relationships/editors", params) { |json| json } end |
#search(filter: nil, limit: nil, cursor: nil, order: nil, attributes: nil) ⇒ Hash
Return graphs.
22 23 24 25 26 27 28 29 30 31 |
# File 'lib/virustotal/clients/graph.rb', line 22 def search(filter: nil, limit: nil, cursor: nil, order: nil, attributes: nil) params = { filter: filter, limit: limit, cursor: cursor, order: order, attributes: attributes }.compact _get("/graphs", params) { |json| json } end |
#update(id, **params) ⇒ Hash
Update a graph.
56 57 58 |
# File 'lib/virustotal/clients/graph.rb', line 56 def update(id, **params) _patch("/graphs/#{id}", params) { |json| json } end |
#viewers(id, limit: nil, cursor: nil) ⇒ Hash
Retrieve graph viewers.
71 72 73 74 75 76 77 |
# File 'lib/virustotal/clients/graph.rb', line 71 def viewers(id, limit: nil, cursor: nil) params = { limit: limit, cursor: cursor }.compact _get("/graphs/#{id}/relationships/viewers", params) { |json| json } end |