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.

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