FIRGetAccountInfoResponse.h 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  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 "FirebaseAuth/Sources/Backend/FIRAuthRPCResponse.h"
  17. #import "FirebaseAuth/Sources/Backend/RPC/Proto/FIRAuthProtoMFAEnrollment.h"
  18. #import "FirebaseAuth/Sources/Public/FirebaseAuth/FIRPasskeyInfo.h"
  19. NS_ASSUME_NONNULL_BEGIN
  20. /** @class FIRGetAccountInfoResponseProviderUserInfo
  21. @brief Represents the provider user info part of the response from the getAccountInfo endpoint.
  22. @see https://developers.google.com/identity/toolkit/web/reference/relyingparty/getAccountInfo
  23. */
  24. @interface FIRGetAccountInfoResponseProviderUserInfo : NSObject
  25. /** @property providerID
  26. @brief The ID of the identity provider.
  27. */
  28. @property(nonatomic, strong, readonly, nullable) NSString *providerID;
  29. /** @property displayName
  30. @brief The user's display name at the identity provider.
  31. */
  32. @property(nonatomic, strong, readonly, nullable) NSString *displayName;
  33. /** @property photoURL
  34. @brief The user's photo URL at the identity provider.
  35. */
  36. @property(nonatomic, strong, readonly, nullable) NSURL *photoURL;
  37. /** @property federatedID
  38. @brief The user's identifier at the identity provider.
  39. */
  40. @property(nonatomic, strong, readonly, nullable) NSString *federatedID;
  41. /** @property email
  42. @brief The user's email at the identity provider.
  43. */
  44. @property(nonatomic, strong, readonly, nullable) NSString *email;
  45. /** @property phoneNumber
  46. @brief A phone number associated with the user.
  47. */
  48. @property(nonatomic, readonly, nullable) NSString *phoneNumber;
  49. /** @fn init
  50. @brief Please use initWithDictionary:
  51. */
  52. - (instancetype)init NS_UNAVAILABLE;
  53. /** @fn initWithAPIKey:
  54. @brief Designated initializer.
  55. @param dictionary The provider user info data from endpoint.
  56. */
  57. - (instancetype)initWithDictionary:(NSDictionary *)dictionary NS_DESIGNATED_INITIALIZER;
  58. @end
  59. /** @class FIRGetAccountInfoResponseUser
  60. @brief Represents the firebase user info part of the response from the getAccountInfo endpoint.
  61. @see https://developers.google.com/identity/toolkit/web/reference/relyingparty/getAccountInfo
  62. */
  63. @interface FIRGetAccountInfoResponseUser : NSObject
  64. /** @property localID
  65. @brief The ID of the user.
  66. */
  67. @property(nonatomic, strong, readonly, nullable) NSString *localID;
  68. /** @property email
  69. @brief The email or the user.
  70. */
  71. @property(nonatomic, strong, readonly, nullable) NSString *email;
  72. /** @property emailVerified
  73. @brief Whether the email has been verified.
  74. */
  75. @property(nonatomic, assign, readonly) BOOL emailVerified;
  76. /** @property displayName
  77. @brief The display name of the user.
  78. */
  79. @property(nonatomic, strong, readonly, nullable) NSString *displayName;
  80. /** @property photoURL
  81. @brief The user's photo URL.
  82. */
  83. @property(nonatomic, strong, readonly, nullable) NSURL *photoURL;
  84. /** @property creationDate
  85. @brief The user's creation date.
  86. */
  87. @property(nonatomic, strong, readonly, nullable) NSDate *creationDate;
  88. /** @property lastSignInDate
  89. @brief The user's last login date.
  90. */
  91. @property(nonatomic, strong, readonly, nullable) NSDate *lastLoginDate;
  92. /** @property providerUserInfo
  93. @brief The user's profiles at the associated identity providers.
  94. */
  95. @property(nonatomic, strong, readonly, nullable)
  96. NSArray<FIRGetAccountInfoResponseProviderUserInfo *> *providerUserInfo;
  97. /** @property passwordHash
  98. @brief Information about user's password.
  99. @remarks This is not necessarily the hash of user's actual password.
  100. */
  101. @property(nonatomic, strong, readonly, nullable) NSString *passwordHash;
  102. /** @property phoneNumber
  103. @brief A phone number associated with the user.
  104. */
  105. @property(nonatomic, readonly, nullable) NSString *phoneNumber;
  106. @property(nonatomic, strong, readonly, nullable)
  107. NSArray<FIRAuthProtoMFAEnrollment *> *MFAEnrollments;
  108. /**
  109. @property enrolledPasskeys
  110. @brief A list of enrolled passkeys of the user.
  111. */
  112. @property(nonatomic, strong, readonly, nullable) NSArray<FIRPasskeyInfo *> *enrolledPasskeys;
  113. /** @fn init
  114. @brief Please use initWithDictionary:
  115. */
  116. - (instancetype)init NS_UNAVAILABLE;
  117. /** @fn initWithAPIKey:
  118. @brief Designated initializer.
  119. @param dictionary The provider user info data from endpoint.
  120. */
  121. - (instancetype)initWithDictionary:(NSDictionary *)dictionary NS_DESIGNATED_INITIALIZER;
  122. @end
  123. /** @class FIRGetAccountInfoResponse
  124. @brief Represents the response from the setAccountInfo endpoint.
  125. @see https://developers.google.com/identity/toolkit/web/reference/relyingparty/getAccountInfo
  126. */
  127. @interface FIRGetAccountInfoResponse : NSObject <FIRAuthRPCResponse>
  128. /** @property providerUserInfo
  129. @brief The requested users' profiles.
  130. */
  131. @property(nonatomic, strong, readonly, nullable) NSArray<FIRGetAccountInfoResponseUser *> *users;
  132. @end
  133. NS_ASSUME_NONNULL_END