#[derive(::grpc_build_core::NamedMessage)]
#[name = "cognito.ListUsersRequest"]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListUsersRequest {
#[prost(message, optional, tag = "1")]
pub filter: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(::grpc_build_core::NamedMessage)]
#[name = "cognito.BooleanResponses"]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BooleanResponses {
#[prost(bool, repeated, tag = "1")]
pub responses: ::prost::alloc::vec::Vec<bool>,
}
#[derive(::grpc_build_core::NamedMessage)]
#[name = "cognito.StringResponses"]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StringResponses {
#[prost(string, repeated, tag = "1")]
pub responses: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[derive(::grpc_build_core::NamedMessage)]
#[name = "cognito.StringsRequest"]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StringsRequest {
#[prost(string, repeated, tag = "1")]
pub requests: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[derive(::grpc_build_core::NamedMessage)]
#[name = "cognito.CreateUserRequest"]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateUserRequest {
#[prost(map = "string, string", tag = "1")]
pub attributes: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
#[prost(message, optional, tag = "2")]
pub password: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, tag = "3")]
pub username: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "4")]
pub desired_delivery_medium_list: ::prost::alloc::vec::Vec<
::prost::alloc::string::String,
>,
#[prost(message, optional, tag = "5")]
pub message_action_type: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(::grpc_build_core::NamedMessage)]
#[name = "cognito.UpdateUserRequest"]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateUserRequest {
#[prost(map = "string, string", tag = "1")]
pub attributes: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
#[prost(string, tag = "2")]
pub username: ::prost::alloc::string::String,
}
#[derive(::grpc_build_core::NamedMessage)]
#[name = "cognito.UserResponse"]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UserResponse {
#[prost(map = "string, string", tag = "1")]
pub attributes: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
#[prost(message, optional, tag = "2")]
pub user_create_date: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "3")]
pub username: ::core::option::Option<::prost::alloc::string::String>,
#[prost(bool, tag = "4")]
pub enabled: bool,
#[prost(message, optional, tag = "5")]
pub user_status: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(::grpc_build_core::NamedMessage)]
#[name = "cognito.UsersResponse"]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UsersResponse {
#[prost(message, repeated, tag = "1")]
pub users: ::prost::alloc::vec::Vec<UserResponse>,
}
#[derive(::grpc_build_core::NamedMessage)]
#[name = "cognito.ResetPasswordRequest"]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ResetPasswordRequest {
#[prost(string, tag = "1")]
pub username: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub confirmation_code: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub new_password: ::prost::alloc::string::String,
}
#[derive(::grpc_build_core::NamedMessage)]
#[name = "cognito.CreateGroupRequest"]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateGroupRequest {
#[prost(string, tag = "1")]
pub group_name: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub description: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "3")]
pub role_arn: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "4")]
pub precedence: ::core::option::Option<i32>,
}
#[derive(::grpc_build_core::NamedMessage)]
#[name = "cognito.GroupsResponse"]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GroupsResponse {
#[prost(message, repeated, tag = "1")]
pub groups: ::prost::alloc::vec::Vec<GroupResponse>,
}
#[derive(::grpc_build_core::NamedMessage)]
#[name = "cognito.GroupResponse"]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GroupResponse {
#[prost(message, optional, tag = "1")]
pub group_name: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "2")]
pub user_pool_id: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "3")]
pub description: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "4")]
pub role_arn: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "5")]
pub precedence: ::core::option::Option<i32>,
#[prost(message, optional, tag = "6")]
pub last_modified_date: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "7")]
pub creation_date: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(::grpc_build_core::NamedMessage)]
#[name = "cognito.AddUserToGroupRequest"]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AddUserToGroupRequest {
#[prost(string, tag = "1")]
pub group_name: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub username: ::prost::alloc::string::String,
}
#[derive(::grpc_build_core::NamedMessage)]
#[name = "cognito.InternalHealthResponse"]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct InternalHealthResponse {
#[prost(string, tag = "1")]
pub status: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub description: ::prost::alloc::string::String,
#[prost(map = "string, string", tag = "3")]
pub details: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
#[prost(string, tag = "4")]
pub last_seen: ::prost::alloc::string::String,
#[prost(string, tag = "5")]
pub ip_address: ::prost::alloc::string::String,
}
pub mod user_service_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 UserServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl UserServiceClient<tonic::transport::Channel> {
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: std::convert::TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> UserServiceClient<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,
) -> UserServiceClient<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,
{
UserServiceClient::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
}
pub async fn create_user(
&mut self,
request: impl tonic::IntoRequest<super::CreateUserRequest>,
) -> Result<tonic::Response<super::UserResponse>, 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(
"/cognito.UserService/createUser",
);
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn confirm_registration(
&mut self,
request: impl tonic::IntoRequest<::prost::alloc::string::String>,
) -> 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(
"/cognito.UserService/confirmRegistration",
);
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn get_user_by_username(
&mut self,
request: impl tonic::IntoRequest<::prost::alloc::string::String>,
) -> Result<tonic::Response<super::UserResponse>, 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(
"/cognito.UserService/getUserByUsername",
);
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn get_all_users(
&mut self,
request: impl tonic::IntoRequest<()>,
) -> Result<tonic::Response<super::UsersResponse>, 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(
"/cognito.UserService/getAllUsers",
);
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn get_all_users_by_filter(
&mut self,
request: impl tonic::IntoRequest<super::ListUsersRequest>,
) -> Result<tonic::Response<super::UsersResponse>, 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(
"/cognito.UserService/getAllUsersByFilter",
);
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn get_users_by_pattern(
&mut self,
request: impl tonic::IntoRequest<::prost::alloc::string::String>,
) -> Result<tonic::Response<super::UsersResponse>, 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(
"/cognito.UserService/getUsersByPattern",
);
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn update_user(
&mut self,
request: impl tonic::IntoRequest<super::UpdateUserRequest>,
) -> 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(
"/cognito.UserService/updateUser",
);
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn delete_users_with_exemptions(
&mut self,
request: impl tonic::IntoRequest<super::StringsRequest>,
) -> Result<tonic::Response<super::BooleanResponses>, 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(
"/cognito.UserService/deleteUsersWithExemptions",
);
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn delete_users_matching(
&mut self,
request: impl tonic::IntoRequest<::prost::alloc::string::String>,
) -> Result<tonic::Response<super::BooleanResponses>, 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(
"/cognito.UserService/deleteUsersMatching",
);
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn delete_user(
&mut self,
request: impl tonic::IntoRequest<::prost::alloc::string::String>,
) -> Result<tonic::Response<bool>, 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(
"/cognito.UserService/deleteUser",
);
self.inner.unary(request.into_request(), path, codec).await
}
}
}
pub mod password_service_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 PasswordServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl PasswordServiceClient<tonic::transport::Channel> {
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: std::convert::TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> PasswordServiceClient<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,
) -> PasswordServiceClient<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,
{
PasswordServiceClient::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
}
pub async fn forgot_password(
&mut self,
request: impl tonic::IntoRequest<::prost::alloc::string::String>,
) -> Result<tonic::Response<bool>, 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(
"/cognito.PasswordService/forgotPassword",
);
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn reset_password(
&mut self,
request: impl tonic::IntoRequest<super::ResetPasswordRequest>,
) -> Result<tonic::Response<bool>, 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(
"/cognito.PasswordService/resetPassword",
);
self.inner.unary(request.into_request(), path, codec).await
}
}
}
pub mod group_service_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 GroupServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl GroupServiceClient<tonic::transport::Channel> {
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: std::convert::TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> GroupServiceClient<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,
) -> GroupServiceClient<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,
{
GroupServiceClient::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
}
pub async fn get_group(
&mut self,
request: impl tonic::IntoRequest<::prost::alloc::string::String>,
) -> Result<tonic::Response<super::GroupResponse>, 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(
"/cognito.GroupService/getGroup",
);
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn get_all_groups(
&mut self,
request: impl tonic::IntoRequest<()>,
) -> Result<tonic::Response<super::GroupsResponse>, 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(
"/cognito.GroupService/getAllGroups",
);
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn create_group(
&mut self,
request: impl tonic::IntoRequest<super::CreateGroupRequest>,
) -> Result<tonic::Response<super::GroupResponse>, 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(
"/cognito.GroupService/createGroup",
);
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn add_user_to_group(
&mut self,
request: impl tonic::IntoRequest<super::AddUserToGroupRequest>,
) -> Result<tonic::Response<bool>, 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(
"/cognito.GroupService/addUserToGroup",
);
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn get_users_in_group(
&mut self,
request: impl tonic::IntoRequest<::prost::alloc::string::String>,
) -> Result<tonic::Response<super::UsersResponse>, 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(
"/cognito.GroupService/getUsersInGroup",
);
self.inner.unary(request.into_request(), path, codec).await
}
}
}
pub mod component_health_service_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 ComponentHealthServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl ComponentHealthServiceClient<tonic::transport::Channel> {
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: std::convert::TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> ComponentHealthServiceClient<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,
) -> ComponentHealthServiceClient<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,
{
ComponentHealthServiceClient::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
}
pub async fn show_details(
&mut self,
request: impl tonic::IntoRequest<()>,
) -> Result<tonic::Response<super::InternalHealthResponse>, 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(
"/cognito.ComponentHealthService/showDetails",
);
self.inner.unary(request.into_request(), path, codec).await
}
}
}
pub mod user_service_server {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
#[async_trait]
pub trait UserService: Send + Sync + 'static {
async fn create_user(
&self,
request: tonic::Request<super::CreateUserRequest>,
) -> Result<tonic::Response<super::UserResponse>, tonic::Status>;
async fn confirm_registration(
&self,
request: tonic::Request<::prost::alloc::string::String>,
) -> Result<tonic::Response<()>, tonic::Status>;
async fn get_user_by_username(
&self,
request: tonic::Request<::prost::alloc::string::String>,
) -> Result<tonic::Response<super::UserResponse>, tonic::Status>;
async fn get_all_users(
&self,
request: tonic::Request<()>,
) -> Result<tonic::Response<super::UsersResponse>, tonic::Status>;
async fn get_all_users_by_filter(
&self,
request: tonic::Request<super::ListUsersRequest>,
) -> Result<tonic::Response<super::UsersResponse>, tonic::Status>;
async fn get_users_by_pattern(
&self,
request: tonic::Request<::prost::alloc::string::String>,
) -> Result<tonic::Response<super::UsersResponse>, tonic::Status>;
async fn update_user(
&self,
request: tonic::Request<super::UpdateUserRequest>,
) -> Result<tonic::Response<()>, tonic::Status>;
async fn delete_users_with_exemptions(
&self,
request: tonic::Request<super::StringsRequest>,
) -> Result<tonic::Response<super::BooleanResponses>, tonic::Status>;
async fn delete_users_matching(
&self,
request: tonic::Request<::prost::alloc::string::String>,
) -> Result<tonic::Response<super::BooleanResponses>, tonic::Status>;
async fn delete_user(
&self,
request: tonic::Request<::prost::alloc::string::String>,
) -> Result<tonic::Response<bool>, tonic::Status>;
}
#[derive(Debug)]
pub struct UserServiceServer<T: UserService> {
inner: _Inner<T>,
accept_compression_encodings: EnabledCompressionEncodings,
send_compression_encodings: EnabledCompressionEncodings,
}
struct _Inner<T>(Arc<T>);
impl<T: UserService> UserServiceServer<T> {
pub fn new(inner: T) -> Self {
Self::from_arc(Arc::new(inner))
}
pub fn from_arc(inner: Arc<T>) -> Self {
let inner = _Inner(inner);
Self {
inner,
accept_compression_encodings: Default::default(),
send_compression_encodings: Default::default(),
}
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> InterceptedService<Self, F>
where
F: tonic::service::Interceptor,
{
InterceptedService::new(Self::new(inner), interceptor)
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.accept_compression_encodings.enable(encoding);
self
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.send_compression_encodings.enable(encoding);
self
}
}
impl<T, B> tonic::codegen::Service<http::Request<B>> for UserServiceServer<T>
where
T: UserService,
B: Body + Send + 'static,
B::Error: Into<StdError> + Send + 'static,
{
type Response = http::Response<tonic::body::BoxBody>;
type Error = std::convert::Infallible;
type Future = BoxFuture<Self::Response, Self::Error>;
fn poll_ready(
&mut self,
_cx: &mut Context<'_>,
) -> Poll<Result<(), Self::Error>> {
Poll::Ready(Ok(()))
}
fn call(&mut self, req: http::Request<B>) -> Self::Future {
let inner = self.inner.clone();
match req.uri().path() {
"/cognito.UserService/createUser" => {
#[allow(non_camel_case_types)]
struct createUserSvc<T: UserService>(pub Arc<T>);
impl<
T: UserService,
> tonic::server::UnaryService<super::CreateUserRequest>
for createUserSvc<T> {
type Response = super::UserResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::CreateUserRequest>,
) -> Self::Future {
let inner = self.0.clone();
let fut = async move { (*inner).create_user(request).await };
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = createUserSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/cognito.UserService/confirmRegistration" => {
#[allow(non_camel_case_types)]
struct confirmRegistrationSvc<T: UserService>(pub Arc<T>);
impl<
T: UserService,
> tonic::server::UnaryService<::prost::alloc::string::String>
for confirmRegistrationSvc<T> {
type Response = ();
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<::prost::alloc::string::String>,
) -> Self::Future {
let inner = self.0.clone();
let fut = async move {
(*inner).confirm_registration(request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = confirmRegistrationSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/cognito.UserService/getUserByUsername" => {
#[allow(non_camel_case_types)]
struct getUserByUsernameSvc<T: UserService>(pub Arc<T>);
impl<
T: UserService,
> tonic::server::UnaryService<::prost::alloc::string::String>
for getUserByUsernameSvc<T> {
type Response = super::UserResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<::prost::alloc::string::String>,
) -> Self::Future {
let inner = self.0.clone();
let fut = async move {
(*inner).get_user_by_username(request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = getUserByUsernameSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/cognito.UserService/getAllUsers" => {
#[allow(non_camel_case_types)]
struct getAllUsersSvc<T: UserService>(pub Arc<T>);
impl<T: UserService> tonic::server::UnaryService<()>
for getAllUsersSvc<T> {
type Response = super::UsersResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(&mut self, request: tonic::Request<()>) -> Self::Future {
let inner = self.0.clone();
let fut = async move {
(*inner).get_all_users(request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = getAllUsersSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/cognito.UserService/getAllUsersByFilter" => {
#[allow(non_camel_case_types)]
struct getAllUsersByFilterSvc<T: UserService>(pub Arc<T>);
impl<
T: UserService,
> tonic::server::UnaryService<super::ListUsersRequest>
for getAllUsersByFilterSvc<T> {
type Response = super::UsersResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::ListUsersRequest>,
) -> Self::Future {
let inner = self.0.clone();
let fut = async move {
(*inner).get_all_users_by_filter(request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = getAllUsersByFilterSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/cognito.UserService/getUsersByPattern" => {
#[allow(non_camel_case_types)]
struct getUsersByPatternSvc<T: UserService>(pub Arc<T>);
impl<
T: UserService,
> tonic::server::UnaryService<::prost::alloc::string::String>
for getUsersByPatternSvc<T> {
type Response = super::UsersResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<::prost::alloc::string::String>,
) -> Self::Future {
let inner = self.0.clone();
let fut = async move {
(*inner).get_users_by_pattern(request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = getUsersByPatternSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/cognito.UserService/updateUser" => {
#[allow(non_camel_case_types)]
struct updateUserSvc<T: UserService>(pub Arc<T>);
impl<
T: UserService,
> tonic::server::UnaryService<super::UpdateUserRequest>
for updateUserSvc<T> {
type Response = ();
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::UpdateUserRequest>,
) -> Self::Future {
let inner = self.0.clone();
let fut = async move { (*inner).update_user(request).await };
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = updateUserSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/cognito.UserService/deleteUsersWithExemptions" => {
#[allow(non_camel_case_types)]
struct deleteUsersWithExemptionsSvc<T: UserService>(pub Arc<T>);
impl<
T: UserService,
> tonic::server::UnaryService<super::StringsRequest>
for deleteUsersWithExemptionsSvc<T> {
type Response = super::BooleanResponses;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::StringsRequest>,
) -> Self::Future {
let inner = self.0.clone();
let fut = async move {
(*inner).delete_users_with_exemptions(request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = deleteUsersWithExemptionsSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/cognito.UserService/deleteUsersMatching" => {
#[allow(non_camel_case_types)]
struct deleteUsersMatchingSvc<T: UserService>(pub Arc<T>);
impl<
T: UserService,
> tonic::server::UnaryService<::prost::alloc::string::String>
for deleteUsersMatchingSvc<T> {
type Response = super::BooleanResponses;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<::prost::alloc::string::String>,
) -> Self::Future {
let inner = self.0.clone();
let fut = async move {
(*inner).delete_users_matching(request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = deleteUsersMatchingSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/cognito.UserService/deleteUser" => {
#[allow(non_camel_case_types)]
struct deleteUserSvc<T: UserService>(pub Arc<T>);
impl<
T: UserService,
> tonic::server::UnaryService<::prost::alloc::string::String>
for deleteUserSvc<T> {
type Response = bool;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<::prost::alloc::string::String>,
) -> Self::Future {
let inner = self.0.clone();
let fut = async move { (*inner).delete_user(request).await };
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = deleteUserSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
_ => {
Box::pin(async move {
Ok(
http::Response::builder()
.status(200)
.header("grpc-status", "12")
.header("content-type", "application/grpc")
.body(empty_body())
.unwrap(),
)
})
}
}
}
}
impl<T: UserService> Clone for UserServiceServer<T> {
fn clone(&self) -> Self {
let inner = self.inner.clone();
Self {
inner,
accept_compression_encodings: self.accept_compression_encodings,
send_compression_encodings: self.send_compression_encodings,
}
}
}
impl<T: UserService> Clone for _Inner<T> {
fn clone(&self) -> Self {
Self(self.0.clone())
}
}
impl<T: std::fmt::Debug> std::fmt::Debug for _Inner<T> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "{:?}", self.0)
}
}
impl<T: UserService> tonic::server::NamedService for UserServiceServer<T> {
const NAME: &'static str = "cognito.UserService";
}
}
pub mod password_service_server {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
#[async_trait]
pub trait PasswordService: Send + Sync + 'static {
async fn forgot_password(
&self,
request: tonic::Request<::prost::alloc::string::String>,
) -> Result<tonic::Response<bool>, tonic::Status>;
async fn reset_password(
&self,
request: tonic::Request<super::ResetPasswordRequest>,
) -> Result<tonic::Response<bool>, tonic::Status>;
}
#[derive(Debug)]
pub struct PasswordServiceServer<T: PasswordService> {
inner: _Inner<T>,
accept_compression_encodings: EnabledCompressionEncodings,
send_compression_encodings: EnabledCompressionEncodings,
}
struct _Inner<T>(Arc<T>);
impl<T: PasswordService> PasswordServiceServer<T> {
pub fn new(inner: T) -> Self {
Self::from_arc(Arc::new(inner))
}
pub fn from_arc(inner: Arc<T>) -> Self {
let inner = _Inner(inner);
Self {
inner,
accept_compression_encodings: Default::default(),
send_compression_encodings: Default::default(),
}
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> InterceptedService<Self, F>
where
F: tonic::service::Interceptor,
{
InterceptedService::new(Self::new(inner), interceptor)
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.accept_compression_encodings.enable(encoding);
self
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.send_compression_encodings.enable(encoding);
self
}
}
impl<T, B> tonic::codegen::Service<http::Request<B>> for PasswordServiceServer<T>
where
T: PasswordService,
B: Body + Send + 'static,
B::Error: Into<StdError> + Send + 'static,
{
type Response = http::Response<tonic::body::BoxBody>;
type Error = std::convert::Infallible;
type Future = BoxFuture<Self::Response, Self::Error>;
fn poll_ready(
&mut self,
_cx: &mut Context<'_>,
) -> Poll<Result<(), Self::Error>> {
Poll::Ready(Ok(()))
}
fn call(&mut self, req: http::Request<B>) -> Self::Future {
let inner = self.inner.clone();
match req.uri().path() {
"/cognito.PasswordService/forgotPassword" => {
#[allow(non_camel_case_types)]
struct forgotPasswordSvc<T: PasswordService>(pub Arc<T>);
impl<
T: PasswordService,
> tonic::server::UnaryService<::prost::alloc::string::String>
for forgotPasswordSvc<T> {
type Response = bool;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<::prost::alloc::string::String>,
) -> Self::Future {
let inner = self.0.clone();
let fut = async move {
(*inner).forgot_password(request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = forgotPasswordSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/cognito.PasswordService/resetPassword" => {
#[allow(non_camel_case_types)]
struct resetPasswordSvc<T: PasswordService>(pub Arc<T>);
impl<
T: PasswordService,
> tonic::server::UnaryService<super::ResetPasswordRequest>
for resetPasswordSvc<T> {
type Response = bool;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::ResetPasswordRequest>,
) -> Self::Future {
let inner = self.0.clone();
let fut = async move {
(*inner).reset_password(request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = resetPasswordSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
_ => {
Box::pin(async move {
Ok(
http::Response::builder()
.status(200)
.header("grpc-status", "12")
.header("content-type", "application/grpc")
.body(empty_body())
.unwrap(),
)
})
}
}
}
}
impl<T: PasswordService> Clone for PasswordServiceServer<T> {
fn clone(&self) -> Self {
let inner = self.inner.clone();
Self {
inner,
accept_compression_encodings: self.accept_compression_encodings,
send_compression_encodings: self.send_compression_encodings,
}
}
}
impl<T: PasswordService> Clone for _Inner<T> {
fn clone(&self) -> Self {
Self(self.0.clone())
}
}
impl<T: std::fmt::Debug> std::fmt::Debug for _Inner<T> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "{:?}", self.0)
}
}
impl<T: PasswordService> tonic::server::NamedService for PasswordServiceServer<T> {
const NAME: &'static str = "cognito.PasswordService";
}
}
pub mod group_service_server {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
#[async_trait]
pub trait GroupService: Send + Sync + 'static {
async fn get_group(
&self,
request: tonic::Request<::prost::alloc::string::String>,
) -> Result<tonic::Response<super::GroupResponse>, tonic::Status>;
async fn get_all_groups(
&self,
request: tonic::Request<()>,
) -> Result<tonic::Response<super::GroupsResponse>, tonic::Status>;
async fn create_group(
&self,
request: tonic::Request<super::CreateGroupRequest>,
) -> Result<tonic::Response<super::GroupResponse>, tonic::Status>;
async fn add_user_to_group(
&self,
request: tonic::Request<super::AddUserToGroupRequest>,
) -> Result<tonic::Response<bool>, tonic::Status>;
async fn get_users_in_group(
&self,
request: tonic::Request<::prost::alloc::string::String>,
) -> Result<tonic::Response<super::UsersResponse>, tonic::Status>;
}
#[derive(Debug)]
pub struct GroupServiceServer<T: GroupService> {
inner: _Inner<T>,
accept_compression_encodings: EnabledCompressionEncodings,
send_compression_encodings: EnabledCompressionEncodings,
}
struct _Inner<T>(Arc<T>);
impl<T: GroupService> GroupServiceServer<T> {
pub fn new(inner: T) -> Self {
Self::from_arc(Arc::new(inner))
}
pub fn from_arc(inner: Arc<T>) -> Self {
let inner = _Inner(inner);
Self {
inner,
accept_compression_encodings: Default::default(),
send_compression_encodings: Default::default(),
}
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> InterceptedService<Self, F>
where
F: tonic::service::Interceptor,
{
InterceptedService::new(Self::new(inner), interceptor)
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.accept_compression_encodings.enable(encoding);
self
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.send_compression_encodings.enable(encoding);
self
}
}
impl<T, B> tonic::codegen::Service<http::Request<B>> for GroupServiceServer<T>
where
T: GroupService,
B: Body + Send + 'static,
B::Error: Into<StdError> + Send + 'static,
{
type Response = http::Response<tonic::body::BoxBody>;
type Error = std::convert::Infallible;
type Future = BoxFuture<Self::Response, Self::Error>;
fn poll_ready(
&mut self,
_cx: &mut Context<'_>,
) -> Poll<Result<(), Self::Error>> {
Poll::Ready(Ok(()))
}
fn call(&mut self, req: http::Request<B>) -> Self::Future {
let inner = self.inner.clone();
match req.uri().path() {
"/cognito.GroupService/getGroup" => {
#[allow(non_camel_case_types)]
struct getGroupSvc<T: GroupService>(pub Arc<T>);
impl<
T: GroupService,
> tonic::server::UnaryService<::prost::alloc::string::String>
for getGroupSvc<T> {
type Response = super::GroupResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<::prost::alloc::string::String>,
) -> Self::Future {
let inner = self.0.clone();
let fut = async move { (*inner).get_group(request).await };
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = getGroupSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/cognito.GroupService/getAllGroups" => {
#[allow(non_camel_case_types)]
struct getAllGroupsSvc<T: GroupService>(pub Arc<T>);
impl<T: GroupService> tonic::server::UnaryService<()>
for getAllGroupsSvc<T> {
type Response = super::GroupsResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(&mut self, request: tonic::Request<()>) -> Self::Future {
let inner = self.0.clone();
let fut = async move {
(*inner).get_all_groups(request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = getAllGroupsSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/cognito.GroupService/createGroup" => {
#[allow(non_camel_case_types)]
struct createGroupSvc<T: GroupService>(pub Arc<T>);
impl<
T: GroupService,
> tonic::server::UnaryService<super::CreateGroupRequest>
for createGroupSvc<T> {
type Response = super::GroupResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::CreateGroupRequest>,
) -> Self::Future {
let inner = self.0.clone();
let fut = async move {
(*inner).create_group(request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = createGroupSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/cognito.GroupService/addUserToGroup" => {
#[allow(non_camel_case_types)]
struct addUserToGroupSvc<T: GroupService>(pub Arc<T>);
impl<
T: GroupService,
> tonic::server::UnaryService<super::AddUserToGroupRequest>
for addUserToGroupSvc<T> {
type Response = bool;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::AddUserToGroupRequest>,
) -> Self::Future {
let inner = self.0.clone();
let fut = async move {
(*inner).add_user_to_group(request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = addUserToGroupSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/cognito.GroupService/getUsersInGroup" => {
#[allow(non_camel_case_types)]
struct getUsersInGroupSvc<T: GroupService>(pub Arc<T>);
impl<
T: GroupService,
> tonic::server::UnaryService<::prost::alloc::string::String>
for getUsersInGroupSvc<T> {
type Response = super::UsersResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<::prost::alloc::string::String>,
) -> Self::Future {
let inner = self.0.clone();
let fut = async move {
(*inner).get_users_in_group(request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = getUsersInGroupSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
_ => {
Box::pin(async move {
Ok(
http::Response::builder()
.status(200)
.header("grpc-status", "12")
.header("content-type", "application/grpc")
.body(empty_body())
.unwrap(),
)
})
}
}
}
}
impl<T: GroupService> Clone for GroupServiceServer<T> {
fn clone(&self) -> Self {
let inner = self.inner.clone();
Self {
inner,
accept_compression_encodings: self.accept_compression_encodings,
send_compression_encodings: self.send_compression_encodings,
}
}
}
impl<T: GroupService> Clone for _Inner<T> {
fn clone(&self) -> Self {
Self(self.0.clone())
}
}
impl<T: std::fmt::Debug> std::fmt::Debug for _Inner<T> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "{:?}", self.0)
}
}
impl<T: GroupService> tonic::server::NamedService for GroupServiceServer<T> {
const NAME: &'static str = "cognito.GroupService";
}
}
pub mod component_health_service_server {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
#[async_trait]
pub trait ComponentHealthService: Send + Sync + 'static {
async fn show_details(
&self,
request: tonic::Request<()>,
) -> Result<tonic::Response<super::InternalHealthResponse>, tonic::Status>;
}
#[derive(Debug)]
pub struct ComponentHealthServiceServer<T: ComponentHealthService> {
inner: _Inner<T>,
accept_compression_encodings: EnabledCompressionEncodings,
send_compression_encodings: EnabledCompressionEncodings,
}
struct _Inner<T>(Arc<T>);
impl<T: ComponentHealthService> ComponentHealthServiceServer<T> {
pub fn new(inner: T) -> Self {
Self::from_arc(Arc::new(inner))
}
pub fn from_arc(inner: Arc<T>) -> Self {
let inner = _Inner(inner);
Self {
inner,
accept_compression_encodings: Default::default(),
send_compression_encodings: Default::default(),
}
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> InterceptedService<Self, F>
where
F: tonic::service::Interceptor,
{
InterceptedService::new(Self::new(inner), interceptor)
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.accept_compression_encodings.enable(encoding);
self
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.send_compression_encodings.enable(encoding);
self
}
}
impl<T, B> tonic::codegen::Service<http::Request<B>>
for ComponentHealthServiceServer<T>
where
T: ComponentHealthService,
B: Body + Send + 'static,
B::Error: Into<StdError> + Send + 'static,
{
type Response = http::Response<tonic::body::BoxBody>;
type Error = std::convert::Infallible;
type Future = BoxFuture<Self::Response, Self::Error>;
fn poll_ready(
&mut self,
_cx: &mut Context<'_>,
) -> Poll<Result<(), Self::Error>> {
Poll::Ready(Ok(()))
}
fn call(&mut self, req: http::Request<B>) -> Self::Future {
let inner = self.inner.clone();
match req.uri().path() {
"/cognito.ComponentHealthService/showDetails" => {
#[allow(non_camel_case_types)]
struct showDetailsSvc<T: ComponentHealthService>(pub Arc<T>);
impl<T: ComponentHealthService> tonic::server::UnaryService<()>
for showDetailsSvc<T> {
type Response = super::InternalHealthResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(&mut self, request: tonic::Request<()>) -> Self::Future {
let inner = self.0.clone();
let fut = async move {
(*inner).show_details(request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = showDetailsSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
_ => {
Box::pin(async move {
Ok(
http::Response::builder()
.status(200)
.header("grpc-status", "12")
.header("content-type", "application/grpc")
.body(empty_body())
.unwrap(),
)
})
}
}
}
}
impl<T: ComponentHealthService> Clone for ComponentHealthServiceServer<T> {
fn clone(&self) -> Self {
let inner = self.inner.clone();
Self {
inner,
accept_compression_encodings: self.accept_compression_encodings,
send_compression_encodings: self.send_compression_encodings,
}
}
}
impl<T: ComponentHealthService> Clone for _Inner<T> {
fn clone(&self) -> Self {
Self(self.0.clone())
}
}
impl<T: std::fmt::Debug> std::fmt::Debug for _Inner<T> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "{:?}", self.0)
}
}
impl<T: ComponentHealthService> tonic::server::NamedService
for ComponentHealthServiceServer<T> {
const NAME: &'static str = "cognito.ComponentHealthService";
}
}