No Description

FIRAuthRPCRequest.h 1.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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. @class FIRAuthRequestConfiguration;
  18. NS_ASSUME_NONNULL_BEGIN
  19. /** @protocol FIRAuthRPCRequest
  20. @brief The generic interface for an RPC request needed by @c FIRAuthBackend.
  21. */
  22. @protocol FIRAuthRPCRequest <NSObject>
  23. /** @fn requestURL
  24. @brief Gets the request's full URL.
  25. */
  26. - (NSURL *)requestURL;
  27. @optional
  28. /** @fn containsPostBody
  29. @brief Returns whether the request contains a post body or not. Requests without a post body
  30. are get requests.
  31. @remarks The default implementation returns YES.
  32. */
  33. - (BOOL)containsPostBody;
  34. /** @fn UnencodedHTTPRequestBodyWithError:
  35. @brief Creates unencoded HTTP body representing the request.
  36. @param error An out field for an error which occurred constructing the request.
  37. @return The HTTP body data representing the request before any encoding, or nil for error.
  38. */
  39. - (nullable id)unencodedHTTPRequestBodyWithError:(NSError *_Nullable *_Nullable)error;
  40. /** @fn requestConfiguration
  41. @brief Obtains the request configurations if available.
  42. @return Returns the request configurations.
  43. */
  44. - (FIRAuthRequestConfiguration *)requestConfiguration;
  45. @end
  46. NS_ASSUME_NONNULL_END