You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

91 lines
3.7 KiB

6 years ago
  1. /*
  2. * Copyright 2017 Google
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. #import "FIRIdentityToolkitRequest.h"
  17. #import "FIRAuthOperationType.h"
  18. #import "FIRAuthRPCRequest.h"
  19. NS_ASSUME_NONNULL_BEGIN
  20. @interface FIRVerifyPhoneNumberRequest : FIRIdentityToolkitRequest <FIRAuthRPCRequest>
  21. /** @property verificationID
  22. @brief The verification ID obtained from the response of @c sendVerificationCode.
  23. */
  24. @property(nonatomic, readonly, nullable) NSString *verificationID;
  25. /** @property verificationCode
  26. @brief The verification code provided by the user.
  27. */
  28. @property(nonatomic, readonly, nullable) NSString *verificationCode;
  29. /** @property accessToken
  30. @brief The STS Access Token for the authenticated user.
  31. */
  32. @property(nonatomic, copy, nullable) NSString *accessToken;
  33. /** @var temporaryProof
  34. @brief The temporary proof code, previously returned from the backend.
  35. */
  36. @property(nonatomic, readonly, nonnull) NSString *temporaryProof;
  37. /** @var phoneNumber
  38. @brief The phone number to be verified in the request.
  39. */
  40. @property(nonatomic, readonly, nonnull) NSString *phoneNumber;
  41. /** @var operation
  42. @brief The type of operation triggering this verify phone number request.
  43. */
  44. @property(nonatomic, assign, readonly) FIRAuthOperationType operation;
  45. /** @fn initWithEndpoint:requestConfiguration:
  46. @brief Please use initWithVerificationID:verificationCode:requestConfiguration
  47. */
  48. - (nullable instancetype)initWithEndpoint:(NSString *)endpoint
  49. requestConfiguration:(FIRAuthRequestConfiguration *)requestConfiguration
  50. NS_UNAVAILABLE;
  51. /** @fn initWithTemporaryProof:phoneNumberAPIKey
  52. @brief Designated initializer.
  53. @param temporaryProof The temporary proof sent by the backed.
  54. @param phoneNumber The phone number associated with the credential to be signed in.
  55. @param operation Indicates what operation triggered the verify phone number request.
  56. @param requestConfiguration An object containing configurations to be added to the request.
  57. */
  58. - (nullable instancetype)initWithTemporaryProof:(NSString *)temporaryProof
  59. phoneNumber:(NSString *)phoneNumber
  60. operation:(FIRAuthOperationType)operation
  61. requestConfiguration:(FIRAuthRequestConfiguration *)requestConfiguration
  62. NS_DESIGNATED_INITIALIZER;
  63. /** @fn initWithVerificationID:verificationCode:requestConfiguration
  64. @brief Designated initializer.
  65. @param verificationID The verification ID obtained from the response of @c sendVerificationCode.
  66. @param verificationCode The verification code provided by the user.
  67. @param operation Indicates what operation triggered the verify phone number request.
  68. @param requestConfiguration An object containing configurations to be added to the request.
  69. */
  70. - (nullable instancetype)initWithVerificationID:(NSString *)verificationID
  71. verificationCode:(NSString *)verificationCode
  72. operation:(FIRAuthOperationType)operation
  73. requestConfiguration:(FIRAuthRequestConfiguration *)requestConfiguration
  74. NS_DESIGNATED_INITIALIZER;
  75. @end
  76. NS_ASSUME_NONNULL_END