#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AutoRetrievalInfo {
#[prost(string, tag = "1")]
pub app_signature_hash: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StartMfaPhoneRequestInfo {
#[prost(string, tag = "1")]
pub phone_number: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub ios_receipt: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub ios_secret: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub recaptcha_token: ::prost::alloc::string::String,
#[prost(message, optional, tag = "5")]
pub auto_retrieval_info: ::core::option::Option<AutoRetrievalInfo>,
#[prost(string, tag = "6")]
pub safety_net_token: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StartMfaPhoneResponseInfo {
#[prost(string, tag = "1")]
pub session_info: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FinalizeMfaPhoneRequestInfo {
#[prost(string, tag = "1")]
pub session_info: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub code: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub android_verification_proof: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub phone_number: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FinalizeMfaPhoneResponseInfo {
#[prost(string, tag = "1")]
pub android_verification_proof: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub android_verification_proof_expire_time: ::core::option::Option<::prost_types::Timestamp>,
#[prost(string, tag = "3")]
pub phone_number: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FinalizeMfaEnrollmentRequest {
#[prost(string, tag = "1")]
pub id_token: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub display_name: ::prost::alloc::string::String,
#[prost(string, tag = "5")]
pub tenant_id: ::prost::alloc::string::String,
#[prost(oneof = "finalize_mfa_enrollment_request::VerificationInfo", tags = "4")]
pub verification_info:
::core::option::Option<finalize_mfa_enrollment_request::VerificationInfo>,
}
pub mod finalize_mfa_enrollment_request {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum VerificationInfo {
#[prost(message, tag = "4")]
PhoneVerificationInfo(super::FinalizeMfaPhoneRequestInfo),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FinalizeMfaEnrollmentResponse {
#[prost(string, tag = "1")]
pub id_token: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub refresh_token: ::prost::alloc::string::String,
#[prost(oneof = "finalize_mfa_enrollment_response::AuxiliaryAuthInfo", tags = "3")]
pub auxiliary_auth_info:
::core::option::Option<finalize_mfa_enrollment_response::AuxiliaryAuthInfo>,
}
pub mod finalize_mfa_enrollment_response {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum AuxiliaryAuthInfo {
#[prost(message, tag = "3")]
PhoneAuthInfo(super::FinalizeMfaPhoneResponseInfo),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StartMfaEnrollmentRequest {
#[prost(string, tag = "1")]
pub id_token: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub tenant_id: ::prost::alloc::string::String,
#[prost(oneof = "start_mfa_enrollment_request::EnrollmentInfo", tags = "3")]
pub enrollment_info: ::core::option::Option<start_mfa_enrollment_request::EnrollmentInfo>,
}
pub mod start_mfa_enrollment_request {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum EnrollmentInfo {
#[prost(message, tag = "3")]
PhoneEnrollmentInfo(super::StartMfaPhoneRequestInfo),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StartMfaEnrollmentResponse {
#[prost(oneof = "start_mfa_enrollment_response::EnrollmentResponse", tags = "1")]
pub enrollment_response:
::core::option::Option<start_mfa_enrollment_response::EnrollmentResponse>,
}
pub mod start_mfa_enrollment_response {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum EnrollmentResponse {
#[prost(message, tag = "1")]
PhoneSessionInfo(super::StartMfaPhoneResponseInfo),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct WithdrawMfaRequest {
#[prost(string, tag = "1")]
pub id_token: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub mfa_enrollment_id: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub tenant_id: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct WithdrawMfaResponse {
#[prost(string, tag = "1")]
pub id_token: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub refresh_token: ::prost::alloc::string::String,
}
#[doc = r" Generated client implementations."]
pub mod account_management_service_client {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
#[doc = " Account management for Identity Toolkit"]
#[derive(Debug, Clone)]
pub struct AccountManagementServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl<T> AccountManagementServiceClient<T>
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
T::ResponseBody: Body + Send + 'static,
T::Error: Into<StdError>,
<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_interceptor<F>(
inner: T,
interceptor: F,
) -> AccountManagementServiceClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
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,
{
AccountManagementServiceClient::new(InterceptedService::new(inner, interceptor))
}
#[doc = r" Compress requests with `gzip`."]
#[doc = r""]
#[doc = r" This requires the server to support it otherwise it might respond with an"]
#[doc = r" error."]
pub fn send_gzip(mut self) -> Self {
self.inner = self.inner.send_gzip();
self
}
#[doc = r" Enable decompressing responses with `gzip`."]
pub fn accept_gzip(mut self) -> Self {
self.inner = self.inner.accept_gzip();
self
}
#[doc = " Finishes enrolling a second factor for the user."]
pub async fn finalize_mfa_enrollment(
&mut self,
request: impl tonic::IntoRequest<super::FinalizeMfaEnrollmentRequest>,
) -> Result<tonic::Response<super::FinalizeMfaEnrollmentResponse>, 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.identitytoolkit.v2.AccountManagementService/FinalizeMfaEnrollment",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Step one of the MFA enrollment process. In SMS case, this sends an"]
#[doc = " SMS verification code to the user."]
pub async fn start_mfa_enrollment(
&mut self,
request: impl tonic::IntoRequest<super::StartMfaEnrollmentRequest>,
) -> Result<tonic::Response<super::StartMfaEnrollmentResponse>, 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.identitytoolkit.v2.AccountManagementService/StartMfaEnrollment",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Revokes one second factor from the enrolled second factors for an account."]
pub async fn withdraw_mfa(
&mut self,
request: impl tonic::IntoRequest<super::WithdrawMfaRequest>,
) -> Result<tonic::Response<super::WithdrawMfaResponse>, 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.identitytoolkit.v2.AccountManagementService/WithdrawMfa",
);
self.inner.unary(request.into_request(), path, codec).await
}
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FinalizeMfaSignInRequest {
#[prost(string, tag = "2")]
pub mfa_pending_credential: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub tenant_id: ::prost::alloc::string::String,
#[prost(oneof = "finalize_mfa_sign_in_request::VerificationInfo", tags = "3")]
pub verification_info: ::core::option::Option<finalize_mfa_sign_in_request::VerificationInfo>,
}
pub mod finalize_mfa_sign_in_request {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum VerificationInfo {
#[prost(message, tag = "3")]
PhoneVerificationInfo(super::FinalizeMfaPhoneRequestInfo),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FinalizeMfaSignInResponse {
#[prost(string, tag = "1")]
pub id_token: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub refresh_token: ::prost::alloc::string::String,
#[prost(oneof = "finalize_mfa_sign_in_response::AuxiliaryAuthInfo", tags = "3")]
pub auxiliary_auth_info:
::core::option::Option<finalize_mfa_sign_in_response::AuxiliaryAuthInfo>,
}
pub mod finalize_mfa_sign_in_response {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum AuxiliaryAuthInfo {
#[prost(message, tag = "3")]
PhoneAuthInfo(super::FinalizeMfaPhoneResponseInfo),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StartMfaSignInRequest {
#[prost(string, tag = "2")]
pub mfa_pending_credential: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub mfa_enrollment_id: ::prost::alloc::string::String,
#[prost(string, tag = "5")]
pub tenant_id: ::prost::alloc::string::String,
#[prost(oneof = "start_mfa_sign_in_request::SignInInfo", tags = "4")]
pub sign_in_info: ::core::option::Option<start_mfa_sign_in_request::SignInInfo>,
}
pub mod start_mfa_sign_in_request {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum SignInInfo {
#[prost(message, tag = "4")]
PhoneSignInInfo(super::StartMfaPhoneRequestInfo),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StartMfaSignInResponse {
#[prost(oneof = "start_mfa_sign_in_response::ResponseInfo", tags = "1")]
pub response_info: ::core::option::Option<start_mfa_sign_in_response::ResponseInfo>,
}
pub mod start_mfa_sign_in_response {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum ResponseInfo {
#[prost(message, tag = "1")]
PhoneResponseInfo(super::StartMfaPhoneResponseInfo),
}
}
#[doc = r" Generated client implementations."]
pub mod authentication_service_client {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
#[doc = " Authentication for Identity Toolkit"]
#[derive(Debug, Clone)]
pub struct AuthenticationServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl<T> AuthenticationServiceClient<T>
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
T::ResponseBody: Body + Send + 'static,
T::Error: Into<StdError>,
<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_interceptor<F>(
inner: T,
interceptor: F,
) -> AuthenticationServiceClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
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,
{
AuthenticationServiceClient::new(InterceptedService::new(inner, interceptor))
}
#[doc = r" Compress requests with `gzip`."]
#[doc = r""]
#[doc = r" This requires the server to support it otherwise it might respond with an"]
#[doc = r" error."]
pub fn send_gzip(mut self) -> Self {
self.inner = self.inner.send_gzip();
self
}
#[doc = r" Enable decompressing responses with `gzip`."]
pub fn accept_gzip(mut self) -> Self {
self.inner = self.inner.accept_gzip();
self
}
#[doc = " Verifies the MFA challenge and performs sign-in"]
pub async fn finalize_mfa_sign_in(
&mut self,
request: impl tonic::IntoRequest<super::FinalizeMfaSignInRequest>,
) -> Result<tonic::Response<super::FinalizeMfaSignInResponse>, 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.identitytoolkit.v2.AuthenticationService/FinalizeMfaSignIn",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Sends the MFA challenge"]
pub async fn start_mfa_sign_in(
&mut self,
request: impl tonic::IntoRequest<super::StartMfaSignInRequest>,
) -> Result<tonic::Response<super::StartMfaSignInResponse>, 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.identitytoolkit.v2.AuthenticationService/StartMfaSignIn",
);
self.inner.unary(request.into_request(), path, codec).await
}
}
}