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

50 lines
1.1 KiB
Plaintext
Raw Normal View History

2024-10-15 10:50:56 +03:00
---
2024-10-15 10:16:04 +03:00
sidebar_position: 7
---
2024-10-15 10:50:56 +03:00
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
2024-10-15 10:16:04 +03:00
# Copy object
Copies file or directory
`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
<br/>
```bsl title="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"
}
```