1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
// This file is @generated by prost-build.
/// The information required to auto-retrieve an SMS.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AutoRetrievalInfo {
    /// The Android app's signature hash for Google Play Service's
    /// SMS Retriever API.
    #[prost(string, tag = "1")]
    pub app_signature_hash: ::prost::alloc::string::String,
}
/// App Verification info for a StartMfa request.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StartMfaPhoneRequestInfo {
    /// Required for enrollment. Phone number to be enrolled as MFA.
    #[prost(string, tag = "1")]
    pub phone_number: ::prost::alloc::string::String,
    /// iOS only. Receipt of successful app token validation with APNS.
    #[prost(string, tag = "2")]
    pub ios_receipt: ::prost::alloc::string::String,
    /// iOS only. Secret delivered to iOS app via APNS.
    #[prost(string, tag = "3")]
    pub ios_secret: ::prost::alloc::string::String,
    /// Web only. Recaptcha solution.
    #[prost(string, tag = "4")]
    pub recaptcha_token: ::prost::alloc::string::String,
    /// Android only. Used by Google Play Services to identify the app for
    /// auto-retrieval.
    #[prost(message, optional, tag = "5")]
    pub auto_retrieval_info: ::core::option::Option<AutoRetrievalInfo>,
    /// Android only. Used to assert application identity in place of a
    /// recaptcha token. A SafetyNet Token can be generated via the
    /// [SafetyNet Android Attestation
    /// API](<https://developer.android.com/training/safetynet/attestation.html>),
    /// with the Base64 encoding of the `phone_number` field as the nonce.
    #[prost(string, tag = "6")]
    pub safety_net_token: ::prost::alloc::string::String,
}
/// Phone Verification info for a StartMfa response.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StartMfaPhoneResponseInfo {
    /// An opaque string that represents the enrollment session.
    #[prost(string, tag = "1")]
    pub session_info: ::prost::alloc::string::String,
}
/// Phone Verification info for a FinalizeMfa request.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FinalizeMfaPhoneRequestInfo {
    /// An opaque string that represents the enrollment session.
    #[prost(string, tag = "1")]
    pub session_info: ::prost::alloc::string::String,
    /// User-entered verification code.
    #[prost(string, tag = "2")]
    pub code: ::prost::alloc::string::String,
    /// Android only. Uses for "instant" phone number verification though GmsCore.
    #[prost(string, tag = "3")]
    pub android_verification_proof: ::prost::alloc::string::String,
    /// Required if Android verification proof is presented.
    #[prost(string, tag = "4")]
    pub phone_number: ::prost::alloc::string::String,
}
/// Phone Verification info for a FinalizeMfa response.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FinalizeMfaPhoneResponseInfo {
    /// Android only. Long-lived replacement for valid code tied to android device.
    #[prost(string, tag = "1")]
    pub android_verification_proof: ::prost::alloc::string::String,
    /// Android only. Expiration time of verification proof in seconds.
    #[prost(message, optional, tag = "2")]
    pub android_verification_proof_expire_time: ::core::option::Option<
        ::prost_types::Timestamp,
    >,
    /// For Android verification proof.
    #[prost(string, tag = "3")]
    pub phone_number: ::prost::alloc::string::String,
}
/// Finalizes sign-in by verifying MFA challenge.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FinalizeMfaSignInRequest {
    /// Required. Pending credential from first factor sign-in.
    #[prost(string, tag = "2")]
    pub mfa_pending_credential: ::prost::alloc::string::String,
    /// The ID of the Identity Platform tenant the user is signing in to. If not
    /// set, the user will sign in to the default Identity Platform project.
    #[prost(string, tag = "4")]
    pub tenant_id: ::prost::alloc::string::String,
    /// Proof of completion of the MFA challenge.
    #[prost(oneof = "finalize_mfa_sign_in_request::VerificationInfo", tags = "3")]
    pub verification_info: ::core::option::Option<
        finalize_mfa_sign_in_request::VerificationInfo,
    >,
}
/// Nested message and enum types in `FinalizeMfaSignInRequest`.
pub mod finalize_mfa_sign_in_request {
    /// Proof of completion of the MFA challenge.
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum VerificationInfo {
        /// Proof of completion of the SMS based MFA challenge.
        #[prost(message, tag = "3")]
        PhoneVerificationInfo(super::FinalizeMfaPhoneRequestInfo),
    }
}
/// FinalizeMfaSignIn response.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FinalizeMfaSignInResponse {
    /// ID token for the authenticated user.
    #[prost(string, tag = "1")]
    pub id_token: ::prost::alloc::string::String,
    /// Refresh token for the authenticated user.
    #[prost(string, tag = "2")]
    pub refresh_token: ::prost::alloc::string::String,
    /// MFA verified sign-in information.
    #[prost(oneof = "finalize_mfa_sign_in_response::AuxiliaryAuthInfo", tags = "3")]
    pub auxiliary_auth_info: ::core::option::Option<
        finalize_mfa_sign_in_response::AuxiliaryAuthInfo,
    >,
}
/// Nested message and enum types in `FinalizeMfaSignInResponse`.
pub mod finalize_mfa_sign_in_response {
    /// MFA verified sign-in information.
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum AuxiliaryAuthInfo {
        /// Extra phone auth info, including android verification proof.
        #[prost(message, tag = "3")]
        PhoneAuthInfo(super::FinalizeMfaPhoneResponseInfo),
    }
}
/// Starts multi-factor sign-in by sending the multi-factor auth challenge.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StartMfaSignInRequest {
    /// Required. Pending credential from first factor sign-in.
    #[prost(string, tag = "2")]
    pub mfa_pending_credential: ::prost::alloc::string::String,
    /// Required. MFA enrollment id from the user's list of current MFA enrollments.
    #[prost(string, tag = "3")]
    pub mfa_enrollment_id: ::prost::alloc::string::String,
    /// The ID of the Identity Platform tenant the user is signing in to. If not
    /// set, the user will sign in to the default Identity Platform project.
    #[prost(string, tag = "5")]
    pub tenant_id: ::prost::alloc::string::String,
    /// MFA information by type of 2nd factor.
    #[prost(oneof = "start_mfa_sign_in_request::SignInInfo", tags = "4")]
    pub sign_in_info: ::core::option::Option<start_mfa_sign_in_request::SignInInfo>,
}
/// Nested message and enum types in `StartMfaSignInRequest`.
pub mod start_mfa_sign_in_request {
    /// MFA information by type of 2nd factor.
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum SignInInfo {
        /// Verification info to authorize sending an SMS for phone verification.
        #[prost(message, tag = "4")]
        PhoneSignInInfo(super::StartMfaPhoneRequestInfo),
    }
}
/// StartMfaSignIn response.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StartMfaSignInResponse {
    /// MultiFactor start sign-in response by 2nd factor type.
    #[prost(oneof = "start_mfa_sign_in_response::ResponseInfo", tags = "1")]
    pub response_info: ::core::option::Option<start_mfa_sign_in_response::ResponseInfo>,
}
/// Nested message and enum types in `StartMfaSignInResponse`.
pub mod start_mfa_sign_in_response {
    /// MultiFactor start sign-in response by 2nd factor type.
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum ResponseInfo {
        /// MultiFactor sign-in session information specific to SMS-type second
        /// factors. Along with the one-time code retrieved from the sent SMS, the
        /// contents of this session information should be passed to
        /// FinalizeMfaSignIn to complete the sign in.
        #[prost(message, tag = "1")]
        PhoneResponseInfo(super::StartMfaPhoneResponseInfo),
    }
}
/// Generated client implementations.
pub mod authentication_service_client {
    #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
    use tonic::codegen::*;
    use tonic::codegen::http::Uri;
    /// 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::Error: Into<StdError>,
        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::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,
        ) -> AuthenticationServiceClient<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> + std::marker::Send + std::marker::Sync,
        {
            AuthenticationServiceClient::new(InterceptedService::new(inner, interceptor))
        }
        /// Compress requests with the given encoding.
        ///
        /// This requires the server to support it otherwise it might respond with an
        /// error.
        #[must_use]
        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.inner = self.inner.send_compressed(encoding);
            self
        }
        /// Enable decompressing responses.
        #[must_use]
        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.inner = self.inner.accept_compressed(encoding);
            self
        }
        /// Limits the maximum size of a decoded message.
        ///
        /// Default: `4MB`
        #[must_use]
        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
            self.inner = self.inner.max_decoding_message_size(limit);
            self
        }
        /// Limits the maximum size of an encoded message.
        ///
        /// Default: `usize::MAX`
        #[must_use]
        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
            self.inner = self.inner.max_encoding_message_size(limit);
            self
        }
        /// Verifies the MFA challenge and performs sign-in
        pub async fn finalize_mfa_sign_in(
            &mut self,
            request: impl tonic::IntoRequest<super::FinalizeMfaSignInRequest>,
        ) -> std::result::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",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.cloud.identitytoolkit.v2.AuthenticationService",
                        "FinalizeMfaSignIn",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Sends the MFA challenge
        pub async fn start_mfa_sign_in(
            &mut self,
            request: impl tonic::IntoRequest<super::StartMfaSignInRequest>,
        ) -> std::result::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",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.cloud.identitytoolkit.v2.AuthenticationService",
                        "StartMfaSignIn",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
    }
}
/// Finishes enrolling a second factor for the user.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FinalizeMfaEnrollmentRequest {
    /// Required. ID token.
    #[prost(string, tag = "1")]
    pub id_token: ::prost::alloc::string::String,
    /// Display name which is entered  by users to distinguish between different
    /// second factors with same type or different type.
    #[prost(string, tag = "3")]
    pub display_name: ::prost::alloc::string::String,
    /// The ID of the Identity Platform tenant that the user enrolling MFA belongs
    /// to. If not set, the user belongs to the default Identity Platform project.
    #[prost(string, tag = "5")]
    pub tenant_id: ::prost::alloc::string::String,
    /// MFA enrollment information to be verified.
    #[prost(oneof = "finalize_mfa_enrollment_request::VerificationInfo", tags = "4")]
    pub verification_info: ::core::option::Option<
        finalize_mfa_enrollment_request::VerificationInfo,
    >,
}
/// Nested message and enum types in `FinalizeMfaEnrollmentRequest`.
pub mod finalize_mfa_enrollment_request {
    /// MFA enrollment information to be verified.
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum VerificationInfo {
        /// Verification info to authorize sending an SMS for phone verification.
        #[prost(message, tag = "4")]
        PhoneVerificationInfo(super::FinalizeMfaPhoneRequestInfo),
    }
}
/// FinalizeMfaEnrollment response.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FinalizeMfaEnrollmentResponse {
    /// ID token updated to reflect MFA enrollment.
    #[prost(string, tag = "1")]
    pub id_token: ::prost::alloc::string::String,
    /// Refresh token updated to reflect MFA enrollment.
    #[prost(string, tag = "2")]
    pub refresh_token: ::prost::alloc::string::String,
    /// MFA verified enrollment information.
    #[prost(oneof = "finalize_mfa_enrollment_response::AuxiliaryAuthInfo", tags = "3")]
    pub auxiliary_auth_info: ::core::option::Option<
        finalize_mfa_enrollment_response::AuxiliaryAuthInfo,
    >,
}
/// Nested message and enum types in `FinalizeMfaEnrollmentResponse`.
pub mod finalize_mfa_enrollment_response {
    /// MFA verified enrollment information.
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum AuxiliaryAuthInfo {
        /// Auxiliary auth info specific to phone auth.
        #[prost(message, tag = "3")]
        PhoneAuthInfo(super::FinalizeMfaPhoneResponseInfo),
    }
}
/// Sends MFA enrollment verification SMS for a user.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StartMfaEnrollmentRequest {
    /// Required. User's ID token.
    #[prost(string, tag = "1")]
    pub id_token: ::prost::alloc::string::String,
    /// The ID of the Identity Platform tenant that the user enrolling MFA belongs
    /// to. If not set, the user belongs to the default Identity Platform project.
    #[prost(string, tag = "4")]
    pub tenant_id: ::prost::alloc::string::String,
    /// MFA information by type of 2nd factor.
    #[prost(oneof = "start_mfa_enrollment_request::EnrollmentInfo", tags = "3")]
    pub enrollment_info: ::core::option::Option<
        start_mfa_enrollment_request::EnrollmentInfo,
    >,
}
/// Nested message and enum types in `StartMfaEnrollmentRequest`.
pub mod start_mfa_enrollment_request {
    /// MFA information by type of 2nd factor.
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum EnrollmentInfo {
        /// Verification info to authorize sending an SMS for phone verification.
        #[prost(message, tag = "3")]
        PhoneEnrollmentInfo(super::StartMfaPhoneRequestInfo),
    }
}
/// StartMfaEnrollment response.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StartMfaEnrollmentResponse {
    /// MFA start enrollment response by 2nd factor type.
    #[prost(oneof = "start_mfa_enrollment_response::EnrollmentResponse", tags = "1")]
    pub enrollment_response: ::core::option::Option<
        start_mfa_enrollment_response::EnrollmentResponse,
    >,
}
/// Nested message and enum types in `StartMfaEnrollmentResponse`.
pub mod start_mfa_enrollment_response {
    /// MFA start enrollment response by 2nd factor type.
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum EnrollmentResponse {
        /// Verification info to authorize sending an SMS for phone verification.
        #[prost(message, tag = "1")]
        PhoneSessionInfo(super::StartMfaPhoneResponseInfo),
    }
}
/// Withdraws MFA.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct WithdrawMfaRequest {
    /// Required. User's ID token.
    #[prost(string, tag = "1")]
    pub id_token: ::prost::alloc::string::String,
    /// Required. MFA enrollment id from a current MFA enrollment.
    #[prost(string, tag = "2")]
    pub mfa_enrollment_id: ::prost::alloc::string::String,
    /// The ID of the Identity Platform tenant that the user unenrolling MFA
    /// belongs to. If not set, the user belongs to the default Identity Platform
    /// project.
    #[prost(string, tag = "3")]
    pub tenant_id: ::prost::alloc::string::String,
}
/// Withdraws MultiFactorAuth response.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct WithdrawMfaResponse {
    /// ID token updated to reflect removal of the second factor.
    #[prost(string, tag = "1")]
    pub id_token: ::prost::alloc::string::String,
    /// Refresh token updated to reflect removal of the second factor.
    #[prost(string, tag = "2")]
    pub refresh_token: ::prost::alloc::string::String,
}
/// Generated client implementations.
pub mod account_management_service_client {
    #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
    use tonic::codegen::*;
    use tonic::codegen::http::Uri;
    /// 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::Error: Into<StdError>,
        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::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,
        ) -> AccountManagementServiceClient<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> + std::marker::Send + std::marker::Sync,
        {
            AccountManagementServiceClient::new(
                InterceptedService::new(inner, interceptor),
            )
        }
        /// Compress requests with the given encoding.
        ///
        /// This requires the server to support it otherwise it might respond with an
        /// error.
        #[must_use]
        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.inner = self.inner.send_compressed(encoding);
            self
        }
        /// Enable decompressing responses.
        #[must_use]
        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.inner = self.inner.accept_compressed(encoding);
            self
        }
        /// Limits the maximum size of a decoded message.
        ///
        /// Default: `4MB`
        #[must_use]
        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
            self.inner = self.inner.max_decoding_message_size(limit);
            self
        }
        /// Limits the maximum size of an encoded message.
        ///
        /// Default: `usize::MAX`
        #[must_use]
        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
            self.inner = self.inner.max_encoding_message_size(limit);
            self
        }
        /// Finishes enrolling a second factor for the user.
        pub async fn finalize_mfa_enrollment(
            &mut self,
            request: impl tonic::IntoRequest<super::FinalizeMfaEnrollmentRequest>,
        ) -> std::result::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",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.cloud.identitytoolkit.v2.AccountManagementService",
                        "FinalizeMfaEnrollment",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Step one of the MFA enrollment process. In SMS case, this sends an
        /// SMS verification code to the user.
        pub async fn start_mfa_enrollment(
            &mut self,
            request: impl tonic::IntoRequest<super::StartMfaEnrollmentRequest>,
        ) -> std::result::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",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.cloud.identitytoolkit.v2.AccountManagementService",
                        "StartMfaEnrollment",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// 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>,
        ) -> std::result::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",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.cloud.identitytoolkit.v2.AccountManagementService",
                        "WithdrawMfa",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
    }
}