An open API service indexing awesome lists of open source software.

https://github.com/sepppenner/googledriveexample

GoogleDriveExample is an assembly/ library on how to work with the Google.Apis.Drive.v3.dll.
https://github.com/sepppenner/googledriveexample

Last synced: 8 months ago
JSON representation

GoogleDriveExample is an assembly/ library on how to work with the Google.Apis.Drive.v3.dll.

Awesome Lists containing this project

README

          

GoogleDriveExample
====================================

GoogleDriveExample is an assembly/ library on how to work with the Google.Apis.Drive.v3.dll.

[![Build status](https://ci.appveyor.com/api/projects/status/qmem8i9v5no63wfg?svg=true)](https://ci.appveyor.com/project/SeppPenner/googledriveexample)
[![GitHub issues](https://img.shields.io/github/issues/SeppPenner/GoogleDriveExample.svg)](https://github.com/SeppPenner/GoogleDriveExample/issues)
[![GitHub forks](https://img.shields.io/github/forks/SeppPenner/GoogleDriveExample.svg)](https://github.com/SeppPenner/GoogleDriveExample/network)
[![GitHub stars](https://img.shields.io/github/stars/SeppPenner/GoogleDriveExample.svg)](https://github.com/SeppPenner/GoogleDriveExample/stargazers)
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://raw.githubusercontent.com/SeppPenner/GoogleDriveExample/master/License.txt)
[![Known Vulnerabilities](https://snyk.io/test/github/SeppPenner/GoogleDriveExample/badge.svg)](https://snyk.io/test/github/SeppPenner/GoogleDriveExample)
[![Blogger](https://img.shields.io/badge/Follow_me_on-blogger-orange)](https://franzhuber23.blogspot.de/)
[![Patreon](https://img.shields.io/badge/Patreon-F96854?logo=patreon&logoColor=white)](https://patreon.com/SeppPennerOpenSourceDevelopment)
[![PayPal](https://img.shields.io/badge/PayPal-00457C?logo=paypal&logoColor=white)](https://paypal.me/th070795)

## Basic usage
```csharp
public void Test()
{
ICustomGDriveService _service = new CustomGDriveService();
_service.xy //See the interface section for more information
}
```

## Interface ICustomGDriveService
```csharp
using System;
using Google.Apis.Drive.v3;
using GoogleDriveExample.Implementation;

namespace GoogleDriveExample.Interfaces
{
///
/// The Google class
///
public interface ICustomGDriveService
{
///
/// Gets the used quota of the account
///
/// The that is needed
/// The used quota of the account
long GetQuotaUsed(DriveService service);

///
/// Gets the total quota (is 15 GB) of the account
///
/// The that is needed
/// The total quota of the account
long GetQuotaTotal(DriveService service);

///
/// Uploads a file to GDrive with "everone that has the link can read the file" rights
///
/// The that is needed
/// The File that should be uploaded
/// The parent folder
/// The download link to the file
string UploadToGDrive(DriveService service, string uploadFile, string parent);

///
/// Gets the root folder id of the account
///
/// The that is needed
/// The root folder id for the account
string GetRootFolderId(DriveService service);

///
/// Gets the needed in the methods above
///
/// The client id that needs to be set inside the Google account (API-Key)
/// The client secret/ password
/// The client username
/// The needed to authenticate the above methods
DriveService GetDriveService(string clientId, string clientSecret, string userName);

///
/// Called when the upload process is changed
///
event EventHandler OnUploadProgessChanged;

///
/// Called when the upload process is finished
///
event EventHandler OnUploadSuccessfull;
}
}
```

Change history
--------------

See the [Changelog](https://github.com/SeppPenner/GoogleDriveExample/blob/master/Changelog.md).