mirror of
https://github.com/Bayselonarrend/OpenIntegrations.git
synced 2025-04-17 12:06:34 +02:00
72 lines
1.8 KiB
Plaintext
72 lines
1.8 KiB
Plaintext
---
|
|
sidebar_position: 7
|
|
---
|
|
|
|
import Tabs from '@theme/Tabs';
|
|
import TabItem from '@theme/TabItem';
|
|
|
|
# Copy object
|
|
Copies file or directory
|
|
|
|
|
|
|
|
`Function CopyObject(Val Token, Val Identifier, Val NewName = "", Val NewParent = "") Export`
|
|
|
|
| Parameter | CLI option | Type | Required | 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="1C:Enterprise/OneScript code example"
|
|
Token = "ya29.a0AeDClZCyyq2tOx0JRD_XVIaMyzhn2uw2tXz5q_8IavFpdrB2btMzTnCCZO3k0K-cq5rv7dXqrg2-ddLdFJqrq0HqLeTkWJkeFqI6iaoCX...";
|
|
Identifier = "1g5oQGNJXwcA4L3f6ug0vuw95AKhI7ZJQ";
|
|
NewName = "CopiedFile.jpeg";
|
|
NewParent = "root";
|
|
|
|
Result = OPI_GoogleDrive.CopyObject(Token, Identifier, NewName, NewParent);
|
|
```
|
|
|
|
|
|
<Tabs>
|
|
|
|
<TabItem value="bash" label="Bash" default>
|
|
```bash
|
|
oint gdrive CopyObject \
|
|
--token "***" \
|
|
--object "1oQYoxKpiv3X0PP47IixTZNFMpGIA5YKM" \
|
|
--title "CopiedFile.jpeg" \
|
|
--catalog "root"
|
|
```
|
|
</TabItem>
|
|
|
|
<TabItem value="bat" label="CMD/Bat" default>
|
|
```batch
|
|
oint gdrive CopyObject ^
|
|
--token "***" ^
|
|
--object "1oQYoxKpiv3X0PP47IixTZNFMpGIA5YKM" ^
|
|
--title "CopiedFile.jpeg" ^
|
|
--catalog "root"
|
|
```
|
|
</TabItem>
|
|
</Tabs>
|
|
|
|
|
|
```json title="Result"
|
|
{
|
|
"kind": "drive#file",
|
|
"id": "19rwnmeC5Vro9P_yBfeKsPLeuSOU9Y9oC",
|
|
"name": "CopiedFile.jpeg",
|
|
"mimeType": "image/jpeg"
|
|
}
|
|
```
|