1
0
mirror of https://github.com/Bayselonarrend/OpenIntegrations.git synced 2025-04-25 12:24:39 +02:00

47 lines
1.1 KiB
Markdown
Raw Normal View History

---
sidebar_position: 7
---
# Copy object
Copies file or directory
2024-07-10 13:58:29 +03:00
`Function CopyObject(Val Token, Val Identifier, Val NewName = "", Val NewParent = "") Export`
| Parameter | CLI option | Type | 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
2024-07-10 14:05:58 +03:00
<br/>
2024-07-10 13:58:29 +03:00
```bsl title="Code example"
2024-10-15 10:07:27 +03:00
Token = "ya29.a0AcM612zdAe2M8Ywdxt7xmK1VAAj2m3yjTdP1Ap8cFmqbE8lVngjIAujPtjc_c94MCuKNLfn7MSssBd6NfMXDQDrHMUv7Fgjp7cjuXk68n...";
Identifier = "14hysfOxsStktI4JZEXRiSZ9Rl69wNJwX";
2024-09-28 19:38:00 +03:00
NewName = "CopiedFile.jpeg";
NewParent = "root";
Result = OPI_GoogleDrive.CopyObject(Token, Identifier, NewName, NewParent);
```
2024-10-15 09:53:37 +03:00
```json title="Result"
2024-09-29 21:40:58 +03:00
{
"kind": "drive#file",
2024-10-09 09:42:00 +03:00
"id": "19rwnmeC5Vro9P_yBfeKsPLeuSOU9Y9oC",
2024-09-29 21:40:58 +03:00
"name": "CopiedFile.jpeg",
"mimeType": "image/jpeg"
}
```