# Consume

Required Frends version: 5.5+

Required .NET version: 6.0

Compatible Agents: Crossplatform

Source code: <https://github.com/FrendsPlatform/Frends.GooglePubSub/tree/main/Frends.GooglePubSub.Consume>

{% tabs %}
{% tab title="Parameter: Input" %}

| Name                               | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| ---------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| ProjectID : `String`               | <p>The project ID.</p><p><br>Default: <code>-</code><br>Example: <code>my-project-123456</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| SubscriptionID : `String`          | <p>The subscription ID.</p><p><br>Default: <code>-</code><br>Example: <code>my-project-123456</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| 🗝ServiceAccountKeyJSON : `String` | <p>The JSON service account key that one can generate in the Google Cloud portal.</p><p><br>Default: <code>-</code><br>Example: <code>{ "type": "service\_account", "project\_id": "something", "private\_key\_id": "fdsafdsafdsalmnop12345678909876543212344", "private\_key": "-----BEGIN PRIVATE KEY-----\nMIIE.......Hw==\n-----END PRIVATE KEY-----\n", "client\_email": "<someone@something.iam.gserviceaccount.com>", "client\_id": "123456789012345678900", "auth\_uri": "<https://accounts.google.com/o/oauth2/auth>", "token\_uri": "<https://oauth2.googleapis.com/token>", "auth\_provider\_x509\_cert\_url": "<https://www.googleapis.com/oauth2/v1/certs>", "client\_x509\_cert\_url": "<https://www....nt.com>" }</code></p> |
| {% endtab %}                       |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |

{% tab title="Parameter: Options" %}

| Name                    | Description                                                                                                                                                                            |
| ----------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Timeout : `Int32`       | <p>Sets the timeout for the pull request to PubSub.</p><p>Too short timeout can lead to DeadlineExceeded exception.</p><p><br>Default: <code>20</code><br>Example: <code>20</code></p> |
| MaxResults : `Int32`    | <p>Maximum amount of messages that is pulled from the PubSub.</p><p><br>Default: <code>20</code><br>Example: <code>20</code></p>                                                       |
| Acknowledge : `Boolean` | <p>Determines if messages are acknowledged after consuming them.</p><p><br>Default: <code>True</code><br>Example: <code>true</code></p>                                                |
| {% endtab %}            |                                                                                                                                                                                        |

{% tab title="Result: Result" %}

| Name                             | Description                                                                                                                                                              |
| -------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Messages : `List<OutputMessage>` | <p>Messages consumed from Google PubSub.<br>Example: <code>\[ { "Hello world!", { "myCustomAttr1": "myAttrValue1" }, "271", "2024-02-27T07:53:25Z", "key" } ]</code></p> |
| {% endtab %}                     |                                                                                                                                                                          |

{% tab title="Changelog" %}

## Changelog

### \[1.0.0] - 2024-02-27

#### Changed

* Initial implementation
  {% endtab %}
  {% endtabs %}
