FIRGetOOBConfirmationCodeRequest.h 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  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 <Foundation/Foundation.h>
  17. #import "FIRAuthRPCRequest.h"
  18. #import "FIRIdentityToolkitRequest.h"
  19. @class FIRActionCodeSettings;
  20. NS_ASSUME_NONNULL_BEGIN
  21. /** @enum FIRGetOOBConfirmationCodeRequestType
  22. @brief Types of OOB Confirmation Code requests.
  23. */
  24. typedef NS_ENUM(NSInteger, FIRGetOOBConfirmationCodeRequestType) {
  25. /** @var FIRGetOOBConfirmationCodeRequestTypePasswordReset
  26. @brief Requests a password reset code.
  27. */
  28. FIRGetOOBConfirmationCodeRequestTypePasswordReset,
  29. /** @var FIRGetOOBConfirmationCodeRequestTypeVerifyEmail
  30. @brief Requests an email verification code.
  31. */
  32. FIRGetOOBConfirmationCodeRequestTypeVerifyEmail,
  33. };
  34. /** @enum FIRGetOOBConfirmationCodeRequest
  35. @brief Represents the parameters for the getOOBConfirmationCode endpoint.
  36. */
  37. @interface FIRGetOOBConfirmationCodeRequest : FIRIdentityToolkitRequest <FIRAuthRPCRequest>
  38. /** @property requestType
  39. @brief The types of OOB Confirmation Code to request.
  40. */
  41. @property(nonatomic, assign, readonly) FIRGetOOBConfirmationCodeRequestType requestType;
  42. /** @property email
  43. @brief The email of the user.
  44. @remarks For password reset.
  45. */
  46. @property(nonatomic, copy, nullable, readonly) NSString *email;
  47. /** @property accessToken
  48. @brief The STS Access Token of the authenticated user.
  49. @remarks For email change.
  50. */
  51. @property(nonatomic, copy, nullable, readonly) NSString *accessToken;
  52. /** @property continueURL
  53. @brief This URL represents the state/Continue URL in the form of a universal link.
  54. */
  55. @property(nonatomic, copy, nullable, readonly) NSString *continueURL;
  56. /** @property iOSBundleID
  57. @brief The iOS bundle Identifier, if available.
  58. */
  59. @property(nonatomic, copy, nullable, readonly) NSString *iOSBundleID;
  60. /** @property androidPackageName
  61. @brief The Android package name, if available.
  62. */
  63. @property(nonatomic, copy, nullable, readonly) NSString *androidPackageName;
  64. /** @property androidMinimumVersion
  65. @brief The minimum Android version supported, if available.
  66. */
  67. @property(nonatomic, copy, nullable, readonly) NSString *androidMinimumVersion;
  68. /** @property androidInstallIfNotAvailable
  69. @brief Indicates whether or not the Android app should be installed if not already available.
  70. */
  71. @property(nonatomic, assign, readonly) BOOL androidInstallApp;
  72. /** @property handleCodeInApp
  73. @brief Indicates whether the action code link will open the app directly or after being
  74. redirected from a Firebase owned web widget.
  75. */
  76. @property(assign, nonatomic) BOOL handleCodeInApp;
  77. /** @fn passwordResetRequestWithEmail:APIKey:
  78. @brief Creates a password reset request.
  79. @param email The user's email address.
  80. @param actionCodeSettings An object of FIRActionCodeSettings which specifies action code
  81. settings to be applied to the password reset request.
  82. @param requestConfiguration An object containing configurations to be added to the request.
  83. @return A password reset request.
  84. */
  85. + (nullable FIRGetOOBConfirmationCodeRequest *)
  86. passwordResetRequestWithEmail:(NSString *)email
  87. actionCodeSettings:(nullable FIRActionCodeSettings *)actionCodeSettings
  88. requestConfiguration:(FIRAuthRequestConfiguration *)requestConfiguration;
  89. /** @fn verifyEmailRequestWithAccessToken:APIKey:
  90. @brief Creates a password reset request.
  91. @param accessToken The user's STS Access Token.
  92. @param actionCodeSettings An object of FIRActionCodeSettings which specifies action code
  93. settings to be applied to the email verification request.
  94. @param requestConfiguration An object containing configurations to be added to the request.
  95. @return A password reset request.
  96. */
  97. + (nullable FIRGetOOBConfirmationCodeRequest *)
  98. verifyEmailRequestWithAccessToken:(NSString *)accessToken
  99. actionCodeSettings:(nullable FIRActionCodeSettings *)actionCodeSettings
  100. requestConfiguration:(FIRAuthRequestConfiguration *)requestConfiguration;
  101. /** @fn init
  102. @brief Please use a factory method.
  103. */
  104. - (nullable instancetype)initWithEndpoint:(NSString *)endpoint
  105. requestConfiguration:(FIRAuthRequestConfiguration *)requestConfiguration
  106. NS_UNAVAILABLE;
  107. @end
  108. NS_ASSUME_NONNULL_END