#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct HttpTarget {
#[prost(string, tag = "1")]
pub uri: ::prost::alloc::string::String,
#[prost(enumeration = "HttpMethod", tag = "2")]
pub http_method: i32,
#[prost(btree_map = "string, string", tag = "3")]
pub headers: ::prost::alloc::collections::BTreeMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
#[prost(bytes = "bytes", tag = "4")]
pub body: ::prost::bytes::Bytes,
#[prost(oneof = "http_target::AuthorizationHeader", tags = "5, 6")]
pub authorization_header: ::core::option::Option<http_target::AuthorizationHeader>,
}
pub mod http_target {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum AuthorizationHeader {
#[prost(message, tag = "5")]
OauthToken(super::OAuthToken),
#[prost(message, tag = "6")]
OidcToken(super::OidcToken),
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AppEngineHttpTarget {
#[prost(enumeration = "HttpMethod", tag = "1")]
pub http_method: i32,
#[prost(message, optional, tag = "2")]
pub app_engine_routing: ::core::option::Option<AppEngineRouting>,
#[prost(string, tag = "3")]
pub relative_uri: ::prost::alloc::string::String,
#[prost(btree_map = "string, string", tag = "4")]
pub headers: ::prost::alloc::collections::BTreeMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
#[prost(bytes = "bytes", tag = "5")]
pub body: ::prost::bytes::Bytes,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PubsubTarget {
#[prost(string, tag = "1")]
pub topic_name: ::prost::alloc::string::String,
#[prost(bytes = "bytes", tag = "3")]
pub data: ::prost::bytes::Bytes,
#[prost(btree_map = "string, string", tag = "4")]
pub attributes: ::prost::alloc::collections::BTreeMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AppEngineRouting {
#[prost(string, tag = "1")]
pub service: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub version: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub instance: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub host: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OAuthToken {
#[prost(string, tag = "1")]
pub service_account_email: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub scope: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OidcToken {
#[prost(string, tag = "1")]
pub service_account_email: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub audience: ::prost::alloc::string::String,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum HttpMethod {
Unspecified = 0,
Post = 1,
Get = 2,
Head = 3,
Put = 4,
Delete = 5,
Patch = 6,
Options = 7,
}
impl HttpMethod {
pub fn as_str_name(&self) -> &'static str {
match self {
HttpMethod::Unspecified => "HTTP_METHOD_UNSPECIFIED",
HttpMethod::Post => "POST",
HttpMethod::Get => "GET",
HttpMethod::Head => "HEAD",
HttpMethod::Put => "PUT",
HttpMethod::Delete => "DELETE",
HttpMethod::Patch => "PATCH",
HttpMethod::Options => "OPTIONS",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"HTTP_METHOD_UNSPECIFIED" => Some(Self::Unspecified),
"POST" => Some(Self::Post),
"GET" => Some(Self::Get),
"HEAD" => Some(Self::Head),
"PUT" => Some(Self::Put),
"DELETE" => Some(Self::Delete),
"PATCH" => Some(Self::Patch),
"OPTIONS" => Some(Self::Options),
_ => None,
}
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Job {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub description: ::prost::alloc::string::String,
#[prost(string, tag = "20")]
pub schedule: ::prost::alloc::string::String,
#[prost(string, tag = "21")]
pub time_zone: ::prost::alloc::string::String,
#[prost(message, optional, tag = "9")]
pub user_update_time: ::core::option::Option<::prost_types::Timestamp>,
#[prost(enumeration = "job::State", tag = "10")]
pub state: i32,
#[prost(message, optional, tag = "11")]
pub status: ::core::option::Option<super::super::super::rpc::Status>,
#[prost(message, optional, tag = "17")]
pub schedule_time: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "18")]
pub last_attempt_time: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "19")]
pub retry_config: ::core::option::Option<RetryConfig>,
#[prost(message, optional, tag = "22")]
pub attempt_deadline: ::core::option::Option<::prost_types::Duration>,
#[prost(oneof = "job::Target", tags = "4, 5, 6")]
pub target: ::core::option::Option<job::Target>,
}
pub mod job {
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum State {
Unspecified = 0,
Enabled = 1,
Paused = 2,
Disabled = 3,
UpdateFailed = 4,
}
impl State {
pub fn as_str_name(&self) -> &'static str {
match self {
State::Unspecified => "STATE_UNSPECIFIED",
State::Enabled => "ENABLED",
State::Paused => "PAUSED",
State::Disabled => "DISABLED",
State::UpdateFailed => "UPDATE_FAILED",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"STATE_UNSPECIFIED" => Some(Self::Unspecified),
"ENABLED" => Some(Self::Enabled),
"PAUSED" => Some(Self::Paused),
"DISABLED" => Some(Self::Disabled),
"UPDATE_FAILED" => Some(Self::UpdateFailed),
_ => None,
}
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Target {
#[prost(message, tag = "4")]
PubsubTarget(super::PubsubTarget),
#[prost(message, tag = "5")]
AppEngineHttpTarget(super::AppEngineHttpTarget),
#[prost(message, tag = "6")]
HttpTarget(super::HttpTarget),
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RetryConfig {
#[prost(int32, tag = "1")]
pub retry_count: i32,
#[prost(message, optional, tag = "2")]
pub max_retry_duration: ::core::option::Option<::prost_types::Duration>,
#[prost(message, optional, tag = "3")]
pub min_backoff_duration: ::core::option::Option<::prost_types::Duration>,
#[prost(message, optional, tag = "4")]
pub max_backoff_duration: ::core::option::Option<::prost_types::Duration>,
#[prost(int32, tag = "5")]
pub max_doublings: i32,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListJobsRequest {
#[prost(string, tag = "1")]
pub parent: ::prost::alloc::string::String,
#[prost(int32, tag = "5")]
pub page_size: i32,
#[prost(string, tag = "6")]
pub page_token: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListJobsResponse {
#[prost(message, repeated, tag = "1")]
pub jobs: ::prost::alloc::vec::Vec<Job>,
#[prost(string, tag = "2")]
pub next_page_token: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetJobRequest {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateJobRequest {
#[prost(string, tag = "1")]
pub parent: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub job: ::core::option::Option<Job>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateJobRequest {
#[prost(message, optional, tag = "1")]
pub job: ::core::option::Option<Job>,
#[prost(message, optional, tag = "2")]
pub update_mask: ::core::option::Option<::prost_types::FieldMask>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteJobRequest {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PauseJobRequest {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ResumeJobRequest {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RunJobRequest {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
pub mod cloud_scheduler_client {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
#[derive(Debug, Clone)]
pub struct CloudSchedulerClient<T> {
inner: tonic::client::Grpc<T>,
}
impl<T> CloudSchedulerClient<T>
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + Send,
{
pub fn new(inner: T) -> Self {
let inner = tonic::client::Grpc::new(inner);
Self { inner }
}
pub fn with_origin(inner: T, origin: Uri) -> Self {
let inner = tonic::client::Grpc::with_origin(inner, origin);
Self { inner }
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> CloudSchedulerClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
>>::Error: Into<StdError> + Send + Sync,
{
CloudSchedulerClient::new(InterceptedService::new(inner, interceptor))
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_decoding_message_size(limit);
self
}
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_encoding_message_size(limit);
self
}
pub async fn list_jobs(
&mut self,
request: impl tonic::IntoRequest<super::ListJobsRequest>,
) -> std::result::Result<
tonic::Response<super::ListJobsResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.scheduler.v1.CloudScheduler/ListJobs",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.cloud.scheduler.v1.CloudScheduler",
"ListJobs",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn get_job(
&mut self,
request: impl tonic::IntoRequest<super::GetJobRequest>,
) -> std::result::Result<tonic::Response<super::Job>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.scheduler.v1.CloudScheduler/GetJob",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("google.cloud.scheduler.v1.CloudScheduler", "GetJob"),
);
self.inner.unary(req, path, codec).await
}
pub async fn create_job(
&mut self,
request: impl tonic::IntoRequest<super::CreateJobRequest>,
) -> std::result::Result<tonic::Response<super::Job>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.scheduler.v1.CloudScheduler/CreateJob",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.cloud.scheduler.v1.CloudScheduler",
"CreateJob",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn update_job(
&mut self,
request: impl tonic::IntoRequest<super::UpdateJobRequest>,
) -> std::result::Result<tonic::Response<super::Job>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.scheduler.v1.CloudScheduler/UpdateJob",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.cloud.scheduler.v1.CloudScheduler",
"UpdateJob",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn delete_job(
&mut self,
request: impl tonic::IntoRequest<super::DeleteJobRequest>,
) -> std::result::Result<tonic::Response<()>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.scheduler.v1.CloudScheduler/DeleteJob",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.cloud.scheduler.v1.CloudScheduler",
"DeleteJob",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn pause_job(
&mut self,
request: impl tonic::IntoRequest<super::PauseJobRequest>,
) -> std::result::Result<tonic::Response<super::Job>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.scheduler.v1.CloudScheduler/PauseJob",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.cloud.scheduler.v1.CloudScheduler",
"PauseJob",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn resume_job(
&mut self,
request: impl tonic::IntoRequest<super::ResumeJobRequest>,
) -> std::result::Result<tonic::Response<super::Job>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.scheduler.v1.CloudScheduler/ResumeJob",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.cloud.scheduler.v1.CloudScheduler",
"ResumeJob",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn run_job(
&mut self,
request: impl tonic::IntoRequest<super::RunJobRequest>,
) -> std::result::Result<tonic::Response<super::Job>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.scheduler.v1.CloudScheduler/RunJob",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("google.cloud.scheduler.v1.CloudScheduler", "RunJob"),
);
self.inner.unary(req, path, codec).await
}
}
}