1
0
mirror of https://github.com/Bayselonarrend/OpenIntegrations.git synced 2025-04-27 12:32:33 +02:00

52 lines
1.2 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-09-29 19:41:20 +03:00
Token = "ya29.a0AcM612xw6IRwwkQIOEhizd2pJ6LLI4UAhdhxmXDGEzYkcfUPrLYgDDwbsSi5iQdc78WPs_1_Qor5KipuV6mAIvr6z-AKzrBaMT4erIR5T...";
Identifier = "1f-YrvMCEZ7r3JWlLGM39zn6dctvFjwCi";
2024-09-28 19:38:00 +03:00
NewName = "CopiedFile.jpeg";
NewParent = "root";
Result = OPI_GoogleDrive.CopyObject(Token, Identifier, NewName, NewParent);
```
```sh title="CLI command example"
oint gdrive CopyObject --token %token% --object "1F8pfXPgltiOG2fPv88uStwegYj1tRoFk" --title %title% --catalog %catalog%
```
```json title="Result"
2024-09-29 21:40:58 +03:00
{
"kind": "drive#file",
2024-10-08 20:15:58 +03:00
"id": "1hLoTAfVd1dsvHujZgOk1thn1S1kRSeZm",
2024-09-29 21:40:58 +03:00
"name": "CopiedFile.jpeg",
"mimeType": "image/jpeg"
}
```