1
0
mirror of https://github.com/Bayselonarrend/OpenIntegrations.git synced 2025-11-27 22:18:36 +02:00
Files
OpenIntegrations/docs/en/md/Google_Drive/File-and-directory-management/Copy-object.mdx
Vitaly the Alpaca (bot) 164a2d2c04 Main build (Jenkins)
2024-10-15 21:15:56 +03:00

50 lines
1.2 KiB
Plaintext

---
sidebar_position: 7
---
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
# Copy object
Copies file or directory
`Function CopyObject(Val Token, Val Identifier, Val NewName = "", Val NewParent = "") Export`
| Parameter | CLI option | Type | Required | Description |
|-|-|-|-|-|
| Token | --token | String | ✔ | Token |
| Identifier | --object | String | ✔ | Object identifier |
| NewName | --title | String | ✖ | New object name |
| NewParent | --catalog | String | ✖ | New parent directory |
Returns: Map Of KeyAndValue - serialized JSON response from Google
<br/>
```bsl title="1C:Enterprise/OneScript code example"
Token = "ya29.a0AcM612zdAe2M8Ywdxt7xmK1VAAj2m3yjTdP1Ap8cFmqbE8lVngjIAujPtjc_c94MCuKNLfn7MSssBd6NfMXDQDrHMUv7Fgjp7cjuXk68n...";
Identifier = "14hysfOxsStktI4JZEXRiSZ9Rl69wNJwX";
NewName = "CopiedFile.jpeg";
NewParent = "root";
Result = OPI_GoogleDrive.CopyObject(Token, Identifier, NewName, NewParent);
```
```json title="Result"
{
"kind": "drive#file",
"id": "19rwnmeC5Vro9P_yBfeKsPLeuSOU9Y9oC",
"name": "CopiedFile.jpeg",
"mimeType": "image/jpeg"
}
```