# Google Cloud Functions

**Google Cloud Functions** permite obter e executar [funções do Cloud Run do Google](https://cloud.google.com/functions?hl=pt-BR).

## **Parameters**

Dê uma olhada nos parâmetros de configuração do conector. Parâmetros suportados por [expressões Double Braces](/documentation/connectors-and-triggers/pt-br/double-braces/overview.md) estão marcados com `(DB)`.

### **Aba General**

<table data-full-width="true"><thead><tr><th>Parâmetro</th><th>Descrição</th><th>Valor padrão</th><th>Tipo de dado</th></tr></thead><tbody><tr><td><strong>Operation</strong></td><td>A operação a ser realizada. As opções são: <strong>Call Function</strong> e <strong>Get Function</strong>.</td><td>N/A</td><td>String</td></tr><tr><td><strong>Function Name</strong> <code>(DB)</code></td><td>O nome da função do Cloud Run no Google.</td><td>N/A</td><td>String</td></tr><tr><td><strong>Account</strong></td><td>A <a href="https://cloud.google.com/iam/docs/keys-create-delete?hl=pt-br">chave de conta de serviço</a> para autenticar na aplicação. Tipo suportado: <strong>Google Key</strong>.</td><td>N/A</td><td>GOOGLE-KEY</td></tr><tr><td><strong>Location</strong></td><td>A localização da função do Cloud Run.</td><td>N/A</td><td>String</td></tr><tr><td><strong>Project</strong> <code>(DB)</code></td><td>O nome do projeto do Google Cloud onde a função do Cloud Run está localizada.</td><td>N/A</td><td>String</td></tr><tr><td><strong>Body</strong> <code>(DB)</code></td><td>O corpo para chamar a função. Se não passar nenhum parâmetro, deve-se pelo menos inserir colchetes vazios <code>{ }</code> neste campo. Está disponível apenas se a <strong>Operation</strong> for <strong>Call Function</strong>.</td><td>N/A</td><td>JSON</td></tr><tr><td><strong>Fail On Error</strong></td><td>Se a opção for ativada, a execução do pipeline com erro será interrompida. Caso contrário, a execução do pipeline continua, mas o resultado mostrará um valor falso para a propriedade <code>"success"</code>.</td><td>False</td><td>Boolean</td></tr></tbody></table>

### **Aba Documentação**

<table data-full-width="true"><thead><tr><th>Parâmetro</th><th>Descrição</th><th>Valor padrão</th><th>Tipo de dado</th></tr></thead><tbody><tr><td><strong>Documentation</strong></td><td>Seção para documentar qualquer informação necessária sobre a configuração do conector e regras de negócios.</td><td>N/A</td><td>String</td></tr></tbody></table>

## **Google Cloud Functions em ação**

### **Operação Call Function**

Ao selecionar a operação **Call Function**, você chama a função no Google usando uma solicitação HTTP.

Veja um exemplo da configuração e saída:

#### **Configuração**

* **Operation:** Call Function
* **Function Name:** helloWorld
* **Account:** google-key-functions
* **Location:** us-central1 (Iowa)
* **Project:** teste-434118
* **Body:** `{ }`

#### **Saída**

{% code overflow="wrap" %}

```json
{
  "success": true,
  "headers": {
    "GoogleCloudFunctionsResponseObject": "execution_id: \"04lfg6k7y71x\"\nresult: \"Hello, World!\"\n"
  },
  "body": {
    "result": "Hello, World!"
  }
}
```

{% endcode %}

### **Operação Get Function**

Ao selecionar a operação **Get Function**, você obtém o objeto Cloud Functions.

Veja um exemplo da configuração e saída:

#### **Configuração**

* **Operation:** Get Function
* **Function Name:** helloWorld
* **Account:** google-key-functions
* **Location:** us-central1 (Iowa)
* **Project:** teste-434118

#### **Saída**

{% code overflow="wrap" %}

```json
{
  "success": true,
  "body": {
    "name": "projects/teste-434118/locations/us-central1/functions/helloWorld",
    "https_trigger": {
      "url": "https://us-central1-teste-434118.cloudfunctions.net/helloWorld"
    },
    "status": "ACTIVE",
    "entry_point": "helloWorld",
    "timeout": {
      "seconds": 60
    },
    "available_memory_mb": 256,
    "service_account_email": "teste-434118@appspot.gserviceaccount.com",
    "source_upload_url": "https://storage.googleapis.com/uploads-603950532802.us-central1.cloudfunctions.appspot.com/9185413e-2038-46aa-9ae1-4c3f0dff7088.zip",
    "runtime": "nodejs14",
    "ingress_settings": "ALLOW_ALL",
    "version_id": 1,
    "build_id": "21535f31-f44b-4748-b401-edd449bd2fcb",
    "update_time": {
      "seconds": 1725041576,
      "nanos": 902000000
    }
  }
}
```

{% endcode %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.digibee.com/documentation/connectors-and-triggers/pt-br/connectors/google-gcp/cloud-functions.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
