1
0
mirror of https://github.com/Bayselonarrend/OpenIntegrations.git synced 2025-11-23 22:05:15 +02:00
Files
OpenIntegrations/docs/en/md/GoogleDrive/File-and-directory-management/Copy-object.mdx
Vitaly the Alpaca (bot) 44cdeadeef Main build (Jenkins)
2025-11-10 09:45:32 +03:00

73 lines
2.1 KiB
Plaintext
Vendored

---
sidebar_position: 7
description: Copy object and other functions to work with Google Drive in the Open Integration Package, a free open-source integration library for 1C:Enterprise 8, OneScript and CLI
keywords: [1C, 1С, 1С:Enterprise, 1С:Enterprise 8.3, API, Integration, Services, Exchange, OneScript, CLI, Google Drive]
---
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.a0ATi6K2uV_ra8mZCZ28JAmrVeqcVpHZ-EkWehFDN6pm_pe6z0WhdBC03MNWeVCZuekWme7CvXsXB0GeXvT-h-JN9gf32H-SKrRcXzp2ib92hVtuZjA9o7q4EwQ...";
Identifier = "1b40ax6s6K0tARHjdoiC-XdAaCizR6cg-";
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 "1-1pznXNxxMJr-egr1FfrDd3-M9pI6YpG" \
--title "CopiedFile.jpeg" \
--catalog "root"
```
</TabItem>
<TabItem value="bat" label="CMD/Bat" default>
```batch
oint gdrive CopyObject ^
--token "***" ^
--object "1-1pznXNxxMJr-egr1FfrDd3-M9pI6YpG" ^
--title "CopiedFile.jpeg" ^
--catalog "root"
```
</TabItem>
</Tabs>
```json title="Result"
{
"kind": "drive#file",
"id": "1WLBvJaQhvZaJtNQLixicZKU6UgPzu2yv",
"name": "CopiedFile.jpeg",
"mimeType": "image/jpeg"
}
```