FIRAuthRequestConfiguration.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  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 "FirebaseAuth/Sources/Backend/FIRAuthRPCRequest.h"
  18. #import "FirebaseAuth/Sources/Public/FirebaseAuth/FIRAuth.h"
  19. @protocol FIRHeartbeatLoggerProtocol;
  20. NS_ASSUME_NONNULL_BEGIN
  21. /** @class FIRAuthRequestConfiguration
  22. @brief Defines configurations to be added to a request to Firebase Auth's backend.
  23. */
  24. @interface FIRAuthRequestConfiguration : NSObject
  25. /** @property APIKey
  26. @brief The Firebase Auth API key used in the request.
  27. */
  28. @property(nonatomic, copy, readonly) NSString *APIKey;
  29. /** @property appID
  30. @brief The Firebase appID used in the request.
  31. */
  32. @property(nonatomic, copy, readonly) NSString *appID;
  33. /** @property auth
  34. @brief The FIRAuth instance used in the request.
  35. */
  36. @property(nonatomic, weak, readonly, nullable) FIRAuth *auth;
  37. /** @property heartbeatLogger
  38. @brief The heartbeat logger used to add heartbeats to the corresponding request's header.
  39. */
  40. @property(nonatomic, copy, nullable) id<FIRHeartbeatLoggerProtocol> heartbeatLogger;
  41. /** @property LanguageCode
  42. @brief The language code used in the request.
  43. */
  44. @property(nonatomic, copy, nullable) NSString *languageCode;
  45. /** @property additionalFrameworkMarker
  46. @brief Additional framework marker that will be added as part of the header of every request.
  47. */
  48. @property(nonatomic, copy, nullable) NSString *additionalFrameworkMarker;
  49. /** @property emulatorHostAndPort
  50. @brief If set, the local emulator host and port to point to instead of the remote backend.
  51. */
  52. @property(nonatomic, copy, nullable) NSString *emulatorHostAndPort;
  53. - (instancetype)init NS_UNAVAILABLE;
  54. /** @fn initWithAPIKey:appID:
  55. @brief Convenience initializer.
  56. @param APIKey The API key to be used in the request.
  57. @param appID The Firebase app ID to be passed in the request header.
  58. */
  59. - (nullable instancetype)initWithAPIKey:(NSString *)APIKey appID:(NSString *)appID;
  60. /** @fn initWithAPIKey:appID:
  61. @brief Convenience initializer.
  62. @param APIKey The API key to be used in the request.
  63. @param appID The Firebase app ID to be passed in the request header.
  64. @param auth The FIRAuth instance used in the request.
  65. */
  66. - (nullable instancetype)initWithAPIKey:(NSString *)APIKey
  67. appID:(NSString *)appID
  68. auth:(nullable FIRAuth *)auth;
  69. /** @fn initWithAPIKey:appID:heartbeatLogger:
  70. @brief Designated initializer.
  71. @param APIKey The API key to be used in the request.
  72. @param appID The Firebase app ID to be passed in the request header.
  73. @param heartbeatLogger The heartbeat logger used to add heartbeats to the request header.
  74. */
  75. - (nullable instancetype)initWithAPIKey:(NSString *)APIKey
  76. appID:(NSString *)appID
  77. heartbeatLogger:(nullable id<FIRHeartbeatLoggerProtocol>)heartbeatLogger;
  78. /** @fn initWithAPIKey:appID:heartbeatLogger:
  79. @brief Designated initializer.
  80. @param APIKey The API key to be used in the request.
  81. @param appID The Firebase app ID to be passed in the request header.
  82. @param auth The FIRAuth instance used in the request.
  83. @param heartbeatLogger The heartbeat logger used to add heartbeats to the request header.
  84. */
  85. - (nullable instancetype)initWithAPIKey:(NSString *)APIKey
  86. appID:(NSString *)appID
  87. auth:(nullable FIRAuth *)auth
  88. heartbeatLogger:(nullable id<FIRHeartbeatLoggerProtocol>)heartbeatLogger
  89. NS_DESIGNATED_INITIALIZER;
  90. @end
  91. NS_ASSUME_NONNULL_END