Struct vt3::VtClient

source ·
pub struct VtClient { /* private fields */ }

Implementations§

source§

impl VtClient

source

pub fn get_comments( self, limit: Option<&str>, filter: Option<&str>, cursor: Option<&str> ) -> VtResult<CommentsRoot>

Retrieves information about the latest comments.

§Example Usage
use vt3::VtClient;

let vt = VtClient::new("Your API Key");
vt.get_comments(Some("10"), Some("tag:malware"), None);
source

pub fn get_comment(self, comment_id: &str) -> VtResult<CommentRoot>

Retrieve a public_api.comment information.

§Example Usage
use vt3::VtClient;

let vt = VtClient::new("Your API Key");
let comment_id = "u-011915942db556bbab5137f761efe61fed2b00598fea900360b800b193a7bf31-d94d7c8a";
vt.get_comment(comment_id);
source

pub fn delete_comment(self, comment_id: &str) -> VtResult<CommentRoot>

Delete a public_api.comment.

§Example Usage
use vt3::VtClient;

let vt = VtClient::new("Your API Key");
let comment_id = "u-011915942db556bbab5137f761efe61fed2b00598fea900360b800b193a7bf31-d94d7c8a";
vt.delete_comment(comment_id);
source§

impl VtClient

source

pub fn domain_info(&self, domain: &str) -> VtResult<Root>

Get the report of a given Domain

§Example Usage
use vt3::VtClient;

let vt = VtClient::new("Your API Key");
println!("{:?}", vt.domain_info("google.com"))
source§

impl VtClient

source

pub fn file_info(&self, id: &str) -> VtResult<Root>

Retrieve public_api.file scan reports id: SHA-256, SHA-1 or MD5 identifying the public_api.file

§Example Usage
use vt3::VtClient;

let vt = VtClient::new("Your API Key");
vt.file_info("44d88612fea8a8f36de82e1278abb02f");
source

pub fn file_scan(&self, file: &str) -> VtResult<ScanRoot>

Upload and scan a public_api.file

§Example Usage
use vt3::VtClient;

let vt = VtClient::new("Your API Key");
println!("{:?}", vt.file_scan("data/eicar.com.txt"));
source

pub fn file_rescan(&self, id: &str) -> VtResult<ScanRoot>

Re-submit/Re-scan already submitted files id: SHA-256, SHA-1 or MD5 identifying the public_api.file

§Example Usage
use vt3::VtClient;

let vt = VtClient::new("Your API Key");
vt.file_rescan("44d88612fea8a8f36de82e1278abb02f");
source§

impl VtClient

source

pub fn ip_info(&self, ip_address: &str) -> VtResult<Root>

Get the report of a given IP Address

§Example Usage
use vt3::VtClient;

let vt = VtClient::new("Your API Key");
println!("{:?}", vt.ip_info("192.168.2.1"));
source

pub fn ip_comments( &self, ip_address: &str ) -> VtResult<Collection<CommentAttributes>>

Get the comments from an ip address

§Example Usage
use vt3::VtClient;

let vt = VtClient::new("API Key");
println!("{:?}", vt.ip_comments("192.168.2.1"));
source

pub fn add_ip_comment( &self, ip_address: &str, attrs: CommentAttributes ) -> VtResult<Object<CommentAttributes>>

Get the comments from an ip address

§Example Usage
use vt3::VtClient;
use vt3::public_api::ip::CommentAttributes;

let vt = VtClient::new("API Key");
let attrs = CommentAttributes::new(
    None,
    None,
    None,
    Some("This is an example".to_string()),
    None,
);
println!("{:?}", vt.add_ip_comment("192.168.2.1", attrs));

List related objects of an ip address

§Example Usage
use vt3::VtClient;
use vt3::public_api::ip::Relationships;

let vt = VtClient::new("API Key");
let res =  vt.list_ip_related_objects("192.168.1.1", Relationships::Comments);

List related ids of an ip address

§Example Usage
use vt3::VtClient;
use vt3::public_api::ip::Relationships;

let vt = VtClient::new("API Key");
let res =  vt.list_ip_related_ids("192.168.1.1", Relationships::Comments);
source

pub fn list_ip_votes(&self, ip_address: &str) -> VtResult<Votes>

List votes for an ip address

§Example Usage
use vt3::VtClient;
use vt3::public_api::ip::Relationships;

let vt = VtClient::new("API Key");
let res = vt.list_ip_votes("192.168.1.1");
source

pub fn create_ip_vote( &self, ip_address: &str, attrs: VoteAttributes ) -> VtResult<Vote>

