# Download

Required Frends version: 5.5+

Required .NET version: 6.0

Compatible Agents: Crossplatform

Source code: <https://github.com/FrendsPlatform/Frends.GoogleDrive>

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

| Name                               | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| ---------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| FileQuery : `String`               | <p>Query for specific files to be downloaded.</p><p>See Google Drive API Guide</p><p><br>Default: <code>\*</code><br>Example: <code>'42o3j8C7kntMJZeElbZb5B\_5u92snSIkb' in parents and name contains 'test'</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| DestinationDirectory : `String`    | <p>Destination directory (local or network folder).</p><p><br>Default: <code>-</code><br>Example: <code>//fileshare/destinationdirectory, c:\temp, /downloads</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| 🗝ServiceAccountKeyJSON : `String` | <p>Service account key JSON.</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> |
| IncludeSharedDrives : `Boolean`    | <p>Whether to include shared drives in the search.</p><p><br>Default: <code>False</code><br>Example: <code>false</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| {% endtab %}                       |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |

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

| Name                                | Description                                                                                                                                                                                                                                                      |
| ----------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| ThrowErrorOnFailure : `Boolean`     | <p>Value indicating whether download error should stop the Task and throw an exception (true) or try to add the error message to Result.ErrorMessages and continue to download next file.</p><p><br>Default: <code>True</code><br>Example: <code>true</code></p> |
| CreateDestinationFolder : `Boolean` | <p>Determines whether to create the destination folder if it does not already exist.</p><p><br>Default: <code>-</code><br>Example: <code>false</code></p>                                                                                                        |
| {% endtab %}                        |                                                                                                                                                                                                                                                                  |

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

| Name                          | Description                                                                                                |
| ----------------------------- | ---------------------------------------------------------------------------------------------------------- |
| Success : `Boolean`           | <p>Gets a value indicating whether download was executed successfully.<br>Example: <code>true</code></p>   |
| Data : `List<DownloadResult>` | <p>List of download result(s).<br>Example: <code>{ {"id", "filename"}, {"id", filename"} }</code></p>      |
| ErrorMessage : `List<Object>` | <p>List of error messages.<br>Example: <code>{ "An error occured...", "Another error occured" }</code></p> |
| {% endtab %}                  |                                                                                                            |

{% tab title="Changelog" %}

## Changelog

### \[1.1.0]

#### Added

* Added a flag to include shared drives in the file search

### \[1.0.0] - 2023-11-16

#### Added

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