DeQmaTech.YandexDiskSDK 3.3.0

dotnet add package DeQmaTech.YandexDiskSDK --version 3.3.0                
NuGet\Install-Package DeQmaTech.YandexDiskSDK -Version 3.3.0                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="DeQmaTech.YandexDiskSDK" Version="3.3.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add DeQmaTech.YandexDiskSDK --version 3.3.0                
#r "nuget: DeQmaTech.YandexDiskSDK, 3.3.0"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install DeQmaTech.YandexDiskSDK as a Cake Addin
#addin nuget:?package=DeQmaTech.YandexDiskSDK&version=3.3.0

// Install DeQmaTech.YandexDiskSDK as a Cake Tool
#tool nuget:?package=DeQmaTech.YandexDiskSDK&version=3.3.0                

Features

  • Assemblies for .NET 4.5.2 and .NET Standard 2.0
  • Just one external reference (Newtonsoft.Json)
  • Easy installation using NuGet
  • Upload/Download tracking support
  • Proxy Support
  • Upload/Download cancellation support

List of functions:

Token

  1. OneYearToken
  2. GetTokenFromCode

Mine

  1. UserInfo
  2. CheckOperationStatus
  3. ListLatestUploadedFiles

Items

  1. ListAllFiles
  2. List
  3. FD_Move
  4. FD_Copy
  5. FD_Rename
  6. FD_Trash
  7. FD_Delete
  8. D_Create
  9. F_GetDownloadUrl
  10. FD_Privacy
  11. FD_Metadata
  12. F_Download
  13. F_DownloadLarge
  14. F_DownloadAsStream
  15. D_DownloadAsZip
  16. Upload
  17. UploadRemotely
  18. FD_Exists
  19. GetThumbnail
  20. FD_AddTag

RecycleBin

  1. List
  2. EmptyTrashBin
  3. Restore

Sharing

  1. ListAllSharedLinks
  2. PublicFolderContents
  3. GetDownloadUrlOfFileInPublicFolder
  4. PublicUrlToPublicKey
  5. Metadata
  6. PublicUrlToDirectUrl
  7. DownloadPublicFile

CodeMap:

codemap

Code simple:


