1
0
mirror of https://github.com/Bayselonarrend/OpenIntegrations.git synced 2025-11-25 22:12:29 +02:00
Files
OpenIntegrations/docs/en/md/GoogleDrive/File-and-directory-management/Copy-object.mdx
Vitaly the Alpaca (bot) 3ae25c4ef9 Main build (Jenkins)
2025-10-17 09:03:05 +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.a0AQQ_BDQ_0g6De1s1jLOYbrGQ43QDri_VRPre92E-_aUXJNk52_zY1j3A74665Q7FVMzsgnjqjKN14ljBwB0PlswTyjZlgxcBIDMnuqIbFLhH8Hcxc5NfKIOpS...";
Identifier = "1gWSd3xX7y9I7s3wCP7avbkrUEK5VueKR";
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 "1SdgrlViZM0g-ROR19eyFdWaooX8pZzZQ" \
--title "CopiedFile.jpeg" \
--catalog "root"
```
</TabItem>
<TabItem value="bat" label="CMD/Bat" default>
```batch
oint gdrive CopyObject ^
--token "***" ^
--object "1SdgrlViZM0g-ROR19eyFdWaooX8pZzZQ" ^
--title "CopiedFile.jpeg" ^
--catalog "root"
```
</TabItem>
</Tabs>
```json title="Result"
{
"kind": "drive#file",
"id": "1spR9Z21272lFG27z6a6eLAwHeKs0ITZo",
"name": "CopiedFile.jpeg",
"mimeType": "image/jpeg"
}
```