source§

impl VtClient

source

pub fn url_scan(&self, resource_url: &str) -> VtResult<ScanRoot>

Scan an URL

§Example Usage
use vt3::VtClient;

let vt = VtClient::new("Your API Key");
let url = "https://example.com";
println!("{:?}", vt.url_scan(url));
source

pub fn url_rescan(&self, resource_id: &str) -> VtResult<ScanRoot>

Re-analyse/Re-Scan an URL

§Example Usage
use vt3::VtClient;

let vt = VtClient::new("Your API Key");
let url = "https://example.com";
println!("{:?}", vt.url_scan(url));
source

pub fn url_info(&self, resource_url: &str) -> VtResult<Root>

Get the report of a given Url

§Example Usage
use vt3::VtClient;

let vt = VtClient::new("Your API Key");
let resource = "https://www.example.com";
println!("{:?}", vt.url_info(resource));
source

pub fn url_info_by_id(&self, resource_id: &str) -> VtResult<Root>

Get the report of a given Url by its resource id. Generally you can first submit a public_api.url for scanning, and then, get the resource_id (data.id) and then url_info_by_id(data.id)

§Example Usage
use vt3::VtClient;

let vt = VtClient::new("Your API Key");
let resource = "https://www.example.com";
let resource_id = vt.url_scan(resource).unwrap();
println!("{:?}", vt.url_info_by_id(&resource_id.data.id))
source§

impl VtClient

source

pub fn user_info(&self, id: &str) -> VtResult<UserRoot>

Retrieve user information.

§Example Usage
use vt3::VtClient;

let vt = VtClient::new("Your API Key");
vt.user_info("user_id");
source

pub fn delete_user(&self, id: &str) -> VtResult<UserRoot>

Delete a user.

§Example Usage
use vt3::VtClient;

let vt = VtClient::new("Your API Key");
vt.delete_user("user_id");
source

pub fn api_usage( &self, id: &str, start_date: Option<&str>, end_date: Option<&str> ) -> VtResult<ApiUsage>

Retrieve user’s API usage.

§Example Usage
use vt3::VtClient;

let vt = VtClient::new("Your API Key");

// start_date & end_date fomrat is: YYYYMMDD
vt.api_usage("user_id", None, None);
source

pub fn overall_quotas(&self, id: &str) -> VtResult<OverallQuotaRoot>

User’s overall quotas.

§Example Usage
use vt3::VtClient;

let vt = VtClient::new("Your API Key");
vt.overall_quotas("user_id");
source

pub fn group_info(&self, id: &str) -> VtResult<GroupRoot>

Retrieve group information.

§Example Usage
use vt3::VtClient;

let vt = VtClient::new("Your API Key");
vt.overall_quotas("user_id");
source

pub fn group_members(&self, id: &str) -> VtResult<GroupMembers>

Retrieve group members.

§Example Usage
use vt3::VtClient;

let vt = VtClient::new("Your API Key");
vt.group_members("user_id");
source

pub fn group_api_usage( &self, id: &str, start_date: Option<&str>, end_date: Option<&str> ) -> VtResult<ApiUsage>

Retrieve group’s API usage.

§Example Usage
use vt3::VtClient;

let vt = VtClient::new("Your API Key");

// start_date & end_date fomrat is: YYYYMMDD
vt.group_api_usage("user_id", None, None);
source§

impl VtClient

source

pub fn file_feed(&self, time: &str) -> VtResult<Vec<Root>>

Get a file feed batch.

§Example Usage
use vt3::VtClient;

let vt = VtClient::new("Your API Key");

// A string in format YYYYMMDDhhmm
vt.file_feed("202106131355");
source

pub fn file_feed_behaviours(&self, time: &str) -> VtResult<Vec<Root>>

Get a file sandbox behaviour feed batch.

§Example Usage
use vt3::VtClient;

let vt = VtClient::new("Your API Key");

// A string in format YYYYMMDDhhmm
vt.file_feed("202106131355");
source

pub fn file_feed_behaviours_hourly(&self, time: &str) -> VtResult<Vec<Root>>

Hourly file feed sandbox behaviour feed batch.

§Example Usage
use vt3::VtClient;

let vt = VtClient::new("Your API Key");

// A string in format YYYYMMDDhh
vt.file_feed("2021061313");
source

pub fn file_feed_hourly(&self, time: &str) -> VtResult<Vec<Root>>

Hourly file feed packages.

§Example Usage
use vt3::VtClient;

let vt = VtClient::new("Your API Key");

