1
0
mirror of https://github.com/Bayselonarrend/OpenIntegrations.git synced 2025-07-03 00:58:12 +02:00
Files
OpenIntegrations/docs/en/md/Yandex_Disk/File-and-folder-management/Move-object.mdx

86 lines
2.9 KiB
Plaintext
Raw Normal View History

2024-10-15 10:50:56 +03:00
---
2024-10-15 10:16:04 +03:00
sidebar_position: 9
---
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
# Move object
Moves the object to the specified path and path to the original
`Function MoveObject(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 folder |
| Path | --to | String | ✔ | Destination path for moving |
| 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...";
2024-11-17 14:43:15 +03:00
Original = "/8953feb0-9721-452f-ae2c-d055abf6406d.png";
2024-10-15 10:16:04 +03:00
Path = "/" + String(New UUID) + ".png";
Result = OPI_YandexDisk.MoveObject(Token, Original, Path, True);
```
2024-10-20 22:36:03 +03:00
<Tabs>
<TabItem value="bash" label="Bash" default>
```bash
oint yadisk MoveObject \
2024-10-22 08:59:24 +03:00
--token "***" \
2024-11-17 16:09:58 +03:00
--from "/3205dd69-5fa6-43f2-9ba9-bb8368de3fae.png" \
--to "/459cbde0-7084-41c9-8ec3-e3ad7ff6a5d5.png" \
2024-10-22 08:59:24 +03:00
--rewrite true
2024-10-20 22:36:03 +03:00
```
</TabItem>
<TabItem value="bat" label="CMD/Bat" default>
```batch
oint yadisk MoveObject ^
2024-10-22 08:59:24 +03:00
--token "***" ^
2024-11-17 16:09:58 +03:00
--from "/3205dd69-5fa6-43f2-9ba9-bb8368de3fae.png" ^
--to "/459cbde0-7084-41c9-8ec3-e3ad7ff6a5d5.png" ^
2024-10-22 08:59:24 +03:00
--rewrite true
2024-10-20 22:36:03 +03:00
```
</TabItem>
</Tabs>
2024-10-15 10:16:04 +03:00
```json title="Result"
{
"antivirus_status": "clean",
"size": 2114023,
"comment_ids": {
"private_resource": "1573541518:513349b18480e51184e963f68f6d0e8f4173c06c4ab885b65f0eb797138892f3",
"public_resource": "1573541518:513349b18480e51184e963f68f6d0e8f4173c06c4ab885b65f0eb797138892f3"
},
"name": "2a45ec48-94fd-4a39-a282-836b0177948a.png",
"exif": {},
"created": "2024-10-09T09:10:03+03:00",
"resource_id": "1573541518:513349b18480e51184e963f68f6d0e8f4173c06c4ab885b65f0eb797138892f3",
"modified": "2024-10-09T09:10:27+03:00",
"mime_type": "multipart",
"file": "https://downloader.disk.yandex.ru/disk/a0b2187a8a78f1e08b108c712034d22c1c5b1f8b7d82f2b5d0c84af4e7ddf460/67065694/gwThwhLBKYvLhQCNnqAHikawF6ofeh69S2Q-9g1T5IGPQ-vmmg5ho0UNlym1cYvMYt55yWUwrNHLEwnJN27VGg%3D%3D?uid=1573541518&filename=2a45ec48-94fd-4a39-a282-836b0177948a.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:/2a45ec48-94fd-4a39-a282-836b0177948a.png",
"media_type": "image",
"sha256": "89f8eb42a35208a17c85036e17237b0aa0657e1841efa6171dc5acbc0dea9e18",
"type": "file",
"md5": "9e0176f87f6565a22f78e0f9b39a4d78",
"revision": 1728454227592125
}
```