{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE FlexibleContexts #-}

module Azure.Storage.Blob
    ( listContainers
    , listBlobs
    , getBlob

    -- re-exports
    , Protocol.getBlobName
    , runAzureOperations
    ) where

import           Data.ByteString (ByteString)
import           Data.Conduit (Source)

import           Azure.Storage.Common
import qualified Azure.Storage.Protocol.Blob as Protocol


listContainers :: AzureContext m => Source m Protocol.ContainerName
listContainers = runStorageOperation Protocol.listContainers

listBlobs :: AzureContext m => Protocol.ContainerName -> Source m Protocol.BlobReference
listBlobs = runStorageOperation . Protocol.listBlobs

getBlob :: AzureContext m => Protocol.BlobReference -> Source m ByteString
getBlob = runStorageOperation . Protocol.getBlob