// A string in format YYYYMMDDhh
vt.file_feed("2021061313");
source§

impl VtClient

source

pub fn url_feed(&self, time: &str) -> VtResult<Vec<Root>>

Get a URL feed batch.

§Example Usage
use vt3::VtClient;

let vt = VtClient::new("Your API Key");

// A string in format YYYYMMDDhhmm
vt.url_feed("202106131355");
source

pub fn url_feed_hourly(&self, time: &str) -> VtResult<Vec<Root>>

Hourly public_api.file feed batch.

§Example Usage
use vt3::VtClient;

let vt = VtClient::new("Your API Key");

// A string in format YYYYMMDDhh
vt.url_feed("2021061313");
source§

impl VtClient

source

pub fn get_rulesets( &self, limit: Option<&str>, order: Option<&str>, filter: Option<&str>, cursor: Option<&str> ) -> VtResult<SearchRulesetRoot>

Retrieve VT Hunting livehunt rulesets

§Example Usage
use vt3::VtClient;

let vt = VtClient::new("Your API Key");
vt.get_rulesets(Some("10"), None, None, None);
source

pub fn get_ruleset(&self, ruleset_id: &str) -> VtResult<SearchRulesetRoot>

Retrieve a VT Hunting Livehunt ruleset given by a id

§Example Usage
use vt3::VtClient;

let vt = VtClient::new("Your API Key");
vt.get_ruleset("1");
source

pub fn create_ruleset( &self, data: &SubmitLivehuntRuleset ) -> VtResult<SubmitLivehuntRuleset>

Create/Submit a new VT Hunting Livehunt ruleset

§Example Usage
use vt3::{VtClient, SubmitLivehuntRuleset};

let vt = VtClient::new("Your API Key");
let mut data = SubmitLivehuntRuleset::default();
vt.create_ruleset(&data);
source

pub fn delete_ruleset(&self, ruleset_id: &str) -> VtResult<String>

Delete/Remove Hunting ruleset by ID

§Example Usage
use vt3::VtClient;

let vt = VtClient::new("Your API Key");
vt.delete_ruleset("1");
source

pub fn update_ruleset( &self, ruleset_id: &str, data: &SubmitLivehuntRuleset ) -> VtResult<SubmitLivehuntRuleset>

Update/Modify a VT Hunting Livehunt ruleset

§Example Usage
use vt3::{VtClient, SubmitLivehuntRuleset};

let vt = VtClient::new("Your API Key");
let mut data = SubmitLivehuntRuleset::default();
vt.update_ruleset("1", &data);
source§

impl VtClient

source

pub fn get_retrohunt_jobs( &self, limit: Option<&str>, filter: Option<&str>, cursor: Option<&str> ) -> VtResult<SearchJobRoot>

Get all or limited RetroHunt jobs

§Example Usage
use vt3::VtClient;

let vt = VtClient::new("Your API Key");
vt.get_retrohunt_jobs(Some("10"), None, None);
source

pub fn get_retrohunt_job(&self, job_id: i32) -> VtResult<SearchJobRoot>

Get RetroHunt job by ID

§Example Usage
use vt3::VtClient;

let vt = VtClient::new("Your API Key");
vt.get_retrohunt_job(1);
source

pub fn create_retrohunt_job( &self, data: &SubmitRetrohuntJob ) -> VtResult<SubmitRetrohuntJob>

Create/Submit a RetroHunt job

§Example Usage
use vt3::{VtClient, SubmitRetrohuntJob};

let vt = VtClient::new("Your API Key");
let mut data = SubmitRetrohuntJob::default();
vt.create_retrohunt_job(&data);
source

pub fn delete_retrohunt_job(&self, job_id: i32) -> VtResult<String>

Delete RetroHunt job

§Example Usage
use vt3::VtClient;

let vt = VtClient::new("Your API Key");
vt.delete_retrohunt_job(1);
source

pub fn abort_retrohunt_job(&self, job_id: i32) -> VtResult<String>

Abort a RetroHunt job

§Example Usage
use vt3::VtClient;

let vt = VtClient::new("Your API Key");
vt.abort_retrohunt_job(1);
source§

impl VtClient

source

pub fn new(api_key: &str) -> Self

Creates a new VirusTotal API Client to access the VirusTotal REST API v3

§Example usage
use vt3::VtClient;

let vt_client = VtClient::new("YOUR API KEY");
source

pub fn user_agent(self, user_agent: &str) -> VtClient

Sets a new user-agent that from the default

Trait Implementations§

source§

impl Clone for VtClient

source§

fn clone(&self) -> VtClient

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more