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.

151 lines
4.9 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 "FIRAuthRPCRequest.h"
  18. #import "FIRIdentityToolkitRequest.h"
  19. @class FIRGetAccountInfoResponse;
  20. NS_ASSUME_NONNULL_BEGIN
  21. /** @var FIRSetAccountInfoUserAttributeEmail
  22. @brief Constant for email attribute used in "deleteAttributes".
  23. */
  24. extern NSString *const FIRSetAccountInfoUserAttributeEmail;
  25. /** @var FIRSetAccountInfoUserAttributeDisplayName
  26. @brief Constant for displayName attribute used in "deleteAttributes".
  27. */
  28. extern NSString *const FIRSetAccountInfoUserAttributeDisplayName;
  29. /** @var FIRSetAccountInfoUserAttributeProvider
  30. @brief Constant for provider attribute used in "deleteAttributes".
  31. */
  32. extern NSString *const FIRSetAccountInfoUserAttributeProvider;
  33. /** @var FIRSetAccountInfoUserAttributePhotoURL
  34. @brief Constant for photoURL attribute used in "deleteAttributes".
  35. */
  36. extern NSString *const FIRSetAccountInfoUserAttributePhotoURL;
  37. /** @var FIRSetAccountInfoUserAttributePassword
  38. @brief Constant for password attribute used in "deleteAttributes".
  39. */
  40. extern NSString *const FIRSetAccountInfoUserAttributePassword;
  41. /** @class FIRSetAccountInfoRequest
  42. @brief Represents the parameters for the setAccountInfo endpoint.
  43. @see https://developers.google.com/identity/toolkit/web/reference/relyingparty/setAccountInfo
  44. */
  45. @interface FIRSetAccountInfoRequest : FIRIdentityToolkitRequest <FIRAuthRPCRequest>
  46. /** @property accessToken
  47. @brief The STS Access Token of the authenticated user.
  48. */
  49. @property(nonatomic, copy, nullable) NSString *accessToken;
  50. /** @property displayName
  51. @brief The name of the user.
  52. */
  53. @property(nonatomic, copy, nullable) NSString *displayName;
  54. /** @property localID
  55. @brief The local ID of the user.
  56. */
  57. @property(nonatomic, copy, nullable) NSString *localID;
  58. /** @property email
  59. @brief The email of the user.
  60. */
  61. @property(nonatomic, copy, nullable) NSString *email;
  62. /** @property photoURL
  63. @brief The photoURL of the user.
  64. */
  65. @property(nonatomic, copy, nullable) NSURL *photoURL;
  66. /** @property password
  67. @brief The new password of the user.
  68. */
  69. @property(nonatomic, copy, nullable) NSString *password;
  70. /** @property providers
  71. @brief The associated identity providers of the user.
  72. */
  73. @property(nonatomic, copy, nullable) NSArray<NSString *> *providers;
  74. /** @property OOBCode
  75. @brief The out-of-band code of the change email request.
  76. */
  77. @property(nonatomic, copy, nullable) NSString *OOBCode;
  78. /** @property emailVerified
  79. @brief Whether to mark the email as verified or not.
  80. */
  81. @property(nonatomic, assign) BOOL emailVerified;
  82. /** @property upgradeToFederatedLogin
  83. @brief Whether to mark the user to upgrade to federated login.
  84. */
  85. @property(nonatomic, assign) BOOL upgradeToFederatedLogin;
  86. /** @property captchaChallenge
  87. @brief The captcha challenge.
  88. */
  89. @property(nonatomic, copy, nullable) NSString *captchaChallenge;
  90. /** @property captchaResponse
  91. @brief Response to the captcha.
  92. */
  93. @property(nonatomic, copy, nullable) NSString *captchaResponse;
  94. /** @property deleteAttributes
  95. @brief The list of user attributes to delete.
  96. @remarks Every element of the list must be one of the predefined constant starts with
  97. "FIRSetAccountInfoUserAttribute".
  98. */
  99. @property(nonatomic, copy, nullable) NSArray<NSString *> *deleteAttributes;
  100. /** @property deleteProviders
  101. @brief The list of identity providers to delete.
  102. */
  103. @property(nonatomic, copy, nullable) NSArray<NSString *> *deleteProviders;
  104. /** @property returnSecureToken
  105. @brief Whether the response should return access token and refresh token directly.
  106. @remarks The default value is @c YES .
  107. */
  108. @property(nonatomic, assign) BOOL returnSecureToken;
  109. /** @fn initWithEndpoint:requestConfiguration:
  110. @brief Please use initWithAPIKey:email:password:displayName:requestConfiguration instead.
  111. */
  112. - (nullable instancetype)initWithEndpoint:(NSString *)endpoint
  113. requestConfiguration:(FIRAuthRequestConfiguration *)requestConfiguration
  114. NS_UNAVAILABLE;
  115. /** @fn initWithRequestConfiguration:
  116. @brief Designated initializer.
  117. @param requestConfiguration An object containing configurations to be added to the request.
  118. */
  119. - (nullable instancetype)initWithRequestConfiguration:
  120. (FIRAuthRequestConfiguration *)requestConfiguration NS_DESIGNATED_INITIALIZER;
  121. @end
  122. NS_ASSUME_NONNULL_END