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-analyticsdata1_beta"
|
||||
version = "5.0.4+20240304"
|
||||
version = "5.0.5+20240417"
|
||||
authors = ["Sebastian Thiel <byronimo@gmail.com>"]
|
||||
description = "A complete library to interact with AnalyticsData (protocol v1beta)"
|
||||
repository = "https://github.com/Byron/google-apis-rs/tree/main/gen/analyticsdata1_beta"
|
||||
homepage = "https://developers.google.com/analytics/devguides/reporting/data/v1/"
|
||||
documentation = "https://docs.rs/google-analyticsdata1_beta/5.0.4+20240304"
|
||||
documentation = "https://docs.rs/google-analyticsdata1_beta/5.0.5+20240417"
|
||||
license = "MIT"
|
||||
keywords = ["analyticsdata", "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,16 +5,16 @@ DO NOT EDIT !
|
||||
-->
|
||||
The `google-analyticsdata1_beta` library allows access to all features of the *Google AnalyticsData* service.
|
||||
|
||||
This documentation was generated from *AnalyticsData* crate version *5.0.4+20240304*, where *20240304* is the exact revision of the *analyticsdata:v1beta* schema built by the [mako](http://www.makotemplates.org/) code generator *v5.0.4*.
|
||||
This documentation was generated from *AnalyticsData* crate version *5.0.5+20240417*, where *20240417* is the exact revision of the *analyticsdata:v1beta* schema built by the [mako](http://www.makotemplates.org/) code generator *v5.0.5*.
|
||||
|
||||
Everything else about the *AnalyticsData* *v1_beta* API can be found at the
|
||||
[official documentation site](https://developers.google.com/analytics/devguides/reporting/data/v1/).
|
||||
# Features
|
||||
|
||||
Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-analyticsdata1_beta/5.0.4+20240304/google_analyticsdata1_beta/AnalyticsData) ...
|
||||
Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-analyticsdata1_beta/5.0.5+20240417/google_analyticsdata1_beta/AnalyticsData) ...
|
||||
|
||||
* properties
|
||||
* [*audience exports create*](https://docs.rs/google-analyticsdata1_beta/5.0.4+20240304/google_analyticsdata1_beta/api::PropertyAudienceExportCreateCall), [*audience exports get*](https://docs.rs/google-analyticsdata1_beta/5.0.4+20240304/google_analyticsdata1_beta/api::PropertyAudienceExportGetCall), [*audience exports list*](https://docs.rs/google-analyticsdata1_beta/5.0.4+20240304/google_analyticsdata1_beta/api::PropertyAudienceExportListCall), [*audience exports query*](https://docs.rs/google-analyticsdata1_beta/5.0.4+20240304/google_analyticsdata1_beta/api::PropertyAudienceExportQueryCall), [*batch run pivot reports*](https://docs.rs/google-analyticsdata1_beta/5.0.4+20240304/google_analyticsdata1_beta/api::PropertyBatchRunPivotReportCall), [*batch run reports*](https://docs.rs/google-analyticsdata1_beta/5.0.4+20240304/google_analyticsdata1_beta/api::PropertyBatchRunReportCall), [*check compatibility*](https://docs.rs/google-analyticsdata1_beta/5.0.4+20240304/google_analyticsdata1_beta/api::PropertyCheckCompatibilityCall), [*get metadata*](https://docs.rs/google-analyticsdata1_beta/5.0.4+20240304/google_analyticsdata1_beta/api::PropertyGetMetadataCall), [*run pivot report*](https://docs.rs/google-analyticsdata1_beta/5.0.4+20240304/google_analyticsdata1_beta/api::PropertyRunPivotReportCall), [*run realtime report*](https://docs.rs/google-analyticsdata1_beta/5.0.4+20240304/google_analyticsdata1_beta/api::PropertyRunRealtimeReportCall) and [*run report*](https://docs.rs/google-analyticsdata1_beta/5.0.4+20240304/google_analyticsdata1_beta/api::PropertyRunReportCall)
|
||||
* [*audience exports create*](https://docs.rs/google-analyticsdata1_beta/5.0.5+20240417/google_analyticsdata1_beta/api::PropertyAudienceExportCreateCall), [*audience exports get*](https://docs.rs/google-analyticsdata1_beta/5.0.5+20240417/google_analyticsdata1_beta/api::PropertyAudienceExportGetCall), [*audience exports list*](https://docs.rs/google-analyticsdata1_beta/5.0.5+20240417/google_analyticsdata1_beta/api::PropertyAudienceExportListCall), [*audience exports query*](https://docs.rs/google-analyticsdata1_beta/5.0.5+20240417/google_analyticsdata1_beta/api::PropertyAudienceExportQueryCall), [*batch run pivot reports*](https://docs.rs/google-analyticsdata1_beta/5.0.5+20240417/google_analyticsdata1_beta/api::PropertyBatchRunPivotReportCall), [*batch run reports*](https://docs.rs/google-analyticsdata1_beta/5.0.5+20240417/google_analyticsdata1_beta/api::PropertyBatchRunReportCall), [*check compatibility*](https://docs.rs/google-analyticsdata1_beta/5.0.5+20240417/google_analyticsdata1_beta/api::PropertyCheckCompatibilityCall), [*get metadata*](https://docs.rs/google-analyticsdata1_beta/5.0.5+20240417/google_analyticsdata1_beta/api::PropertyGetMetadataCall), [*run pivot report*](https://docs.rs/google-analyticsdata1_beta/5.0.5+20240417/google_analyticsdata1_beta/api::PropertyRunPivotReportCall), [*run realtime report*](https://docs.rs/google-analyticsdata1_beta/5.0.5+20240417/google_analyticsdata1_beta/api::PropertyRunRealtimeReportCall) and [*run report*](https://docs.rs/google-analyticsdata1_beta/5.0.5+20240417/google_analyticsdata1_beta/api::PropertyRunReportCall)
|
||||
|
||||
|
||||
|
||||
@@ -23,17 +23,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-analyticsdata1_beta/5.0.4+20240304/google_analyticsdata1_beta/AnalyticsData)**
|
||||
* **[Hub](https://docs.rs/google-analyticsdata1_beta/5.0.5+20240417/google_analyticsdata1_beta/AnalyticsData)**
|
||||
* a central object to maintain state and allow accessing all *Activities*
|
||||
* creates [*Method Builders*](https://docs.rs/google-analyticsdata1_beta/5.0.4+20240304/google_analyticsdata1_beta/client::MethodsBuilder) which in turn
|
||||
allow access to individual [*Call Builders*](https://docs.rs/google-analyticsdata1_beta/5.0.4+20240304/google_analyticsdata1_beta/client::CallBuilder)
|
||||
* **[Resources](https://docs.rs/google-analyticsdata1_beta/5.0.4+20240304/google_analyticsdata1_beta/client::Resource)**
|
||||
* creates [*Method Builders*](https://docs.rs/google-analyticsdata1_beta/5.0.5+20240417/google_analyticsdata1_beta/client::MethodsBuilder) which in turn
|
||||
allow access to individual [*Call Builders*](https://docs.rs/google-analyticsdata1_beta/5.0.5+20240417/google_analyticsdata1_beta/client::CallBuilder)
|
||||
* **[Resources](https://docs.rs/google-analyticsdata1_beta/5.0.5+20240417/google_analyticsdata1_beta/client::Resource)**
|
||||
* primary types that you can apply *Activities* to
|
||||
* a collection of properties and *Parts*
|
||||
* **[Parts](https://docs.rs/google-analyticsdata1_beta/5.0.4+20240304/google_analyticsdata1_beta/client::Part)**
|
||||
* **[Parts](https://docs.rs/google-analyticsdata1_beta/5.0.5+20240417/google_analyticsdata1_beta/client::Part)**
|
||||
* a collection of properties
|
||||
* never directly used in *Activities*
|
||||
* **[Activities](https://docs.rs/google-analyticsdata1_beta/5.0.4+20240304/google_analyticsdata1_beta/client::CallBuilder)**
|
||||
* **[Activities](https://docs.rs/google-analyticsdata1_beta/5.0.5+20240417/google_analyticsdata1_beta/client::CallBuilder)**
|
||||
* operations to apply to *Resources*
|
||||
|
||||
All *structures* are marked with applicable traits to further categorize them and ease browsing.
|
||||
@@ -51,8 +51,8 @@ let r = hub.properties().audience_exports_create(...).doit().await
|
||||
let r = hub.properties().audience_exports_get(...).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.
|
||||
|
||||
@@ -77,22 +77,23 @@ extern crate hyper_rustls;
|
||||
extern crate google_analyticsdata1_beta as analyticsdata1_beta;
|
||||
use analyticsdata1_beta::api::AudienceExport;
|
||||
use analyticsdata1_beta::{Result, Error};
|
||||
use analyticsdata1_beta::api::enums::*;
|
||||
use std::default::Default;
|
||||
use analyticsdata1_beta::{AnalyticsData, 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 = AnalyticsData::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().https_or_http().enable_http1().build()), auth);
|
||||
let mut hub = AnalyticsData::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().unwrap().https_or_http().enable_http1().build()), auth);
|
||||
// As the method needs a request, you would usually fill it with the desired information
|
||||
// into the respective structure. Some of the parts shown here might not be applicable !
|
||||
// Values shown here are possibly random and not representative !
|
||||
@@ -125,49 +126,49 @@ match result {
|
||||
```
|
||||
## Handling Errors
|
||||
|
||||
All errors produced by the system are provided either as [Result](https://docs.rs/google-analyticsdata1_beta/5.0.4+20240304/google_analyticsdata1_beta/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-analyticsdata1_beta/5.0.4+20240304/google_analyticsdata1_beta/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-analyticsdata1_beta/5.0.5+20240417/google_analyticsdata1_beta/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-analyticsdata1_beta/5.0.5+20240417/google_analyticsdata1_beta/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-analyticsdata1_beta/5.0.4+20240304/google_analyticsdata1_beta/client::Result), should be
|
||||
If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-analyticsdata1_beta/5.0.5+20240417/google_analyticsdata1_beta/client::Result), should be
|
||||
read by you to obtain the media.
|
||||
If such a method also supports a [Response Result](https://docs.rs/google-analyticsdata1_beta/5.0.4+20240304/google_analyticsdata1_beta/client::ResponseResult), it will return that by default.
|
||||
If such a method also supports a [Response Result](https://docs.rs/google-analyticsdata1_beta/5.0.5+20240417/google_analyticsdata1_beta/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-analyticsdata1_beta/5.0.4+20240304/google_analyticsdata1_beta/client::Delegate) to the
|
||||
[Method Builder](https://docs.rs/google-analyticsdata1_beta/5.0.4+20240304/google_analyticsdata1_beta/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-analyticsdata1_beta/5.0.5+20240417/google_analyticsdata1_beta/client::Delegate) to the
|
||||
[Method Builder](https://docs.rs/google-analyticsdata1_beta/5.0.5+20240417/google_analyticsdata1_beta/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-analyticsdata1_beta/5.0.4+20240304/google_analyticsdata1_beta/client::Delegate) is default-implemented, allowing you to customize it with minimal effort.
|
||||
The [delegate trait](https://docs.rs/google-analyticsdata1_beta/5.0.5+20240417/google_analyticsdata1_beta/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-analyticsdata1_beta/5.0.4+20240304/google_analyticsdata1_beta/client::RequestValue) and
|
||||
[decodable](https://docs.rs/google-analyticsdata1_beta/5.0.4+20240304/google_analyticsdata1_beta/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-analyticsdata1_beta/5.0.5+20240417/google_analyticsdata1_beta/client::RequestValue) and
|
||||
[decodable](https://docs.rs/google-analyticsdata1_beta/5.0.5+20240417/google_analyticsdata1_beta/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-analyticsdata1_beta/5.0.4+20240304/google_analyticsdata1_beta/client::Part) which are identifiable by name, which will be sent to
|
||||
Most optionals are are considered [Parts](https://docs.rs/google-analyticsdata1_beta/5.0.5+20240417/google_analyticsdata1_beta/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-analyticsdata1_beta/5.0.4+20240304/google_analyticsdata1_beta/client::CallBuilder), you are able to prepare an action call by repeatedly calling it's methods.
|
||||
Using [method builders](https://docs.rs/google-analyticsdata1_beta/5.0.5+20240417/google_analyticsdata1_beta/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-analyticsdata1_beta/5.0.4+20240304/google_analyticsdata1_beta/client::RequestValue) are moved
|
||||
* [request values](https://docs.rs/google-analyticsdata1_beta/5.0.5+20240417/google_analyticsdata1_beta/client::RequestValue) are moved
|
||||
|
||||
Arguments will always be copied or cloned into the builder, to make them independent of their original life times.
|
||||
|
||||
@@ -176,7 +177,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 **analyticsdata1_beta** library was generated by Sebastian Thiel, and is placed
|
||||
The **analyticsdata1_beta** 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
1213
gen/analyticsdata1_beta/src/api/enums.rs
Normal file
1213
gen/analyticsdata1_beta/src/api/enums.rs
Normal file
File diff suppressed because it is too large
Load Diff
113
gen/analyticsdata1_beta/src/api/hub.rs
Normal file
113
gen/analyticsdata1_beta/src/api/hub.rs
Normal file
@@ -0,0 +1,113 @@
|
||||
use super::*;
|
||||
|
||||
/// Central instance to access all AnalyticsData related resource activities
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
/// Instantiate a new hub
|
||||
///
|
||||
/// ```test_harness,no_run
|
||||
/// extern crate hyper;
|
||||
/// extern crate hyper_rustls;
|
||||
/// extern crate google_analyticsdata1_beta as analyticsdata1_beta;
|
||||
/// use analyticsdata1_beta::api::AudienceExport;
|
||||
/// use analyticsdata1_beta::{Result, Error};
|
||||
/// use analyticsdata1_beta::api::enums::*;
|
||||
/// # async fn dox() {
|
||||
/// use std::default::Default;
|
||||
/// use analyticsdata1_beta::{AnalyticsData, 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 = AnalyticsData::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().unwrap().https_or_http().enable_http1().build()), auth);
|
||||
/// // As the method needs a request, you would usually fill it with the desired information
|
||||
/// // into the respective structure. Some of the parts shown here might not be applicable !
|
||||
/// // Values shown here are possibly random and not representative !
|
||||
/// let mut req = AudienceExport::default();
|
||||
///
|
||||
/// // 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.properties().audience_exports_create(req, "parent")
|
||||
/// .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 AnalyticsData<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 AnalyticsData<S> {}
|
||||
|
||||
impl<'a, S> AnalyticsData<S> {
|
||||
|
||||
pub fn new<A: 'static + client::GetToken>(client: hyper::Client<S, hyper::body::Body>, auth: A) -> AnalyticsData<S> {
|
||||
AnalyticsData {
|
||||
client,
|
||||
auth: Box::new(auth),
|
||||
_user_agent: "google-api-rust-client/5.0.5".to_string(),
|
||||
_base_url: "https://analyticsdata.googleapis.com/".to_string(),
|
||||
_root_url: "https://analyticsdata.googleapis.com/".to_string(),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn properties(&'a self) -> PropertyMethods<'a, S> {
|
||||
PropertyMethods { 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://analyticsdata.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://analyticsdata.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)
|
||||
}
|
||||
}
|
||||
247
gen/analyticsdata1_beta/src/api/method_builders.rs
Normal file
247
gen/analyticsdata1_beta/src/api/method_builders.rs
Normal file
@@ -0,0 +1,247 @@
|
||||
use super::*;
|
||||
/// A builder providing access to all methods supported on *property* resources.
|
||||
/// It is not used directly, but through the [`AnalyticsData`] hub.
|
||||
///
|
||||
/// # Example
|
||||
///
|
||||
/// Instantiate a resource builder
|
||||
///
|
||||
/// ```test_harness,no_run
|
||||
/// extern crate hyper;
|
||||
/// extern crate hyper_rustls;
|
||||
/// extern crate google_analyticsdata1_beta as analyticsdata1_beta;
|
||||
///
|
||||
/// # async fn dox() {
|
||||
/// use std::default::Default;
|
||||
/// use analyticsdata1_beta::{AnalyticsData, 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 = AnalyticsData::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 `audience_exports_create(...)`, `audience_exports_get(...)`, `audience_exports_list(...)`, `audience_exports_query(...)`, `batch_run_pivot_reports(...)`, `batch_run_reports(...)`, `check_compatibility(...)`, `get_metadata(...)`, `run_pivot_report(...)`, `run_realtime_report(...)` and `run_report(...)`
|
||||
/// // to build up your call.
|
||||
/// let rb = hub.properties();
|
||||
/// # }
|
||||
/// ```
|
||||
pub struct PropertyMethods<'a, S>
|
||||
where S: 'a {
|
||||
|
||||
pub(super) hub: &'a AnalyticsData<S>,
|
||||
}
|
||||
|
||||
impl<'a, S> client::MethodsBuilder for PropertyMethods<'a, S> {}
|
||||
|
||||
impl<'a, S> PropertyMethods<'a, S> {
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Creates an audience export for later retrieval. This method quickly returns the audience export's resource name and initiates a long running asynchronous request to form an audience export. To export the users in an audience export, first create the audience export through this method and then send the audience resource name to the `QueryAudienceExport` method. See [Creating an Audience Export](https://developers.google.com/analytics/devguides/reporting/data/v1/audience-list-basics) for an introduction to Audience Exports with examples. An audience export is a snapshot of the users currently in the audience at the time of audience export creation. Creating audience exports for one audience on different days will return different results as users enter and exit the audience. Audiences in Google Analytics 4 allow you to segment your users in the ways that are important to your business. To learn more, see https://support.google.com/analytics/answer/9267572. Audience exports contain the users in each audience. Audience Export APIs have some methods at alpha and other methods at beta stability. The intention is to advance methods to beta stability after some feedback and adoption. To give your feedback on this API, complete the [Google Analytics Audience Export API Feedback](https://forms.gle/EeA5u5LW6PEggtCEA) form.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `request` - No description provided.
|
||||
/// * `parent` - Required. The parent resource where this audience export will be created. Format: `properties/{property}`
|
||||
pub fn audience_exports_create(&self, request: AudienceExport, parent: &str) -> PropertyAudienceExportCreateCall<'a, S> {
|
||||
PropertyAudienceExportCreateCall {
|
||||
hub: self.hub,
|
||||
_request: request,
|
||||
_parent: parent.to_string(),
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Gets configuration metadata about a specific audience export. This method can be used to understand an audience export after it has been created. See [Creating an Audience Export](https://developers.google.com/analytics/devguides/reporting/data/v1/audience-list-basics) for an introduction to Audience Exports with examples. Audience Export APIs have some methods at alpha and other methods at beta stability. The intention is to advance methods to beta stability after some feedback and adoption. To give your feedback on this API, complete the [Google Analytics Audience Export API Feedback](https://forms.gle/EeA5u5LW6PEggtCEA) form.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `name` - Required. The audience export resource name. Format: `properties/{property}/audienceExports/{audience_export}`
|
||||
pub fn audience_exports_get(&self, name: &str) -> PropertyAudienceExportGetCall<'a, S> {
|
||||
PropertyAudienceExportGetCall {
|
||||
hub: self.hub,
|
||||
_name: name.to_string(),
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Lists all audience exports for a property. This method can be used for you to find and reuse existing audience exports rather than creating unnecessary new audience exports. The same audience can have multiple audience exports that represent the export of users that were in an audience on different days. See [Creating an Audience Export](https://developers.google.com/analytics/devguides/reporting/data/v1/audience-list-basics) for an introduction to Audience Exports with examples. Audience Export APIs have some methods at alpha and other methods at beta stability. The intention is to advance methods to beta stability after some feedback and adoption. To give your feedback on this API, complete the [Google Analytics Audience Export API Feedback](https://forms.gle/EeA5u5LW6PEggtCEA) form.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `parent` - Required. All audience exports for this property will be listed in the response. Format: `properties/{property}`
|
||||
pub fn audience_exports_list(&self, parent: &str) -> PropertyAudienceExportListCall<'a, S> {
|
||||
PropertyAudienceExportListCall {
|
||||
hub: self.hub,
|
||||
_parent: parent.to_string(),
|
||||
_page_token: Default::default(),
|
||||
_page_size: Default::default(),
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Retrieves an audience export of users. After creating an audience, the users are not immediately available for exporting. First, a request to `CreateAudienceExport` is necessary to create an audience export of users, and then second, this method is used to retrieve the users in the audience export. See [Creating an Audience Export](https://developers.google.com/analytics/devguides/reporting/data/v1/audience-list-basics) for an introduction to Audience Exports with examples. Audiences in Google Analytics 4 allow you to segment your users in the ways that are important to your business. To learn more, see https://support.google.com/analytics/answer/9267572. Audience Export APIs have some methods at alpha and other methods at beta stability. The intention is to advance methods to beta stability after some feedback and adoption. To give your feedback on this API, complete the [Google Analytics Audience Export API Feedback](https://forms.gle/EeA5u5LW6PEggtCEA) form.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `request` - No description provided.
|
||||
/// * `name` - Required. The name of the audience export to retrieve users from. Format: `properties/{property}/audienceExports/{audience_export}`
|
||||
pub fn audience_exports_query(&self, request: QueryAudienceExportRequest, name: &str) -> PropertyAudienceExportQueryCall<'a, S> {
|
||||
PropertyAudienceExportQueryCall {
|
||||
hub: self.hub,
|
||||
_request: request,
|
||||
_name: name.to_string(),
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Returns multiple pivot reports in a batch. All reports must be for the same GA4 Property.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `request` - No description provided.
|
||||
/// * `property` - A Google Analytics GA4 property identifier whose events are tracked. Specified in the URL path and not the body. To learn more, see [where to find your Property ID](https://developers.google.com/analytics/devguides/reporting/data/v1/property-id). This property must be specified for the batch. The property within RunPivotReportRequest may either be unspecified or consistent with this property. Example: properties/1234
|
||||
pub fn batch_run_pivot_reports(&self, request: BatchRunPivotReportsRequest, property: &str) -> PropertyBatchRunPivotReportCall<'a, S> {
|
||||
PropertyBatchRunPivotReportCall {
|
||||
hub: self.hub,
|
||||
_request: request,
|
||||
_property: property.to_string(),
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Returns multiple reports in a batch. All reports must be for the same GA4 Property.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `request` - No description provided.
|
||||
/// * `property` - A Google Analytics GA4 property identifier whose events are tracked. Specified in the URL path and not the body. To learn more, see [where to find your Property ID](https://developers.google.com/analytics/devguides/reporting/data/v1/property-id). This property must be specified for the batch. The property within RunReportRequest may either be unspecified or consistent with this property. Example: properties/1234
|
||||
pub fn batch_run_reports(&self, request: BatchRunReportsRequest, property: &str) -> PropertyBatchRunReportCall<'a, S> {
|
||||
PropertyBatchRunReportCall {
|
||||
hub: self.hub,
|
||||
_request: request,
|
||||
_property: property.to_string(),
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// This compatibility method lists dimensions and metrics that can be added to a report request and maintain compatibility. This method fails if the request's dimensions and metrics are incompatible. In Google Analytics, reports fail if they request incompatible dimensions and/or metrics; in that case, you will need to remove dimensions and/or metrics from the incompatible report until the report is compatible. The Realtime and Core reports have different compatibility rules. This method checks compatibility for Core reports.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `request` - No description provided.
|
||||
/// * `property` - A Google Analytics GA4 property identifier whose events are tracked. To learn more, see [where to find your Property ID](https://developers.google.com/analytics/devguides/reporting/data/v1/property-id). `property` should be the same value as in your `runReport` request. Example: properties/1234
|
||||
pub fn check_compatibility(&self, request: CheckCompatibilityRequest, property: &str) -> PropertyCheckCompatibilityCall<'a, S> {
|
||||
PropertyCheckCompatibilityCall {
|
||||
hub: self.hub,
|
||||
_request: request,
|
||||
_property: property.to_string(),
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Returns metadata for dimensions and metrics available in reporting methods. Used to explore the dimensions and metrics. In this method, a Google Analytics GA4 Property Identifier is specified in the request, and the metadata response includes Custom dimensions and metrics as well as Universal metadata. For example if a custom metric with parameter name `levels_unlocked` is registered to a property, the Metadata response will contain `customEvent:levels_unlocked`. Universal metadata are dimensions and metrics applicable to any property such as `country` and `totalUsers`.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `name` - Required. The resource name of the metadata to retrieve. This name field is specified in the URL path and not URL parameters. Property is a numeric Google Analytics GA4 Property identifier. To learn more, see [where to find your Property ID](https://developers.google.com/analytics/devguides/reporting/data/v1/property-id). Example: properties/1234/metadata Set the Property ID to 0 for dimensions and metrics common to all properties. In this special mode, this method will not return custom dimensions and metrics.
|
||||
pub fn get_metadata(&self, name: &str) -> PropertyGetMetadataCall<'a, S> {
|
||||
PropertyGetMetadataCall {
|
||||
hub: self.hub,
|
||||
_name: name.to_string(),
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Returns a customized pivot report of your Google Analytics event data. Pivot reports are more advanced and expressive formats than regular reports. In a pivot report, dimensions are only visible if they are included in a pivot. Multiple pivots can be specified to further dissect your data.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `request` - No description provided.
|
||||
/// * `property` - A Google Analytics GA4 property identifier whose events are tracked. Specified in the URL path and not the body. To learn more, see [where to find your Property ID](https://developers.google.com/analytics/devguides/reporting/data/v1/property-id). Within a batch request, this property should either be unspecified or consistent with the batch-level property. Example: properties/1234
|
||||
pub fn run_pivot_report(&self, request: RunPivotReportRequest, property: &str) -> PropertyRunPivotReportCall<'a, S> {
|
||||
PropertyRunPivotReportCall {
|
||||
hub: self.hub,
|
||||
_request: request,
|
||||
_property: property.to_string(),
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Returns a customized report of realtime event data for your property. Events appear in realtime reports seconds after they have been sent to the Google Analytics. Realtime reports show events and usage data for the periods of time ranging from the present moment to 30 minutes ago (up to 60 minutes for Google Analytics 360 properties). For a guide to constructing realtime requests & understanding responses, see [Creating a Realtime Report](https://developers.google.com/analytics/devguides/reporting/data/v1/realtime-basics).
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `request` - No description provided.
|
||||
/// * `property` - A Google Analytics GA4 property identifier whose events are tracked. Specified in the URL path and not the body. To learn more, see [where to find your Property ID](https://developers.google.com/analytics/devguides/reporting/data/v1/property-id). Example: properties/1234
|
||||
pub fn run_realtime_report(&self, request: RunRealtimeReportRequest, property: &str) -> PropertyRunRealtimeReportCall<'a, S> {
|
||||
PropertyRunRealtimeReportCall {
|
||||
hub: self.hub,
|
||||
_request: request,
|
||||
_property: property.to_string(),
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Returns a customized report of your Google Analytics event data. Reports contain statistics derived from data collected by the Google Analytics tracking code. The data returned from the API is as a table with columns for the requested dimensions and metrics. Metrics are individual measurements of user activity on your property, such as active users or event count. Dimensions break down metrics across some common criteria, such as country or event name. For a guide to constructing requests & understanding responses, see [Creating a Report](https://developers.google.com/analytics/devguides/reporting/data/v1/basics).
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `request` - No description provided.
|
||||
/// * `property` - A Google Analytics GA4 property identifier whose events are tracked. Specified in the URL path and not the body. To learn more, see [where to find your Property ID](https://developers.google.com/analytics/devguides/reporting/data/v1/property-id). Within a batch request, this property should either be unspecified or consistent with the batch-level property. Example: properties/1234
|
||||
pub fn run_report(&self, request: RunReportRequest, property: &str) -> PropertyRunReportCall<'a, S> {
|
||||
PropertyRunReportCall {
|
||||
hub: self.hub,
|
||||
_request: request,
|
||||
_property: property.to_string(),
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
35
gen/analyticsdata1_beta/src/api/mod.rs
Normal file
35
gen/analyticsdata1_beta/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::*;
|
||||
1635
gen/analyticsdata1_beta/src/api/schemas.rs
Normal file
1635
gen/analyticsdata1_beta/src/api/schemas.rs
Normal file
File diff suppressed because it is too large
Load Diff
28
gen/analyticsdata1_beta/src/api/utilities.rs
Normal file
28
gen/analyticsdata1_beta/src/api/utilities.rs
Normal file
@@ -0,0 +1,28 @@
|
||||
use super::*;
|
||||
/// Identifies the an OAuth2 authorization scope.
|
||||
/// A scope is needed when requesting an
|
||||
/// [authorization token](https://developers.google.com/youtube/v3/guides/authentication).
|
||||
#[derive(PartialEq, Eq, Hash, Debug, Clone)]
|
||||
pub enum Scope {
|
||||
/// View and manage your Google Analytics data
|
||||
Analytic,
|
||||
|
||||
/// See and download your Google Analytics data
|
||||
AnalyticReadonly,
|
||||
}
|
||||
|
||||
impl AsRef<str> for Scope {
|
||||
fn as_ref(&self) -> &str {
|
||||
match *self {
|
||||
Scope::Analytic => "https://www.googleapis.com/auth/analytics",
|
||||
Scope::AnalyticReadonly => "https://www.googleapis.com/auth/analytics.readonly",
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Default for Scope {
|
||||
fn default() -> Scope {
|
||||
Scope::AnalyticReadonly
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 *AnalyticsData* crate version *5.0.4+20240304*, where *20240304* is the exact revision of the *analyticsdata:v1beta* schema built by the [mako](http://www.makotemplates.org/) code generator *v5.0.4*.
|
||||
//! This documentation was generated from *AnalyticsData* crate version *5.0.5+20240417*, where *20240417* is the exact revision of the *analyticsdata:v1beta* schema built by the [mako](http://www.makotemplates.org/) code generator *v5.0.5*.
|
||||
//!
|
||||
//! Everything else about the *AnalyticsData* *v1_beta* API can be found at the
|
||||
//! [official documentation site](https://developers.google.com/analytics/devguides/reporting/data/v1/).
|
||||
//! The original source code is [on github](https://github.com/Byron/google-apis-rs/tree/main/gen/analyticsdata1_beta).
|
||||
//! # Features
|
||||
//!
|
||||
//! Handle the following *Resources* with ease from the central [hub](AnalyticsData) ...
|
||||
//! Handle the following *Resources* with ease from the central [hub](AnalyticsData) ...
|
||||
//!
|
||||
//! * properties
|
||||
//! * [*audience exports create*](api::PropertyAudienceExportCreateCall), [*audience exports get*](api::PropertyAudienceExportGetCall), [*audience exports list*](api::PropertyAudienceExportListCall), [*audience exports query*](api::PropertyAudienceExportQueryCall), [*batch run pivot reports*](api::PropertyBatchRunPivotReportCall), [*batch run reports*](api::PropertyBatchRunReportCall), [*check compatibility*](api::PropertyCheckCompatibilityCall), [*get metadata*](api::PropertyGetMetadataCall), [*run pivot report*](api::PropertyRunPivotReportCall), [*run realtime report*](api::PropertyRunRealtimeReportCall) and [*run report*](api::PropertyRunReportCall)
|
||||
@@ -51,8 +51,8 @@
|
||||
//! let r = hub.properties().audience_exports_get(...).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.
|
||||
//!
|
||||
@@ -77,23 +77,24 @@
|
||||
//! extern crate google_analyticsdata1_beta as analyticsdata1_beta;
|
||||
//! use analyticsdata1_beta::api::AudienceExport;
|
||||
//! use analyticsdata1_beta::{Result, Error};
|
||||
//! use analyticsdata1_beta::api::enums::*;
|
||||
//! # async fn dox() {
|
||||
//! use std::default::Default;
|
||||
//! use analyticsdata1_beta::{AnalyticsData, 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 = AnalyticsData::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().https_or_http().enable_http1().build()), auth);
|
||||
//! let mut hub = AnalyticsData::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().unwrap().https_or_http().enable_http1().build()), auth);
|
||||
//! // As the method needs a request, you would usually fill it with the desired information
|
||||
//! // into the respective structure. Some of the parts shown here might not be applicable !
|
||||
//! // Values shown here are possibly random and not representative !
|
||||
@@ -127,10 +128,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
|
||||
@@ -140,25 +141,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