gopro-plus-0.3.1.1: GoPro Plus Client API.

Copyright(c) Dustin Sallings 2020
LicenseBSD3
Maintainerdustin@spy.net
Stabilityexperimental
Safe HaskellNone
LanguageHaskell2010

GoPro.Plus.Upload

Contents

Description

GoPro Plus media upload client.

Synopsis

High level upload all-in-one convenience.

uploadMedium Source #

Arguments

:: (HasGoProAuth m, MonadMask m, MonadFail m, MonadIO m) 
=> [FilePath]

Parts of a single medium to upload (e.g., a video file).

-> m MediumID 

Convenience action to upload a single medium.

Low-level upload parts.

runUpload Source #

Arguments

:: (HasGoProAuth m, MonadFail m, MonadIO m) 
=> [FilePath]

The list of files to include in the medium.

-> Uploader m a

The action to perform.

-> m a

The result of the inner action.

Run an Uploader monad to create a single medium and upload the content for it.

resumeUpload :: (HasGoProAuth m, MonadFail m, MonadIO m) => [FilePath] -> MediumID -> Uploader m a -> m a Source #

Run an Uploader monad for which we already know the MediumID (i.e., we're resuming an upload we previously began).

createMedium :: (HasGoProAuth m, MonadIO m) => Uploader m MediumID Source #

Create a new medium (e.g., video, photo, etc...) and return its ID.

createSource :: (HasGoProAuth m, MonadIO m) => Int -> Uploader m DerivativeID Source #

Convenient action for creating a Source derivative.

createDerivative Source #

Arguments

:: (HasGoProAuth m, MonadIO m) 
=> Int

The number of parts this derivative contains.

-> Text

The "type" of this derivative.

-> Text

The label of this derivative.

-> Uploader m DerivativeID 

Create a new derivative of the current medium containing the given number of parts.

createUpload Source #

Arguments

:: (HasGoProAuth m, MonadIO m) 
=> DerivativeID

The derivative into which we're uploading.

-> Int

The part number (1-based) being uploaded.

-> Int

The size of the file being uploaded in this part.

-> Uploader m Upload 

Create a new upload for a derivative.

completeUpload Source #

Arguments

:: (HasGoProAuth m, MonadIO m) 
=> UploadID

The upload ID.

-> DerivativeID

The derivative ID.

-> Int

The part number within the derivative.

-> Integer

The size of the file that was uploaded.

-> Uploader m () 

Mark the given upload for the given derivative as complete.

getUpload Source #

Arguments

:: (HasGoProAuth m, MonadIO m) 
=> UploadID

ID of the upload to retrieve

-> DerivativeID

ID of the derivative to which the upload belongs

-> Int

Part number within the derivative.

-> Int

Size of this part.

-> Uploader m Upload 

Retreive an Upload with the given upload and derivative ID.

uploadChunk Source #

Arguments

:: (MonadMask m, MonadIO m) 
=> FilePath

The path being uploaded.

-> UploadPart

The UploadPart describing the chunk of upload being transferred

-> Uploader m () 

Upload a chunk of of the given file as specified by this UploadPart.

markAvailable :: (HasGoProAuth m, MonadIO m) => DerivativeID -> Uploader m () Source #

Mark the given derivative as availble to use. This also updates the medium record marking it as having completed its upload.

Data Types

data UploadPart Source #

Instances
Show UploadPart Source # 
Instance details

Defined in GoPro.Plus.Upload

data Upload Source #

Constructors

Upload 
Instances
Show Upload Source # 
Instance details

Defined in GoPro.Plus.Upload

Uploader monad.

type Uploader m = StateT (Env m) m Source #

GoPro Plus uploader monad.

setMediumType :: Monad m => MediumType -> Uploader m () Source #

Override the detected medium type.

setLogAction :: (Monad m, MonadMask m) => (String -> m ()) -> Uploader m () Source #

Set the logging action to report retries (or whatever other interesting things might happen).

For your convenience.

listUploading :: (HasGoProAuth m, MonadIO m) => m [Medium] Source #

List all media in uploading state.