make regen-apis

This commit is contained in:
OMGeeky
2024-05-16 21:23:40 +02:00
parent 52d2e89e51
commit ad85cafeef
5108 changed files with 1615625 additions and 992044 deletions

View File

@@ -0,0 +1,797 @@
use super::*;
// region AppEngineHttpRequestHttpMethodEnum
#[derive(Clone, Copy, Eq, Hash, Debug, PartialEq, Serialize, Deserialize)]
/// The HTTP method to use for the request. The default is POST. The app's request handler for the task's target URL must be able to handle HTTP requests with this http_method, otherwise the task attempt fails with error code 405 (Method Not Allowed). See [Writing a push task request handler](https://cloud.google.com/appengine/docs/java/taskqueue/push/creating-handlers#writing_a_push_task_request_handler) and the App Engine documentation for your runtime on [How Requests are Handled](https://cloud.google.com/appengine/docs/standard/python3/how-requests-are-handled).
pub enum AppEngineHttpRequestHttpMethodEnum {
/// HTTP method unspecified
///
/// "HTTP_METHOD_UNSPECIFIED"
#[serde(rename="HTTP_METHOD_UNSPECIFIED")]
HTTPMETHODUNSPECIFIED,
/// HTTP POST
///
/// "POST"
#[serde(rename="POST")]
POST,
/// HTTP GET
///
/// "GET"
#[serde(rename="GET")]
GET,
/// HTTP HEAD
///
/// "HEAD"
#[serde(rename="HEAD")]
HEAD,
/// HTTP PUT
///
/// "PUT"
#[serde(rename="PUT")]
PUT,
/// HTTP DELETE
///
/// "DELETE"
#[serde(rename="DELETE")]
DELETE,
/// HTTP PATCH
///
/// "PATCH"
#[serde(rename="PATCH")]
PATCH,
/// HTTP OPTIONS
///
/// "OPTIONS"
#[serde(rename="OPTIONS")]
OPTIONS,
}
impl AsRef<str> for AppEngineHttpRequestHttpMethodEnum {
fn as_ref(&self) -> &str {
match *self {
AppEngineHttpRequestHttpMethodEnum::HTTPMETHODUNSPECIFIED => "HTTP_METHOD_UNSPECIFIED",
AppEngineHttpRequestHttpMethodEnum::POST => "POST",
AppEngineHttpRequestHttpMethodEnum::GET => "GET",
AppEngineHttpRequestHttpMethodEnum::HEAD => "HEAD",
AppEngineHttpRequestHttpMethodEnum::PUT => "PUT",
AppEngineHttpRequestHttpMethodEnum::DELETE => "DELETE",
AppEngineHttpRequestHttpMethodEnum::PATCH => "PATCH",
AppEngineHttpRequestHttpMethodEnum::OPTIONS => "OPTIONS",
}
}
}
impl std::convert::TryFrom< &str> for AppEngineHttpRequestHttpMethodEnum {
type Error = ();
fn try_from(value: &str) -> Result<Self, Self::Error> {
match value {
"HTTP_METHOD_UNSPECIFIED" => Ok(AppEngineHttpRequestHttpMethodEnum::HTTPMETHODUNSPECIFIED),
"POST" => Ok(AppEngineHttpRequestHttpMethodEnum::POST),
"GET" => Ok(AppEngineHttpRequestHttpMethodEnum::GET),
"HEAD" => Ok(AppEngineHttpRequestHttpMethodEnum::HEAD),
"PUT" => Ok(AppEngineHttpRequestHttpMethodEnum::PUT),
"DELETE" => Ok(AppEngineHttpRequestHttpMethodEnum::DELETE),
"PATCH" => Ok(AppEngineHttpRequestHttpMethodEnum::PATCH),
"OPTIONS" => Ok(AppEngineHttpRequestHttpMethodEnum::OPTIONS),
_=> Err(()),
}
}
}
impl<'a> Into<std::borrow::Cow<'a, str>> for &'a AppEngineHttpRequestHttpMethodEnum {
fn into(self) -> std::borrow::Cow<'a, str> {
self.as_ref().into()
}
}
// endregion
// region CreateTaskRequestResponseViewEnum
#[derive(Clone, Copy, Eq, Hash, Debug, PartialEq, Serialize, Deserialize)]
/// The response_view specifies which subset of the Task will be returned. By default response_view is BASIC; not all information is retrieved by default because some data, such as payloads, might be desirable to return only when needed because of its large size or because of the sensitivity of data that it contains. Authorization for FULL requires `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) permission on the Task resource.
pub enum CreateTaskRequestResponseViewEnum {
/// Unspecified. Defaults to BASIC.
///
/// "VIEW_UNSPECIFIED"
#[serde(rename="VIEW_UNSPECIFIED")]
VIEWUNSPECIFIED,
/// The basic view omits fields which can be large or can contain sensitive data. This view does not include the body in AppEngineHttpRequest. Bodies are desirable to return only when needed, because they can be large and because of the sensitivity of the data that you choose to store in it.
///
/// "BASIC"
#[serde(rename="BASIC")]
BASIC,
/// All information is returned. Authorization for FULL requires `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) permission on the Queue resource.
///
/// "FULL"
#[serde(rename="FULL")]
FULL,
}
impl AsRef<str> for CreateTaskRequestResponseViewEnum {
fn as_ref(&self) -> &str {
match *self {
CreateTaskRequestResponseViewEnum::VIEWUNSPECIFIED => "VIEW_UNSPECIFIED",
CreateTaskRequestResponseViewEnum::BASIC => "BASIC",
CreateTaskRequestResponseViewEnum::FULL => "FULL",
}
}
}
impl std::convert::TryFrom< &str> for CreateTaskRequestResponseViewEnum {
type Error = ();
fn try_from(value: &str) -> Result<Self, Self::Error> {
match value {
"VIEW_UNSPECIFIED" => Ok(CreateTaskRequestResponseViewEnum::VIEWUNSPECIFIED),
"BASIC" => Ok(CreateTaskRequestResponseViewEnum::BASIC),
"FULL" => Ok(CreateTaskRequestResponseViewEnum::FULL),
_=> Err(()),
}
}
}
impl<'a> Into<std::borrow::Cow<'a, str>> for &'a CreateTaskRequestResponseViewEnum {
fn into(self) -> std::borrow::Cow<'a, str> {
self.as_ref().into()
}
}
// endregion
// region HttpRequestHttpMethodEnum
#[derive(Clone, Copy, Eq, Hash, Debug, PartialEq, Serialize, Deserialize)]
/// The HTTP method to use for the request. The default is POST.
pub enum HttpRequestHttpMethodEnum {
/// HTTP method unspecified
///
/// "HTTP_METHOD_UNSPECIFIED"
#[serde(rename="HTTP_METHOD_UNSPECIFIED")]
HTTPMETHODUNSPECIFIED,
/// HTTP POST
///
/// "POST"
#[serde(rename="POST")]
POST,
/// HTTP GET
///
/// "GET"
#[serde(rename="GET")]
GET,
/// HTTP HEAD
///
/// "HEAD"
#[serde(rename="HEAD")]
HEAD,
/// HTTP PUT
///
/// "PUT"
#[serde(rename="PUT")]
PUT,
/// HTTP DELETE
///
/// "DELETE"
#[serde(rename="DELETE")]
DELETE,
/// HTTP PATCH
///
/// "PATCH"
#[serde(rename="PATCH")]
PATCH,
/// HTTP OPTIONS
///
/// "OPTIONS"
#[serde(rename="OPTIONS")]
OPTIONS,
}
impl AsRef<str> for HttpRequestHttpMethodEnum {
fn as_ref(&self) -> &str {
match *self {
HttpRequestHttpMethodEnum::HTTPMETHODUNSPECIFIED => "HTTP_METHOD_UNSPECIFIED",
HttpRequestHttpMethodEnum::POST => "POST",
HttpRequestHttpMethodEnum::GET => "GET",
HttpRequestHttpMethodEnum::HEAD => "HEAD",
HttpRequestHttpMethodEnum::PUT => "PUT",
HttpRequestHttpMethodEnum::DELETE => "DELETE",
HttpRequestHttpMethodEnum::PATCH => "PATCH",
HttpRequestHttpMethodEnum::OPTIONS => "OPTIONS",
}
}
}
impl std::convert::TryFrom< &str> for HttpRequestHttpMethodEnum {
type Error = ();
fn try_from(value: &str) -> Result<Self, Self::Error> {
match value {
"HTTP_METHOD_UNSPECIFIED" => Ok(HttpRequestHttpMethodEnum::HTTPMETHODUNSPECIFIED),
"POST" => Ok(HttpRequestHttpMethodEnum::POST),
"GET" => Ok(HttpRequestHttpMethodEnum::GET),
"HEAD" => Ok(HttpRequestHttpMethodEnum::HEAD),
"PUT" => Ok(HttpRequestHttpMethodEnum::PUT),
"DELETE" => Ok(HttpRequestHttpMethodEnum::DELETE),
"PATCH" => Ok(HttpRequestHttpMethodEnum::PATCH),
"OPTIONS" => Ok(HttpRequestHttpMethodEnum::OPTIONS),
_=> Err(()),
}
}
}
impl<'a> Into<std::borrow::Cow<'a, str>> for &'a HttpRequestHttpMethodEnum {
fn into(self) -> std::borrow::Cow<'a, str> {
self.as_ref().into()
}
}
// endregion
// region HttpTargetHttpMethodEnum
#[derive(Clone, Copy, Eq, Hash, Debug, PartialEq, Serialize, Deserialize)]
/// The HTTP method to use for the request. When specified, it overrides HttpRequest for the task. Note that if the value is set to HttpMethod the HttpRequest of the task will be ignored at execution time.
pub enum HttpTargetHttpMethodEnum {
/// HTTP method unspecified
///
/// "HTTP_METHOD_UNSPECIFIED"
#[serde(rename="HTTP_METHOD_UNSPECIFIED")]
HTTPMETHODUNSPECIFIED,
/// HTTP POST
///
/// "POST"
#[serde(rename="POST")]
POST,
/// HTTP GET
///
/// "GET"
#[serde(rename="GET")]
GET,
/// HTTP HEAD
///
/// "HEAD"
#[serde(rename="HEAD")]
HEAD,
/// HTTP PUT
///
/// "PUT"
#[serde(rename="PUT")]
PUT,
/// HTTP DELETE
///
/// "DELETE"
#[serde(rename="DELETE")]
DELETE,
/// HTTP PATCH
///
/// "PATCH"
#[serde(rename="PATCH")]
PATCH,
/// HTTP OPTIONS
///
/// "OPTIONS"
#[serde(rename="OPTIONS")]
OPTIONS,
}
impl AsRef<str> for HttpTargetHttpMethodEnum {
fn as_ref(&self) -> &str {
match *self {
HttpTargetHttpMethodEnum::HTTPMETHODUNSPECIFIED => "HTTP_METHOD_UNSPECIFIED",
HttpTargetHttpMethodEnum::POST => "POST",
HttpTargetHttpMethodEnum::GET => "GET",
HttpTargetHttpMethodEnum::HEAD => "HEAD",
HttpTargetHttpMethodEnum::PUT => "PUT",
HttpTargetHttpMethodEnum::DELETE => "DELETE",
HttpTargetHttpMethodEnum::PATCH => "PATCH",
HttpTargetHttpMethodEnum::OPTIONS => "OPTIONS",
}
}
}
impl std::convert::TryFrom< &str> for HttpTargetHttpMethodEnum {
type Error = ();
fn try_from(value: &str) -> Result<Self, Self::Error> {
match value {
"HTTP_METHOD_UNSPECIFIED" => Ok(HttpTargetHttpMethodEnum::HTTPMETHODUNSPECIFIED),
"POST" => Ok(HttpTargetHttpMethodEnum::POST),
"GET" => Ok(HttpTargetHttpMethodEnum::GET),
"HEAD" => Ok(HttpTargetHttpMethodEnum::HEAD),
"PUT" => Ok(HttpTargetHttpMethodEnum::PUT),
"DELETE" => Ok(HttpTargetHttpMethodEnum::DELETE),
"PATCH" => Ok(HttpTargetHttpMethodEnum::PATCH),
"OPTIONS" => Ok(HttpTargetHttpMethodEnum::OPTIONS),
_=> Err(()),
}
}
}
impl<'a> Into<std::borrow::Cow<'a, str>> for &'a HttpTargetHttpMethodEnum {
fn into(self) -> std::borrow::Cow<'a, str> {
self.as_ref().into()
}
}
// endregion
// region QueueStateEnum
#[derive(Clone, Copy, Eq, Hash, Debug, PartialEq, Serialize, Deserialize)]
/// Output only. The state of the queue. `state` can only be changed by called PauseQueue, ResumeQueue, or uploading [queue.yaml/xml](https://cloud.google.com/appengine/docs/python/config/queueref). UpdateQueue cannot be used to change `state`.
pub enum QueueStateEnum {
/// Unspecified state.
///
/// "STATE_UNSPECIFIED"
#[serde(rename="STATE_UNSPECIFIED")]
STATEUNSPECIFIED,
/// The queue is running. Tasks can be dispatched. If the queue was created using Cloud Tasks and the queue has had no activity (method calls or task dispatches) for 30 days, the queue may take a few minutes to re-activate. Some method calls may return NOT_FOUND and tasks may not be dispatched for a few minutes until the queue has been re-activated.
///
/// "RUNNING"
#[serde(rename="RUNNING")]
RUNNING,
/// Tasks are paused by the user. If the queue is paused then Cloud Tasks will stop delivering tasks from it, but more tasks can still be added to it by the user.
///
/// "PAUSED"
#[serde(rename="PAUSED")]
PAUSED,
/// The queue is disabled. A queue becomes `DISABLED` when [queue.yaml](https://cloud.google.com/appengine/docs/python/config/queueref) or [queue.xml](https://cloud.google.com/appengine/docs/standard/java/config/queueref) is uploaded which does not contain the queue. You cannot directly disable a queue. When a queue is disabled, tasks can still be added to a queue but the tasks are not dispatched. To permanently delete this queue and all of its tasks, call DeleteQueue.
///
/// "DISABLED"
#[serde(rename="DISABLED")]
DISABLED,
}
impl AsRef<str> for QueueStateEnum {
fn as_ref(&self) -> &str {
match *self {
QueueStateEnum::STATEUNSPECIFIED => "STATE_UNSPECIFIED",
QueueStateEnum::RUNNING => "RUNNING",
QueueStateEnum::PAUSED => "PAUSED",
QueueStateEnum::DISABLED => "DISABLED",
}
}
}
impl std::convert::TryFrom< &str> for QueueStateEnum {
type Error = ();
fn try_from(value: &str) -> Result<Self, Self::Error> {
match value {
"STATE_UNSPECIFIED" => Ok(QueueStateEnum::STATEUNSPECIFIED),
"RUNNING" => Ok(QueueStateEnum::RUNNING),
"PAUSED" => Ok(QueueStateEnum::PAUSED),
"DISABLED" => Ok(QueueStateEnum::DISABLED),
_=> Err(()),
}
}
}
impl<'a> Into<std::borrow::Cow<'a, str>> for &'a QueueStateEnum {
fn into(self) -> std::borrow::Cow<'a, str> {
self.as_ref().into()
}
}
// endregion
// region QueueTypeEnum
#[derive(Clone, Copy, Eq, Hash, Debug, PartialEq, Serialize, Deserialize)]
/// Immutable. The type of a queue (push or pull). `Queue.type` is an immutable property of the queue that is set at the queue creation time. When left unspecified, the default value of `PUSH` is selected.
pub enum QueueTypeEnum {
/// Default value.
///
/// "TYPE_UNSPECIFIED"
#[serde(rename="TYPE_UNSPECIFIED")]
TYPEUNSPECIFIED,
/// A pull queue.
///
/// "PULL"
#[serde(rename="PULL")]
PULL,
/// A push queue.
///
/// "PUSH"
#[serde(rename="PUSH")]
PUSH,
}
impl AsRef<str> for QueueTypeEnum {
fn as_ref(&self) -> &str {
match *self {
QueueTypeEnum::TYPEUNSPECIFIED => "TYPE_UNSPECIFIED",
QueueTypeEnum::PULL => "PULL",
QueueTypeEnum::PUSH => "PUSH",
}
}
}
impl std::convert::TryFrom< &str> for QueueTypeEnum {
type Error = ();
fn try_from(value: &str) -> Result<Self, Self::Error> {
match value {
"TYPE_UNSPECIFIED" => Ok(QueueTypeEnum::TYPEUNSPECIFIED),
"PULL" => Ok(QueueTypeEnum::PULL),
"PUSH" => Ok(QueueTypeEnum::PUSH),
_=> Err(()),
}
}
}
impl<'a> Into<std::borrow::Cow<'a, str>> for &'a QueueTypeEnum {
fn into(self) -> std::borrow::Cow<'a, str> {
self.as_ref().into()
}
}
// endregion
// region RunTaskRequestResponseViewEnum
#[derive(Clone, Copy, Eq, Hash, Debug, PartialEq, Serialize, Deserialize)]
/// The response_view specifies which subset of the Task will be returned. By default response_view is BASIC; not all information is retrieved by default because some data, such as payloads, might be desirable to return only when needed because of its large size or because of the sensitivity of data that it contains. Authorization for FULL requires `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) permission on the Task resource.
pub enum RunTaskRequestResponseViewEnum {
/// Unspecified. Defaults to BASIC.
///
/// "VIEW_UNSPECIFIED"
#[serde(rename="VIEW_UNSPECIFIED")]
VIEWUNSPECIFIED,
/// The basic view omits fields which can be large or can contain sensitive data. This view does not include the body in AppEngineHttpRequest. Bodies are desirable to return only when needed, because they can be large and because of the sensitivity of the data that you choose to store in it.
///
/// "BASIC"
#[serde(rename="BASIC")]
BASIC,
/// All information is returned. Authorization for FULL requires `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) permission on the Queue resource.
///
/// "FULL"
#[serde(rename="FULL")]
FULL,
}
impl AsRef<str> for RunTaskRequestResponseViewEnum {
fn as_ref(&self) -> &str {
match *self {
RunTaskRequestResponseViewEnum::VIEWUNSPECIFIED => "VIEW_UNSPECIFIED",
RunTaskRequestResponseViewEnum::BASIC => "BASIC",
RunTaskRequestResponseViewEnum::FULL => "FULL",
}
}
}
impl std::convert::TryFrom< &str> for RunTaskRequestResponseViewEnum {
type Error = ();
fn try_from(value: &str) -> Result<Self, Self::Error> {
match value {
"VIEW_UNSPECIFIED" => Ok(RunTaskRequestResponseViewEnum::VIEWUNSPECIFIED),
"BASIC" => Ok(RunTaskRequestResponseViewEnum::BASIC),
"FULL" => Ok(RunTaskRequestResponseViewEnum::FULL),
_=> Err(()),
}
}
}
impl<'a> Into<std::borrow::Cow<'a, str>> for &'a RunTaskRequestResponseViewEnum {
fn into(self) -> std::borrow::Cow<'a, str> {
self.as_ref().into()
}
}
// endregion
// region TaskViewEnum
#[derive(Clone, Copy, Eq, Hash, Debug, PartialEq, Serialize, Deserialize)]
/// Output only. The view specifies which subset of the Task has been returned.
pub enum TaskViewEnum {
/// Unspecified. Defaults to BASIC.
///
/// "VIEW_UNSPECIFIED"
#[serde(rename="VIEW_UNSPECIFIED")]
VIEWUNSPECIFIED,
/// The basic view omits fields which can be large or can contain sensitive data. This view does not include the body in AppEngineHttpRequest. Bodies are desirable to return only when needed, because they can be large and because of the sensitivity of the data that you choose to store in it.
///
/// "BASIC"
#[serde(rename="BASIC")]
BASIC,
/// All information is returned. Authorization for FULL requires `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) permission on the Queue resource.
///
/// "FULL"
#[serde(rename="FULL")]
FULL,
}
impl AsRef<str> for TaskViewEnum {
fn as_ref(&self) -> &str {
match *self {
TaskViewEnum::VIEWUNSPECIFIED => "VIEW_UNSPECIFIED",
TaskViewEnum::BASIC => "BASIC",
TaskViewEnum::FULL => "FULL",
}
}
}
impl std::convert::TryFrom< &str> for TaskViewEnum {
type Error = ();
fn try_from(value: &str) -> Result<Self, Self::Error> {
match value {
"VIEW_UNSPECIFIED" => Ok(TaskViewEnum::VIEWUNSPECIFIED),
"BASIC" => Ok(TaskViewEnum::BASIC),
"FULL" => Ok(TaskViewEnum::FULL),
_=> Err(()),
}
}
}
impl<'a> Into<std::borrow::Cow<'a, str>> for &'a TaskViewEnum {
fn into(self) -> std::borrow::Cow<'a, str> {
self.as_ref().into()
}
}
// endregion
// region UriOverrideSchemeEnum
#[derive(Clone, Copy, Eq, Hash, Debug, PartialEq, Serialize, Deserialize)]
/// Scheme override. When specified, the task URI scheme is replaced by the provided value (HTTP or HTTPS).
pub enum UriOverrideSchemeEnum {
/// Scheme unspecified. Defaults to HTTPS.
///
/// "SCHEME_UNSPECIFIED"
#[serde(rename="SCHEME_UNSPECIFIED")]
SCHEMEUNSPECIFIED,
/// Convert the scheme to HTTP, e.g., https://www.google.ca will change to http://www.google.ca.
///
/// "HTTP"
#[serde(rename="HTTP")]
HTTP,
/// Convert the scheme to HTTPS, e.g., http://www.google.ca will change to https://www.google.ca.
///
/// "HTTPS"
#[serde(rename="HTTPS")]
HTTPS,
}
impl AsRef<str> for UriOverrideSchemeEnum {
fn as_ref(&self) -> &str {
match *self {
UriOverrideSchemeEnum::SCHEMEUNSPECIFIED => "SCHEME_UNSPECIFIED",
UriOverrideSchemeEnum::HTTP => "HTTP",
UriOverrideSchemeEnum::HTTPS => "HTTPS",
}
}
}
impl std::convert::TryFrom< &str> for UriOverrideSchemeEnum {
type Error = ();
fn try_from(value: &str) -> Result<Self, Self::Error> {
match value {
"SCHEME_UNSPECIFIED" => Ok(UriOverrideSchemeEnum::SCHEMEUNSPECIFIED),
"HTTP" => Ok(UriOverrideSchemeEnum::HTTP),
"HTTPS" => Ok(UriOverrideSchemeEnum::HTTPS),
_=> Err(()),
}
}
}
impl<'a> Into<std::borrow::Cow<'a, str>> for &'a UriOverrideSchemeEnum {
fn into(self) -> std::borrow::Cow<'a, str> {
self.as_ref().into()
}
}
// endregion
// region UriOverrideUriOverrideEnforceModeEnum
#[derive(Clone, Copy, Eq, Hash, Debug, PartialEq, Serialize, Deserialize)]
/// URI Override Enforce Mode When specified, determines the Target UriOverride mode. If not specified, it defaults to ALWAYS.
pub enum UriOverrideUriOverrideEnforceModeEnum {
/// OverrideMode Unspecified. Defaults to ALWAYS.
///
/// "URI_OVERRIDE_ENFORCE_MODE_UNSPECIFIED"
#[serde(rename="URI_OVERRIDE_ENFORCE_MODE_UNSPECIFIED")]
URIOVERRIDEENFORCEMODEUNSPECIFIED,
/// In the IF_NOT_EXISTS mode, queue-level configuration is only applied where task-level configuration does not exist.
///
/// "IF_NOT_EXISTS"
#[serde(rename="IF_NOT_EXISTS")]
IFNOTEXISTS,
/// In the ALWAYS mode, queue-level configuration overrides all task-level configuration
///
/// "ALWAYS"
#[serde(rename="ALWAYS")]
ALWAYS,
}
impl AsRef<str> for UriOverrideUriOverrideEnforceModeEnum {
fn as_ref(&self) -> &str {
match *self {
UriOverrideUriOverrideEnforceModeEnum::URIOVERRIDEENFORCEMODEUNSPECIFIED => "URI_OVERRIDE_ENFORCE_MODE_UNSPECIFIED",
UriOverrideUriOverrideEnforceModeEnum::IFNOTEXISTS => "IF_NOT_EXISTS",
UriOverrideUriOverrideEnforceModeEnum::ALWAYS => "ALWAYS",
}
}
}
impl std::convert::TryFrom< &str> for UriOverrideUriOverrideEnforceModeEnum {
type Error = ();
fn try_from(value: &str) -> Result<Self, Self::Error> {
match value {
"URI_OVERRIDE_ENFORCE_MODE_UNSPECIFIED" => Ok(UriOverrideUriOverrideEnforceModeEnum::URIOVERRIDEENFORCEMODEUNSPECIFIED),
"IF_NOT_EXISTS" => Ok(UriOverrideUriOverrideEnforceModeEnum::IFNOTEXISTS),
"ALWAYS" => Ok(UriOverrideUriOverrideEnforceModeEnum::ALWAYS),
_=> Err(()),
}
}
}
impl<'a> Into<std::borrow::Cow<'a, str>> for &'a UriOverrideUriOverrideEnforceModeEnum {
fn into(self) -> std::borrow::Cow<'a, str> {
self.as_ref().into()
}
}
// endregion
// region ProjectResponseViewEnum
#[derive(Clone, Copy, Eq, Hash, Debug, PartialEq, Serialize, Deserialize)]
/// The response_view specifies which subset of the Task will be returned. By default response_view is BASIC; not all information is retrieved by default because some data, such as payloads, might be desirable to return only when needed because of its large size or because of the sensitivity of data that it contains. Authorization for FULL requires `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) permission on the Task resource.
pub enum ProjectResponseViewEnum {
/// Unspecified. Defaults to BASIC.
///
/// "VIEW_UNSPECIFIED"
#[serde(rename="VIEW_UNSPECIFIED")]
VIEWUNSPECIFIED,
/// The basic view omits fields which can be large or can contain sensitive data. This view does not include the body in AppEngineHttpRequest. Bodies are desirable to return only when needed, because they can be large and because of the sensitivity of the data that you choose to store in it.
///
/// "BASIC"
#[serde(rename="BASIC")]
BASIC,
/// All information is returned. Authorization for FULL requires `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) permission on the Queue resource.
///
/// "FULL"
#[serde(rename="FULL")]
FULL,
}
impl AsRef<str> for ProjectResponseViewEnum {
fn as_ref(&self) -> &str {
match *self {
ProjectResponseViewEnum::VIEWUNSPECIFIED => "VIEW_UNSPECIFIED",
ProjectResponseViewEnum::BASIC => "BASIC",
ProjectResponseViewEnum::FULL => "FULL",
}
}
}
impl std::convert::TryFrom< &str> for ProjectResponseViewEnum {
type Error = ();
fn try_from(value: &str) -> Result<Self, Self::Error> {
match value {
"VIEW_UNSPECIFIED" => Ok(ProjectResponseViewEnum::VIEWUNSPECIFIED),
"BASIC" => Ok(ProjectResponseViewEnum::BASIC),
"FULL" => Ok(ProjectResponseViewEnum::FULL),
_=> Err(()),
}
}
}
impl<'a> Into<std::borrow::Cow<'a, str>> for &'a ProjectResponseViewEnum {
fn into(self) -> std::borrow::Cow<'a, str> {
self.as_ref().into()
}
}
// endregion

