2024-10-15 10:16:04 +03:00
|
|
|
import Tabs from '@theme/Tabs';
|
|
|
|
import TabItem from '@theme/TabItem';
|
|
|
|
|
|
|
|
---
|
|
|
|
sidebar_position: 7
|
|
|
|
---
|
|
|
|
|
|
|
|
# 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"
|
|
|
|
}
|
|
|
|
```
|