yadisk-client 1.10.2 → 1.11.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/dependabot.yml +14 -0
- data/.github/workflows/CI.yml +50 -0
- data/Gemfile.lock +12 -1
- data/README.md +5 -2
- data/lib/yadisk/resources/disk.rb +5 -6
- data/lib/yadisk/version.rb +2 -2
- data/spec/lib/yadisk/client_spec.rb +4 -8
- data/spec/lib/yadisk/disk_spec.rb +220 -217
- data/spec/lib/yadisk/operation_spec.rb +18 -0
- data/spec/lib/yadisk/public_spec.rb +31 -37
- data/spec/lib/yadisk/trash_spec.rb +27 -56
- data/spec/spec_helper.rb +15 -1
- data/spec/vcr/disk/{POST_copy.yml → copy.yml} +10 -8
- data/spec/vcr/disk/create_dir.yml +52 -0
- data/spec/vcr/disk/{PUT_create_dir.yml → create_dir_error_409.yml} +10 -6
- data/spec/vcr/disk/{DELETE_delete.yml → delete.yml} +3 -3
- data/spec/vcr/{operations/GET_status.yml → disk/download.yml} +4 -4
- data/spec/vcr/disk/get_meta.yml +52 -0
- data/spec/vcr/disk/info.yml +57 -0
- data/spec/vcr/disk/last_uploaded.yml +52 -0
- data/spec/vcr/disk/list_files.yml +52 -0
- data/spec/vcr/disk/list_public.yml +52 -0
- data/spec/vcr/disk/{POST_move.yml → move.yml} +10 -8
- data/spec/vcr/disk/{PUT_publish.yml → publish.yml} +4 -4
- data/spec/vcr/disk/{PUT_unpublish.yml → unpublish.yml} +4 -4
- data/spec/vcr/disk/update_meta.yml +54 -0
- data/spec/vcr/disk/{GET_get_meta.yml → upload.yml} +5 -5
- data/spec/vcr/disk/{POST_upload_by_url.yml → upload_by_url.yml} +4 -4
- data/spec/vcr/disk/upload_from_file.yml +111 -0
- data/spec/vcr/{disk/GET_download.yml → operation/status.yml} +4 -4
- data/spec/vcr/{disk/GET_list_public.yml → public/link.yml} +4 -4
- data/spec/vcr/public/meta.yml +52 -0
- data/spec/vcr/public/save.yml +52 -0
- data/spec/vcr/trash/{DELETE_delete.yml → delete.yml} +3 -3
- data/spec/vcr/trash/list.yml +52 -0
- data/spec/vcr/trash/{PUT_restore.yml → restore.yml} +6 -5
- data/spec/vcr_setup.rb +0 -4
- data/yadisk.gemspec +8 -0
- metadata +133 -23
- data/spec/lib/yadisk/errors_spec.rb +0 -16
- data/spec/lib/yadisk/operations_spec.rb +0 -23
- data/spec/vcr/disk/ERROR_info.yml +0 -48
- data/spec/vcr/disk/GET_info.yml +0 -52
- data/spec/vcr/disk/GET_upload.yml +0 -48
- data/spec/vcr/disk/PATCH_update_meta.yml +0 -54
- data/spec/vcr/trash/DELETE_delete_error.yml +0 -49
- data/spec/vcr/trash/GET_list.yml +0 -51
data/spec/spec_helper.rb
CHANGED
@@ -6,12 +6,26 @@ require File.expand_path("./vcr_setup", __dir__)
|
|
6
6
|
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), "..", "lib"))
|
7
7
|
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
8
8
|
|
9
|
+
require "simplecov"
|
10
|
+
require "simplecov-lcov"
|
11
|
+
|
9
12
|
require_relative "../lib/yadisk"
|
10
13
|
|
14
|
+
SimpleCov::Formatter::LcovFormatter.config.report_with_single_file = true
|
15
|
+
SimpleCov.formatter = SimpleCov::Formatter::LcovFormatter
|
16
|
+
|
17
|
+
SimpleCov.start do
|
18
|
+
add_filter "spec/"
|
19
|
+
add_group "Lib", "lib"
|
20
|
+
minimum_coverage 80.0
|
21
|
+
end
|
22
|
+
|
23
|
+
ACCESS_TOKEN = ENV["YANDEX_DISK_ACCESS_TOKEN"] || "your_access_token"
|
24
|
+
|
11
25
|
RSpec.configure do |config|
|
12
26
|
config.include CassetteHelpers
|
13
27
|
config.before(:each) do
|
14
|
-
@yandex = Yadisk::Client.new(token:
|
28
|
+
@yandex = Yadisk::Client.new(token: ACCESS_TOKEN)
|
15
29
|
end
|
16
30
|
|
17
31
|
config.expect_with :rspec do |c|
|
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: post
|
5
|
-
uri: https://cloud-api.yandex.net/v1/disk/resources/copy?from=
|
5
|
+
uri: https://cloud-api.yandex.net/v1/disk/resources/copy?from=yadisk_test_png.png&path=yadisk_test_png_copy.png
|
6
6
|
body:
|
7
7
|
encoding: UTF-8
|
8
8
|
string: ''
|
@@ -19,19 +19,21 @@ http_interactions:
|
|
19
19
|
- "*/*"
|
20
20
|
response:
|
21
21
|
status:
|
22
|
-
code:
|
23
|
-
message:
|
22
|
+
code: 201
|
23
|
+
message: CREATED
|
24
24
|
headers:
|
25
25
|
Server:
|
26
26
|
- nginx
|
27
27
|
Date:
|
28
|
-
-
|
28
|
+
- Tue, 18 Oct 2022 11:48:30 GMT
|
29
29
|
Content-Type:
|
30
|
-
- application/json
|
30
|
+
- application/json; charset=utf-8
|
31
31
|
Content-Length:
|
32
|
-
- '
|
32
|
+
- '130'
|
33
33
|
Connection:
|
34
34
|
- keep-alive
|
35
|
+
Access-Control-Allow-Methods:
|
36
|
+
- POST, OPTIONS
|
35
37
|
Access-Control-Allow-Credentials:
|
36
38
|
- 'true'
|
37
39
|
Yandex-Cloud-Request-Id:
|
@@ -45,6 +47,6 @@ http_interactions:
|
|
45
47
|
Authorization
|
46
48
|
body:
|
47
49
|
encoding: UTF-8
|
48
|
-
string: '{"
|
49
|
-
recorded_at:
|
50
|
+
string: '{"href":"https://cloud-api.yandex.net/v1/disk/resources?path=disk%3A%2Fyadisk_test_png_copy.png","method":"GET","templated":false}'
|
51
|
+
recorded_at: Tue, 18 Oct 2022 11:48:30 GMT
|
50
52
|
recorded_with: VCR 6.1.0
|
@@ -0,0 +1,52 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: put
|
5
|
+
uri: https://cloud-api.yandex.net/v1/disk/resources?path=yadisk_created_dir
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- Faraday v1.10.2
|
12
|
+
Authorization:
|
13
|
+
- "[**********]"
|
14
|
+
Content-Type:
|
15
|
+
- application/x-www-form-urlencoded
|
16
|
+
Accept-Encoding:
|
17
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
18
|
+
Accept:
|
19
|
+
- "*/*"
|
20
|
+
response:
|
21
|
+
status:
|
22
|
+
code: 201
|
23
|
+
message: CREATED
|
24
|
+
headers:
|
25
|
+
Server:
|
26
|
+
- nginx
|
27
|
+
Date:
|
28
|
+
- Tue, 18 Oct 2022 12:03:24 GMT
|
29
|
+
Content-Type:
|
30
|
+
- application/json; charset=utf-8
|
31
|
+
Content-Length:
|
32
|
+
- '124'
|
33
|
+
Connection:
|
34
|
+
- keep-alive
|
35
|
+
Access-Control-Allow-Methods:
|
36
|
+
- PUT, PATCH, DELETE, GET, OPTIONS
|
37
|
+
Access-Control-Allow-Credentials:
|
38
|
+
- 'true'
|
39
|
+
Yandex-Cloud-Request-Id:
|
40
|
+
- omitted
|
41
|
+
Cache-Control:
|
42
|
+
- no-cache
|
43
|
+
Access-Control-Allow-Origin:
|
44
|
+
- "*"
|
45
|
+
Access-Control-Allow-Headers:
|
46
|
+
- Accept-Language, Accept, X-Uid, X-HTTP-Method, X-Requested-With, Content-Type,
|
47
|
+
Authorization
|
48
|
+
body:
|
49
|
+
encoding: UTF-8
|
50
|
+
string: '{"href":"https://cloud-api.yandex.net/v1/disk/resources?path=disk%3A%2Fyadisk_created_dir","method":"GET","templated":false}'
|
51
|
+
recorded_at: Tue, 18 Oct 2022 12:03:23 GMT
|
52
|
+
recorded_with: VCR 6.1.0
|
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: put
|
5
|
-
uri: https://cloud-api.yandex.net/v1/disk/resources?path=
|
5
|
+
uri: https://cloud-api.yandex.net/v1/disk/resources?path=yadisk_created_dir
|
6
6
|
body:
|
7
7
|
encoding: UTF-8
|
8
8
|
string: ''
|
@@ -20,16 +20,16 @@ http_interactions:
|
|
20
20
|
response:
|
21
21
|
status:
|
22
22
|
code: 409
|
23
|
-
message:
|
23
|
+
message: Conflict
|
24
24
|
headers:
|
25
25
|
Server:
|
26
26
|
- nginx
|
27
27
|
Date:
|
28
|
-
-
|
28
|
+
- Tue, 18 Oct 2022 12:03:24 GMT
|
29
29
|
Content-Type:
|
30
30
|
- application/json
|
31
31
|
Content-Length:
|
32
|
-
- '
|
32
|
+
- '271'
|
33
33
|
Connection:
|
34
34
|
- keep-alive
|
35
35
|
Access-Control-Allow-Credentials:
|
@@ -43,8 +43,12 @@ http_interactions:
|
|
43
43
|
Access-Control-Allow-Headers:
|
44
44
|
- Accept-Language, Accept, X-Uid, X-HTTP-Method, X-Requested-With, Content-Type,
|
45
45
|
Authorization
|
46
|
+
X-Envoy-Upstream-Service-Time:
|
47
|
+
- '249'
|
46
48
|
body:
|
47
49
|
encoding: UTF-8
|
48
|
-
string: '{"
|
49
|
-
|
50
|
+
string: '{"message":"По указанному пути \"yadisk_created_dir\" уже существует
|
51
|
+
папка с таким именем.","description":"Specified path \"yadisk_created_dir\"
|
52
|
+
points to existent directory.","error":"DiskPathPointsToExistentDirectoryError"}'
|
53
|
+
recorded_at: Tue, 18 Oct 2022 12:03:23 GMT
|
50
54
|
recorded_with: VCR 6.1.0
|
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: delete
|
5
|
-
uri: https://cloud-api.yandex.net/v1/disk/resources?path=
|
5
|
+
uri: https://cloud-api.yandex.net/v1/disk/resources?path=yadisk_test_png.png
|
6
6
|
body:
|
7
7
|
encoding: US-ASCII
|
8
8
|
string: ''
|
@@ -23,7 +23,7 @@ http_interactions:
|
|
23
23
|
Server:
|
24
24
|
- nginx
|
25
25
|
Date:
|
26
|
-
-
|
26
|
+
- Tue, 18 Oct 2022 11:58:56 GMT
|
27
27
|
Content-Type:
|
28
28
|
- application/json; charset=utf-8
|
29
29
|
Content-Length:
|
@@ -46,5 +46,5 @@ http_interactions:
|
|
46
46
|
body:
|
47
47
|
encoding: UTF-8
|
48
48
|
string: ''
|
49
|
-
recorded_at:
|
49
|
+
recorded_at: Tue, 18 Oct 2022 11:58:55 GMT
|
50
50
|
recorded_with: VCR 6.1.0
|
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: get
|
5
|
-
uri: https://cloud-api.yandex.net/v1/disk/
|
5
|
+
uri: https://cloud-api.yandex.net/v1/disk/resources/download?path=yadisk_test_png_copy.png
|
6
6
|
body:
|
7
7
|
encoding: US-ASCII
|
8
8
|
string: ''
|
@@ -23,7 +23,7 @@ http_interactions:
|
|
23
23
|
Server:
|
24
24
|
- nginx
|
25
25
|
Date:
|
26
|
-
-
|
26
|
+
- Tue, 18 Oct 2022 11:48:43 GMT
|
27
27
|
Content-Type:
|
28
28
|
- application/json; charset=utf-8
|
29
29
|
Transfer-Encoding:
|
@@ -47,6 +47,6 @@ http_interactions:
|
|
47
47
|
Authorization
|
48
48
|
body:
|
49
49
|
encoding: UTF-8
|
50
|
-
string: '{"
|
51
|
-
recorded_at:
|
50
|
+
string: '{"href":"https://downloader.disk.yandex.ru/disk/037f3c29ce1efab998aa2f5e97f4d15044a910c366adb6faf35bc34348f90b41/634ecadb/wQYFfZvXbSuHTOTzNLBFPm0KOuGlmqJqt-gP1pnGFp3pPxbUv3VruyBmBo9eQx6ADVGmh41pOtaWjuxNFY79JA%3D%3D?uid=12345678&filename=yadisk_test_png_copy.png&disposition=attachment&hash=&limit=0&content_type=image%2Fpng&owner_uid=12345678&fsize=976&hid=11f9f98d69f194fd21a436fcc5f98c7e&media_type=image&tknv=v2&etag=08d91a170e2697b630465e9e9bc0b8bd","method":"GET","templated":false}'
|
51
|
+
recorded_at: Tue, 18 Oct 2022 11:48:42 GMT
|
52
52
|
recorded_with: VCR 6.1.0
|
@@ -0,0 +1,52 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://cloud-api.yandex.net/v1/disk/resources?path=yadisk_test_png.png
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- Faraday v1.10.2
|
12
|
+
Authorization:
|
13
|
+
- "[**********]"
|
14
|
+
Accept-Encoding:
|
15
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
16
|
+
Accept:
|
17
|
+
- "*/*"
|
18
|
+
response:
|
19
|
+
status:
|
20
|
+
code: 200
|
21
|
+
message: OK
|
22
|
+
headers:
|
23
|
+
Server:
|
24
|
+
- nginx
|
25
|
+
Date:
|
26
|
+
- Tue, 18 Oct 2022 11:47:53 GMT
|
27
|
+
Content-Type:
|
28
|
+
- application/json; charset=utf-8
|
29
|
+
Transfer-Encoding:
|
30
|
+
- chunked
|
31
|
+
Connection:
|
32
|
+
- keep-alive
|
33
|
+
Vary:
|
34
|
+
- Accept-Encoding
|
35
|
+
Access-Control-Allow-Methods:
|
36
|
+
- PUT, PATCH, DELETE, GET, OPTIONS
|
37
|
+
Access-Control-Allow-Credentials:
|
38
|
+
- 'true'
|
39
|
+
Yandex-Cloud-Request-Id:
|
40
|
+
- omitted
|
41
|
+
Cache-Control:
|
42
|
+
- no-cache
|
43
|
+
Access-Control-Allow-Origin:
|
44
|
+
- "*"
|
45
|
+
Access-Control-Allow-Headers:
|
46
|
+
- Accept-Language, Accept, X-Uid, X-HTTP-Method, X-Requested-With, Content-Type,
|
47
|
+
Authorization
|
48
|
+
body:
|
49
|
+
encoding: UTF-8
|
50
|
+
string: '{"antivirus_status":"clean","size":976,"comment_ids":{"private_resource":"12345678:d33a07b1dbd4b443f169e56484731fab7cf5b78ae5e6b357567a3af24c6ff965","public_resource":"12345678:d33a07b1dbd4b443f169e56484731fab7cf5b78ae5e6b357567a3af24c6ff965"},"name":"yadisk_test_png.png","exif":{},"created":"2022-10-18T11:47:37+00:00","custom_properties":{"key":"value"},"resource_id":"12345678:d33a07b1dbd4b443f169e56484731fab7cf5b78ae5e6b357567a3af24c6ff965","modified":"2022-10-18T11:47:52+00:00","mime_type":"image/png","file":"https://downloader.disk.yandex.ru/disk/73f6463491664e1ae56d809cd81b9e188d1af9ee054c73119b283ff9eb5cbb88/634ecaa9/wQYFfZvXbSuHTOTzNLBFPm0KOuGlmqJqt-gP1pnGFp3pPxbUv3VruyBmBo9eQx6ADVGmh41pOtaWjuxNFY79JA%3D%3D?uid=12345678&filename=yadisk_test_png.png&disposition=attachment&hash=&limit=0&content_type=image%2Fpng&owner_uid=12345678&fsize=976&hid=11f9f98d69f194fd21a436fcc5f98c7e&media_type=image&tknv=v2&etag=08d91a170e2697b630465e9e9bc0b8bd","media_type":"image","preview":"https://downloader.disk.yandex.ru/preview/d619c43f6501afdbc0436ef1a31d83b3c5f81b1fef53f1bcd4dbccc67999ae95/inf/GAyQwWKMxmt5vqh3onJV2W0KOuGlmqJqt-gP1pnGFp3-zrM1ddX9qM_4XglWRw48beksfosE5iXGCDHqK0pdQw%3D%3D?uid=12345678&filename=yadisk_test_png.png&disposition=inline&hash=&limit=0&content_type=image%2Fpng&owner_uid=12345678&tknv=v2&size=S&crop=0","path":"disk:/yadisk_test_png.png","sha256":"48d8a840a19c51300bfe52e3d7199f73e960965f07532868962e8e11c143256d","type":"file","md5":"08d91a170e2697b630465e9e9bc0b8bd","revision":1666093672657383}'
|
51
|
+
recorded_at: Tue, 18 Oct 2022 11:47:52 GMT
|
52
|
+
recorded_with: VCR 6.1.0
|
@@ -0,0 +1,57 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://cloud-api.yandex.net/v1/disk
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- Faraday v1.10.2
|
12
|
+
Authorization:
|
13
|
+
- "[**********]"
|
14
|
+
Accept-Encoding:
|
15
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
16
|
+
Accept:
|
17
|
+
- "*/*"
|
18
|
+
response:
|
19
|
+
status:
|
20
|
+
code: 200
|
21
|
+
message: OK
|
22
|
+
headers:
|
23
|
+
Server:
|
24
|
+
- nginx
|
25
|
+
Date:
|
26
|
+
- Tue, 18 Oct 2022 11:43:09 GMT
|
27
|
+
Content-Type:
|
28
|
+
- application/json; charset=utf-8
|
29
|
+
Transfer-Encoding:
|
30
|
+
- chunked
|
31
|
+
Connection:
|
32
|
+
- keep-alive
|
33
|
+
Vary:
|
34
|
+
- Accept-Encoding
|
35
|
+
Access-Control-Allow-Methods:
|
36
|
+
- GET, OPTIONS
|
37
|
+
Access-Control-Allow-Credentials:
|
38
|
+
- 'true'
|
39
|
+
Yandex-Cloud-Request-Id:
|
40
|
+
- omitted
|
41
|
+
Cache-Control:
|
42
|
+
- no-cache
|
43
|
+
Access-Control-Allow-Origin:
|
44
|
+
- "*"
|
45
|
+
Access-Control-Allow-Headers:
|
46
|
+
- Accept-Language, Accept, X-Uid, X-HTTP-Method, X-Requested-With, Content-Type,
|
47
|
+
Authorization
|
48
|
+
body:
|
49
|
+
encoding: UTF-8
|
50
|
+
string: '{"max_file_size":53687091200,"unlimited_autoupload_enabled":false,"total_space":3389266067456,"trash_size":0,"is_paid":true,"used_space":2099318908604,"system_folders":{"odnoklassniki":"disk:/Социальные
|
51
|
+
сети/Одноклассники","google":"disk:/Социальные сети/Google+","instagram":"disk:/Социальные
|
52
|
+
сети/Instagram","vkontakte":"disk:/Социальные сети/ВКонтакте","attach":"disk:/Почтовые
|
53
|
+
вложения","mailru":"disk:/Социальные сети/Мой Мир","downloads":"disk:/Загрузки/","applications":"disk:/Приложения","facebook":"disk:/Социальные
|
54
|
+
сети/Facebook","social":"disk:/Социальные сети/","messenger":"disk:/Файлы
|
55
|
+
Мессенджера","calendar":"disk:/Материалы встреч","scans":"disk:/Сканы","screenshots":"disk:/Скриншоты/","photostream":"disk:/Фотокамера/"},"user":{"country":"ru","login":"userlogin","display_name":"Ilya","uid":"12345678"},"revision":1666093125917488}'
|
56
|
+
recorded_at: Tue, 18 Oct 2022 11:43:08 GMT
|
57
|
+
recorded_with: VCR 6.1.0
|
@@ -0,0 +1,52 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://cloud-api.yandex.net/v1/disk/resources/last-uploaded?limit=1
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- Faraday v1.10.2
|
12
|
+
Authorization:
|
13
|
+
- "[**********]"
|
14
|
+
Accept-Encoding:
|
15
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
16
|
+
Accept:
|
17
|
+
- "*/*"
|
18
|
+
response:
|
19
|
+
status:
|
20
|
+
code: 200
|
21
|
+
message: OK
|
22
|
+
headers:
|
23
|
+
Server:
|
24
|
+
- nginx
|
25
|
+
Date:
|
26
|
+
- Tue, 18 Oct 2022 11:55:47 GMT
|
27
|
+
Content-Type:
|
28
|
+
- application/json; charset=utf-8
|
29
|
+
Transfer-Encoding:
|
30
|
+
- chunked
|
31
|
+
Connection:
|
32
|
+
- keep-alive
|
33
|
+
Vary:
|
34
|
+
- Accept-Encoding
|
35
|
+
Access-Control-Allow-Methods:
|
36
|
+
- GET, OPTIONS
|
37
|
+
Access-Control-Allow-Credentials:
|
38
|
+
- 'true'
|
39
|
+
Yandex-Cloud-Request-Id:
|
40
|
+
- omitted
|
41
|
+
Cache-Control:
|
42
|
+
- no-cache
|
43
|
+
Access-Control-Allow-Origin:
|
44
|
+
- "*"
|
45
|
+
Access-Control-Allow-Headers:
|
46
|
+
- Accept-Language, Accept, X-Uid, X-HTTP-Method, X-Requested-With, Content-Type,
|
47
|
+
Authorization
|
48
|
+
body:
|
49
|
+
encoding: UTF-8
|
50
|
+
string: '{"items":[{"antivirus_status":"clean","size":976,"comment_ids":{"private_resource":"12345678:d33a07b1dbd4b443f169e56484731fab7cf5b78ae5e6b357567a3af24c6ff965","public_resource":"12345678:d33a07b1dbd4b443f169e56484731fab7cf5b78ae5e6b357567a3af24c6ff965"},"name":"yadisk_test_png.png","exif":{},"created":"2022-10-18T11:47:37+00:00","custom_properties":{"key":"value"},"resource_id":"12345678:d33a07b1dbd4b443f169e56484731fab7cf5b78ae5e6b357567a3af24c6ff965","modified":"2022-10-18T11:47:52+00:00","mime_type":"image/png","file":"https://downloader.disk.yandex.ru/disk/739d07b1e98a23b639a7ca9e3cd07d8c0f08020f0147f8156e63e0e0f5a00894/634ecc83/wQYFfZvXbSuHTOTzNLBFPm0KOuGlmqJqt-gP1pnGFp3pPxbUv3VruyBmBo9eQx6ADVGmh41pOtaWjuxNFY79JA%3D%3D?uid=12345678&filename=yadisk_test_png.png&disposition=attachment&hash=&limit=0&content_type=image%2Fpng&owner_uid=12345678&fsize=976&hid=11f9f98d69f194fd21a436fcc5f98c7e&media_type=image&tknv=v2&etag=08d91a170e2697b630465e9e9bc0b8bd","media_type":"image","preview":"https://downloader.disk.yandex.ru/preview/d619c43f6501afdbc0436ef1a31d83b3c5f81b1fef53f1bcd4dbccc67999ae95/inf/GAyQwWKMxmt5vqh3onJV2W0KOuGlmqJqt-gP1pnGFp3-zrM1ddX9qM_4XglWRw48beksfosE5iXGCDHqK0pdQw%3D%3D?uid=12345678&filename=yadisk_test_png.png&disposition=inline&hash=&limit=0&content_type=image%2Fpng&owner_uid=12345678&tknv=v2&size=S&crop=0","path":"disk:/yadisk_test_png.png","sha256":"48d8a840a19c51300bfe52e3d7199f73e960965f07532868962e8e11c143256d","type":"file","md5":"08d91a170e2697b630465e9e9bc0b8bd","revision":1666093672657383}],"limit":1}'
|
51
|
+
recorded_at: Tue, 18 Oct 2022 11:55:46 GMT
|
52
|
+
recorded_with: VCR 6.1.0
|
@@ -0,0 +1,52 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://cloud-api.yandex.net/v1/disk/resources/files?limit=1
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- Faraday v1.10.2
|
12
|
+
Authorization:
|
13
|
+
- "[**********]"
|
14
|
+
Accept-Encoding:
|
15
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
16
|
+
Accept:
|
17
|
+
- "*/*"
|
18
|
+
response:
|
19
|
+
status:
|
20
|
+
code: 200
|
21
|
+
message: OK
|
22
|
+
headers:
|
23
|
+
Server:
|
24
|
+
- nginx
|
25
|
+
Date:
|
26
|
+
- Tue, 18 Oct 2022 11:52:53 GMT
|
27
|
+
Content-Type:
|
28
|
+
- application/json; charset=utf-8
|
29
|
+
Transfer-Encoding:
|
30
|
+
- chunked
|
31
|
+
Connection:
|
32
|
+
- keep-alive
|
33
|
+
Vary:
|
34
|
+
- Accept-Encoding
|
35
|
+
Access-Control-Allow-Methods:
|
36
|
+
- GET, OPTIONS
|
37
|
+
Access-Control-Allow-Credentials:
|
38
|
+
- 'true'
|
39
|
+
Yandex-Cloud-Request-Id:
|
40
|
+
- omitted
|
41
|
+
Cache-Control:
|
42
|
+
- no-cache
|
43
|
+
Access-Control-Allow-Origin:
|
44
|
+
- "*"
|
45
|
+
Access-Control-Allow-Headers:
|
46
|
+
- Accept-Language, Accept, X-Uid, X-HTTP-Method, X-Requested-With, Content-Type,
|
47
|
+
Authorization
|
48
|
+
body:
|
49
|
+
encoding: UTF-8
|
50
|
+
string: '{"items":[{"antivirus_status":"clean","size":1771331,"comment_ids":{"private_resource":"12345678:57c4ee83eb3ceeb2f18bc6998cc063ff0af447296298bbc8917967bcec12d603","public_resource":"12345678:57c4ee83eb3ceeb2f18bc6998cc063ff0af447296298bbc8917967bcec12d603"},"name":"BecomeAnXCoder.pdf","exif":{},"created":"2012-06-12T14:10:23+00:00","resource_id":"12345678:57c4ee83eb3ceeb2f18bc6998cc063ff0af447296298bbc8917967bcec12d603","modified":"2012-06-12T14:10:23+00:00","mime_type":"application/pdf","file":"https://downloader.disk.yandex.ru/disk/06002fb71ffd5f37d2e392a3db3d53b176d3609ea5ac0f22fa8c1883877aeca8/634ecbd5/pEuHK5PJgmPBpWoQjSxrZpcHRRVwB_1TsWpns42PAgjPJV2cd48ftYZjPa3904daujDyEoSwTRKaApGlP2uhxA%3D%3D?uid=12345678&filename=BecomeAnXCoder.pdf&disposition=attachment&hash=&limit=0&content_type=application%2Fpdf&owner_uid=12345678&fsize=1771331&hid=bdd02a4b304ef7709e0c16e0890c867b&media_type=document&tknv=v2&etag=219d5b6e0b5a90ffa95b79db1d3c8aa7","media_type":"document","preview":"https://downloader.disk.yandex.ru/preview/04a9888e87b226e2708db51e9f7e128728f6bbaee9601d8c05d5eb8486cedf0a/inf/qxNRKmaykcabm3fqiYkrOAuRPD8zF8GXv13R1x_8nRTNTo-Mh_vlq9_q8A1f9K9s36a0e1BurVcWt-gwgcJjdA%3D%3D?uid=12345678&filename=BecomeAnXCoder.pdf&disposition=inline&hash=&limit=0&content_type=image%2Fjpeg&owner_uid=12345678&tknv=v2&size=S&crop=0","path":"disk:/Books/BecomeAnXCoder.pdf","sha256":"c94341c8cf086bf6207f444585466fa6449576009da76c0f296e6497cadbd90b","type":"file","md5":"219d5b6e0b5a90ffa95b79db1d3c8aa7","revision":1470077346326403}],"limit":1,"offset":0}'
|
51
|
+
recorded_at: Tue, 18 Oct 2022 11:52:52 GMT
|
52
|
+
recorded_with: VCR 6.1.0
|
@@ -0,0 +1,52 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://cloud-api.yandex.net/v1/disk/resources/public?limit=1
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- Faraday v1.10.2
|
12
|
+
Authorization:
|
13
|
+
- "[**********]"
|
14
|
+
Accept-Encoding:
|
15
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
16
|
+
Accept:
|
17
|
+
- "*/*"
|
18
|
+
response:
|
19
|
+
status:
|
20
|
+
code: 200
|
21
|
+
message: OK
|
22
|
+
headers:
|
23
|
+
Server:
|
24
|
+
- nginx
|
25
|
+
Date:
|
26
|
+
- Tue, 18 Oct 2022 11:57:06 GMT
|
27
|
+
Content-Type:
|
28
|
+
- application/json; charset=utf-8
|
29
|
+
Transfer-Encoding:
|
30
|
+
- chunked
|
31
|
+
Connection:
|
32
|
+
- keep-alive
|
33
|
+
Vary:
|
34
|
+
- Accept-Encoding
|
35
|
+
Access-Control-Allow-Methods:
|
36
|
+
- GET, OPTIONS
|
37
|
+
Access-Control-Allow-Credentials:
|
38
|
+
- 'true'
|
39
|
+
Yandex-Cloud-Request-Id:
|
40
|
+
- omitted
|
41
|
+
Cache-Control:
|
42
|
+
- no-cache
|
43
|
+
Access-Control-Allow-Origin:
|
44
|
+
- "*"
|
45
|
+
Access-Control-Allow-Headers:
|
46
|
+
- Accept-Language, Accept, X-Uid, X-HTTP-Method, X-Requested-With, Content-Type,
|
47
|
+
Authorization
|
48
|
+
body:
|
49
|
+
encoding: UTF-8
|
50
|
+
string: '{"items":[{"antivirus_status":"clean","public_key":"kPhZek+XdUwHf+TUmFvY8swvYG+1woCj987654115z44oR7fpVfAessL+SzW6qgbq/J6bpmRyOJonT3VoXnDag==","public_url":"https://yadi.sk/i/ztOzg-OyVX6OlW","name":"Example.pdf","exif":{},"created":"2022-10-16T15:33:20+00:00","size":2771771,"resource_id":"12345678:ec8d5352235345aaeb467183282d275155759a433b7a5039314e579ae693093c","modified":"2022-10-16T15:33:20+00:00","comment_ids":{"private_resource":"12345678:ec8d5352235345aaeb467183282d275155759a433b7a5039314e579ae693093c","public_resource":"12345678:ec8d5352235345aaeb467183282d275155759a433b7a5039314e579ae693093c"},"mime_type":"application/pdf","file":"https://downloader.disk.yandex.ruetag=355b1b0f369c2d3bce7642fe216","media_type":"document","preview":"https://downloader.disk.yandex.ruetag=355b1b0f369c2d3bce7642fe216","path":"disk:/Example.pdf","sha256":"8897bf16f51006208ac6a4b93b0ecc39df404decff44dde7838c7e03a5e228xx","type":"file","md5":"30fb1b00069c2d3bce7642fe21639788","revision":4321564403723301}],"limit":1,"offset":0}'
|
51
|
+
recorded_at: Tue, 18 Oct 2022 11:57:05 GMT
|
52
|
+
recorded_with: VCR 6.1.0
|
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: post
|
5
|
-
uri: https://cloud-api.yandex.net/v1/disk/resources/move?from=
|
5
|
+
uri: https://cloud-api.yandex.net/v1/disk/resources/move?from=yadisk_test_png_copy.png&path=yadisk.png
|
6
6
|
body:
|
7
7
|
encoding: UTF-8
|
8
8
|
string: ''
|
@@ -19,19 +19,21 @@ http_interactions:
|
|
19
19
|
- "*/*"
|
20
20
|
response:
|
21
21
|
status:
|
22
|
-
code:
|
23
|
-
message:
|
22
|
+
code: 201
|
23
|
+
message: CREATED
|
24
24
|
headers:
|
25
25
|
Server:
|
26
26
|
- nginx
|
27
27
|
Date:
|
28
|
-
-
|
28
|
+
- Tue, 18 Oct 2022 12:21:14 GMT
|
29
29
|
Content-Type:
|
30
|
-
- application/json
|
30
|
+
- application/json; charset=utf-8
|
31
31
|
Content-Length:
|
32
|
-
- '
|
32
|
+
- '116'
|
33
33
|
Connection:
|
34
34
|
- keep-alive
|
35
|
+
Access-Control-Allow-Methods:
|
36
|
+
- POST, OPTIONS
|
35
37
|
Access-Control-Allow-Credentials:
|
36
38
|
- 'true'
|
37
39
|
Yandex-Cloud-Request-Id:
|
@@ -45,6 +47,6 @@ http_interactions:
|
|
45
47
|
Authorization
|
46
48
|
body:
|
47
49
|
encoding: UTF-8
|
48
|
-
string: '{"
|
49
|
-
recorded_at:
|
50
|
+
string: '{"href":"https://cloud-api.yandex.net/v1/disk/resources?path=disk%3A%2Fyadisk.png","method":"GET","templated":false}'
|
51
|
+
recorded_at: Tue, 18 Oct 2022 12:21:14 GMT
|
50
52
|
recorded_with: VCR 6.1.0
|
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: put
|
5
|
-
uri: https://cloud-api.yandex.net/v1/disk/resources/publish?path=
|
5
|
+
uri: https://cloud-api.yandex.net/v1/disk/resources/publish?path=yadisk.png
|
6
6
|
body:
|
7
7
|
encoding: UTF-8
|
8
8
|
string: ''
|
@@ -25,7 +25,7 @@ http_interactions:
|
|
25
25
|
Server:
|
26
26
|
- nginx
|
27
27
|
Date:
|
28
|
-
-
|
28
|
+
- Tue, 18 Oct 2022 11:58:16 GMT
|
29
29
|
Content-Type:
|
30
30
|
- application/json; charset=utf-8
|
31
31
|
Transfer-Encoding:
|
@@ -49,6 +49,6 @@ http_interactions:
|
|
49
49
|
Authorization
|
50
50
|
body:
|
51
51
|
encoding: UTF-8
|
52
|
-
string: '{"
|
53
|
-
recorded_at:
|
52
|
+
string: '{"href":"https://cloud-api.yandex.net/v1/disk/resources?path=disk%3A%2Fyadisk.png","method":"GET","templated":false}'
|
53
|
+
recorded_at: Tue, 18 Oct 2022 11:58:16 GMT
|
54
54
|
recorded_with: VCR 6.1.0
|
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: put
|
5
|
-
uri: https://cloud-api.yandex.net/v1/disk/resources/unpublish?path=
|
5
|
+
uri: https://cloud-api.yandex.net/v1/disk/resources/unpublish?path=yadisk.png
|
6
6
|
body:
|
7
7
|
encoding: UTF-8
|
8
8
|
string: ''
|
@@ -25,7 +25,7 @@ http_interactions:
|
|
25
25
|
Server:
|
26
26
|
- nginx
|
27
27
|
Date:
|
28
|
-
-
|
28
|
+
- Tue, 18 Oct 2022 11:58:32 GMT
|
29
29
|
Content-Type:
|
30
30
|
- application/json; charset=utf-8
|
31
31
|
Transfer-Encoding:
|
@@ -49,6 +49,6 @@ http_interactions:
|
|
49
49
|
Authorization
|
50
50
|
body:
|
51
51
|
encoding: UTF-8
|
52
|
-
string: '{"
|
53
|
-
recorded_at:
|
52
|
+
string: '{"href":"https://cloud-api.yandex.net/v1/disk/resources?path=disk%3A%2Fyadisk.png","method":"GET","templated":false}'
|
53
|
+
recorded_at: Tue, 18 Oct 2022 11:58:32 GMT
|
54
54
|
recorded_with: VCR 6.1.0
|
@@ -0,0 +1,54 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: patch
|
5
|
+
uri: https://cloud-api.yandex.net/v1/disk/resources?path=yadisk_test_png.png
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: '{"custom_properties":{"key":"value"}}'
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- Faraday v1.10.2
|
12
|
+
Authorization:
|
13
|
+
- "[**********]"
|
14
|
+
Content-Type:
|
15
|
+
- application/json
|
16
|
+
Accept-Encoding:
|
17
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
18
|
+
Accept:
|
19
|
+
- "*/*"
|
20
|
+
response:
|
21
|
+
status:
|
22
|
+
code: 200
|
23
|
+
message: OK
|
24
|
+
headers:
|
25
|
+
Server:
|
26
|
+
- nginx
|
27
|
+
Date:
|
28
|
+
- Tue, 18 Oct 2022 11:47:52 GMT
|
29
|
+
Content-Type:
|
30
|
+
- application/json; charset=utf-8
|
31
|
+
Transfer-Encoding:
|
32
|
+
- chunked
|
33
|
+
Connection:
|
34
|
+
- keep-alive
|
35
|
+
Vary:
|
36
|
+
- Accept-Encoding
|
37
|
+
Access-Control-Allow-Methods:
|
38
|
+
- PUT, PATCH, DELETE, GET, OPTIONS
|
39
|
+
Access-Control-Allow-Credentials:
|
40
|
+
- 'true'
|
41
|
+
Yandex-Cloud-Request-Id:
|
42
|
+
- omitted
|
43
|
+
Cache-Control:
|
44
|
+
- no-cache
|
45
|
+
Access-Control-Allow-Origin:
|
46
|
+
- "*"
|
47
|
+
Access-Control-Allow-Headers:
|
48
|
+
- Accept-Language, Accept, X-Uid, X-HTTP-Method, X-Requested-With, Content-Type,
|
49
|
+
Authorization
|
50
|
+
body:
|
51
|
+
encoding: UTF-8
|
52
|
+
string: '{"antivirus_status":"clean","size":976,"comment_ids":{"private_resource":"12345678:d33a07b1dbd4b443f169e56484731fab7cf5b78ae5e6b357567a3af24c6ff965","public_resource":"12345678:d33a07b1dbd4b443f169e56484731fab7cf5b78ae5e6b357567a3af24c6ff965"},"name":"yadisk_test_png.png","exif":{},"created":"2022-10-18T11:47:37+00:00","custom_properties":{"key":"value"},"resource_id":"12345678:d33a07b1dbd4b443f169e56484731fab7cf5b78ae5e6b357567a3af24c6ff965","modified":"2022-10-18T11:47:37+00:00","mime_type":"image/png","file":"https://downloader.disk.yandex.ru/disk/33edf5c0fff9981b32a682b433f93b464b9ef6e5bad2396aa48774f01f627bb5/634ecaa8/wQYFfZvXbSuHTOTzNLBFPm0KOuGlmqJqt-gP1pnGFp3pPxbUv3VruyBmBo9eQx6ADVGmh41pOtaWjuxNFY79JA%3D%3D?uid=12345678&filename=yadisk_test_png.png&disposition=attachment&hash=&limit=0&content_type=image%2Fpng&owner_uid=12345678&fsize=976&hid=11f9f98d69f194fd21a436fcc5f98c7e&media_type=image&tknv=v2&etag=08d91a170e2697b630465e9e9bc0b8bd","media_type":"image","preview":"https://downloader.disk.yandex.ru/preview/d619c43f6501afdbc0436ef1a31d83b3c5f81b1fef53f1bcd4dbccc67999ae95/inf/GAyQwWKMxmt5vqh3onJV2W0KOuGlmqJqt-gP1pnGFp3-zrM1ddX9qM_4XglWRw48beksfosE5iXGCDHqK0pdQw%3D%3D?uid=12345678&filename=yadisk_test_png.png&disposition=inline&hash=&limit=0&content_type=image%2Fpng&owner_uid=12345678&tknv=v2&size=S&crop=0","path":"disk:/yadisk_test_png.png","sha256":"48d8a840a19c51300bfe52e3d7199f73e960965f07532868962e8e11c143256d","type":"file","md5":"08d91a170e2697b630465e9e9bc0b8bd","revision":1666093658094153}'
|
53
|
+
recorded_at: Tue, 18 Oct 2022 11:47:52 GMT
|
54
|
+
recorded_with: VCR 6.1.0
|