Async Function AllTasks() As Task
    'first get auth token (one time only)
    Dim tokn = YandexDiskSDK.GetToken.OneYearToken(YandexDiskSDK.utilitiez.ResponseType.token, "yourclientid")
    'OR
    Dim cod = YandexDiskSDK.GetToken.OneYearToken(YandexDiskSDK.utilitiez.ResponseType.code, "yourclientid")
    Dim exchanecodewithtoken = YandexDiskSDK.GetToken.GetTokenFromCode("yourclientid", cod, "yourAppSectretKey")

    ''set proxy and connection options
    Dim con As New YandexDiskSDK.ConnectionSettings With {.CloseConnection = True, .TimeOut = TimeSpan.FromMinutes(30), .Proxy = New YandexDiskSDK.ProxyConfig With {.SetProxy = True, .ProxyIP = "127.0.0.1", .ProxyPort = 8888, .ProxyUsername = "user", .ProxyPassword = "pass"}}
    ''set api client
    Dim CLNT As YandexDiskSDK.IClient = New YandexDiskSDK.YClient("xxxxxtokenxxxxx", con)

    ''general
    Await CLNT.UserInfo()
    Await CLNT.CheckOperationStatus("")
    Await CLNT.ListLatestUploadedFiles()

    ''singleitem
    '' [D_] = dir
    '' [F_] = file
    '' [FD_] = file & dir
    Await CLNT.Item("folder_path").D_Create("new folder")
    Dim cts As New Threading.CancellationTokenSource()
    Dim _ReportCls As New Progress(Of YandexDiskSDK.ReportStatus)(Sub(ReportClass As YandexDiskSDK.ReportStatus) Console.WriteLine(String.Format("{0} - {1}% - {2}", String.Format("{0}/{1}", (ReportClass.BytesTransferred), (ReportClass.TotalBytes)), CInt(ReportClass.ProgressPercentage), ReportClass.TextStatus)))
    Await CLNT.Item("folder_path").D_DownloadAsZip("c:\\downloads", _ReportCls, cts.Token)
    Await CLNT.Item("file_path OR folder_path").FD_AddTag("{""foo"":1, ""bar"":2}")
    Await CLNT.Item("file_path OR folder_path").FD_Copy("folder_path", Nothing, False)
    Await CLNT.Item("file_path OR folder_path").FD_Delete
    Await CLNT.Item("file_path OR folder_path").FD_Move("folder_path", Nothing, False)
    Await CLNT.Item("file_path OR folder_path").FD_Exists
    Await CLNT.Item("file_path OR folder_path").FD_Metadata(True, PreviewSizeEnum.S_300)
    Await CLNT.Item("file_path OR folder_path").FD_Privacy(PrivacyEnum.Public)
    Await CLNT.Item("file_path OR folder_path").FD_Rename("newname.jpg")
    Await CLNT.Item("file_path OR folder_path").FD_Trash
    Await CLNT.Item("file_path").F_Download("c:\\downloads", _ReportCls, cts.Token)
    Await CLNT.Item("file_path").F_DownloadAsStream(_ReportCls, cts.Token)
    Await CLNT.Item("file_path").F_DownloadLarge("c:\\downloads", _ReportCls, cts.Token)
    Await CLNT.Item("file_path").F_GetDownloadUrl()
    Await CLNT.Item("file_path").F_GetThumbnail(New Uri("preview_url"), _ReportCls, cts.Token)
    Await CLNT.Item("root_path OR folder_path").D_List(False, PreviewSizeEnum.S_500, SortEnum.created, 20, 0)
    Await CLNT.Item("root_path OR folder_path").D_ListAllFiles(New List(Of FilterEnum) From {FilterEnum.audio, FilterEnum.video}, True, PreviewSizeEnum.S_150, SortEnum.path, 20, 0)
    Await CLNT.Item("folder_path").D_Upload("c:\\VIDO.mp4", UploadTypes.FilePath, "VIDO.mp4", True, _ReportCls, cts.Token)
    Await CLNT.Item("folder_path").D_UploadRemotely(New Uri("https://domain.com/watch.mp4"), "watch.mp4", False)

    ''RecycleBin
    Await CLNT.RecycleBin(CLNT.RootPath(DestinationType.trash)).EmptyTrashBin
    Await CLNT.RecycleBin("trashroot_path OR trashfolder_path").List(False, PreviewSizeEnum.S_150, SortEnum.size, 20, 0)
    Await CLNT.RecycleBin("trashfile_path OR trashfolder_path").Restore

    ''root 
    Dim root = CLNT.RootPath(DestinationType.disk)

    ''Sharing
    Await CLNT.Sharing.DownloadPublicFile(New Uri("https://yadi.sk/i/xxxxx"), "c:\\downloads", _ReportCls, cts.Token)
    Await CLNT.Sharing.GetDownloadUrlOfFileInPublicFolder("https://yadi.sk/d/xxxxx", "/img.jpg")
    Await CLNT.Sharing.ListAllSharedLinks(ItemTypeEnum.file, Fields.name, Nothing, 20, 0)
    Await CLNT.Sharing.Metadata(New Uri("https://yadi.sk/i/xxxxx"))
    Await CLNT.Sharing.PublicFolderContents("https://yadi.sk/d/xxxxx", Nothing, SortEnum.path, False, PreviewSizeEnum.S_1024, 20, 0)
    Await CLNT.Sharing.PublicUrlToDirectUrl(New Uri("https://yadi.sk/i/xxxxx"))
    Await CLNT.Sharing.PublicUrlToPublicKey(New Uri("https://yadi.sk/d/xxxxx"))

End Function

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 is compatible.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net452 is compatible.  net46 was computed.  net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
3.3.0 741 2/2/2020
3.1.0 537 9/29/2019
3.0.0 546 8/27/2019