mirror of
https://github.com/OMGeeky/google-apis-rs.git
synced 2026-02-23 15:49:49 +01:00
make regen-apis
This commit is contained in:
@@ -4,12 +4,12 @@
|
||||
[package]
|
||||
|
||||
name = "google-safebrowsing4"
|
||||
version = "5.0.4+20240225"
|
||||
version = "5.0.5+20240414"
|
||||
authors = ["Sebastian Thiel <byronimo@gmail.com>"]
|
||||
description = "A complete library to interact with Safebrowsing (protocol v4)"
|
||||
repository = "https://github.com/Byron/google-apis-rs/tree/main/gen/safebrowsing4"
|
||||
homepage = "https://developers.google.com/safe-browsing/"
|
||||
documentation = "https://docs.rs/google-safebrowsing4/5.0.4+20240225"
|
||||
documentation = "https://docs.rs/google-safebrowsing4/5.0.5+20240414"
|
||||
license = "MIT"
|
||||
keywords = ["safebrowsing", "google", "protocol", "web", "api"]
|
||||
autobins = false
|
||||
@@ -18,12 +18,12 @@ edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
anyhow = "^ 1.0"
|
||||
hyper-rustls = "0.24.0"
|
||||
hyper-rustls = "0.25.0"
|
||||
mime = "^ 0.3.0"
|
||||
serde = { version = "^ 1.0", features = ["derive"] }
|
||||
serde_json = "^ 1.0"
|
||||
itertools = "^ 0.10"
|
||||
google-apis-common = { path = "../../google-apis-common", version = "6.0" }
|
||||
google-apis-common = { path = "../../google-apis-common", version = "6.0.3" }
|
||||
hyper = "^ 0.14"
|
||||
http = "^0.2"
|
||||
tokio = "^1.0"
|
||||
|
||||
@@ -6,7 +6,7 @@ DO NOT EDIT !
|
||||
The MIT License (MIT)
|
||||
=====================
|
||||
|
||||
Copyright © `2015-2020` `Sebastian Thiel`
|
||||
Copyright 2015–2024 Sebastian Thiel
|
||||
|
||||
Permission is hereby granted, free of charge, to any person
|
||||
obtaining a copy of this software and associated documentation
|
||||
|
||||
@@ -5,28 +5,28 @@ DO NOT EDIT !
|
||||
-->
|
||||
The `google-safebrowsing4` library allows access to all features of the *Google Safebrowsing* service.
|
||||
|
||||
This documentation was generated from *Safebrowsing* crate version *5.0.4+20240225*, where *20240225* is the exact revision of the *safebrowsing:v4* schema built by the [mako](http://www.makotemplates.org/) code generator *v5.0.4*.
|
||||
This documentation was generated from *Safebrowsing* crate version *5.0.5+20240414*, where *20240414* is the exact revision of the *safebrowsing:v4* schema built by the [mako](http://www.makotemplates.org/) code generator *v5.0.5*.
|
||||
|
||||
Everything else about the *Safebrowsing* *v4* API can be found at the
|
||||
[official documentation site](https://developers.google.com/safe-browsing/).
|
||||
# Features
|
||||
|
||||
Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-safebrowsing4/5.0.4+20240225/google_safebrowsing4/Safebrowsing) ...
|
||||
Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-safebrowsing4/5.0.5+20240414/google_safebrowsing4/Safebrowsing) ...
|
||||
|
||||
* encoded full hashes
|
||||
* [*get*](https://docs.rs/google-safebrowsing4/5.0.4+20240225/google_safebrowsing4/api::EncodedFullHashGetCall)
|
||||
* [*get*](https://docs.rs/google-safebrowsing4/5.0.5+20240414/google_safebrowsing4/api::EncodedFullHashGetCall)
|
||||
* encoded updates
|
||||
* [*get*](https://docs.rs/google-safebrowsing4/5.0.4+20240225/google_safebrowsing4/api::EncodedUpdateGetCall)
|
||||
* [*get*](https://docs.rs/google-safebrowsing4/5.0.5+20240414/google_safebrowsing4/api::EncodedUpdateGetCall)
|
||||
* full hashes
|
||||
* [*find*](https://docs.rs/google-safebrowsing4/5.0.4+20240225/google_safebrowsing4/api::FullHashFindCall)
|
||||
* [*find*](https://docs.rs/google-safebrowsing4/5.0.5+20240414/google_safebrowsing4/api::FullHashFindCall)
|
||||
* threat hits
|
||||
* [*create*](https://docs.rs/google-safebrowsing4/5.0.4+20240225/google_safebrowsing4/api::ThreatHitCreateCall)
|
||||
* [*create*](https://docs.rs/google-safebrowsing4/5.0.5+20240414/google_safebrowsing4/api::ThreatHitCreateCall)
|
||||
* threat list updates
|
||||
* [*fetch*](https://docs.rs/google-safebrowsing4/5.0.4+20240225/google_safebrowsing4/api::ThreatListUpdateFetchCall)
|
||||
* [*fetch*](https://docs.rs/google-safebrowsing4/5.0.5+20240414/google_safebrowsing4/api::ThreatListUpdateFetchCall)
|
||||
* threat lists
|
||||
* [*list*](https://docs.rs/google-safebrowsing4/5.0.4+20240225/google_safebrowsing4/api::ThreatListListCall)
|
||||
* [*list*](https://docs.rs/google-safebrowsing4/5.0.5+20240414/google_safebrowsing4/api::ThreatListListCall)
|
||||
* threat matches
|
||||
* [*find*](https://docs.rs/google-safebrowsing4/5.0.4+20240225/google_safebrowsing4/api::ThreatMatchFindCall)
|
||||
* [*find*](https://docs.rs/google-safebrowsing4/5.0.5+20240414/google_safebrowsing4/api::ThreatMatchFindCall)
|
||||
|
||||
|
||||
|
||||
@@ -35,17 +35,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r
|
||||
|
||||
The API is structured into the following primary items:
|
||||
|
||||
* **[Hub](https://docs.rs/google-safebrowsing4/5.0.4+20240225/google_safebrowsing4/Safebrowsing)**
|
||||
* **[Hub](https://docs.rs/google-safebrowsing4/5.0.5+20240414/google_safebrowsing4/Safebrowsing)**
|
||||
* a central object to maintain state and allow accessing all *Activities*
|
||||
* creates [*Method Builders*](https://docs.rs/google-safebrowsing4/5.0.4+20240225/google_safebrowsing4/client::MethodsBuilder) which in turn
|
||||
allow access to individual [*Call Builders*](https://docs.rs/google-safebrowsing4/5.0.4+20240225/google_safebrowsing4/client::CallBuilder)
|
||||
* **[Resources](https://docs.rs/google-safebrowsing4/5.0.4+20240225/google_safebrowsing4/client::Resource)**
|
||||
* creates [*Method Builders*](https://docs.rs/google-safebrowsing4/5.0.5+20240414/google_safebrowsing4/client::MethodsBuilder) which in turn
|
||||
allow access to individual [*Call Builders*](https://docs.rs/google-safebrowsing4/5.0.5+20240414/google_safebrowsing4/client::CallBuilder)
|
||||
* **[Resources](https://docs.rs/google-safebrowsing4/5.0.5+20240414/google_safebrowsing4/client::Resource)**
|
||||
* primary types that you can apply *Activities* to
|
||||
* a collection of properties and *Parts*
|
||||
* **[Parts](https://docs.rs/google-safebrowsing4/5.0.4+20240225/google_safebrowsing4/client::Part)**
|
||||
* **[Parts](https://docs.rs/google-safebrowsing4/5.0.5+20240414/google_safebrowsing4/client::Part)**
|
||||
* a collection of properties
|
||||
* never directly used in *Activities*
|
||||
* **[Activities](https://docs.rs/google-safebrowsing4/5.0.4+20240225/google_safebrowsing4/client::CallBuilder)**
|
||||
* **[Activities](https://docs.rs/google-safebrowsing4/5.0.5+20240414/google_safebrowsing4/client::CallBuilder)**
|
||||
* operations to apply to *Resources*
|
||||
|
||||
All *structures* are marked with applicable traits to further categorize them and ease browsing.
|
||||
@@ -63,8 +63,8 @@ let r = hub.encoded_full_hashes().get(...).doit().await
|
||||
let r = hub.full_hashes().find(...).doit().await
|
||||
```
|
||||
|
||||
The `resource()` and `activity(...)` calls create [builders][builder-pattern]. The second one dealing with `Activities`
|
||||
supports various methods to configure the impending operation (not shown here). It is made such that all required arguments have to be
|
||||
The `resource()` and `activity(...)` calls create [builders][builder-pattern]. The second one dealing with `Activities`
|
||||
supports various methods to configure the impending operation (not shown here). It is made such that all required arguments have to be
|
||||
specified right away (i.e. `(...)`), whereas all optional ones can be [build up][builder-pattern] as desired.
|
||||
The `doit()` method performs the actual communication with the server and returns the respective result.
|
||||
|
||||
@@ -88,22 +88,23 @@ extern crate hyper;
|
||||
extern crate hyper_rustls;
|
||||
extern crate google_safebrowsing4 as safebrowsing4;
|
||||
use safebrowsing4::{Result, Error};
|
||||
use safebrowsing4::api::enums::*;
|
||||
use std::default::Default;
|
||||
use safebrowsing4::{Safebrowsing, oauth2, hyper, hyper_rustls, chrono, FieldMask};
|
||||
|
||||
// Get an ApplicationSecret instance by some means. It contains the `client_id` and
|
||||
// Get an ApplicationSecret instance by some means. It contains the `client_id` and
|
||||
// `client_secret`, among other things.
|
||||
let secret: oauth2::ApplicationSecret = Default::default();
|
||||
// Instantiate the authenticator. It will choose a suitable authentication flow for you,
|
||||
// Instantiate the authenticator. It will choose a suitable authentication flow for you,
|
||||
// unless you replace `None` with the desired Flow.
|
||||
// Provide your own `AuthenticatorDelegate` to adjust the way it operates and get feedback about
|
||||
// Provide your own `AuthenticatorDelegate` to adjust the way it operates and get feedback about
|
||||
// what's going on. You probably want to bring in your own `TokenStorage` to persist tokens and
|
||||
// retrieve them from storage.
|
||||
let auth = oauth2::InstalledFlowAuthenticator::builder(
|
||||
secret,
|
||||
oauth2::InstalledFlowReturnMethod::HTTPRedirect,
|
||||
).build().await.unwrap();
|
||||
let mut hub = Safebrowsing::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().https_or_http().enable_http1().build()), auth);
|
||||
let mut hub = Safebrowsing::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().unwrap().https_or_http().enable_http1().build()), auth);
|
||||
// You can configure optional parameters by calling the respective setters at will, and
|
||||
// execute the final call using `doit()`.
|
||||
// Values shown here are possibly random and not representative !
|
||||
@@ -133,49 +134,49 @@ match result {
|
||||
```
|
||||
## Handling Errors
|
||||
|
||||
All errors produced by the system are provided either as [Result](https://docs.rs/google-safebrowsing4/5.0.4+20240225/google_safebrowsing4/client::Result) enumeration as return value of
|
||||
the doit() methods, or handed as possibly intermediate results to either the
|
||||
[Hub Delegate](https://docs.rs/google-safebrowsing4/5.0.4+20240225/google_safebrowsing4/client::Delegate), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html).
|
||||
All errors produced by the system are provided either as [Result](https://docs.rs/google-safebrowsing4/5.0.5+20240414/google_safebrowsing4/client::Result) enumeration as return value of
|
||||
the doit() methods, or handed as possibly intermediate results to either the
|
||||
[Hub Delegate](https://docs.rs/google-safebrowsing4/5.0.5+20240414/google_safebrowsing4/client::Delegate), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html).
|
||||
|
||||
When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This
|
||||
When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This
|
||||
makes the system potentially resilient to all kinds of errors.
|
||||
|
||||
## Uploads and Downloads
|
||||
If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-safebrowsing4/5.0.4+20240225/google_safebrowsing4/client::Result), should be
|
||||
If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-safebrowsing4/5.0.5+20240414/google_safebrowsing4/client::Result), should be
|
||||
read by you to obtain the media.
|
||||
If such a method also supports a [Response Result](https://docs.rs/google-safebrowsing4/5.0.4+20240225/google_safebrowsing4/client::ResponseResult), it will return that by default.
|
||||
If such a method also supports a [Response Result](https://docs.rs/google-safebrowsing4/5.0.5+20240414/google_safebrowsing4/client::ResponseResult), it will return that by default.
|
||||
You can see it as meta-data for the actual media. To trigger a media download, you will have to set up the builder by making
|
||||
this call: `.param("alt", "media")`.
|
||||
|
||||
Methods supporting uploads can do so using up to 2 different protocols:
|
||||
*simple* and *resumable*. The distinctiveness of each is represented by customized
|
||||
Methods supporting uploads can do so using up to 2 different protocols:
|
||||
*simple* and *resumable*. The distinctiveness of each is represented by customized
|
||||
`doit(...)` methods, which are then named `upload(...)` and `upload_resumable(...)` respectively.
|
||||
|
||||
## Customization and Callbacks
|
||||
|
||||
You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-safebrowsing4/5.0.4+20240225/google_safebrowsing4/client::Delegate) to the
|
||||
[Method Builder](https://docs.rs/google-safebrowsing4/5.0.4+20240225/google_safebrowsing4/client::CallBuilder) before making the final `doit()` call.
|
||||
Respective methods will be called to provide progress information, as well as determine whether the system should
|
||||
You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-safebrowsing4/5.0.5+20240414/google_safebrowsing4/client::Delegate) to the
|
||||
[Method Builder](https://docs.rs/google-safebrowsing4/5.0.5+20240414/google_safebrowsing4/client::CallBuilder) before making the final `doit()` call.
|
||||
Respective methods will be called to provide progress information, as well as determine whether the system should
|
||||
retry on failure.
|
||||
|
||||
The [delegate trait](https://docs.rs/google-safebrowsing4/5.0.4+20240225/google_safebrowsing4/client::Delegate) is default-implemented, allowing you to customize it with minimal effort.
|
||||
The [delegate trait](https://docs.rs/google-safebrowsing4/5.0.5+20240414/google_safebrowsing4/client::Delegate) is default-implemented, allowing you to customize it with minimal effort.
|
||||
|
||||
## Optional Parts in Server-Requests
|
||||
|
||||
All structures provided by this library are made to be [encodable](https://docs.rs/google-safebrowsing4/5.0.4+20240225/google_safebrowsing4/client::RequestValue) and
|
||||
[decodable](https://docs.rs/google-safebrowsing4/5.0.4+20240225/google_safebrowsing4/client::ResponseResult) via *json*. Optionals are used to indicate that partial requests are responses
|
||||
All structures provided by this library are made to be [encodable](https://docs.rs/google-safebrowsing4/5.0.5+20240414/google_safebrowsing4/client::RequestValue) and
|
||||
[decodable](https://docs.rs/google-safebrowsing4/5.0.5+20240414/google_safebrowsing4/client::ResponseResult) via *json*. Optionals are used to indicate that partial requests are responses
|
||||
are valid.
|
||||
Most optionals are are considered [Parts](https://docs.rs/google-safebrowsing4/5.0.4+20240225/google_safebrowsing4/client::Part) which are identifiable by name, which will be sent to
|
||||
Most optionals are are considered [Parts](https://docs.rs/google-safebrowsing4/5.0.5+20240414/google_safebrowsing4/client::Part) which are identifiable by name, which will be sent to
|
||||
the server to indicate either the set parts of the request or the desired parts in the response.
|
||||
|
||||
## Builder Arguments
|
||||
|
||||
Using [method builders](https://docs.rs/google-safebrowsing4/5.0.4+20240225/google_safebrowsing4/client::CallBuilder), you are able to prepare an action call by repeatedly calling it's methods.
|
||||
Using [method builders](https://docs.rs/google-safebrowsing4/5.0.5+20240414/google_safebrowsing4/client::CallBuilder), you are able to prepare an action call by repeatedly calling it's methods.
|
||||
These will always take a single argument, for which the following statements are true.
|
||||
|
||||
* [PODs][wiki-pod] are handed by copy
|
||||
* strings are passed as `&str`
|
||||
* [request values](https://docs.rs/google-safebrowsing4/5.0.4+20240225/google_safebrowsing4/client::RequestValue) are moved
|
||||
* [request values](https://docs.rs/google-safebrowsing4/5.0.5+20240414/google_safebrowsing4/client::RequestValue) are moved
|
||||
|
||||
Arguments will always be copied or cloned into the builder, to make them independent of their original life times.
|
||||
|
||||
@@ -184,7 +185,7 @@ Arguments will always be copied or cloned into the builder, to make them indepen
|
||||
[google-go-api]: https://github.com/google/google-api-go-client
|
||||
|
||||
# License
|
||||
The **safebrowsing4** library was generated by Sebastian Thiel, and is placed
|
||||
The **safebrowsing4** library was generated by Sebastian Thiel, and is placed
|
||||
under the *MIT* license.
|
||||
You can read the full text at the repository's [license file][repo-license].
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
2575
gen/safebrowsing4/src/api/enums.rs
Normal file
2575
gen/safebrowsing4/src/api/enums.rs
Normal file
File diff suppressed because it is too large
Load Diff
127
gen/safebrowsing4/src/api/hub.rs
Normal file
127
gen/safebrowsing4/src/api/hub.rs
Normal file
@@ -0,0 +1,127 @@
|
||||
use super::*;
|
||||
|
||||
/// Central instance to access all Safebrowsing related resource activities
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
/// Instantiate a new hub
|
||||
///
|
||||
/// ```test_harness,no_run
|
||||
/// extern crate hyper;
|
||||
/// extern crate hyper_rustls;
|
||||
/// extern crate google_safebrowsing4 as safebrowsing4;
|
||||
/// use safebrowsing4::{Result, Error};
|
||||
/// use safebrowsing4::api::enums::*;
|
||||
/// # async fn dox() {
|
||||
/// use std::default::Default;
|
||||
/// use safebrowsing4::{Safebrowsing, oauth2, hyper, hyper_rustls, chrono, FieldMask};
|
||||
///
|
||||
/// // Get an ApplicationSecret instance by some means. It contains the `client_id` and
|
||||
/// // `client_secret`, among other things.
|
||||
/// let secret: oauth2::ApplicationSecret = Default::default();
|
||||
/// // Instantiate the authenticator. It will choose a suitable authentication flow for you,
|
||||
/// // unless you replace `None` with the desired Flow.
|
||||
/// // Provide your own `AuthenticatorDelegate` to adjust the way it operates and get feedback about
|
||||
/// // what's going on. You probably want to bring in your own `TokenStorage` to persist tokens and
|
||||
/// // retrieve them from storage.
|
||||
/// let auth = oauth2::InstalledFlowAuthenticator::builder(
|
||||
/// secret,
|
||||
/// oauth2::InstalledFlowReturnMethod::HTTPRedirect,
|
||||
/// ).build().await.unwrap();
|
||||
/// let mut hub = Safebrowsing::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().unwrap().https_or_http().enable_http1().build()), auth);
|
||||
/// // You can configure optional parameters by calling the respective setters at will, and
|
||||
/// // execute the final call using `doit()`.
|
||||
/// // Values shown here are possibly random and not representative !
|
||||
/// let result = hub.encoded_full_hashes().get(vec![0, 1, 2, 3])
|
||||
/// .client_version("voluptua.")
|
||||
/// .client_id("At")
|
||||
/// .doit().await;
|
||||
///
|
||||
/// match result {
|
||||
/// Err(e) => match e {
|
||||
/// // The Error enum provides details about what exactly happened.
|
||||
/// // You can also just use its `Debug`, `Display` or `Error` traits
|
||||
/// Error::HttpError(_)
|
||||
/// |Error::Io(_)
|
||||
/// |Error::MissingAPIKey
|
||||
/// |Error::MissingToken(_)
|
||||
/// |Error::Cancelled
|
||||
/// |Error::UploadSizeLimitExceeded(_, _)
|
||||
/// |Error::Failure(_)
|
||||
/// |Error::BadRequest(_)
|
||||
/// |Error::FieldClash(_)
|
||||
/// |Error::JsonDecodeError(_, _) => println!("{}", e),
|
||||
/// },
|
||||
/// Ok(res) => println!("Success: {:?}", res),
|
||||
/// }
|
||||
/// # }
|
||||
/// ```
|
||||
#[derive(Clone)]
|
||||
pub struct Safebrowsing<S> {
|
||||
pub client: hyper::Client<S, hyper::body::Body>,
|
||||
pub auth: Box<dyn client::GetToken>,
|
||||
pub(super) _user_agent: String,
|
||||
pub(super) _base_url: String,
|
||||
pub(super) _root_url: String,
|
||||
}
|
||||
|
||||
impl<'a, S> client::Hub for Safebrowsing<S> {}
|
||||
|
||||
impl<'a, S> Safebrowsing<S> {
|
||||
|
||||
pub fn new<A: 'static + client::GetToken>(client: hyper::Client<S, hyper::body::Body>, auth: A) -> Safebrowsing<S> {
|
||||
Safebrowsing {
|
||||
client,
|
||||
auth: Box::new(auth),
|
||||
_user_agent: "google-api-rust-client/5.0.5".to_string(),
|
||||
_base_url: "https://safebrowsing.googleapis.com/".to_string(),
|
||||
_root_url: "https://safebrowsing.googleapis.com/".to_string(),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn encoded_full_hashes(&'a self) -> EncodedFullHashMethods<'a, S> {
|
||||
EncodedFullHashMethods { hub: &self }
|
||||
}
|
||||
pub fn encoded_updates(&'a self) -> EncodedUpdateMethods<'a, S> {
|
||||
EncodedUpdateMethods { hub: &self }
|
||||
}
|
||||
pub fn full_hashes(&'a self) -> FullHashMethods<'a, S> {
|
||||
FullHashMethods { hub: &self }
|
||||
}
|
||||
pub fn threat_hits(&'a self) -> ThreatHitMethods<'a, S> {
|
||||
ThreatHitMethods { hub: &self }
|
||||
}
|
||||
pub fn threat_list_updates(&'a self) -> ThreatListUpdateMethods<'a, S> {
|
||||
ThreatListUpdateMethods { hub: &self }
|
||||
}
|
||||
pub fn threat_lists(&'a self) -> ThreatListMethods<'a, S> {
|
||||
ThreatListMethods { hub: &self }
|
||||
}
|
||||
pub fn threat_matches(&'a self) -> ThreatMatchMethods<'a, S> {
|
||||
ThreatMatchMethods { hub: &self }
|
||||
}
|
||||
|
||||
/// Set the user-agent header field to use in all requests to the server.
|
||||
/// It defaults to `google-api-rust-client/5.0.5`.
|
||||
///
|
||||
/// Returns the previously set user-agent.
|
||||
pub fn user_agent(&mut self, agent_name: String) -> String {
|
||||
mem::replace(&mut self._user_agent, agent_name)
|
||||
}
|
||||
|
||||
/// Set the base url to use in all requests to the server.
|
||||
/// It defaults to `https://safebrowsing.googleapis.com/`.
|
||||
///
|
||||
/// Returns the previously set base url.
|
||||
pub fn base_url(&mut self, new_base_url: String) -> String {
|
||||
mem::replace(&mut self._base_url, new_base_url)
|
||||
}
|
||||
|
||||
/// Set the root url to use in all requests to the server.
|
||||
/// It defaults to `https://safebrowsing.googleapis.com/`.
|
||||
///
|
||||
/// Returns the previously set root url.
|
||||
pub fn root_url(&mut self, new_root_url: String) -> String {
|
||||
mem::replace(&mut self._root_url, new_root_url)
|
||||
}
|
||||
}
|
||||
399
gen/safebrowsing4/src/api/method_builders.rs
Normal file
399
gen/safebrowsing4/src/api/method_builders.rs
Normal file
@@ -0,0 +1,399 @@
|
||||
use super::*;
|
||||
/// A builder providing access to all methods supported on *encodedFullHash* resources.
|
||||
/// It is not used directly, but through the [`Safebrowsing`] hub.
|
||||
///
|
||||
/// # Example
|
||||
///
|
||||
/// Instantiate a resource builder
|
||||
///
|
||||
/// ```test_harness,no_run
|
||||
/// extern crate hyper;
|
||||
/// extern crate hyper_rustls;
|
||||
/// extern crate google_safebrowsing4 as safebrowsing4;
|
||||
///
|
||||
/// # async fn dox() {
|
||||
/// use std::default::Default;
|
||||
/// use safebrowsing4::{Safebrowsing, oauth2, hyper, hyper_rustls, chrono, FieldMask};
|
||||
///
|
||||
/// let secret: oauth2::ApplicationSecret = Default::default();
|
||||
/// let auth = oauth2::InstalledFlowAuthenticator::builder(
|
||||
/// secret,
|
||||
/// oauth2::InstalledFlowReturnMethod::HTTPRedirect,
|
||||
/// ).build().await.unwrap();
|
||||
/// let mut hub = Safebrowsing::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().unwrap().https_or_http().enable_http1().build()), auth);
|
||||
/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders*
|
||||
/// // like `get(...)`
|
||||
/// // to build up your call.
|
||||
/// let rb = hub.encoded_full_hashes();
|
||||
/// # }
|
||||
/// ```
|
||||
pub struct EncodedFullHashMethods<'a, S>
|
||||
where S: 'a {
|
||||
|
||||
pub(super) hub: &'a Safebrowsing<S>,
|
||||
}
|
||||
|
||||
impl<'a, S> client::MethodsBuilder for EncodedFullHashMethods<'a, S> {}
|
||||
|
||||
impl<'a, S> EncodedFullHashMethods<'a, S> {
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
///
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `encodedRequest` - A serialized FindFullHashesRequest proto.
|
||||
pub fn get(&self, encoded_request: Vec<u8>) -> EncodedFullHashGetCall<'a, S> {
|
||||
EncodedFullHashGetCall {
|
||||
hub: self.hub,
|
||||
_encoded_request: encoded_request,
|
||||
_client_version: Default::default(),
|
||||
_client_id: Default::default(),
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// A builder providing access to all methods supported on *encodedUpdate* resources.
|
||||
/// It is not used directly, but through the [`Safebrowsing`] hub.
|
||||
///
|
||||
/// # Example
|
||||
///
|
||||
/// Instantiate a resource builder
|
||||
///
|
||||
/// ```test_harness,no_run
|
||||
/// extern crate hyper;
|
||||
/// extern crate hyper_rustls;
|
||||
/// extern crate google_safebrowsing4 as safebrowsing4;
|
||||
///
|
||||
/// # async fn dox() {
|
||||
/// use std::default::Default;
|
||||
/// use safebrowsing4::{Safebrowsing, oauth2, hyper, hyper_rustls, chrono, FieldMask};
|
||||
///
|
||||
/// let secret: oauth2::ApplicationSecret = Default::default();
|
||||
/// let auth = oauth2::InstalledFlowAuthenticator::builder(
|
||||
/// secret,
|
||||
/// oauth2::InstalledFlowReturnMethod::HTTPRedirect,
|
||||
/// ).build().await.unwrap();
|
||||
/// let mut hub = Safebrowsing::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().unwrap().https_or_http().enable_http1().build()), auth);
|
||||
/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders*
|
||||
/// // like `get(...)`
|
||||
/// // to build up your call.
|
||||
/// let rb = hub.encoded_updates();
|
||||
/// # }
|
||||
/// ```
|
||||
pub struct EncodedUpdateMethods<'a, S>
|
||||
where S: 'a {
|
||||
|
||||
pub(super) hub: &'a Safebrowsing<S>,
|
||||
}
|
||||
|
||||
impl<'a, S> client::MethodsBuilder for EncodedUpdateMethods<'a, S> {}
|
||||
|
||||
impl<'a, S> EncodedUpdateMethods<'a, S> {
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
///
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `encodedRequest` - A serialized FetchThreatListUpdatesRequest proto.
|
||||
pub fn get(&self, encoded_request: Vec<u8>) -> EncodedUpdateGetCall<'a, S> {
|
||||
EncodedUpdateGetCall {
|
||||
hub: self.hub,
|
||||
_encoded_request: encoded_request,
|
||||
_client_version: Default::default(),
|
||||
_client_id: Default::default(),
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// A builder providing access to all methods supported on *fullHash* resources.
|
||||
/// It is not used directly, but through the [`Safebrowsing`] hub.
|
||||
///
|
||||
/// # Example
|
||||
///
|
||||
/// Instantiate a resource builder
|
||||
///
|
||||
/// ```test_harness,no_run
|
||||
/// extern crate hyper;
|
||||
/// extern crate hyper_rustls;
|
||||
/// extern crate google_safebrowsing4 as safebrowsing4;
|
||||
///
|
||||
/// # async fn dox() {
|
||||
/// use std::default::Default;
|
||||
/// use safebrowsing4::{Safebrowsing, oauth2, hyper, hyper_rustls, chrono, FieldMask};
|
||||
///
|
||||
/// let secret: oauth2::ApplicationSecret = Default::default();
|
||||
/// let auth = oauth2::InstalledFlowAuthenticator::builder(
|
||||
/// secret,
|
||||
/// oauth2::InstalledFlowReturnMethod::HTTPRedirect,
|
||||
/// ).build().await.unwrap();
|
||||
/// let mut hub = Safebrowsing::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().unwrap().https_or_http().enable_http1().build()), auth);
|
||||
/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders*
|
||||
/// // like `find(...)`
|
||||
/// // to build up your call.
|
||||
/// let rb = hub.full_hashes();
|
||||
/// # }
|
||||
/// ```
|
||||
pub struct FullHashMethods<'a, S>
|
||||
where S: 'a {
|
||||
|
||||
pub(super) hub: &'a Safebrowsing<S>,
|
||||
}
|
||||
|
||||
impl<'a, S> client::MethodsBuilder for FullHashMethods<'a, S> {}
|
||||
|
||||
impl<'a, S> FullHashMethods<'a, S> {
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Finds the full hashes that match the requested hash prefixes.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `request` - No description provided.
|
||||
pub fn find(&self, request: GoogleSecuritySafebrowsingV4FindFullHashesRequest) -> FullHashFindCall<'a, S> {
|
||||
FullHashFindCall {
|
||||
hub: self.hub,
|
||||
_request: request,
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// A builder providing access to all methods supported on *threatHit* resources.
|
||||
/// It is not used directly, but through the [`Safebrowsing`] hub.
|
||||
///
|
||||
/// # Example
|
||||
///
|
||||
/// Instantiate a resource builder
|
||||
///
|
||||
/// ```test_harness,no_run
|
||||
/// extern crate hyper;
|
||||
/// extern crate hyper_rustls;
|
||||
/// extern crate google_safebrowsing4 as safebrowsing4;
|
||||
///
|
||||
/// # async fn dox() {
|
||||
/// use std::default::Default;
|
||||
/// use safebrowsing4::{Safebrowsing, oauth2, hyper, hyper_rustls, chrono, FieldMask};
|
||||
///
|
||||
/// let secret: oauth2::ApplicationSecret = Default::default();
|
||||
/// let auth = oauth2::InstalledFlowAuthenticator::builder(
|
||||
/// secret,
|
||||
/// oauth2::InstalledFlowReturnMethod::HTTPRedirect,
|
||||
/// ).build().await.unwrap();
|
||||
/// let mut hub = Safebrowsing::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().unwrap().https_or_http().enable_http1().build()), auth);
|
||||
/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders*
|
||||
/// // like `create(...)`
|
||||
/// // to build up your call.
|
||||
/// let rb = hub.threat_hits();
|
||||
/// # }
|
||||
/// ```
|
||||
pub struct ThreatHitMethods<'a, S>
|
||||
where S: 'a {
|
||||
|
||||
pub(super) hub: &'a Safebrowsing<S>,
|
||||
}
|
||||
|
||||
impl<'a, S> client::MethodsBuilder for ThreatHitMethods<'a, S> {}
|
||||
|
||||
impl<'a, S> ThreatHitMethods<'a, S> {
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Reports a Safe Browsing threat list hit to Google. Only projects with TRUSTED_REPORTER visibility can use this method.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `request` - No description provided.
|
||||
pub fn create(&self, request: GoogleSecuritySafebrowsingV4ThreatHit) -> ThreatHitCreateCall<'a, S> {
|
||||
ThreatHitCreateCall {
|
||||
hub: self.hub,
|
||||
_request: request,
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// A builder providing access to all methods supported on *threatListUpdate* resources.
|
||||
/// It is not used directly, but through the [`Safebrowsing`] hub.
|
||||
///
|
||||
/// # Example
|
||||
///
|
||||
/// Instantiate a resource builder
|
||||
///
|
||||
/// ```test_harness,no_run
|
||||
/// extern crate hyper;
|
||||
/// extern crate hyper_rustls;
|
||||
/// extern crate google_safebrowsing4 as safebrowsing4;
|
||||
///
|
||||
/// # async fn dox() {
|
||||
/// use std::default::Default;
|
||||
/// use safebrowsing4::{Safebrowsing, oauth2, hyper, hyper_rustls, chrono, FieldMask};
|
||||
///
|
||||
/// let secret: oauth2::ApplicationSecret = Default::default();
|
||||
/// let auth = oauth2::InstalledFlowAuthenticator::builder(
|
||||
/// secret,
|
||||
/// oauth2::InstalledFlowReturnMethod::HTTPRedirect,
|
||||
/// ).build().await.unwrap();
|
||||
/// let mut hub = Safebrowsing::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().unwrap().https_or_http().enable_http1().build()), auth);
|
||||
/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders*
|
||||
/// // like `fetch(...)`
|
||||
/// // to build up your call.
|
||||
/// let rb = hub.threat_list_updates();
|
||||
/// # }
|
||||
/// ```
|
||||
pub struct ThreatListUpdateMethods<'a, S>
|
||||
where S: 'a {
|
||||
|
||||
pub(super) hub: &'a Safebrowsing<S>,
|
||||
}
|
||||
|
||||
impl<'a, S> client::MethodsBuilder for ThreatListUpdateMethods<'a, S> {}
|
||||
|
||||
impl<'a, S> ThreatListUpdateMethods<'a, S> {
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Fetches the most recent threat list updates. A client can request updates for multiple lists at once.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `request` - No description provided.
|
||||
pub fn fetch(&self, request: GoogleSecuritySafebrowsingV4FetchThreatListUpdatesRequest) -> ThreatListUpdateFetchCall<'a, S> {
|
||||
ThreatListUpdateFetchCall {
|
||||
hub: self.hub,
|
||||
_request: request,
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// A builder providing access to all methods supported on *threatList* resources.
|
||||
/// It is not used directly, but through the [`Safebrowsing`] hub.
|
||||
///
|
||||
/// # Example
|
||||
///
|
||||
/// Instantiate a resource builder
|
||||
///
|
||||
/// ```test_harness,no_run
|
||||
/// extern crate hyper;
|
||||
/// extern crate hyper_rustls;
|
||||
/// extern crate google_safebrowsing4 as safebrowsing4;
|
||||
///
|
||||
/// # async fn dox() {
|
||||
/// use std::default::Default;
|
||||
/// use safebrowsing4::{Safebrowsing, oauth2, hyper, hyper_rustls, chrono, FieldMask};
|
||||
///
|
||||
/// let secret: oauth2::ApplicationSecret = Default::default();
|
||||
/// let auth = oauth2::InstalledFlowAuthenticator::builder(
|
||||
/// secret,
|
||||
/// oauth2::InstalledFlowReturnMethod::HTTPRedirect,
|
||||
/// ).build().await.unwrap();
|
||||
/// let mut hub = Safebrowsing::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().unwrap().https_or_http().enable_http1().build()), auth);
|
||||
/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders*
|
||||
/// // like `list(...)`
|
||||
/// // to build up your call.
|
||||
/// let rb = hub.threat_lists();
|
||||
/// # }
|
||||
/// ```
|
||||
pub struct ThreatListMethods<'a, S>
|
||||
where S: 'a {
|
||||
|
||||
pub(super) hub: &'a Safebrowsing<S>,
|
||||
}
|
||||
|
||||
impl<'a, S> client::MethodsBuilder for ThreatListMethods<'a, S> {}
|
||||
|
||||
impl<'a, S> ThreatListMethods<'a, S> {
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Lists the Safe Browsing threat lists available for download.
|
||||
pub fn list(&self) -> ThreatListListCall<'a, S> {
|
||||
ThreatListListCall {
|
||||
hub: self.hub,
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// A builder providing access to all methods supported on *threatMatch* resources.
|
||||
/// It is not used directly, but through the [`Safebrowsing`] hub.
|
||||
///
|
||||
/// # Example
|
||||
///
|
||||
/// Instantiate a resource builder
|
||||
///
|
||||
/// ```test_harness,no_run
|
||||
/// extern crate hyper;
|
||||
/// extern crate hyper_rustls;
|
||||
/// extern crate google_safebrowsing4 as safebrowsing4;
|
||||
///
|
||||
/// # async fn dox() {
|
||||
/// use std::default::Default;
|
||||
/// use safebrowsing4::{Safebrowsing, oauth2, hyper, hyper_rustls, chrono, FieldMask};
|
||||
///
|
||||
/// let secret: oauth2::ApplicationSecret = Default::default();
|
||||
/// let auth = oauth2::InstalledFlowAuthenticator::builder(
|
||||
/// secret,
|
||||
/// oauth2::InstalledFlowReturnMethod::HTTPRedirect,
|
||||
/// ).build().await.unwrap();
|
||||
/// let mut hub = Safebrowsing::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().unwrap().https_or_http().enable_http1().build()), auth);
|
||||
/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders*
|
||||
/// // like `find(...)`
|
||||
/// // to build up your call.
|
||||
/// let rb = hub.threat_matches();
|
||||
/// # }
|
||||
/// ```
|
||||
pub struct ThreatMatchMethods<'a, S>
|
||||
where S: 'a {
|
||||
|
||||
pub(super) hub: &'a Safebrowsing<S>,
|
||||
}
|
||||
|
||||
impl<'a, S> client::MethodsBuilder for ThreatMatchMethods<'a, S> {}
|
||||
|
||||
impl<'a, S> ThreatMatchMethods<'a, S> {
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Finds the threat entries that match the Safe Browsing lists.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `request` - No description provided.
|
||||
pub fn find(&self, request: GoogleSecuritySafebrowsingV4FindThreatMatchesRequest) -> ThreatMatchFindCall<'a, S> {
|
||||
ThreatMatchFindCall {
|
||||
hub: self.hub,
|
||||
_request: request,
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
35
gen/safebrowsing4/src/api/mod.rs
Normal file
35
gen/safebrowsing4/src/api/mod.rs
Normal file
@@ -0,0 +1,35 @@
|
||||
use std::collections::HashMap;
|
||||
use std::cell::RefCell;
|
||||
use std::default::Default;
|
||||
use std::collections::BTreeSet;
|
||||
use std::error::Error as StdError;
|
||||
use serde_json as json;
|
||||
use std::io;
|
||||
use std::fs;
|
||||
use std::mem;
|
||||
|
||||
use hyper::client::connect;
|
||||
use tokio::io::{AsyncRead, AsyncWrite};
|
||||
use tokio::time::sleep;
|
||||
use tower_service;
|
||||
use serde::{Serialize, Deserialize};
|
||||
|
||||
use crate::{client, client::GetToken, client::serde_with};
|
||||
|
||||
mod utilities;
|
||||
pub use utilities::*;
|
||||
|
||||
mod hub;
|
||||
pub use hub::*;
|
||||
|
||||
mod schemas;
|
||||
pub use schemas::*;
|
||||
|
||||
mod method_builders;
|
||||
pub use method_builders::*;
|
||||
|
||||
mod call_builders;
|
||||
pub use call_builders::*;
|
||||
|
||||
pub mod enums;
|
||||
pub(crate) use enums::*;
|
||||
661
gen/safebrowsing4/src/api/schemas.rs
Normal file
661
gen/safebrowsing4/src/api/schemas.rs
Normal file
@@ -0,0 +1,661 @@
|
||||
use super::*;
|
||||
/// A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }
|
||||
///
|
||||
/// # Activities
|
||||
///
|
||||
/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
|
||||
/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
|
||||
///
|
||||
/// * [create threat hits](ThreatHitCreateCall) (response)
|
||||
#[serde_with::serde_as(crate = "::client::serde_with")]
|
||||
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
|
||||
pub struct GoogleProtobufEmpty { _never_set: Option<bool> }
|
||||
|
||||
impl client::ResponseResult for GoogleProtobufEmpty {}
|
||||
|
||||
|
||||
/// The expected state of a client's local database.
|
||||
///
|
||||
/// This type is not used in any activity, and only used as *part* of another schema.
|
||||
///
|
||||
#[serde_with::serde_as(crate = "::client::serde_with")]
|
||||
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
|
||||
pub struct GoogleSecuritySafebrowsingV4Checksum {
|
||||
/// The SHA256 hash of the client state; that is, of the sorted list of all hashes present in the database.
|
||||
|
||||
#[serde_as(as = "Option<::client::serde::standard_base64::Wrapper>")]
|
||||
pub sha256: Option<Vec<u8>>,
|
||||
}
|
||||
|
||||
impl client::Part for GoogleSecuritySafebrowsingV4Checksum {}
|
||||
|
||||
|
||||
/// The client metadata associated with Safe Browsing API requests.
|
||||
///
|
||||
/// This type is not used in any activity, and only used as *part* of another schema.
|
||||
///
|
||||
#[serde_with::serde_as(crate = "::client::serde_with")]
|
||||
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
|
||||
pub struct GoogleSecuritySafebrowsingV4ClientInfo {
|
||||
/// A client ID that (hopefully) uniquely identifies the client implementation of the Safe Browsing API.
|
||||
#[serde(rename="clientId")]
|
||||
|
||||
pub client_id: Option<String>,
|
||||
/// The version of the client implementation.
|
||||
#[serde(rename="clientVersion")]
|
||||
|
||||
pub client_version: Option<String>,
|
||||
}
|
||||
|
||||
impl client::Part for GoogleSecuritySafebrowsingV4ClientInfo {}
|
||||
|
||||
|
||||
/// Describes a Safe Browsing API update request. Clients can request updates for multiple lists in a single request. The server may not respond to all requests, if the server has no updates for that list. NOTE: Field index 2 is unused. NEXT: 5
|
||||
///
|
||||
/// # Activities
|
||||
///
|
||||
/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
|
||||
/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
|
||||
///
|
||||
/// * [fetch threat list updates](ThreatListUpdateFetchCall) (request)
|
||||
#[serde_with::serde_as(crate = "::client::serde_with")]
|
||||
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
|
||||
pub struct GoogleSecuritySafebrowsingV4FetchThreatListUpdatesRequest {
|
||||
/// The client metadata.
|
||||
|
||||
pub client: Option<GoogleSecuritySafebrowsingV4ClientInfo>,
|
||||
/// The requested threat list updates.
|
||||
#[serde(rename="listUpdateRequests")]
|
||||
|
||||
pub list_update_requests: Option<Vec<GoogleSecuritySafebrowsingV4FetchThreatListUpdatesRequestListUpdateRequest>>,
|
||||
}
|
||||
|
||||
impl client::RequestValue for GoogleSecuritySafebrowsingV4FetchThreatListUpdatesRequest {}
|
||||
|
||||
|
||||
/// A single list update request.
|
||||
///
|
||||
/// This type is not used in any activity, and only used as *part* of another schema.
|
||||
///
|
||||
#[serde_with::serde_as(crate = "::client::serde_with")]
|
||||
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
|
||||
pub struct GoogleSecuritySafebrowsingV4FetchThreatListUpdatesRequestListUpdateRequest {
|
||||
/// The constraints associated with this request.
|
||||
|
||||
pub constraints: Option<GoogleSecuritySafebrowsingV4FetchThreatListUpdatesRequestListUpdateRequestConstraints>,
|
||||
/// The type of platform at risk by entries present in the list.
|
||||
#[serde(rename="platformType")]
|
||||
|
||||
pub platform_type: Option<GoogleSecuritySafebrowsingV4FetchThreatListUpdatesRequestListUpdateRequestPlatformTypeEnum>,
|
||||
/// The current state of the client for the requested list (the encrypted client state that was received from the last successful list update).
|
||||
|
||||
#[serde_as(as = "Option<::client::serde::standard_base64::Wrapper>")]
|
||||
pub state: Option<Vec<u8>>,
|
||||
/// The types of entries present in the list.
|
||||
#[serde(rename="threatEntryType")]
|
||||
|
||||
pub threat_entry_type: Option<GoogleSecuritySafebrowsingV4FetchThreatListUpdatesRequestListUpdateRequestThreatEntryTypeEnum>,
|
||||
/// The type of threat posed by entries present in the list.
|
||||
#[serde(rename="threatType")]
|
||||
|
||||
pub threat_type: Option<GoogleSecuritySafebrowsingV4FetchThreatListUpdatesRequestListUpdateRequestThreatTypeEnum>,
|
||||
}
|
||||
|
||||
impl client::Part for GoogleSecuritySafebrowsingV4FetchThreatListUpdatesRequestListUpdateRequest {}
|
||||
|
||||
|
||||
/// The constraints for this update.
|
||||
///
|
||||
/// This type is not used in any activity, and only used as *part* of another schema.
|
||||
///
|
||||
#[serde_with::serde_as(crate = "::client::serde_with")]
|
||||
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
|
||||
pub struct GoogleSecuritySafebrowsingV4FetchThreatListUpdatesRequestListUpdateRequestConstraints {
|
||||
/// A client's physical location, expressed as a ISO 31166-1 alpha-2 region code.
|
||||
#[serde(rename="deviceLocation")]
|
||||
|
||||
pub device_location: Option<String>,
|
||||
/// Requests the lists for a specific language. Expects ISO 639 alpha-2 format.
|
||||
|
||||
pub language: Option<String>,
|
||||
/// Sets the maximum number of entries that the client is willing to have in the local database for the specified list. This should be a power of 2 between 2**10 and 2**20. If zero, no database size limit is set.
|
||||
#[serde(rename="maxDatabaseEntries")]
|
||||
|
||||
pub max_database_entries: Option<i32>,
|
||||
/// The maximum size in number of entries. The update will not contain more entries than this value. This should be a power of 2 between 2**10 and 2**20. If zero, no update size limit is set.
|
||||
#[serde(rename="maxUpdateEntries")]
|
||||
|
||||
pub max_update_entries: Option<i32>,
|
||||
/// Requests the list for a specific geographic location. If not set the server may pick that value based on the user's IP address. Expects ISO 3166-1 alpha-2 format.
|
||||
|
||||
pub region: Option<String>,
|
||||
/// The compression types supported by the client.
|
||||
#[serde(rename="supportedCompressions")]
|
||||
|
||||
pub supported_compressions: Option<Vec<GoogleSecuritySafebrowsingV4FetchThreatListUpdatesRequestListUpdateRequestConstraintSupportedCompressionsEnum>>,
|
||||
}
|
||||
|
||||
impl client::Part for GoogleSecuritySafebrowsingV4FetchThreatListUpdatesRequestListUpdateRequestConstraints {}
|
||||
|
||||
|
||||
/// There is no detailed description.
|
||||
///
|
||||
/// # Activities
|
||||
///
|
||||
/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
|
||||
/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
|
||||
///
|
||||
/// * [get encoded updates](EncodedUpdateGetCall) (response)
|
||||
/// * [fetch threat list updates](ThreatListUpdateFetchCall) (response)
|
||||
#[serde_with::serde_as(crate = "::client::serde_with")]
|
||||
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
|
||||
pub struct GoogleSecuritySafebrowsingV4FetchThreatListUpdatesResponse {
|
||||
/// The list updates requested by the clients. The number of responses here may be less than the number of requests sent by clients. This is the case, for example, if the server has no updates for a particular list.
|
||||
#[serde(rename="listUpdateResponses")]
|
||||
|
||||
pub list_update_responses: Option<Vec<GoogleSecuritySafebrowsingV4FetchThreatListUpdatesResponseListUpdateResponse>>,
|
||||
/// The minimum duration the client must wait before issuing any update request. If this field is not set clients may update as soon as they want.
|
||||
#[serde(rename="minimumWaitDuration")]
|
||||
|
||||
#[serde_as(as = "Option<::client::serde::duration::Wrapper>")]
|
||||
pub minimum_wait_duration: Option<client::chrono::Duration>,
|
||||
}
|
||||
|
||||
impl client::ResponseResult for GoogleSecuritySafebrowsingV4FetchThreatListUpdatesResponse {}
|
||||
|
||||
|
||||
/// An update to an individual list.
|
||||
///
|
||||
/// This type is not used in any activity, and only used as *part* of another schema.
|
||||
///
|
||||
#[serde_with::serde_as(crate = "::client::serde_with")]
|
||||
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
|
||||
pub struct GoogleSecuritySafebrowsingV4FetchThreatListUpdatesResponseListUpdateResponse {
|
||||
/// A set of entries to add to a local threat type's list. Repeated to allow for a combination of compressed and raw data to be sent in a single response.
|
||||
|
||||
pub additions: Option<Vec<GoogleSecuritySafebrowsingV4ThreatEntrySet>>,
|
||||
/// The expected SHA256 hash of the client state; that is, of the sorted list of all hashes present in the database after applying the provided update. If the client state doesn't match the expected state, the client must disregard this update and retry later.
|
||||
|
||||
pub checksum: Option<GoogleSecuritySafebrowsingV4Checksum>,
|
||||
/// The new client state, in encrypted format. Opaque to clients.
|
||||
#[serde(rename="newClientState")]
|
||||
|
||||
#[serde_as(as = "Option<::client::serde::standard_base64::Wrapper>")]
|
||||
pub new_client_state: Option<Vec<u8>>,
|
||||
/// The platform type for which data is returned.
|
||||
#[serde(rename="platformType")]
|
||||
|
||||
pub platform_type: Option<GoogleSecuritySafebrowsingV4FetchThreatListUpdatesResponseListUpdateResponsePlatformTypeEnum>,
|
||||
/// A set of entries to remove from a local threat type's list. In practice, this field is empty or contains exactly one ThreatEntrySet.
|
||||
|
||||
pub removals: Option<Vec<GoogleSecuritySafebrowsingV4ThreatEntrySet>>,
|
||||
/// The type of response. This may indicate that an action is required by the client when the response is received.
|
||||
#[serde(rename="responseType")]
|
||||
|
||||
pub response_type: Option<GoogleSecuritySafebrowsingV4FetchThreatListUpdatesResponseListUpdateResponseResponseTypeEnum>,
|
||||
/// The format of the threats.
|
||||
#[serde(rename="threatEntryType")]
|
||||
|
||||
pub threat_entry_type: Option<GoogleSecuritySafebrowsingV4FetchThreatListUpdatesResponseListUpdateResponseThreatEntryTypeEnum>,
|
||||
/// The threat type for which data is returned.
|
||||
#[serde(rename="threatType")]
|
||||
|
||||
pub threat_type: Option<GoogleSecuritySafebrowsingV4FetchThreatListUpdatesResponseListUpdateResponseThreatTypeEnum>,
|
||||
}
|
||||
|
||||
impl client::Part for GoogleSecuritySafebrowsingV4FetchThreatListUpdatesResponseListUpdateResponse {}
|
||||
|
||||
|
||||
/// Request to return full hashes matched by the provided hash prefixes.
|
||||
///
|
||||
/// # Activities
|
||||
///
|
||||
/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
|
||||
/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
|
||||
///
|
||||
/// * [find full hashes](FullHashFindCall) (request)
|
||||
#[serde_with::serde_as(crate = "::client::serde_with")]
|
||||
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
|
||||
pub struct GoogleSecuritySafebrowsingV4FindFullHashesRequest {
|
||||
/// Client metadata associated with callers of higher-level APIs built on top of the client's implementation.
|
||||
#[serde(rename="apiClient")]
|
||||
|
||||
pub api_client: Option<GoogleSecuritySafebrowsingV4ClientInfo>,
|
||||
/// The client metadata.
|
||||
|
||||
pub client: Option<GoogleSecuritySafebrowsingV4ClientInfo>,
|
||||
/// The current client states for each of the client's local threat lists.
|
||||
#[serde(rename="clientStates")]
|
||||
|
||||
#[serde_as(as = "Option<Vec<::client::serde::standard_base64::Wrapper>>")]
|
||||
pub client_states: Option<Vec<Vec<u8>>>,
|
||||
/// The lists and hashes to be checked.
|
||||
#[serde(rename="threatInfo")]
|
||||
|
||||
pub threat_info: Option<GoogleSecuritySafebrowsingV4ThreatInfo>,
|
||||
}
|
||||
|
||||
impl client::RequestValue for GoogleSecuritySafebrowsingV4FindFullHashesRequest {}
|
||||
|
||||
|
||||
/// There is no detailed description.
|
||||
///
|
||||
/// # Activities
|
||||
///
|
||||
/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
|
||||
/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
|
||||
///
|
||||
/// * [get encoded full hashes](EncodedFullHashGetCall) (response)
|
||||
/// * [find full hashes](FullHashFindCall) (response)
|
||||
#[serde_with::serde_as(crate = "::client::serde_with")]
|
||||
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
|
||||
pub struct GoogleSecuritySafebrowsingV4FindFullHashesResponse {
|
||||
/// The full hashes that matched the requested prefixes.
|
||||
|
||||
pub matches: Option<Vec<GoogleSecuritySafebrowsingV4ThreatMatch>>,
|
||||
/// The minimum duration the client must wait before issuing any find hashes request. If this field is not set, clients can issue a request as soon as they want.
|
||||
#[serde(rename="minimumWaitDuration")]
|
||||
|
||||
#[serde_as(as = "Option<::client::serde::duration::Wrapper>")]
|
||||
pub minimum_wait_duration: Option<client::chrono::Duration>,
|
||||
/// For requested entities that did not match the threat list, how long to cache the response.
|
||||
#[serde(rename="negativeCacheDuration")]
|
||||
|
||||
#[serde_as(as = "Option<::client::serde::duration::Wrapper>")]
|
||||
pub negative_cache_duration: Option<client::chrono::Duration>,
|
||||
}
|
||||
|
||||
impl client::ResponseResult for GoogleSecuritySafebrowsingV4FindFullHashesResponse {}
|
||||
|
||||
|
||||
/// Request to check entries against lists.
|
||||
///
|
||||
/// # Activities
|
||||
///
|
||||
/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
|
||||
/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
|
||||
///
|
||||
/// * [find threat matches](ThreatMatchFindCall) (request)
|
||||
#[serde_with::serde_as(crate = "::client::serde_with")]
|
||||
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
|
||||
pub struct GoogleSecuritySafebrowsingV4FindThreatMatchesRequest {
|
||||
/// The client metadata.
|
||||
|
||||
pub client: Option<GoogleSecuritySafebrowsingV4ClientInfo>,
|
||||
/// The lists and entries to be checked for matches.
|
||||
#[serde(rename="threatInfo")]
|
||||
|
||||
pub threat_info: Option<GoogleSecuritySafebrowsingV4ThreatInfo>,
|
||||
}
|
||||
|
||||
impl client::RequestValue for GoogleSecuritySafebrowsingV4FindThreatMatchesRequest {}
|
||||
|
||||
|
||||
/// There is no detailed description.
|
||||
///
|
||||
/// # Activities
|
||||
///
|
||||
/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
|
||||
/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
|
||||
///
|
||||
/// * [find threat matches](ThreatMatchFindCall) (response)
|
||||
#[serde_with::serde_as(crate = "::client::serde_with")]
|
||||
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
|
||||
pub struct GoogleSecuritySafebrowsingV4FindThreatMatchesResponse {
|
||||
/// The threat list matches.
|
||||
|
||||
pub matches: Option<Vec<GoogleSecuritySafebrowsingV4ThreatMatch>>,
|
||||
}
|
||||
|
||||
impl client::ResponseResult for GoogleSecuritySafebrowsingV4FindThreatMatchesResponse {}
|
||||
|
||||
|
||||
/// There is no detailed description.
|
||||
///
|
||||
/// # Activities
|
||||
///
|
||||
/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
|
||||
/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
|
||||
///
|
||||
/// * [list threat lists](ThreatListListCall) (response)
|
||||
#[serde_with::serde_as(crate = "::client::serde_with")]
|
||||
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
|
||||
pub struct GoogleSecuritySafebrowsingV4ListThreatListsResponse {
|
||||
/// The lists available for download by the client.
|
||||
#[serde(rename="threatLists")]
|
||||
|
||||
pub threat_lists: Option<Vec<GoogleSecuritySafebrowsingV4ThreatListDescriptor>>,
|
||||
}
|
||||
|
||||
impl client::ResponseResult for GoogleSecuritySafebrowsingV4ListThreatListsResponse {}
|
||||
|
||||
|
||||
/// The uncompressed threat entries in hash format of a particular prefix length. Hashes can be anywhere from 4 to 32 bytes in size. A large majority are 4 bytes, but some hashes are lengthened if they collide with the hash of a popular URL. Used for sending ThreatEntrySet to clients that do not support compression, or when sending non-4-byte hashes to clients that do support compression.
|
||||
///
|
||||
/// This type is not used in any activity, and only used as *part* of another schema.
|
||||
///
|
||||
#[serde_with::serde_as(crate = "::client::serde_with")]
|
||||
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
|
||||
pub struct GoogleSecuritySafebrowsingV4RawHashes {
|
||||
/// The number of bytes for each prefix encoded below. This field can be anywhere from 4 (shortest prefix) to 32 (full SHA256 hash).
|
||||
#[serde(rename="prefixSize")]
|
||||
|
||||
pub prefix_size: Option<i32>,
|
||||
/// The hashes, in binary format, concatenated into one long string. Hashes are sorted in lexicographic order. For JSON API users, hashes are base64-encoded.
|
||||
#[serde(rename="rawHashes")]
|
||||
|
||||
#[serde_as(as = "Option<::client::serde::standard_base64::Wrapper>")]
|
||||
pub raw_hashes: Option<Vec<u8>>,
|
||||
}
|
||||
|
||||
impl client::Part for GoogleSecuritySafebrowsingV4RawHashes {}
|
||||
|
||||
|
||||
/// A set of raw indices to remove from a local list.
|
||||
///
|
||||
/// This type is not used in any activity, and only used as *part* of another schema.
|
||||
///
|
||||
#[serde_with::serde_as(crate = "::client::serde_with")]
|
||||
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
|
||||
pub struct GoogleSecuritySafebrowsingV4RawIndices {
|
||||
/// The indices to remove from a lexicographically-sorted local list.
|
||||
|
||||
pub indices: Option<Vec<i32>>,
|
||||
}
|
||||
|
||||
impl client::Part for GoogleSecuritySafebrowsingV4RawIndices {}
|
||||
|
||||
|
||||
/// The Rice-Golomb encoded data. Used for sending compressed 4-byte hashes or compressed removal indices.
|
||||
///
|
||||
/// This type is not used in any activity, and only used as *part* of another schema.
|
||||
///
|
||||
#[serde_with::serde_as(crate = "::client::serde_with")]
|
||||
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
|
||||
pub struct GoogleSecuritySafebrowsingV4RiceDeltaEncoding {
|
||||
/// The encoded deltas that are encoded using the Golomb-Rice coder.
|
||||
#[serde(rename="encodedData")]
|
||||
|
||||
#[serde_as(as = "Option<::client::serde::standard_base64::Wrapper>")]
|
||||
pub encoded_data: Option<Vec<u8>>,
|
||||
/// The offset of the first entry in the encoded data, or, if only a single integer was encoded, that single integer's value. If the field is empty or missing, assume zero.
|
||||
#[serde(rename="firstValue")]
|
||||
|
||||
#[serde_as(as = "Option<::client::serde_with::DisplayFromStr>")]
|
||||
pub first_value: Option<i64>,
|
||||
/// The number of entries that are delta encoded in the encoded data. If only a single integer was encoded, this will be zero and the single value will be stored in `first_value`.
|
||||
#[serde(rename="numEntries")]
|
||||
|
||||
pub num_entries: Option<i32>,
|
||||
/// The Golomb-Rice parameter, which is a number between 2 and 28. This field is missing (that is, zero) if `num_entries` is zero.
|
||||
#[serde(rename="riceParameter")]
|
||||
|
||||
pub rice_parameter: Option<i32>,
|
||||
}
|
||||
|
||||
impl client::Part for GoogleSecuritySafebrowsingV4RiceDeltaEncoding {}
|
||||
|
||||
|
||||
/// An individual threat; for example, a malicious URL or its hash representation. Only one of these fields should be set.
|
||||
///
|
||||
/// This type is not used in any activity, and only used as *part* of another schema.
|
||||
///
|
||||
#[serde_with::serde_as(crate = "::client::serde_with")]
|
||||
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
|
||||
pub struct GoogleSecuritySafebrowsingV4ThreatEntry {
|
||||
/// The digest of an executable in SHA256 format. The API supports both binary and hex digests. For JSON requests, digests are base64-encoded.
|
||||
|
||||
#[serde_as(as = "Option<::client::serde::standard_base64::Wrapper>")]
|
||||
pub digest: Option<Vec<u8>>,
|
||||
/// A hash prefix, consisting of the most significant 4-32 bytes of a SHA256 hash. This field is in binary format. For JSON requests, hashes are base64-encoded.
|
||||
|
||||
#[serde_as(as = "Option<::client::serde::standard_base64::Wrapper>")]
|
||||
pub hash: Option<Vec<u8>>,
|
||||
/// A URL.
|
||||
|
||||
pub url: Option<String>,
|
||||
}
|
||||
|
||||
impl client::Part for GoogleSecuritySafebrowsingV4ThreatEntry {}
|
||||
|
||||
|
||||
/// The metadata associated with a specific threat entry. The client is expected to know the metadata key/value pairs associated with each threat type.
|
||||
///
|
||||
/// This type is not used in any activity, and only used as *part* of another schema.
|
||||
///
|
||||
#[serde_with::serde_as(crate = "::client::serde_with")]
|
||||
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
|
||||
pub struct GoogleSecuritySafebrowsingV4ThreatEntryMetadata {
|
||||
/// The metadata entries.
|
||||
|
||||
pub entries: Option<Vec<GoogleSecuritySafebrowsingV4ThreatEntryMetadataMetadataEntry>>,
|
||||
}
|
||||
|
||||
impl client::Part for GoogleSecuritySafebrowsingV4ThreatEntryMetadata {}
|
||||
|
||||
|
||||
/// A single metadata entry.
|
||||
///
|
||||
/// This type is not used in any activity, and only used as *part* of another schema.
|
||||
///
|
||||
#[serde_with::serde_as(crate = "::client::serde_with")]
|
||||
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
|
||||
pub struct GoogleSecuritySafebrowsingV4ThreatEntryMetadataMetadataEntry {
|
||||
/// The metadata entry key. For JSON requests, the key is base64-encoded.
|
||||
|
||||
#[serde_as(as = "Option<::client::serde::standard_base64::Wrapper>")]
|
||||
pub key: Option<Vec<u8>>,
|
||||
/// The metadata entry value. For JSON requests, the value is base64-encoded.
|
||||
|
||||
#[serde_as(as = "Option<::client::serde::standard_base64::Wrapper>")]
|
||||
pub value: Option<Vec<u8>>,
|
||||
}
|
||||
|
||||
impl client::Part for GoogleSecuritySafebrowsingV4ThreatEntryMetadataMetadataEntry {}
|
||||
|
||||
|
||||
/// A set of threats that should be added or removed from a client's local database.
|
||||
///
|
||||
/// This type is not used in any activity, and only used as *part* of another schema.
|
||||
///
|
||||
#[serde_with::serde_as(crate = "::client::serde_with")]
|
||||
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
|
||||
pub struct GoogleSecuritySafebrowsingV4ThreatEntrySet {
|
||||
/// The compression type for the entries in this set.
|
||||
#[serde(rename="compressionType")]
|
||||
|
||||
pub compression_type: Option<GoogleSecuritySafebrowsingV4ThreatEntrySetCompressionTypeEnum>,
|
||||
/// The raw SHA256-formatted entries.
|
||||
#[serde(rename="rawHashes")]
|
||||
|
||||
pub raw_hashes: Option<GoogleSecuritySafebrowsingV4RawHashes>,
|
||||
/// The raw removal indices for a local list.
|
||||
#[serde(rename="rawIndices")]
|
||||
|
||||
pub raw_indices: Option<GoogleSecuritySafebrowsingV4RawIndices>,
|
||||
/// The encoded 4-byte prefixes of SHA256-formatted entries, using a Golomb-Rice encoding. The hashes are converted to uint32, sorted in ascending order, then delta encoded and stored as encoded_data.
|
||||
#[serde(rename="riceHashes")]
|
||||
|
||||
pub rice_hashes: Option<GoogleSecuritySafebrowsingV4RiceDeltaEncoding>,
|
||||
/// The encoded local, lexicographically-sorted list indices, using a Golomb-Rice encoding. Used for sending compressed removal indices. The removal indices (uint32) are sorted in ascending order, then delta encoded and stored as encoded_data.
|
||||
#[serde(rename="riceIndices")]
|
||||
|
||||
pub rice_indices: Option<GoogleSecuritySafebrowsingV4RiceDeltaEncoding>,
|
||||
}
|
||||
|
||||
impl client::Part for GoogleSecuritySafebrowsingV4ThreatEntrySet {}
|
||||
|
||||
|
||||
/// There is no detailed description.
|
||||
///
|
||||
/// # Activities
|
||||
///
|
||||
/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
|
||||
/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
|
||||
///
|
||||
/// * [create threat hits](ThreatHitCreateCall) (request)
|
||||
#[serde_with::serde_as(crate = "::client::serde_with")]
|
||||
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
|
||||
pub struct GoogleSecuritySafebrowsingV4ThreatHit {
|
||||
/// Client-reported identification.
|
||||
#[serde(rename="clientInfo")]
|
||||
|
||||
pub client_info: Option<GoogleSecuritySafebrowsingV4ClientInfo>,
|
||||
/// The threat entry responsible for the hit. Full hash should be reported for hash-based hits.
|
||||
|
||||
pub entry: Option<GoogleSecuritySafebrowsingV4ThreatEntry>,
|
||||
/// The platform type reported.
|
||||
#[serde(rename="platformType")]
|
||||
|
||||
pub platform_type: Option<GoogleSecuritySafebrowsingV4ThreatHitPlatformTypeEnum>,
|
||||
/// The resources related to the threat hit.
|
||||
|
||||
pub resources: Option<Vec<GoogleSecuritySafebrowsingV4ThreatHitThreatSource>>,
|
||||
/// The threat type reported.
|
||||
#[serde(rename="threatType")]
|
||||
|
||||
pub threat_type: Option<GoogleSecuritySafebrowsingV4ThreatHitThreatTypeEnum>,
|
||||
/// Details about the user that encountered the threat.
|
||||
#[serde(rename="userInfo")]
|
||||
|
||||
pub user_info: Option<GoogleSecuritySafebrowsingV4ThreatHitUserInfo>,
|
||||
}
|
||||
|
||||
impl client::RequestValue for GoogleSecuritySafebrowsingV4ThreatHit {}
|
||||
|
||||
|
||||
/// A single resource related to a threat hit.
|
||||
///
|
||||
/// This type is not used in any activity, and only used as *part* of another schema.
|
||||
///
|
||||
#[serde_with::serde_as(crate = "::client::serde_with")]
|
||||
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
|
||||
pub struct GoogleSecuritySafebrowsingV4ThreatHitThreatSource {
|
||||
/// Referrer of the resource. Only set if the referrer is available.
|
||||
|
||||
pub referrer: Option<String>,
|
||||
/// The remote IP of the resource in ASCII format. Either IPv4 or IPv6.
|
||||
#[serde(rename="remoteIp")]
|
||||
|
||||
pub remote_ip: Option<String>,
|
||||
/// The type of source reported.
|
||||
#[serde(rename="type")]
|
||||
|
||||
pub type_: Option<GoogleSecuritySafebrowsingV4ThreatHitThreatSourceTypeEnum>,
|
||||
/// The URL of the resource.
|
||||
|
||||
pub url: Option<String>,
|
||||
}
|
||||
|
||||
impl client::Part for GoogleSecuritySafebrowsingV4ThreatHitThreatSource {}
|
||||
|
||||
|
||||
/// Details about the user that encountered the threat.
|
||||
///
|
||||
/// This type is not used in any activity, and only used as *part* of another schema.
|
||||
///
|
||||
#[serde_with::serde_as(crate = "::client::serde_with")]
|
||||
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
|
||||
pub struct GoogleSecuritySafebrowsingV4ThreatHitUserInfo {
|
||||
/// The UN M.49 region code associated with the user's location.
|
||||
#[serde(rename="regionCode")]
|
||||
|
||||
pub region_code: Option<String>,
|
||||
/// Unique user identifier defined by the client.
|
||||
#[serde(rename="userId")]
|
||||
|
||||
#[serde_as(as = "Option<::client::serde::standard_base64::Wrapper>")]
|
||||
pub user_id: Option<Vec<u8>>,
|
||||
}
|
||||
|
||||
impl client::Part for GoogleSecuritySafebrowsingV4ThreatHitUserInfo {}
|
||||
|
||||
|
||||
/// The information regarding one or more threats that a client submits when checking for matches in threat lists.
|
||||
///
|
||||
/// This type is not used in any activity, and only used as *part* of another schema.
|
||||
///
|
||||
#[serde_with::serde_as(crate = "::client::serde_with")]
|
||||
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
|
||||
pub struct GoogleSecuritySafebrowsingV4ThreatInfo {
|
||||
/// The platform types to be checked.
|
||||
#[serde(rename="platformTypes")]
|
||||
|
||||
pub platform_types: Option<Vec<GoogleSecuritySafebrowsingV4ThreatInfoPlatformTypesEnum>>,
|
||||
/// The threat entries to be checked.
|
||||
#[serde(rename="threatEntries")]
|
||||
|
||||
pub threat_entries: Option<Vec<GoogleSecuritySafebrowsingV4ThreatEntry>>,
|
||||
/// The entry types to be checked.
|
||||
#[serde(rename="threatEntryTypes")]
|
||||
|
||||
pub threat_entry_types: Option<Vec<GoogleSecuritySafebrowsingV4ThreatInfoThreatEntryTypesEnum>>,
|
||||
/// The threat types to be checked.
|
||||
#[serde(rename="threatTypes")]
|
||||
|
||||
pub threat_types: Option<Vec<GoogleSecuritySafebrowsingV4ThreatInfoThreatTypesEnum>>,
|
||||
}
|
||||
|
||||
impl client::Part for GoogleSecuritySafebrowsingV4ThreatInfo {}
|
||||
|
||||
|
||||
/// Describes an individual threat list. A list is defined by three parameters: the type of threat posed, the type of platform targeted by the threat, and the type of entries in the list.
|
||||
///
|
||||
/// This type is not used in any activity, and only used as *part* of another schema.
|
||||
///
|
||||
#[serde_with::serde_as(crate = "::client::serde_with")]
|
||||
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
|
||||
pub struct GoogleSecuritySafebrowsingV4ThreatListDescriptor {
|
||||
/// The platform type targeted by the list's entries.
|
||||
#[serde(rename="platformType")]
|
||||
|
||||
pub platform_type: Option<GoogleSecuritySafebrowsingV4ThreatListDescriptorPlatformTypeEnum>,
|
||||
/// The entry types contained in the list.
|
||||
#[serde(rename="threatEntryType")]
|
||||
|
||||
pub threat_entry_type: Option<GoogleSecuritySafebrowsingV4ThreatListDescriptorThreatEntryTypeEnum>,
|
||||
/// The threat type posed by the list's entries.
|
||||
#[serde(rename="threatType")]
|
||||
|
||||
pub threat_type: Option<GoogleSecuritySafebrowsingV4ThreatListDescriptorThreatTypeEnum>,
|
||||
}
|
||||
|
||||
impl client::Part for GoogleSecuritySafebrowsingV4ThreatListDescriptor {}
|
||||
|
||||
|
||||
/// A match when checking a threat entry in the Safe Browsing threat lists.
|
||||
///
|
||||
/// This type is not used in any activity, and only used as *part* of another schema.
|
||||
///
|
||||
#[serde_with::serde_as(crate = "::client::serde_with")]
|
||||
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
|
||||
pub struct GoogleSecuritySafebrowsingV4ThreatMatch {
|
||||
/// The cache lifetime for the returned match. Clients must not cache this response for more than this duration to avoid false positives.
|
||||
#[serde(rename="cacheDuration")]
|
||||
|
||||
#[serde_as(as = "Option<::client::serde::duration::Wrapper>")]
|
||||
pub cache_duration: Option<client::chrono::Duration>,
|
||||
/// The platform type matching this threat.
|
||||
#[serde(rename="platformType")]
|
||||
|
||||
pub platform_type: Option<GoogleSecuritySafebrowsingV4ThreatMatchPlatformTypeEnum>,
|
||||
/// The threat matching this threat.
|
||||
|
||||
pub threat: Option<GoogleSecuritySafebrowsingV4ThreatEntry>,
|
||||
/// Optional metadata associated with this threat.
|
||||
#[serde(rename="threatEntryMetadata")]
|
||||
|
||||
pub threat_entry_metadata: Option<GoogleSecuritySafebrowsingV4ThreatEntryMetadata>,
|
||||
/// The threat entry type matching this threat.
|
||||
#[serde(rename="threatEntryType")]
|
||||
|
||||
pub threat_entry_type: Option<GoogleSecuritySafebrowsingV4ThreatMatchThreatEntryTypeEnum>,
|
||||
/// The threat type matching this threat.
|
||||
#[serde(rename="threatType")]
|
||||
|
||||
pub threat_type: Option<GoogleSecuritySafebrowsingV4ThreatMatchThreatTypeEnum>,
|
||||
}
|
||||
|
||||
impl client::Part for GoogleSecuritySafebrowsingV4ThreatMatch {}
|
||||
|
||||
|
||||
2
gen/safebrowsing4/src/api/utilities.rs
Normal file
2
gen/safebrowsing4/src/api/utilities.rs
Normal file
@@ -0,0 +1,2 @@
|
||||
use super::*;
|
||||
|
||||
@@ -2,14 +2,14 @@
|
||||
// This file was generated automatically from 'src/generator/templates/api/lib.rs.mako'
|
||||
// DO NOT EDIT !
|
||||
|
||||
//! This documentation was generated from *Safebrowsing* crate version *5.0.4+20240225*, where *20240225* is the exact revision of the *safebrowsing:v4* schema built by the [mako](http://www.makotemplates.org/) code generator *v5.0.4*.
|
||||
//! This documentation was generated from *Safebrowsing* crate version *5.0.5+20240414*, where *20240414* is the exact revision of the *safebrowsing:v4* schema built by the [mako](http://www.makotemplates.org/) code generator *v5.0.5*.
|
||||
//!
|
||||
//! Everything else about the *Safebrowsing* *v4* API can be found at the
|
||||
//! [official documentation site](https://developers.google.com/safe-browsing/).
|
||||
//! The original source code is [on github](https://github.com/Byron/google-apis-rs/tree/main/gen/safebrowsing4).
|
||||
//! # Features
|
||||
//!
|
||||
//! Handle the following *Resources* with ease from the central [hub](Safebrowsing) ...
|
||||
//! Handle the following *Resources* with ease from the central [hub](Safebrowsing) ...
|
||||
//!
|
||||
//! * encoded full hashes
|
||||
//! * [*get*](api::EncodedFullHashGetCall)
|
||||
@@ -63,8 +63,8 @@
|
||||
//! let r = hub.full_hashes().find(...).doit().await
|
||||
//! ```
|
||||
//!
|
||||
//! The `resource()` and `activity(...)` calls create [builders][builder-pattern]. The second one dealing with `Activities`
|
||||
//! supports various methods to configure the impending operation (not shown here). It is made such that all required arguments have to be
|
||||
//! The `resource()` and `activity(...)` calls create [builders][builder-pattern]. The second one dealing with `Activities`
|
||||
//! supports various methods to configure the impending operation (not shown here). It is made such that all required arguments have to be
|
||||
//! specified right away (i.e. `(...)`), whereas all optional ones can be [build up][builder-pattern] as desired.
|
||||
//! The `doit()` method performs the actual communication with the server and returns the respective result.
|
||||
//!
|
||||
@@ -88,23 +88,24 @@
|
||||
//! extern crate hyper_rustls;
|
||||
//! extern crate google_safebrowsing4 as safebrowsing4;
|
||||
//! use safebrowsing4::{Result, Error};
|
||||
//! use safebrowsing4::api::enums::*;
|
||||
//! # async fn dox() {
|
||||
//! use std::default::Default;
|
||||
//! use safebrowsing4::{Safebrowsing, oauth2, hyper, hyper_rustls, chrono, FieldMask};
|
||||
//!
|
||||
//! // Get an ApplicationSecret instance by some means. It contains the `client_id` and
|
||||
//! // Get an ApplicationSecret instance by some means. It contains the `client_id` and
|
||||
//! // `client_secret`, among other things.
|
||||
//! let secret: oauth2::ApplicationSecret = Default::default();
|
||||
//! // Instantiate the authenticator. It will choose a suitable authentication flow for you,
|
||||
//! // Instantiate the authenticator. It will choose a suitable authentication flow for you,
|
||||
//! // unless you replace `None` with the desired Flow.
|
||||
//! // Provide your own `AuthenticatorDelegate` to adjust the way it operates and get feedback about
|
||||
//! // Provide your own `AuthenticatorDelegate` to adjust the way it operates and get feedback about
|
||||
//! // what's going on. You probably want to bring in your own `TokenStorage` to persist tokens and
|
||||
//! // retrieve them from storage.
|
||||
//! let auth = oauth2::InstalledFlowAuthenticator::builder(
|
||||
//! secret,
|
||||
//! oauth2::InstalledFlowReturnMethod::HTTPRedirect,
|
||||
//! ).build().await.unwrap();
|
||||
//! let mut hub = Safebrowsing::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().https_or_http().enable_http1().build()), auth);
|
||||
//! let mut hub = Safebrowsing::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().unwrap().https_or_http().enable_http1().build()), auth);
|
||||
//! // You can configure optional parameters by calling the respective setters at will, and
|
||||
//! // execute the final call using `doit()`.
|
||||
//! // Values shown here are possibly random and not representative !
|
||||
@@ -135,10 +136,10 @@
|
||||
//! ## Handling Errors
|
||||
//!
|
||||
//! All errors produced by the system are provided either as [Result](client::Result) enumeration as return value of
|
||||
//! the doit() methods, or handed as possibly intermediate results to either the
|
||||
//! the doit() methods, or handed as possibly intermediate results to either the
|
||||
//! [Hub Delegate](client::Delegate), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html).
|
||||
//!
|
||||
//! When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This
|
||||
//! When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This
|
||||
//! makes the system potentially resilient to all kinds of errors.
|
||||
//!
|
||||
//! ## Uploads and Downloads
|
||||
@@ -148,25 +149,25 @@
|
||||
//! You can see it as meta-data for the actual media. To trigger a media download, you will have to set up the builder by making
|
||||
//! this call: `.param("alt", "media")`.
|
||||
//!
|
||||
//! Methods supporting uploads can do so using up to 2 different protocols:
|
||||
//! *simple* and *resumable*. The distinctiveness of each is represented by customized
|
||||
//! Methods supporting uploads can do so using up to 2 different protocols:
|
||||
//! *simple* and *resumable*. The distinctiveness of each is represented by customized
|
||||
//! `doit(...)` methods, which are then named `upload(...)` and `upload_resumable(...)` respectively.
|
||||
//!
|
||||
//! ## Customization and Callbacks
|
||||
//!
|
||||
//! You may alter the way an `doit()` method is called by providing a [delegate](client::Delegate) to the
|
||||
//! [Method Builder](client::CallBuilder) before making the final `doit()` call.
|
||||
//! Respective methods will be called to provide progress information, as well as determine whether the system should
|
||||
//! You may alter the way an `doit()` method is called by providing a [delegate](client::Delegate) to the
|
||||
//! [Method Builder](client::CallBuilder) before making the final `doit()` call.
|
||||
//! Respective methods will be called to provide progress information, as well as determine whether the system should
|
||||
//! retry on failure.
|
||||
//!
|
||||
//! The [delegate trait](client::Delegate) is default-implemented, allowing you to customize it with minimal effort.
|
||||
//!
|
||||
//! ## Optional Parts in Server-Requests
|
||||
//!
|
||||
//! All structures provided by this library are made to be [encodable](client::RequestValue) and
|
||||
//! [decodable](client::ResponseResult) via *json*. Optionals are used to indicate that partial requests are responses
|
||||
//! All structures provided by this library are made to be [encodable](client::RequestValue) and
|
||||
//! [decodable](client::ResponseResult) via *json*. Optionals are used to indicate that partial requests are responses
|
||||
//! are valid.
|
||||
//! Most optionals are are considered [Parts](client::Part) which are identifiable by name, which will be sent to
|
||||
//! Most optionals are are considered [Parts](client::Part) which are identifiable by name, which will be sent to
|
||||
//! the server to indicate either the set parts of the request or the desired parts in the response.
|
||||
//!
|
||||
//! ## Builder Arguments
|
||||
|
||||
Reference in New Issue
Block a user