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

53 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 | Destination |
|-|-|-|-|
| 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-07-10 14:24:11 +03:00
NewName = "CopiedFile.jpeg";
NewLocation = "1603PU_Hrkvj4HeFJKYSVxZJDRoGvd3SJ";
Identifier = "1F8pfXPgltiOG2fPv88uStwegYj1tRoFk";
Response = OPI_GoogleDrive.CopyObject(Token, Identifier, NewName, NewLocation) //Map
Response = OPI_Tools.JSONString(Response); //String
```
```sh title="CLI command example"
oint gdrive CopyObject --token %token% --object "1F8pfXPgltiOG2fPv88uStwegYj1tRoFk" --title "CopiedFile.jpeg" --catalog %catalog%
```
```json title="Result"
2024-07-10 14:11:17 +03:00
{
"mimeType": "image/jpeg",
"name": "CopiedFile.jpeg",
"id": "1uxsMaxL1W5Y7z6-HhjE6QpyDxFPgW4Fy",
"kind": "drive#file"
}
```