mirror of
https://github.com/OMGeeky/google-apis-rs.git
synced 2026-02-13 21:19:05 +01:00
make regen-apis
This commit is contained in:
113
gen/workflows1/src/api/hub.rs
Normal file
113
gen/workflows1/src/api/hub.rs
Normal file
@@ -0,0 +1,113 @@
|
||||
use super::*;
|
||||
|
||||
/// Central instance to access all Workflows related resource activities
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
/// Instantiate a new hub
|
||||
///
|
||||
/// ```test_harness,no_run
|
||||
/// extern crate hyper;
|
||||
/// extern crate hyper_rustls;
|
||||
/// extern crate google_workflows1 as workflows1;
|
||||
/// use workflows1::api::Workflow;
|
||||
/// use workflows1::{Result, Error};
|
||||
/// # async fn dox() {
|
||||
/// use std::default::Default;
|
||||
/// use workflows1::{Workflows, 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 = Workflows::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().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 = Workflow::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_workflows_create(req, "parent")
|
||||
/// .workflow_id("At")
|
||||
/// .doit().await;
|
||||
///
|
||||
/// match result {
|
||||
/// Err(e) => match e {
|
||||
/// // The Error enum provides details about what exactly happened.
|
||||
/// // You can also just use its `Debug`, `Display` or `Error` traits
|
||||
/// Error::HttpError(_)
|
||||
/// |Error::Io(_)
|
||||
/// |Error::MissingAPIKey
|
||||
/// |Error::MissingToken(_)
|
||||
/// |Error::Cancelled
|
||||
/// |Error::UploadSizeLimitExceeded(_, _)
|
||||
/// |Error::Failure(_)
|
||||
/// |Error::BadRequest(_)
|
||||
/// |Error::FieldClash(_)
|
||||
/// |Error::JsonDecodeError(_, _) => println!("{}", e),
|
||||
/// },
|
||||
/// Ok(res) => println!("Success: {:?}", res),
|
||||
/// }
|
||||
/// # }
|
||||
/// ```
|
||||
#[derive(Clone)]
|
||||
pub struct Workflows<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 Workflows<S> {}
|
||||
|
||||
impl<'a, S> Workflows<S> {
|
||||
|
||||
pub fn new<A: 'static + client::GetToken>(client: hyper::Client<S, hyper::body::Body>, auth: A) -> Workflows<S> {
|
||||
Workflows {
|
||||
client,
|
||||
auth: Box::new(auth),
|
||||
_user_agent: "google-api-rust-client/5.0.3".to_string(),
|
||||
_base_url: "https://workflows.googleapis.com/".to_string(),
|
||||
_root_url: "https://workflows.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.3`.
|
||||
///
|
||||
/// 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://workflows.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://workflows.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)
|
||||
}
|
||||
}
|
||||
228
gen/workflows1/src/api/method_builders.rs
Normal file
228
gen/workflows1/src/api/method_builders.rs
Normal file
@@ -0,0 +1,228 @@
|
||||
use super::*;
|
||||
/// A builder providing access to all methods supported on *project* resources.
|
||||
/// It is not used directly, but through the [`Workflows`] hub.
|
||||
///
|
||||
/// # Example
|
||||
///
|
||||
/// Instantiate a resource builder
|
||||
///
|
||||
/// ```test_harness,no_run
|
||||
/// extern crate hyper;
|
||||
/// extern crate hyper_rustls;
|
||||
/// extern crate google_workflows1 as workflows1;
|
||||
///
|
||||
/// # async fn dox() {
|
||||
/// use std::default::Default;
|
||||
/// use workflows1::{Workflows, 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 = Workflows::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().https_or_http().enable_http1().build()), auth);
|
||||
/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders*
|
||||
/// // like `locations_get(...)`, `locations_list(...)`, `locations_operations_delete(...)`, `locations_operations_get(...)`, `locations_operations_list(...)`, `locations_workflows_create(...)`, `locations_workflows_delete(...)`, `locations_workflows_get(...)`, `locations_workflows_list(...)` and `locations_workflows_patch(...)`
|
||||
/// // to build up your call.
|
||||
/// let rb = hub.projects();
|
||||
/// # }
|
||||
/// ```
|
||||
pub struct ProjectMethods<'a, S>
|
||||
where S: 'a {
|
||||
|
||||
pub(super) hub: &'a Workflows<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:
|
||||
///
|
||||
/// Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `name` - The name of the operation resource to be deleted.
|
||||
pub fn locations_operations_delete(&self, name: &str) -> ProjectLocationOperationDeleteCall<'a, S> {
|
||||
ProjectLocationOperationDeleteCall {
|
||||
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 latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `name` - The name of the operation resource.
|
||||
pub fn locations_operations_get(&self, name: &str) -> ProjectLocationOperationGetCall<'a, S> {
|
||||
ProjectLocationOperationGetCall {
|
||||
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 operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name` binding allows API services to override the binding to use different resource name schemes, such as `users/*/operations`. To override the binding, API services can add a binding such as `"/v1/{name=users/*}/operations"` to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `name` - The name of the operation's parent resource.
|
||||
pub fn locations_operations_list(&self, name: &str) -> ProjectLocationOperationListCall<'a, S> {
|
||||
ProjectLocationOperationListCall {
|
||||
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 a new workflow. If a workflow with the specified name already exists in the specified project and location, the long running operation returns a ALREADY_EXISTS error.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `request` - No description provided.
|
||||
/// * `parent` - Required. Project and location in which the workflow should be created. Format: projects/{project}/locations/{location}
|
||||
pub fn locations_workflows_create(&self, request: Workflow, parent: &str) -> ProjectLocationWorkflowCreateCall<'a, S> {
|
||||
ProjectLocationWorkflowCreateCall {
|
||||
hub: self.hub,
|
||||
_request: request,
|
||||
_parent: parent.to_string(),
|
||||
_workflow_id: Default::default(),
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Deletes a workflow with the specified name. This method also cancels and deletes all running executions of the workflow.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `name` - Required. Name of the workflow to be deleted. Format: projects/{project}/locations/{location}/workflows/{workflow}
|
||||
pub fn locations_workflows_delete(&self, name: &str) -> ProjectLocationWorkflowDeleteCall<'a, S> {
|
||||
ProjectLocationWorkflowDeleteCall {
|
||||
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 details of a single workflow.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `name` - Required. Name of the workflow for which information should be retrieved. Format: projects/{project}/locations/{location}/workflows/{workflow}
|
||||
pub fn locations_workflows_get(&self, name: &str) -> ProjectLocationWorkflowGetCall<'a, S> {
|
||||
ProjectLocationWorkflowGetCall {
|
||||
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 workflows in a given project and location. The default order is not specified.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `parent` - Required. Project and location from which the workflows should be listed. Format: projects/{project}/locations/{location}
|
||||
pub fn locations_workflows_list(&self, parent: &str) -> ProjectLocationWorkflowListCall<'a, S> {
|
||||
ProjectLocationWorkflowListCall {
|
||||
hub: self.hub,
|
||||
_parent: parent.to_string(),
|
||||
_page_token: Default::default(),
|
||||
_page_size: Default::default(),
|
||||
_order_by: 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 an existing workflow. Running this method has no impact on already running executions of the workflow. A new revision of the workflow might be created as a result of a successful update operation. In that case, the new revision is used in new workflow executions.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `request` - No description provided.
|
||||
/// * `name` - The resource name of the workflow. Format: projects/{project}/locations/{location}/workflows/{workflow}
|
||||
pub fn locations_workflows_patch(&self, request: Workflow, name: &str) -> ProjectLocationWorkflowPatchCall<'a, S> {
|
||||
ProjectLocationWorkflowPatchCall {
|
||||
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:
|
||||
///
|
||||
/// 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:
|
||||
///
|
||||
/// 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(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
32
gen/workflows1/src/api/mod.rs
Normal file
32
gen/workflows1/src/api/mod.rs
Normal file
@@ -0,0 +1,32 @@
|
||||
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::*;
|
||||
231
gen/workflows1/src/api/schemas.rs
Normal file
231
gen/workflows1/src/api/schemas.rs
Normal file
@@ -0,0 +1,231 @@
|
||||
use super::*;
|
||||
/// A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }
|
||||
///
|
||||
/// # Activities
|
||||
///
|
||||
/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
|
||||
/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
|
||||
///
|
||||
/// * [locations operations delete projects](ProjectLocationOperationDeleteCall) (response)
|
||||
#[serde_with::serde_as(crate = "::client::serde_with")]
|
||||
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
|
||||
pub struct Empty { _never_set: Option<bool> }
|
||||
|
||||
impl client::ResponseResult for Empty {}
|
||||
|
||||
|
||||
/// The response message for Locations.ListLocations.
|
||||
///
|
||||
/// # Activities
|
||||
///
|
||||
/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
|
||||
/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
|
||||
///
|
||||
/// * [locations list projects](ProjectLocationListCall) (response)
|
||||
#[serde_with::serde_as(crate = "::client::serde_with")]
|
||||
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
|
||||
pub struct ListLocationsResponse {
|
||||
/// A list of locations that matches the specified filter in the request.
|
||||
|
||||
pub locations: Option<Vec<Location>>,
|
||||
/// The standard List next-page token.
|
||||
#[serde(rename="nextPageToken")]
|
||||
|
||||
pub next_page_token: Option<String>,
|
||||
}
|
||||
|
||||
impl client::ResponseResult for ListLocationsResponse {}
|
||||
|
||||
|
||||
/// The response message for Operations.ListOperations.
|
||||
///
|
||||
/// # Activities
|
||||
///
|
||||
/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
|
||||
/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
|
||||
///
|
||||
/// * [locations operations list projects](ProjectLocationOperationListCall) (response)
|
||||
#[serde_with::serde_as(crate = "::client::serde_with")]
|
||||
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
|
||||
pub struct ListOperationsResponse {
|
||||
/// The standard List next-page token.
|
||||
#[serde(rename="nextPageToken")]
|
||||
|
||||
pub next_page_token: Option<String>,
|
||||
/// A list of operations that matches the specified filter in the request.
|
||||
|
||||
pub operations: Option<Vec<Operation>>,
|
||||
}
|
||||
|
||||
impl client::ResponseResult for ListOperationsResponse {}
|
||||
|
||||
|
||||
/// Response for the ListWorkflows method.
|
||||
///
|
||||
/// # Activities
|
||||
///
|
||||
/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
|
||||
/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
|
||||
///
|
||||
/// * [locations workflows list projects](ProjectLocationWorkflowListCall) (response)
|
||||
#[serde_with::serde_as(crate = "::client::serde_with")]
|
||||
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
|
||||
pub struct ListWorkflowsResponse {
|
||||
/// A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no subsequent pages.
|
||||
#[serde(rename="nextPageToken")]
|
||||
|
||||
pub next_page_token: Option<String>,
|
||||
/// Unreachable resources.
|
||||
|
||||
pub unreachable: Option<Vec<String>>,
|
||||
/// The workflows that match the request.
|
||||
|
||||
pub workflows: Option<Vec<Workflow>>,
|
||||
}
|
||||
|
||||
impl client::ResponseResult for ListWorkflowsResponse {}
|
||||
|
||||
|
||||
/// A resource that represents Google Cloud Platform location.
|
||||
///
|
||||
/// # Activities
|
||||
///
|
||||
/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
|
||||
/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
|
||||
///
|
||||
/// * [locations get projects](ProjectLocationGetCall) (response)
|
||||
#[serde_with::serde_as(crate = "::client::serde_with")]
|
||||
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
|
||||
pub struct Location {
|
||||
/// The friendly name for this location, typically a nearby city name. For example, "Tokyo".
|
||||
#[serde(rename="displayName")]
|
||||
|
||||
pub display_name: Option<String>,
|
||||
/// Cross-service attributes for the location. For example {"cloud.googleapis.com/region": "us-east1"}
|
||||
|
||||
pub labels: Option<HashMap<String, String>>,
|
||||
/// The canonical id for this location. For example: `"us-east1"`.
|
||||
#[serde(rename="locationId")]
|
||||
|
||||
pub location_id: Option<String>,
|
||||
/// Service-specific metadata. For example the available capacity at the given location.
|
||||
|
||||
pub metadata: Option<HashMap<String, json::Value>>,
|
||||
/// Resource name for the location, which may vary between implementations. For example: `"projects/example-project/locations/us-east1"`
|
||||
|
||||
pub name: Option<String>,
|
||||
}
|
||||
|
||||
impl client::ResponseResult for Location {}
|
||||
|
||||
|
||||
/// This resource represents a long-running operation that is the result of a network API call.
|
||||
///
|
||||
/// # Activities
|
||||
///
|
||||
/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
|
||||
/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
|
||||
///
|
||||
/// * [locations operations get projects](ProjectLocationOperationGetCall) (response)
|
||||
/// * [locations workflows create projects](ProjectLocationWorkflowCreateCall) (response)
|
||||
/// * [locations workflows delete projects](ProjectLocationWorkflowDeleteCall) (response)
|
||||
/// * [locations workflows patch projects](ProjectLocationWorkflowPatchCall) (response)
|
||||
#[serde_with::serde_as(crate = "::client::serde_with")]
|
||||
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
|
||||
pub struct Operation {
|
||||
/// If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.
|
||||
|
||||
pub done: Option<bool>,
|
||||
/// The error result of the operation in case of failure or cancellation.
|
||||
|
||||
pub error: Option<Status>,
|
||||
/// Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.
|
||||
|
||||
pub metadata: Option<HashMap<String, json::Value>>,
|
||||
/// The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the `name` should be a resource name ending with `operations/{unique_id}`.
|
||||
|
||||
pub name: Option<String>,
|
||||
/// The normal response of the operation in case of success. If the original method returns no data on success, such as `Delete`, the response is `google.protobuf.Empty`. If the original method is standard `Get`/`Create`/`Update`, the response should be the resource. For other methods, the response should have the type `XxxResponse`, where `Xxx` is the original method name. For example, if the original method name is `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`.
|
||||
|
||||
pub response: Option<HashMap<String, json::Value>>,
|
||||
}
|
||||
|
||||
impl client::ResponseResult for Operation {}
|
||||
|
||||
|
||||
/// The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors).
|
||||
///
|
||||
/// This type is not used in any activity, and only used as *part* of another schema.
|
||||
///
|
||||
#[serde_with::serde_as(crate = "::client::serde_with")]
|
||||
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
|
||||
pub struct Status {
|
||||
/// The status code, which should be an enum value of google.rpc.Code.
|
||||
|
||||
pub code: Option<i32>,
|
||||
/// A list of messages that carry the error details. There is a common set of message types for APIs to use.
|
||||
|
||||
pub details: Option<Vec<HashMap<String, json::Value>>>,
|
||||
/// A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client.
|
||||
|
||||
pub message: Option<String>,
|
||||
}
|
||||
|
||||
impl client::Part for Status {}
|
||||
|
||||
|
||||
/// Workflow program to be executed by Workflows.
|
||||
///
|
||||
/// # Activities
|
||||
///
|
||||
/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
|
||||
/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
|
||||
///
|
||||
/// * [locations workflows create projects](ProjectLocationWorkflowCreateCall) (request)
|
||||
/// * [locations workflows get projects](ProjectLocationWorkflowGetCall) (response)
|
||||
/// * [locations workflows patch projects](ProjectLocationWorkflowPatchCall) (request)
|
||||
#[serde_with::serde_as(crate = "::client::serde_with")]
|
||||
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
|
||||
pub struct Workflow {
|
||||
/// Output only. The timestamp for when the workflow was created.
|
||||
#[serde(rename="createTime")]
|
||||
|
||||
pub create_time: Option<client::chrono::DateTime<client::chrono::offset::Utc>>,
|
||||
/// Description of the workflow provided by the user. Must be at most 1000 unicode characters long.
|
||||
|
||||
pub description: Option<String>,
|
||||
/// Labels associated with this workflow. Labels can contain at most 64 entries. Keys and values can be no longer than 63 characters and can only contain lowercase letters, numeric characters, underscores, and dashes. Label keys must start with a letter. International characters are allowed.
|
||||
|
||||
pub labels: Option<HashMap<String, String>>,
|
||||
/// The resource name of the workflow. Format: projects/{project}/locations/{location}/workflows/{workflow}
|
||||
|
||||
pub name: Option<String>,
|
||||
/// Output only. The timestamp for the latest revision of the workflow's creation.
|
||||
#[serde(rename="revisionCreateTime")]
|
||||
|
||||
pub revision_create_time: Option<client::chrono::DateTime<client::chrono::offset::Utc>>,
|
||||
/// Output only. The revision of the workflow. A new revision of a workflow is created as a result of updating the following properties of a workflow: - Service account - Workflow code to be executed The format is "000001-a4d", where the first 6 characters define the zero-padded revision ordinal number. They are followed by a hyphen and 3 hexadecimal random characters.
|
||||
#[serde(rename="revisionId")]
|
||||
|
||||
pub revision_id: Option<String>,
|
||||
/// The service account associated with the latest workflow version. This service account represents the identity of the workflow and determines what permissions the workflow has. Format: projects/{project}/serviceAccounts/{account} or {account} Using `-` as a wildcard for the `{project}` or not providing one at all will infer the project from the account. The `{account}` value can be the `email` address or the `unique_id` of the service account. If not provided, workflow will use the project's default service account. Modifying this field for an existing workflow results in a new workflow revision.
|
||||
#[serde(rename="serviceAccount")]
|
||||
|
||||
pub service_account: Option<String>,
|
||||
/// Workflow code to be executed. The size limit is 128KB.
|
||||
#[serde(rename="sourceContents")]
|
||||
|
||||
pub source_contents: Option<String>,
|
||||
/// Output only. State of the workflow deployment.
|
||||
|
||||
pub state: Option<String>,
|
||||
/// Output only. The timestamp for when the workflow was last updated.
|
||||
#[serde(rename="updateTime")]
|
||||
|
||||
pub update_time: Option<client::chrono::DateTime<client::chrono::offset::Utc>>,
|
||||
}
|
||||
|
||||
impl client::RequestValue for Workflow {}
|
||||
impl client::ResponseResult for Workflow {}
|
||||
|
||||
|
||||
24
gen/workflows1/src/api/utilities.rs
Normal file
24
gen/workflows1/src/api/utilities.rs
Normal 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
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user