View File

@@ -0,0 +1,114 @@
use super::*;
/// Central instance to access all CloudTasks related resource activities
///
/// # Examples
///
/// Instantiate a new hub
///
/// ```test_harness,no_run
/// extern crate hyper;
/// extern crate hyper_rustls;
/// extern crate google_cloudtasks2_beta3 as cloudtasks2_beta3;
/// use cloudtasks2_beta3::api::Queue;
/// use cloudtasks2_beta3::{Result, Error};
/// use cloudtasks2_beta3::api::enums::*;
/// # async fn dox() {
/// use std::default::Default;
/// use cloudtasks2_beta3::{CloudTasks, 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 = CloudTasks::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 = Queue::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.projects().locations_queues_patch(req, "name")
/// .update_mask(FieldMask::new::<&str>(&[]))
/// .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 CloudTasks<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 CloudTasks<S> {}
impl<'a, S> CloudTasks<S> {
pub fn new<A: 'static + client::GetToken>(client: hyper::Client<S, hyper::body::Body>, auth: A) -> CloudTasks<S> {
CloudTasks {
client,
auth: Box::new(auth),
_user_agent: "google-api-rust-client/5.0.5".to_string(),
_base_url: "https://cloudtasks.googleapis.com/".to_string(),
_root_url: "https://cloudtasks.googleapis.com/".to_string(),
}
}
pub fn projects(&'a self) -> ProjectMethods<'a, S> {
ProjectMethods { 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://cloudtasks.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://cloudtasks.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)
}
}

View File

@@ -0,0 +1,439 @@
use super::*;
/// A builder providing access to all methods supported on *project* resources.
/// It is not used directly, but through the [`CloudTasks`] hub.
///
/// # Example
///
/// Instantiate a resource builder
///
/// ```test_harness,no_run
/// extern crate hyper;
/// extern crate hyper_rustls;
/// extern crate google_cloudtasks2_beta3 as cloudtasks2_beta3;
///
/// # async fn dox() {
/// use std::default::Default;
/// use cloudtasks2_beta3::{CloudTasks, 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 = CloudTasks::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 `locations_get(...)`, `locations_get_cmek_config(...)`, `locations_list(...)`, `locations_queues_create(...)`, `locations_queues_delete(...)`, `locations_queues_get(...)`, `locations_queues_get_iam_policy(...)`, `locations_queues_list(...)`, `locations_queues_patch(...)`, `locations_queues_pause(...)`, `locations_queues_purge(...)`, `locations_queues_resume(...)`, `locations_queues_set_iam_policy(...)`, `locations_queues_tasks_buffer(...)`, `locations_queues_tasks_create(...)`, `locations_queues_tasks_delete(...)`, `locations_queues_tasks_get(...)`, `locations_queues_tasks_list(...)`, `locations_queues_tasks_run(...)`, `locations_queues_test_iam_permissions(...)` and `locations_update_cmek_config(...)`
/// // to build up your call.
/// let rb = hub.projects();
/// # }
/// ```
pub struct ProjectMethods<'a, S>
where S: 'a {
pub(super) hub: &'a CloudTasks<S>,
}
impl<'a, S> client::MethodsBuilder for ProjectMethods<'a, S> {}
impl<'a, S> ProjectMethods<'a, S> {
/// Create a builder to help you perform the following task:
///
/// Creates and buffers a new task without the need to explicitly define a Task message. The queue must have HTTP target. To create the task with a custom ID, use the following format and set TASK_ID to your desired ID: projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID:buffer To create the task with an automatically generated ID, use the following format: projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks:buffer.
///
/// # Arguments
///
/// * `request` - No description provided.
/// * `queue` - Required. The parent queue name. For example: projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` The queue must already exist.
/// * `taskId` - Optional. Task ID for the task being created. If not provided, a random task ID is assigned to the task.
pub fn locations_queues_tasks_buffer(&self, request: BufferTaskRequest, queue: &str, task_id: &str) -> ProjectLocationQueueTaskBufferCall<'a, S> {
ProjectLocationQueueTaskBufferCall {
hub: self.hub,
_request: request,
_queue: queue.to_string(),
_task_id: task_id.to_string(),
_delegate: Default::default(),
_additional_params: Default::default(),
_scopes: Default::default(),
}
}
/// Create a builder to help you perform the following task:
///
/// Creates a task and adds it to a queue. Tasks cannot be updated after creation; there is no UpdateTask command. * The maximum task size is 100KB.
///
/// # Arguments
///
/// * `request` - No description provided.
/// * `parent` - Required. The queue name. For example: `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` The queue must already exist.
pub fn locations_queues_tasks_create(&self, request: CreateTaskRequest, parent: &str) -> ProjectLocationQueueTaskCreateCall<'a, S> {
ProjectLocationQueueTaskCreateCall {
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:
///
/// Deletes a task. A task can be deleted if it is scheduled or dispatched. A task cannot be deleted if it has executed successfully or permanently failed.
///
/// # Arguments
///
/// * `name` - Required. The task name. For example: `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`
pub fn locations_queues_tasks_delete(&self, name: &str) -> ProjectLocationQueueTaskDeleteCall<'a, S> {
ProjectLocationQueueTaskDeleteCall {
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:
///
/// Gets a task.
///
/// # Arguments
///
/// * `name` - Required. The task name. For example: `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`
pub fn locations_queues_tasks_get(&self, name: &str) -> ProjectLocationQueueTaskGetCall<'a, S> {
ProjectLocationQueueTaskGetCall {
hub: self.hub,
_name: name.to_string(),
_response_view: Default::default(),
_delegate: Default::default(),
_additional_params: Default::default(),
_scopes: Default::default(),
}
}
/// Create a builder to help you perform the following task:
///
/// Lists the tasks in a queue. By default, only the BASIC view is retrieved due to performance considerations; response_view controls the subset of information which is returned. The tasks may be returned in any order. The ordering may change at any time.
///
/// # Arguments
///
/// * `parent` - Required. The queue name. For example: `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`
pub fn locations_queues_tasks_list(&self, parent: &str) -> ProjectLocationQueueTaskListCall<'a, S> {
ProjectLocationQueueTaskListCall {
hub: self.hub,
_parent: parent.to_string(),
_response_view: Default::default(),
_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:
///
/// Forces a task to run now. When this method is called, Cloud Tasks will dispatch the task, even if the task is already running, the queue has reached its RateLimits or is PAUSED. This command is meant to be used for manual debugging. For example, RunTask can be used to retry a failed task after a fix has been made or to manually force a task to be dispatched now. The dispatched task is returned. That is, the task that is returned contains the status after the task is dispatched but before the task is received by its target. If Cloud Tasks receives a successful response from the task's target, then the task will be deleted; otherwise the task's schedule_time will be reset to the time that RunTask was called plus the retry delay specified in the queue's RetryConfig. RunTask returns NOT_FOUND when it is called on a task that has already succeeded or permanently failed.
///
/// # Arguments
///
/// * `request` - No description provided.
/// * `name` - Required. The task name. For example: `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`
pub fn locations_queues_tasks_run(&self, request: RunTaskRequest, name: &str) -> ProjectLocationQueueTaskRunCall<'a, S> {
ProjectLocationQueueTaskRunCall {
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:
///
/// Creates a queue. Queues created with this method allow tasks to live for a maximum of 31 days. After a task is 31 days old, the task will be deleted regardless of whether it was dispatched or not. WARNING: Using this method may have unintended side effects if you are using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. Read [Overview of Queue Management and queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using this method.
///
/// # Arguments
///
/// * `request` - No description provided.
/// * `parent` - Required. The location name in which the queue will be created. For example: `projects/PROJECT_ID/locations/LOCATION_ID` The list of allowed locations can be obtained by calling Cloud Tasks' implementation of ListLocations.
pub fn locations_queues_create(&self, request: Queue, parent: &str) -> ProjectLocationQueueCreateCall<'a, S> {
ProjectLocationQueueCreateCall {
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:
///
/// Deletes a queue. This command will delete the queue even if it has tasks in it. Note : If you delete a queue, you may be prevented from creating a new queue with the same name as the deleted queue for a tombstone window of up to 3 days. During this window, the CreateQueue operation may appear to recreate the queue, but this can be misleading. If you attempt to create a queue with the same name as one that is in the tombstone window, run GetQueue to confirm that the queue creation was successful. If GetQueue returns 200 response code, your queue was successfully created with the name of the previously deleted queue. Otherwise, your queue did not successfully recreate. WARNING: Using this method may have unintended side effects if you are using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. Read [Overview of Queue Management and queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using this method.
///
/// # Arguments
///
/// * `name` - Required. The queue name. For example: `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`
pub fn locations_queues_delete(&self, name: &str) -> ProjectLocationQueueDeleteCall<'a, S> {
ProjectLocationQueueDeleteCall {
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:
///
/// Gets a queue.
///
/// # Arguments
///
/// * `name` - Required. The resource name of the queue. For example: `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`
pub fn locations_queues_get(&self, name: &str) -> ProjectLocationQueueGetCall<'a, S> {
ProjectLocationQueueGetCall {
hub: self.hub,
_name: name.to_string(),
_read_mask: Default::default(),
_delegate: Default::default(),
_additional_params: Default::default(),
_scopes: Default::default(),
}
}
/// Create a builder to help you perform the following task:
///
/// Gets the access control policy for a Queue. Returns an empty policy if the resource exists and does not have a policy set. Authorization requires the following [Google IAM](https://cloud.google.com/iam) permission on the specified resource parent: * `cloudtasks.queues.getIamPolicy`
///
/// # Arguments
///
/// * `request` - No description provided.
/// * `resource` - REQUIRED: The resource for which the policy is being requested. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field.
pub fn locations_queues_get_iam_policy(&self, request: GetIamPolicyRequest, resource: &str) -> ProjectLocationQueueGetIamPolicyCall<'a, S> {
ProjectLocationQueueGetIamPolicyCall {
hub: self.hub,
_request: request,
_resource: resource.to_string(),
_delegate: Default::default(),
_additional_params: Default::default(),
_scopes: Default::default(),
}
}
/// Create a builder to help you perform the following task:
///
/// Lists queues. Queues are returned in lexicographical order.
///
/// # Arguments
///
/// * `parent` - Required. The location name. For example: `projects/PROJECT_ID/locations/LOCATION_ID`
pub fn locations_queues_list(&self, parent: &str) -> ProjectLocationQueueListCall<'a, S> {
ProjectLocationQueueListCall {
hub: self.hub,
_parent: parent.to_string(),
_read_mask: Default::default(),
_page_token: Default::default(),
_page_size: Default::default(),
_filter: Default::default(),
_delegate: Default::default(),
_additional_params: Default::default(),
_scopes: Default::default(),
}
}
/// Create a builder to help you perform the following task:
///
/// Updates a queue. This method creates the queue if it does not exist and updates the queue if it does exist. Queues created with this method allow tasks to live for a maximum of 31 days. After a task is 31 days old, the task will be deleted regardless of whether it was dispatched or not. WARNING: Using this method may have unintended side effects if you are using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. Read [Overview of Queue Management and queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using this method.
///
/// # Arguments
///
/// * `request` - No description provided.
/// * `name` - Caller-specified and required in CreateQueue, after which it becomes output only. The queue name. The queue name must have the following format: `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), hyphens (-), colons (:), or periods (.). For more information, see [Identifying projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects) * `LOCATION_ID` is the canonical ID for the queue's location. The list of available locations can be obtained by calling ListLocations. For more information, see https://cloud.google.com/about/locations/. * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or hyphens (-). The maximum length is 100 characters.
pub fn locations_queues_patch(&self, request: Queue, name: &str) -> ProjectLocationQueuePatchCall<'a, S> {
ProjectLocationQueuePatchCall {
hub: self.hub,
_request: request,
_name: name.to_string(),
_update_mask: Default::default(),
_delegate: Default::default(),
_additional_params: Default::default(),
_scopes: Default::default(),
}
}
/// Create a builder to help you perform the following task:
///
/// Pauses the queue. If a queue is paused then the system will stop dispatching tasks until the queue is resumed via ResumeQueue. Tasks can still be added when the queue is paused. A queue is paused if its state is PAUSED.
///
/// # Arguments
///
/// * `request` - No description provided.
/// * `name` - Required. The queue name. For example: `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID`
pub fn locations_queues_pause(&self, request: PauseQueueRequest, name: &str) -> ProjectLocationQueuePauseCall<'a, S> {
ProjectLocationQueuePauseCall {
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:
///
/// Purges a queue by deleting all of its tasks. All tasks created before this method is called are permanently deleted. Purge operations can take up to one minute to take effect. Tasks might be dispatched before the purge takes effect. A purge is irreversible.
///
/// # Arguments
///
/// * `request` - No description provided.
/// * `name` - Required. The queue name. For example: `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID`
pub fn locations_queues_purge(&self, request: PurgeQueueRequest, name: &str) -> ProjectLocationQueuePurgeCall<'a, S> {
ProjectLocationQueuePurgeCall {
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:
///
/// Resume a queue. This method resumes a queue after it has been PAUSED or DISABLED. The state of a queue is stored in the queue's state; after calling this method it will be set to RUNNING. WARNING: Resuming many high-QPS queues at the same time can lead to target overloading. If you are resuming high-QPS queues, follow the 500/50/5 pattern described in [Managing Cloud Tasks Scaling Risks](https://cloud.google.com/tasks/docs/manage-cloud-task-scaling).
///
/// # Arguments
///
/// * `request` - No description provided.
/// * `name` - Required. The queue name. For example: `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID`
pub fn locations_queues_resume(&self, request: ResumeQueueRequest, name: &str) -> ProjectLocationQueueResumeCall<'a, S> {
ProjectLocationQueueResumeCall {
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:
///
/// Sets the access control policy for a Queue. Replaces any existing policy. Note: The Cloud Console does not check queue-level IAM permissions yet. Project-level permissions are required to use the Cloud Console. Authorization requires the following [Google IAM](https://cloud.google.com/iam) permission on the specified resource parent: * `cloudtasks.queues.setIamPolicy`
///
/// # Arguments
///
/// * `request` - No description provided.
/// * `resource` - REQUIRED: The resource for which the policy is being specified. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field.
pub fn locations_queues_set_iam_policy(&self, request: SetIamPolicyRequest, resource: &str) -> ProjectLocationQueueSetIamPolicyCall<'a, S> {
ProjectLocationQueueSetIamPolicyCall {
hub: self.hub,
_request: request,
_resource: resource.to_string(),
_delegate: Default::default(),
_additional_params: Default::default(),
_scopes: Default::default(),
}
}
/// Create a builder to help you perform the following task:
///
/// Returns permissions that a caller has on a Queue. If the resource does not exist, this will return an empty set of permissions, not a NOT_FOUND error. Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning.
///
/// # Arguments
///
/// * `request` - No description provided.
/// * `resource` - REQUIRED: The resource for which the policy detail is being requested. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field.
pub fn locations_queues_test_iam_permissions(&self, request: TestIamPermissionsRequest, resource: &str) -> ProjectLocationQueueTestIamPermissionCall<'a, S> {
ProjectLocationQueueTestIamPermissionCall {
hub: self.hub,
_request: request,
_resource: resource.to_string(),
_delegate: Default::default(),
_additional_params: Default::default(),
_scopes: Default::default(),
}
}
/// Create a builder to help you perform the following task:
///
/// Gets information about a location.
///
/// # Arguments
///
/// * `name` - Resource name for the location.
pub fn locations_get(&self, name: &str) -> ProjectLocationGetCall<'a, S> {
ProjectLocationGetCall {
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:
///
/// Gets the CMEK config. Gets the Customer Managed Encryption Key configured with the Cloud Tasks lcoation. By default there is no kms_key configured.
///
/// # Arguments
///
/// * `name` - Required. The config resource name. For example: projects/PROJECT_ID/locations/LOCATION_ID/cmekConfig`
pub fn locations_get_cmek_config(&self, name: &str) -> ProjectLocationGetCmekConfigCall<'a, S> {
ProjectLocationGetCmekConfigCall {
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 information about the supported locations for this service.
///
/// # Arguments
///
/// * `name` - The resource that owns the locations collection, if applicable.
pub fn locations_list(&self, name: &str) -> ProjectLocationListCall<'a, S> {
ProjectLocationListCall {
hub: self.hub,
_name: name.to_string(),
_page_token: Default::default(),
_page_size: Default::default(),
_filter: Default::default(),
_delegate: Default::default(),
_additional_params: Default::default(),
_scopes: Default::default(),
}
}
/// Create a builder to help you perform the following task:
///
/// Creates or Updates a CMEK config. Updates the Customer Managed Encryption Key assotiated with the Cloud Tasks location (Creates if the key does not already exist). All new tasks created in the location will be encrypted at-rest with the KMS-key provided in the config.
///
/// # Arguments
///
/// * `request` - No description provided.
/// * `name` - Output only. The config resource name which includes the project and location and must end in 'cmekConfig', in the format projects/PROJECT_ID/locations/LOCATION_ID/cmekConfig`
pub fn locations_update_cmek_config(&self, request: CmekConfig, name: &str) -> ProjectLocationUpdateCmekConfigCall<'a, S> {
ProjectLocationUpdateCmekConfigCall {
hub: self.hub,
_request: request,
_name: name.to_string(),
_update_mask: Default::default(),
_delegate: Default::default(),
_additional_params: Default::default(),
_scopes: Default::default(),
}
}
}

View 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::*;

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,24 @@
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 {
/// See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account.
CloudPlatform,
}
impl AsRef<str> for Scope {
fn as_ref(&self) -> &str {
match *self {
Scope::CloudPlatform => "https://www.googleapis.com/auth/cloud-platform",
}
}
}
impl Default for Scope {
fn default() -> Scope {
Scope::CloudPlatform
}
}

View File

@@ -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 *Cloud Tasks* crate version *5.0.4+20240223*, where *20240223* is the exact revision of the *cloudtasks:v2beta3* schema built by the [mako](http://www.makotemplates.org/) code generator *v5.0.4*.
//! This documentation was generated from *Cloud Tasks* crate version *5.0.5+20240315*, where *20240315* is the exact revision of the *cloudtasks:v2beta3* schema built by the [mako](http://www.makotemplates.org/) code generator *v5.0.5*.
//!
//! Everything else about the *Cloud Tasks* *v2_beta3* API can be found at the
//! [official documentation site](https://cloud.google.com/tasks/).
//! The original source code is [on github](https://github.com/Byron/google-apis-rs/tree/main/gen/cloudtasks2_beta3).
//! # Features
//!
//! Handle the following *Resources* with ease from the central [hub](CloudTasks) ...
//! Handle the following *Resources* with ease from the central [hub](CloudTasks) ...
//!
//! * projects
//! * [*locations get*](api::ProjectLocationGetCall), [*locations get cmek config*](api::ProjectLocationGetCmekConfigCall), [*locations list*](api::ProjectLocationListCall), [*locations queues create*](api::ProjectLocationQueueCreateCall), [*locations queues delete*](api::ProjectLocationQueueDeleteCall), [*locations queues get*](api::ProjectLocationQueueGetCall), [*locations queues get iam policy*](api::ProjectLocationQueueGetIamPolicyCall), [*locations queues list*](api::ProjectLocationQueueListCall), [*locations queues patch*](api::ProjectLocationQueuePatchCall), [*locations queues pause*](api::ProjectLocationQueuePauseCall), [*locations queues purge*](api::ProjectLocationQueuePurgeCall), [*locations queues resume*](api::ProjectLocationQueueResumeCall), [*locations queues set iam policy*](api::ProjectLocationQueueSetIamPolicyCall), [*locations queues tasks buffer*](api::ProjectLocationQueueTaskBufferCall), [*locations queues tasks create*](api::ProjectLocationQueueTaskCreateCall), [*locations queues tasks delete*](api::ProjectLocationQueueTaskDeleteCall), [*locations queues tasks get*](api::ProjectLocationQueueTaskGetCall), [*locations queues tasks list*](api::ProjectLocationQueueTaskListCall), [*locations queues tasks run*](api::ProjectLocationQueueTaskRunCall), [*locations queues test iam permissions*](api::ProjectLocationQueueTestIamPermissionCall) and [*locations update cmek config*](api::ProjectLocationUpdateCmekConfigCall)
@@ -55,8 +55,8 @@
//! let r = hub.projects().locations_queues_resume(...).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.
//!
@@ -81,23 +81,24 @@
//! extern crate google_cloudtasks2_beta3 as cloudtasks2_beta3;
//! use cloudtasks2_beta3::api::Queue;
//! use cloudtasks2_beta3::{Result, Error};
//! use cloudtasks2_beta3::api::enums::*;
//! # async fn dox() {
//! use std::default::Default;
//! use cloudtasks2_beta3::{CloudTasks, 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 = CloudTasks::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().https_or_http().enable_http1().build()), auth);
//! let mut hub = CloudTasks::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 !
@@ -107,7 +108,7 @@
//! // execute the final call using `doit()`.
//! // Values shown here are possibly random and not representative !
//! let result = hub.projects().locations_queues_patch(req, "name")
//! .update_mask(&Default::default())
//! .update_mask(FieldMask::new::<&str>(&[]))
//! .doit().await;
//!
//! match result {
@@ -132,10 +133,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
@@ -145,25 +146,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