1
0
mirror of https://github.com/Bayselonarrend/OpenIntegrations.git synced 2025-05-17 22:32:45 +02:00

64 lines
2.3 KiB
Plaintext
Raw Normal View History

2024-10-15 10:50:56 +03:00
---
2024-10-15 10:16:04 +03:00
sidebar_position: 5
---
2024-10-15 10:50:56 +03:00
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
2024-10-15 10:16:04 +03:00
# Create object copy
Creates a copy of the object at the specified path and path to the original
`Function CreateObjectCopy(Val Token, Val Original, Val Path, Val Overwrite = False) Export`
2024-10-15 15:15:47 +03:00
| Parameter | CLI option | Type | Required | Description |
|-|-|-|-|-|
| Token | --token | String | ✔ | Token |
| Original | --from | String | ✔ | Path to the original file or directory |
| Path | --to | String | ✔ | Destination path for the copy |
| Overwrite | --rewrite | Boolean | ✖ | Overwrite if a file with the same name already exists |
2024-10-15 10:16:04 +03:00
Returns: Map Of KeyAndValue - serialized JSON response from Yandex
<br/>
2024-10-15 21:15:56 +03:00
```bsl title="1C:Enterprise/OneScript code example"
2024-10-15 10:16:04 +03:00
Token = "y0_AgAAAABdylaOAAs0QgAAAAD5i-a...";
Original = "/55ea8d67-9f19-45d3-a65e-2f8ae070c7e2.png";
Path = "/" + String(New UUID) + ".png";
Result = OPI_YandexDisk.CreateObjectCopy(Token, Original, Path, True);
```
```json title="Result"
{
"antivirus_status": "clean",
"size": 2114023,
"comment_ids": {
"private_resource": "1573541518:6926f51536837394b524a917099c11217914ac43eecf41e7152d52b8e9a20362",
"public_resource": "1573541518:6926f51536837394b524a917099c11217914ac43eecf41e7152d52b8e9a20362"
},
"name": "ed13b9fd-51cb-4857-b59d-d8f4fe448746.png",
"exif": {},
"created": "2024-10-09T09:09:01+03:00",
"resource_id": "1573541518:6926f51536837394b524a917099c11217914ac43eecf41e7152d52b8e9a20362",
"modified": "2024-10-09T09:09:01+03:00",
"mime_type": "multipart",
"file": "https://downloader.disk.yandex.ru/disk/dc02f41a6c785082b3d549fecc0135f2724bd95aa23e7d01b871ce33be82a59a/6706563e/gwThwhLBKYvLhQCNnqAHikawF6ofeh69S2Q-9g1T5IGPQ-vmmg5ho0UNlym1cYvMYt55yWUwrNHLEwnJN27VGg%3D%3D?uid=1573541518&filename=ed13b9fd-51cb-4857-b59d-d8f4fe448746.png&disposition=attachment&hash=&limit=0&content_type=multipart&owner_uid=1573541518&fsize=2114023&hid=03d7263840468e281bd0b238a26e7d0d&media_type=image&tknv=v2&etag=9e0176f87f6565a22f78e0f9b39a4d78",
"path": "disk:/ed13b9fd-51cb-4857-b59d-d8f4fe448746.png",
"media_type": "image",
"sha256": "89f8eb42a35208a17c85036e17237b0aa0657e1841efa6171dc5acbc0dea9e18",
"type": "file",
"md5": "9e0176f87f6565a22f78e0f9b39a4d78",
"revision": 1728454141910980
}
```