# firebase::functions::Functions


`#include <functions.h>`

Entry point for the Firebase C++ SDK for Cloud [Functions](https://firebase.google.com/docs/reference/cpp/class/firebase/functions/functions#classfirebase_1_1functions_1_1_functions).

## Summary

To use the SDK, call [firebase::functions::Functions::GetInstance()](https://firebase.google.com/docs/reference/cpp/class/firebase/functions/functions#classfirebase_1_1functions_1_1_functions_1a8086e949ffc16eb1c341a91866c2623e) to obtain an instance of [Functions](https://firebase.google.com/docs/reference/cpp/class/firebase/functions/functions#classfirebase_1_1functions_1_1_functions), then use [GetHttpsCallable()](https://firebase.google.com/docs/reference/cpp/class/firebase/functions/functions#classfirebase_1_1functions_1_1_functions_1a340bf0b4c06c8103dc6cab036f5e1388) to obtain references to callable functions. From there you can call them with CallableReference::Call().

| ### Constructors and Destructors ||
|---|---|
| `https://firebase.google.com/docs/reference/cpp/class/firebase/functions/functions#classfirebase_1_1functions_1_1_functions_1adde9ba027532915b736c31ebf6fed2e4()` Destructor. ||

| ### Public functions ||
|---|---|
| `https://firebase.google.com/docs/reference/cpp/class/firebase/functions/functions#classfirebase_1_1functions_1_1_functions_1a340bf0b4c06c8103dc6cab036f5e1388(const char *name) const ` | `https://firebase.google.com/docs/reference/cpp/class/firebase/functions/https-callable-reference#classfirebase_1_1functions_1_1_https_callable_reference` Get a FunctionsReference for the specified path. |
| `https://firebase.google.com/docs/reference/cpp/class/firebase/functions/functions#classfirebase_1_1functions_1_1_functions_1ac377cbb3c08364d247d12b61d65f1e4a(const char *name, const https://firebase.google.com/docs/reference/cpp/struct/firebase/functions/https-callable-options#structfirebase_1_1functions_1_1_https_callable_options & options) const ` | `https://firebase.google.com/docs/reference/cpp/class/firebase/functions/https-callable-reference#classfirebase_1_1functions_1_1_https_callable_reference` Get a FunctionsReference for the specified path with the given options. |
| `https://firebase.google.com/docs/reference/cpp/class/firebase/functions/functions#classfirebase_1_1functions_1_1_functions_1af3218783e8cfbdafe1ce37e5562842e9(const char *url) const ` | `https://firebase.google.com/docs/reference/cpp/class/firebase/functions/https-callable-reference#classfirebase_1_1functions_1_1_https_callable_reference` Get a FunctionsReference for the specified URL. |
| `https://firebase.google.com/docs/reference/cpp/class/firebase/functions/functions#classfirebase_1_1functions_1_1_functions_1afc5cd67162ef0f59dcf2e2d1c50de459(const char *url, const https://firebase.google.com/docs/reference/cpp/struct/firebase/functions/https-callable-options#structfirebase_1_1functions_1_1_https_callable_options & options) const ` | `https://firebase.google.com/docs/reference/cpp/class/firebase/functions/https-callable-reference#classfirebase_1_1functions_1_1_https_callable_reference` Get a FunctionsReference for the specified URL with the given options. |
| `https://firebase.google.com/docs/reference/cpp/class/firebase/functions/functions#classfirebase_1_1functions_1_1_functions_1a39a4008ae9c511dff0145c2b7187d151(const char *origin)` | `void` Sets an origin for a Cloud [Functions](https://firebase.google.com/docs/reference/cpp/class/firebase/functions/functions#classfirebase_1_1functions_1_1_functions) emulator to use. |
| `https://firebase.google.com/docs/reference/cpp/class/firebase/functions/functions#classfirebase_1_1functions_1_1_functions_1a16c659ac1164eb1eed394cff4287a946()` | `::https://firebase.google.com/docs/reference/cpp/class/firebase/app#classfirebase_1_1_app *` Get the [firebase::App](https://firebase.google.com/docs/reference/cpp/class/firebase/app#classfirebase_1_1_app) that this [Functions](https://firebase.google.com/docs/reference/cpp/class/firebase/functions/functions#classfirebase_1_1functions_1_1_functions) was created with. |

| ### Public static functions ||
|---|---|
| `https://firebase.google.com/docs/reference/cpp/class/firebase/functions/functions#classfirebase_1_1functions_1_1_functions_1a8086e949ffc16eb1c341a91866c2623e(::https://firebase.google.com/docs/reference/cpp/class/firebase/app#classfirebase_1_1_app *app, https://firebase.google.com/docs/reference/cpp/namespace/firebase#namespacefirebase_1a8f058cad989f8f1a6c5b42a77a8c3478 *init_result_out)` | `https://firebase.google.com/docs/reference/cpp/class/firebase/functions/functions#classfirebase_1_1functions_1_1_functions *` Get an instance of [Functions](https://firebase.google.com/docs/reference/cpp/class/firebase/functions/functions#classfirebase_1_1functions_1_1_functions) corresponding to the given [App](https://firebase.google.com/docs/reference/cpp/class/firebase/app#classfirebase_1_1_app). |
| `https://firebase.google.com/docs/reference/cpp/class/firebase/functions/functions#classfirebase_1_1functions_1_1_functions_1af3e8983fa9b920f9338a7064e2246db0(::https://firebase.google.com/docs/reference/cpp/class/firebase/app#classfirebase_1_1_app *app, const char *region, https://firebase.google.com/docs/reference/cpp/namespace/firebase#namespacefirebase_1a8f058cad989f8f1a6c5b42a77a8c3478 *init_result_out)` | `https://firebase.google.com/docs/reference/cpp/class/firebase/functions/functions#classfirebase_1_1functions_1_1_functions *` Get an instance of [Functions](https://firebase.google.com/docs/reference/cpp/class/firebase/functions/functions#classfirebase_1_1functions_1_1_functions) corresponding to the given [App](https://firebase.google.com/docs/reference/cpp/class/firebase/app#classfirebase_1_1_app). |

## Public functions

### GetHttpsCallable

```c++
HttpsCallableReference GetHttpsCallable(
  const char *name
) const 
```
Get a FunctionsReference for the specified path.

### GetHttpsCallable

```c++
HttpsCallableReference GetHttpsCallable(
  const char *name,
  const HttpsCallableOptions & options
) const 
```
Get a FunctionsReference for the specified path with the given options.

### GetHttpsCallableFromURL

```c++
HttpsCallableReference GetHttpsCallableFromURL(
  const char *url
) const 
```
Get a FunctionsReference for the specified URL.

### GetHttpsCallableFromURL

```c++
HttpsCallableReference GetHttpsCallableFromURL(
  const char *url,
  const HttpsCallableOptions & options
) const 
```
Get a FunctionsReference for the specified URL with the given options.

### UseFunctionsEmulator

```c++
void UseFunctionsEmulator(
  const char *origin
)
```
Sets an origin for a Cloud [Functions](https://firebase.google.com/docs/reference/cpp/class/firebase/functions/functions#classfirebase_1_1functions_1_1_functions) emulator to use.

### app

```c++
::firebase::App * app()
```
Get the [firebase::App](https://firebase.google.com/docs/reference/cpp/class/firebase/app#classfirebase_1_1_app) that this [Functions](https://firebase.google.com/docs/reference/cpp/class/firebase/functions/functions#classfirebase_1_1functions_1_1_functions) was created with.

<br />

| Details ||
|---|---|
| **Returns** | The [firebase::App](https://firebase.google.com/docs/reference/cpp/class/firebase/app#classfirebase_1_1_app) this [Functions](https://firebase.google.com/docs/reference/cpp/class/firebase/functions/functions#classfirebase_1_1functions_1_1_functions) was created with. |

### \~Functions

```c++
 ~Functions()
```
Destructor.

You may delete an instance of [Functions](https://firebase.google.com/docs/reference/cpp/class/firebase/functions/functions#classfirebase_1_1functions_1_1_functions) when you are finished using it, to shut down the [Functions](https://firebase.google.com/docs/reference/cpp/class/firebase/functions/functions#classfirebase_1_1functions_1_1_functions) library.

## Public static functions

### GetInstance

```c++
Functions * GetInstance(
  ::firebase::App *app,
  InitResult *init_result_out
)
```
Get an instance of [Functions](https://firebase.google.com/docs/reference/cpp/class/firebase/functions/functions#classfirebase_1_1functions_1_1_functions) corresponding to the given [App](https://firebase.google.com/docs/reference/cpp/class/firebase/app#classfirebase_1_1_app).

Cloud [Functions](https://firebase.google.com/docs/reference/cpp/class/firebase/functions/functions#classfirebase_1_1functions_1_1_functions) uses [firebase::App](https://firebase.google.com/docs/reference/cpp/class/firebase/app#classfirebase_1_1_app) to communicate with Firebase Authentication to authenticate users to the server backend.

<br />

Details Parameters `app` An instance of [firebase::App](https://firebase.google.com/docs/reference/cpp/class/firebase/app#classfirebase_1_1_app). Cloud [Functions](https://firebase.google.com/docs/reference/cpp/class/firebase/functions/functions#classfirebase_1_1functions_1_1_functions) will use this to communicate with Firebase Authentication. `init_result_out` Optional: If provided, write the init result here. Will be set to kInitResultSuccess if initialization succeeded, or kInitResultFailedMissingDependency on Android if Google Play services is not available on the current device. **Returns** An instance of [Functions](https://firebase.google.com/docs/reference/cpp/class/firebase/functions/functions#classfirebase_1_1functions_1_1_functions) corresponding to the given [App](https://firebase.google.com/docs/reference/cpp/class/firebase/app#classfirebase_1_1_app).

### GetInstance

```c++
Functions * GetInstance(
  ::firebase::App *app,
  const char *region,
  InitResult *init_result_out
)
```
Get an instance of [Functions](https://firebase.google.com/docs/reference/cpp/class/firebase/functions/functions#classfirebase_1_1functions_1_1_functions) corresponding to the given [App](https://firebase.google.com/docs/reference/cpp/class/firebase/app#classfirebase_1_1_app).

Cloud [Functions](https://firebase.google.com/docs/reference/cpp/class/firebase/functions/functions#classfirebase_1_1functions_1_1_functions) uses [firebase::App](https://firebase.google.com/docs/reference/cpp/class/firebase/app#classfirebase_1_1_app) to communicate with Firebase Authentication to authenticate users to the server backend.

<br />

Details Parameters `app` An instance of [firebase::App](https://firebase.google.com/docs/reference/cpp/class/firebase/app#classfirebase_1_1_app). Cloud [Functions](https://firebase.google.com/docs/reference/cpp/class/firebase/functions/functions#classfirebase_1_1functions_1_1_functions) will use this to communicate with Firebase Authentication. `region` The region to call functions in. `init_result_out` Optional: If provided, write the init result here. Will be set to kInitResultSuccess if initialization succeeded, or kInitResultFailedMissingDependency on Android if Google Play services is not available on the current device. **Returns** An instance of [Functions](https://firebase.google.com/docs/reference/cpp/class/firebase/functions/functions#classfirebase_1_1functions_1_1_functions) corresponding to the given [App](https://firebase.google.com/docs/reference/cpp/class/firebase/app#classfirebase_1_1_app).