FIRFunctions.h 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. // Copyright 2017 Google
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. #import <Foundation/Foundation.h>
  15. NS_ASSUME_NONNULL_BEGIN
  16. @class FIRApp;
  17. @class FIRHTTPSCallable;
  18. /**
  19. * `FIRFunctions` is the client for Cloud Functions for a Firebase project.
  20. */
  21. NS_SWIFT_NAME(Functions)
  22. @interface FIRFunctions : NSObject
  23. - (id)init NS_UNAVAILABLE;
  24. /**
  25. * Creates a Cloud Functions client with the default app.
  26. */
  27. + (instancetype)functions NS_SWIFT_NAME(functions());
  28. /**
  29. * Creates a Cloud Functions client with the given app.
  30. * @param app The app for the Firebase project.
  31. */
  32. + (instancetype)functionsForApp:(FIRApp *)app NS_SWIFT_NAME(functions(app:));
  33. /**
  34. * Creates a Cloud Functions client with the default app and given region.
  35. * @param region The region for the http trigger, such as "us-central1".
  36. */
  37. + (instancetype)functionsForRegion:(NSString *)region NS_SWIFT_NAME(functions(region:));
  38. /**
  39. * Creates a Cloud Functions client with the given app and region.
  40. * @param app The app for the Firebase project.
  41. * @param region The region for the http trigger, such as "us-central1".
  42. */
  43. // clang-format off
  44. // because it incorrectly breaks this NS_SWIFT_NAME.
  45. + (instancetype)functionsForApp:(FIRApp *)app
  46. region:(NSString *)region NS_SWIFT_NAME(functions(app:region:));
  47. // clang-format on
  48. /**
  49. * Creates a reference to the Callable HTTPS trigger with the given name.
  50. * @param name The name of the Callable HTTPS trigger.
  51. */
  52. - (FIRHTTPSCallable *)HTTPSCallableWithName:(NSString *)name NS_SWIFT_NAME(httpsCallable(_:));
  53. /**
  54. * Changes this instance to point to a Cloud Functions emulator running locally.
  55. * See https://firebase.google.com/docs/functions/local-emulator
  56. * @param origin The origin of the local emulator, such as "http://localhost:5005".
  57. */
  58. - (void)useFunctionsEmulatorOrigin:(NSString *)origin NS_SWIFT_NAME(useFunctionsEmulator(origin:));
  59. @end
  60. NS_ASSUME_NONNULL_END