# Upload

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                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| ---------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| SourceDirectory : `String`         | <p>Source directory.</p><p><br>Default: <code>-</code><br>Example: <code>c:\temp, \network\folder</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| FileMask : `String`                | <p>Windows-style filemask. Empty field = all objects (<em>).</em></p><p><em>If you want to upload only one file, define exact filename as filemask.</em></p><p><em>Consider using .zip (for example) when uploading multiple objects at the same time.</em></p><p><br><em>Default:</em><br>Example: <em><code>.</code></em><code> , ?</code><em><code>file.*, foo</code></em><code>*.txt, singlefile.txt</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                       |
| TargetFolderId : `String`          | <p>Id of the target Google Drive folder.</p><p><br>Default: <code>-</code><br>Example: <code>42o3j8D7cmhMJFAAlbZb5B\_8u9OqnAIkn</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| 🗝ServiceAccountKeyJSON : `String` | <p>The JSON service account key generated in the Google Cloud portal.</p><p>Value can be either JSON string or full filepath to JSON file.</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>" } , C:\temp\ServiceAccountKeyJSON.json</code></p> |
| IncludeSharedDrives : `Boolean`    | <p>Whether to enable support for shared drives.</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 upload error should stop the Task and throw an exception (true) or try to add the error message to Result.ErrorMessages and continue to upload next file.</p><p><br>Default: <code>True</code><br>Example: <code>true</code></p> |
| ThrowErrorIfNoMatch : `Boolean` | <p>Throw error if there are no file(s) in the path matching the filemask.</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 upload was executed successfully.<br>Example: <code>true</code></p>   |
| Data : `List<UploadResult>`   | <p>List of upload result(s).<br>Example: <code>{ {"id", "filename"}, {"id", filename"} }</code></p>      |
| ErrorMessage : `List<Object>` | <p>Gets error message.<br>Example: <code>{ {"An error occured..."}, {"An error occured..."} }</code></p> |
| {% endtab %}                  |                                                                                                          |

{% tab title="Changelog" %}

## Changelog

### \[1.1.0]

#### Added

* Added a flag for shared drive support in the file search

### \[1.0.1] - 2023-12-07

#### Changed

* Input.ServiceAccountKeyJSON and Result.ErrorMessage documentation update.

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

#### Added

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