-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | A Minio Haskell Library for Amazon S3 compatible cloud
--   storage.
--   
--   The Minio Haskell client library provides simple APIs to access Minio,
--   Amazon S3 and other API compatible cloud storage servers.
@package minio-hs
@version 1.2.0

module Network.Minio.AdminAPI
data DriveInfo
DriveInfo :: Text -> Text -> Text -> DriveInfo
[diUuid] :: DriveInfo -> Text
[diEndpoint] :: DriveInfo -> Text
[diState] :: DriveInfo -> Text
data ErasureInfo
ErasureInfo :: Int -> Int -> StorageClass -> StorageClass -> [[DriveInfo]] -> ErasureInfo
[eiOnlineDisks] :: ErasureInfo -> Int
[eiOfflineDisks] :: ErasureInfo -> Int
[eiStandard] :: ErasureInfo -> StorageClass
[eiReducedRedundancy] :: ErasureInfo -> StorageClass
[eiSets] :: ErasureInfo -> [[DriveInfo]]
data Backend
BackendFS :: Backend
BackendErasure :: ErasureInfo -> Backend
data ConnStats
ConnStats :: Int64 -> Int64 -> ConnStats
[csTransferred] :: ConnStats -> Int64
[csReceived] :: ConnStats -> Int64
data HttpStats
HttpStats :: CountNAvgTime -> CountNAvgTime -> CountNAvgTime -> CountNAvgTime -> CountNAvgTime -> CountNAvgTime -> CountNAvgTime -> CountNAvgTime -> CountNAvgTime -> CountNAvgTime -> HttpStats
[hsTotalHeads] :: HttpStats -> CountNAvgTime
[hsSuccessHeads] :: HttpStats -> CountNAvgTime
[hsTotalGets] :: HttpStats -> CountNAvgTime
[hsSuccessGets] :: HttpStats -> CountNAvgTime
[hsTotalPuts] :: HttpStats -> CountNAvgTime
[hsSuccessPuts] :: HttpStats -> CountNAvgTime
[hsTotalPosts] :: HttpStats -> CountNAvgTime
[hsSuccessPosts] :: HttpStats -> CountNAvgTime
[hsTotalDeletes] :: HttpStats -> CountNAvgTime
[hsSuccessDeletes] :: HttpStats -> CountNAvgTime
data ServerProps
ServerProps :: NominalDiffTime -> Text -> Text -> Text -> [Text] -> ServerProps
[spUptime] :: ServerProps -> NominalDiffTime
[spVersion] :: ServerProps -> Text
[spCommitId] :: ServerProps -> Text
[spRegion] :: ServerProps -> Text
[spSqsArns] :: ServerProps -> [Text]
data CountNAvgTime
CountNAvgTime :: Int64 -> Text -> CountNAvgTime
[caCount] :: CountNAvgTime -> Int64
[caAvgDuration] :: CountNAvgTime -> Text
data StorageClass
StorageClass :: Int -> Int -> StorageClass
[scParity] :: StorageClass -> Int
[scData] :: StorageClass -> Int
data StorageInfo
StorageInfo :: Int64 -> Backend -> StorageInfo
[siUsed] :: StorageInfo -> Int64
[siBackend] :: StorageInfo -> Backend
data SIData
SIData :: StorageInfo -> ConnStats -> HttpStats -> ServerProps -> SIData
[sdStorage] :: SIData -> StorageInfo
[sdConnStats] :: SIData -> ConnStats
[sdHttpStats] :: SIData -> HttpStats
[sdProps] :: SIData -> ServerProps
data ServerInfo
ServerInfo :: Text -> Text -> SIData -> ServerInfo
[siError] :: ServerInfo -> Text
[siAddr] :: ServerInfo -> Text
[siData] :: ServerInfo -> SIData

-- | Fetches information for all cluster nodes, such as server properties,
--   storage information, network statistics, etc.
getServerInfo :: Minio [ServerInfo]
data HealOpts
HealOpts :: Bool -> Bool -> HealOpts
[hoRecursive] :: HealOpts -> Bool
[hoDryRun] :: HealOpts -> Bool
data HealResultItem
HealResultItem :: Int -> HealItemType -> Bucket -> Object -> Text -> Maybe Int -> Maybe Int -> Int -> Int -> Int -> [DriveInfo] -> [DriveInfo] -> HealResultItem
[hriResultIdx] :: HealResultItem -> Int
[hriType] :: HealResultItem -> HealItemType
[hriBucket] :: HealResultItem -> Bucket
[hriObject] :: HealResultItem -> Object
[hriDetail] :: HealResultItem -> Text
[hriParityBlocks] :: HealResultItem -> Maybe Int
[hriDataBlocks] :: HealResultItem -> Maybe Int
[hriDiskCount] :: HealResultItem -> Int
[hriSetCount] :: HealResultItem -> Int
[hriObjectSize] :: HealResultItem -> Int
[hriBefore] :: HealResultItem -> [DriveInfo]
[hriAfter] :: HealResultItem -> [DriveInfo]
data HealStatus
HealStatus :: Text -> UTCTime -> HealOpts -> Int -> Maybe Text -> Maybe [HealResultItem] -> HealStatus
[hsSummary] :: HealStatus -> Text
[hsStartTime] :: HealStatus -> UTCTime
[hsSettings] :: HealStatus -> HealOpts
[hsNumDisks] :: HealStatus -> Int
[hsFailureDetail] :: HealStatus -> Maybe Text
[hsItems] :: HealStatus -> Maybe [HealResultItem]
data HealStartResp
HealStartResp :: Text -> Text -> UTCTime -> HealStartResp
[hsrClientToken] :: HealStartResp -> Text
[hsrClientAddr] :: HealStartResp -> Text
[hsrStartTime] :: HealStartResp -> UTCTime

-- | Start a heal sequence that scans data under given (possible empty)
--   <tt>bucket</tt> and <tt>prefix</tt>. The <tt>recursive</tt> bool turns
--   on recursive traversal under the given path. <tt>dryRun</tt> does not
--   mutate on-disk data, but performs data validation. Two heal sequences
--   on overlapping paths may not be initiated. The progress of a heal
--   should be followed using the <a>HealStatus</a> API. The server
--   accumulates results of the heal traversal and waits for the client to
--   receive and acknowledge them using the status API
startHeal :: Maybe Bucket -> Maybe Text -> HealOpts -> Minio HealStartResp

-- | Similar to start a heal sequence, but force start a new heal sequence
--   even if an active heal is under progress.
forceStartHeal :: Maybe Bucket -> Maybe Text -> HealOpts -> Minio HealStartResp

-- | Get the progress of currently running heal task, this API should be
--   invoked right after <a>startHeal</a>. <tt>token</tt> is obtained after
--   <a>startHeal</a> which should be used to get the heal status.
getHealStatus :: Maybe Bucket -> Maybe Text -> Text -> Minio HealStatus
data SetConfigResult
SetConfigResult :: Bool -> [NodeSummary] -> SetConfigResult
[scrStatus] :: SetConfigResult -> Bool
[scrNodeSummary] :: SetConfigResult -> [NodeSummary]
data NodeSummary
NodeSummary :: Text -> Bool -> Text -> NodeSummary
[nsName] :: NodeSummary -> Text
[nsErrSet] :: NodeSummary -> Bool
[nsErrMessage] :: NodeSummary -> Text

-- | Set a new config to the server.
setConfig :: ByteString -> Minio SetConfigResult

-- | Get the current config file from server.
getConfig :: Minio ByteString
data ServerVersion
ServerVersion :: Text -> Text -> ServerVersion
[svVersion] :: ServerVersion -> Text
[svCommitId] :: ServerVersion -> Text
data ServiceStatus
ServiceStatus :: ServerVersion -> NominalDiffTime -> ServiceStatus
[ssVersion] :: ServiceStatus -> ServerVersion
[ssUptime] :: ServiceStatus -> NominalDiffTime

-- | Get server version and uptime.
serviceStatus :: Minio ServiceStatus
data ServiceAction
ServiceActionRestart :: ServiceAction
ServiceActionStop :: ServiceAction

-- | Send service restart or stop action to Minio server.
serviceSendAction :: ServiceAction -> Minio ()
instance GHC.Show.Show Network.Minio.AdminAPI.HealStatus
instance GHC.Classes.Eq Network.Minio.AdminAPI.HealStatus
instance GHC.Show.Show Network.Minio.AdminAPI.HealResultItem
instance GHC.Classes.Eq Network.Minio.AdminAPI.HealResultItem
instance GHC.Show.Show Network.Minio.AdminAPI.SetConfigResult
instance GHC.Classes.Eq Network.Minio.AdminAPI.SetConfigResult
instance GHC.Show.Show Network.Minio.AdminAPI.NodeSummary
instance GHC.Classes.Eq Network.Minio.AdminAPI.NodeSummary
instance GHC.Show.Show Network.Minio.AdminAPI.HealItemType
instance GHC.Classes.Eq Network.Minio.AdminAPI.HealItemType
instance GHC.Show.Show Network.Minio.AdminAPI.HealOpts
instance GHC.Classes.Eq Network.Minio.AdminAPI.HealOpts
instance GHC.Show.Show Network.Minio.AdminAPI.HealStartResp
instance GHC.Classes.Eq Network.Minio.AdminAPI.HealStartResp
instance GHC.Show.Show Network.Minio.AdminAPI.ServiceAction
instance GHC.Classes.Eq Network.Minio.AdminAPI.ServiceAction
instance GHC.Show.Show Network.Minio.AdminAPI.ServiceStatus
instance GHC.Classes.Eq Network.Minio.AdminAPI.ServiceStatus
instance GHC.Show.Show Network.Minio.AdminAPI.ServerVersion
instance GHC.Classes.Eq Network.Minio.AdminAPI.ServerVersion
instance GHC.Show.Show Network.Minio.AdminAPI.ServerInfo
instance GHC.Classes.Eq Network.Minio.AdminAPI.ServerInfo
instance GHC.Show.Show Network.Minio.AdminAPI.SIData
instance GHC.Classes.Eq Network.Minio.AdminAPI.SIData
instance GHC.Show.Show Network.Minio.AdminAPI.HttpStats
instance GHC.Classes.Eq Network.Minio.AdminAPI.HttpStats
instance GHC.Show.Show Network.Minio.AdminAPI.CountNAvgTime
instance GHC.Classes.Eq Network.Minio.AdminAPI.CountNAvgTime
instance GHC.Show.Show Network.Minio.AdminAPI.StorageInfo
instance GHC.Classes.Eq Network.Minio.AdminAPI.StorageInfo
instance GHC.Show.Show Network.Minio.AdminAPI.ServerProps
instance GHC.Classes.Eq Network.Minio.AdminAPI.ServerProps
instance GHC.Show.Show Network.Minio.AdminAPI.ConnStats
instance GHC.Classes.Eq Network.Minio.AdminAPI.ConnStats
instance GHC.Show.Show Network.Minio.AdminAPI.Backend
instance GHC.Classes.Eq Network.Minio.AdminAPI.Backend
instance GHC.Show.Show Network.Minio.AdminAPI.ErasureInfo
instance GHC.Classes.Eq Network.Minio.AdminAPI.ErasureInfo
instance GHC.Show.Show Network.Minio.AdminAPI.StorageClass
instance GHC.Classes.Eq Network.Minio.AdminAPI.StorageClass
instance GHC.Show.Show Network.Minio.AdminAPI.DriveInfo
instance GHC.Classes.Eq Network.Minio.AdminAPI.DriveInfo
instance Data.Aeson.Types.FromJSON.FromJSON Network.Minio.AdminAPI.HealStatus
instance Data.Aeson.Types.FromJSON.FromJSON Network.Minio.AdminAPI.HealResultItem
instance Data.Aeson.Types.FromJSON.FromJSON Network.Minio.AdminAPI.SetConfigResult
instance Data.Aeson.Types.FromJSON.FromJSON Network.Minio.AdminAPI.NodeSummary
instance Data.Aeson.Types.FromJSON.FromJSON Network.Minio.AdminAPI.HealItemType
instance Data.Aeson.Types.ToJSON.ToJSON Network.Minio.AdminAPI.HealOpts
instance Data.Aeson.Types.FromJSON.FromJSON Network.Minio.AdminAPI.HealOpts
instance Data.Aeson.Types.FromJSON.FromJSON Network.Minio.AdminAPI.HealStartResp
instance Data.Aeson.Types.ToJSON.ToJSON Network.Minio.AdminAPI.ServiceAction
instance Data.Aeson.Types.FromJSON.FromJSON Network.Minio.AdminAPI.ServiceStatus
instance Data.Aeson.Types.FromJSON.FromJSON Network.Minio.AdminAPI.ServerVersion
instance Data.Aeson.Types.FromJSON.FromJSON Network.Minio.AdminAPI.ServerInfo
instance Data.Aeson.Types.FromJSON.FromJSON Network.Minio.AdminAPI.SIData
instance Data.Aeson.Types.FromJSON.FromJSON Network.Minio.AdminAPI.HttpStats
instance Data.Aeson.Types.FromJSON.FromJSON Network.Minio.AdminAPI.CountNAvgTime
instance Data.Aeson.Types.FromJSON.FromJSON Network.Minio.AdminAPI.StorageInfo
instance Data.Aeson.Types.FromJSON.FromJSON Network.Minio.AdminAPI.ServerProps
instance Data.Aeson.Types.FromJSON.FromJSON Network.Minio.AdminAPI.ConnStats
instance Data.Aeson.Types.FromJSON.FromJSON Network.Minio.AdminAPI.Backend
instance Data.Aeson.Types.FromJSON.FromJSON Network.Minio.AdminAPI.ErasureInfo
instance Data.Aeson.Types.FromJSON.FromJSON Network.Minio.AdminAPI.DriveInfo

module Network.Minio.S3API

-- | Represents a region TODO: This could be a Sum Type with all defined
--   regions for AWS.
type Region = Text

-- | Fetch bucket location (region)
getLocation :: Bucket -> Minio Region

-- | Fetch all buckets from the service.
getService :: Minio [BucketInfo]

-- | Represents result from a listing of objects in a bucket.
data ListObjectsResult
ListObjectsResult :: Bool -> Maybe Text -> [ObjectInfo] -> [Text] -> ListObjectsResult
[lorHasMore] :: ListObjectsResult -> Bool
[lorNextToken] :: ListObjectsResult -> Maybe Text
[lorObjects] :: ListObjectsResult -> [ObjectInfo]
[lorCPrefixes] :: ListObjectsResult -> [Text]

-- | Represents result from a listing of objects version 1 in a bucket.
data ListObjectsV1Result
ListObjectsV1Result :: Bool -> Maybe Text -> [ObjectInfo] -> [Text] -> ListObjectsV1Result
[lorHasMore'] :: ListObjectsV1Result -> Bool
[lorNextMarker] :: ListObjectsV1Result -> Maybe Text
[lorObjects'] :: ListObjectsV1Result -> [ObjectInfo]
[lorCPrefixes'] :: ListObjectsV1Result -> [Text]

-- | List objects in a bucket matching prefix up to delimiter, starting
--   from nextToken.
listObjects' :: Bucket -> Maybe Text -> Maybe Text -> Maybe Text -> Maybe Int -> Minio ListObjectsResult

-- | List objects in a bucket matching prefix up to delimiter, starting
--   from nextMarker.
listObjectsV1' :: Bucket -> Maybe Text -> Maybe Text -> Maybe Text -> Maybe Int -> Minio ListObjectsV1Result

-- | Query the object store if a given bucket exists.
headBucket :: Bucket -> Minio Bool

-- | GET an object from the service and return the response headers and a
--   conduit source for the object content
getObject' :: Bucket -> Object -> Query -> [Header] -> Minio ([Header], ConduitM () ByteString Minio ())

-- | Get metadata of an object.
headObject :: Bucket -> Object -> Minio ObjectInfo

-- | Creates a bucket via a PUT bucket call.
putBucket :: Bucket -> Region -> Minio ()

-- | A type alias to represent an Entity-Tag returned by S3-compatible
--   APIs.
type ETag = Text
putObjectSingle' :: Bucket -> Object -> [Header] -> ByteString -> Minio ETag

-- | PUT an object into the service. This function performs a single PUT
--   object call, and so can only transfer objects upto 5GiB.
putObjectSingle :: Bucket -> Object -> [Header] -> Handle -> Int64 -> Int64 -> Minio ETag

-- | Performs server-side copy of an object that is upto 5GiB in size. If
--   the object is greater than 5GiB, this function throws the error
--   returned by the server.
copyObjectSingle :: Bucket -> Object -> SourceInfo -> [Header] -> Minio (ETag, UTCTime)

-- | A type alias to represent an upload-id for multipart upload
type UploadId = Text

-- | A type to represent a part-number and etag.
type PartTuple = (PartNumber, ETag)

-- | Represents different kinds of payload that are used with S3 API
--   requests.
data Payload
PayloadBS :: ByteString -> Payload
PayloadH :: Handle -> Int64 -> Int64 -> Payload

-- | A type alias to represent a part-number for multipart upload
type PartNumber = Int16

-- | Create a new multipart upload.
newMultipartUpload :: Bucket -> Object -> [Header] -> Minio UploadId

-- | PUT a part of an object as part of a multipart upload.
putObjectPart :: Bucket -> Object -> UploadId -> PartNumber -> [Header] -> Payload -> Minio PartTuple

-- | Performs server-side copy of an object or part of an object as an
--   upload part of an ongoing multi-part upload.
copyObjectPart :: DestinationInfo -> SourceInfo -> UploadId -> PartNumber -> [Header] -> Minio (ETag, UTCTime)

-- | Complete a multipart upload.
completeMultipartUpload :: Bucket -> Object -> UploadId -> [PartTuple] -> Minio ETag

-- | Abort a multipart upload.
abortMultipartUpload :: Bucket -> Object -> UploadId -> Minio ()

-- | Represents result from a listing of incomplete uploads to a bucket.
data ListUploadsResult
ListUploadsResult :: Bool -> Maybe Text -> Maybe Text -> [(Object, UploadId, UTCTime)] -> [Text] -> ListUploadsResult
[lurHasMore] :: ListUploadsResult -> Bool
[lurNextKey] :: ListUploadsResult -> Maybe Text
[lurNextUpload] :: ListUploadsResult -> Maybe Text
[lurUploads] :: ListUploadsResult -> [(Object, UploadId, UTCTime)]
[lurCPrefixes] :: ListUploadsResult -> [Text]

-- | List incomplete multipart uploads.
listIncompleteUploads' :: Bucket -> Maybe Text -> Maybe Text -> Maybe Text -> Maybe Text -> Maybe Int -> Minio ListUploadsResult

-- | Represents result from a listing of object parts of an ongoing
--   multipart upload.
data ListPartsResult
ListPartsResult :: Bool -> Maybe Int -> [ObjectPartInfo] -> ListPartsResult
[lprHasMore] :: ListPartsResult -> Bool
[lprNextPart] :: ListPartsResult -> Maybe Int
[lprParts] :: ListPartsResult -> [ObjectPartInfo]

-- | List parts of an ongoing multipart upload.
listIncompleteParts' :: Bucket -> Object -> UploadId -> Maybe Text -> Maybe Text -> Minio ListPartsResult

-- | DELETE a bucket from the service.
deleteBucket :: Bucket -> Minio ()

-- | DELETE an object from the service.
deleteObject :: Bucket -> Object -> Minio ()

-- | Time to expire for a presigned URL. It interpreted as a number of
--   seconds. The maximum duration that can be specified is 7 days.
type UrlExpiry = Int

-- | Generate a presigned URL. This function allows for advanced usage -
--   for simple cases prefer the `presigned*Url` functions.
--   
--   If region is Nothing, it is picked up from the connection information
--   (no check of bucket existence is performed).
--   
--   All extra query parameters or headers are signed, and therefore are
--   required to be sent when the generated URL is actually used.
makePresignedUrl :: UrlExpiry -> Method -> Maybe Bucket -> Maybe Object -> Maybe Region -> Query -> RequestHeaders -> Minio ByteString

-- | Generate a URL with authentication signature to PUT (upload) an
--   object. Any extra headers if passed, are signed, and so they are
--   required when the URL is used to upload data. This could be used, for
--   example, to set user-metadata on the object.
--   
--   For a list of possible headers to pass, please refer to the PUT object
--   REST API AWS S3 documentation.
presignedPutObjectUrl :: Bucket -> Object -> UrlExpiry -> RequestHeaders -> Minio ByteString

-- | Generate a URL with authentication signature to GET (download) an
--   object. All extra query parameters and headers passed here will be
--   signed and are required when the generated URL is used. Query
--   parameters could be used to change the response headers sent by the
--   server. Headers can be used to set Etag match conditions among others.
--   
--   For a list of possible request parameters and headers, please refer to
--   the GET object REST API AWS S3 documentation.
presignedGetObjectUrl :: Bucket -> Object -> UrlExpiry -> Query -> RequestHeaders -> Minio ByteString

-- | Generate a URL with authentication signature to make a HEAD request on
--   an object. This is used to fetch metadata about an object. All extra
--   headers passed here will be signed and are required when the generated
--   URL is used.
--   
--   For a list of possible headers to pass, please refer to the HEAD
--   object REST API AWS S3 documentation.
presignedHeadObjectUrl :: Bucket -> Object -> UrlExpiry -> RequestHeaders -> Minio ByteString

-- | Represents individual conditions in a Post Policy document.
data PostPolicyCondition
PPCStartsWith :: Text -> Text -> PostPolicyCondition
PPCEquals :: Text -> Text -> PostPolicyCondition
PPCRange :: Text -> Int64 -> Int64 -> PostPolicyCondition

-- | Set the bucket name that the upload should use.
ppCondBucket :: Bucket -> PostPolicyCondition

-- | Set the content length range constraint with minimum and maximum byte
--   count values.
ppCondContentLengthRange :: Int64 -> Int64 -> PostPolicyCondition

-- | Set the content-type header for the upload.
ppCondContentType :: Text -> PostPolicyCondition

-- | Set the object name constraint for the upload.
ppCondKey :: Object -> PostPolicyCondition

-- | Set the object name prefix constraint for the upload.
ppCondKeyStartsWith :: Object -> PostPolicyCondition

-- | Status code that the S3-server should send on a successful POST upload
ppCondSuccessActionStatus :: Int -> PostPolicyCondition

-- | A PostPolicy is required to perform uploads via browser forms.
data PostPolicy
PostPolicy :: UTCTime -> [PostPolicyCondition] -> PostPolicy
[expiration] :: PostPolicy -> UTCTime
[conditions] :: PostPolicy -> [PostPolicyCondition]

-- | Possible validation errors when creating a PostPolicy.
data PostPolicyError
PPEKeyNotSpecified :: PostPolicyError
PPEBucketNotSpecified :: PostPolicyError
PPEConditionKeyEmpty :: PostPolicyError
PPERangeInvalid :: PostPolicyError

-- | This function creates a PostPolicy after validating its arguments.
newPostPolicy :: UTCTime -> [PostPolicyCondition] -> Either PostPolicyError PostPolicy

-- | Convert Post Policy to a string (e.g. for printing).
showPostPolicy :: PostPolicy -> ByteString

-- | Generate a presigned URL and POST policy to upload files via a
--   browser. On success, this function returns a URL and POST form-data.
presignedPostPolicy :: PostPolicy -> Minio (ByteString, Map Text ByteString)

-- | Fetch the policy if any on a bucket.
getBucketPolicy :: Bucket -> Minio Text

-- | Set a new policy on a bucket. As a special condition if the policy is
--   empty then we treat it as policy DELETE operation.
setBucketPolicy :: Bucket -> Text -> Minio ()

-- | A data-type to represent bucket notification configuration. It is a
--   collection of queue, topic or lambda function configurations. The
--   structure of the types follow closely the XML representation described
--   at
--   <a>https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTnotification.html</a>
data Notification
Notification :: [NotificationConfig] -> [NotificationConfig] -> [NotificationConfig] -> Notification
[nQueueConfigurations] :: Notification -> [NotificationConfig]
[nTopicConfigurations] :: Notification -> [NotificationConfig]
[nCloudFunctionConfigurations] :: Notification -> [NotificationConfig]

-- | A data-type representing the configuration for a particular
--   notification system. It could represent a Queue, Topic or Lambda
--   Function configuration.
data NotificationConfig
NotificationConfig :: Text -> Arn -> [Event] -> Filter -> NotificationConfig
[ncId] :: NotificationConfig -> Text
[ncArn] :: NotificationConfig -> Arn
[ncEvents] :: NotificationConfig -> [Event]
[ncFilter] :: NotificationConfig -> Filter
type Arn = Text

-- | A data-type for events that can occur in the object storage server.
--   Reference:
--   <a>https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html#supported-notification-event-types</a>
data Event
ObjectCreated :: Event
ObjectCreatedPut :: Event
ObjectCreatedPost :: Event
ObjectCreatedCopy :: Event
ObjectCreatedMultipartUpload :: Event
ObjectRemoved :: Event
ObjectRemovedDelete :: Event
ObjectRemovedDeleteMarkerCreated :: Event
ReducedRedundancyLostObject :: Event
data Filter
Filter :: FilterKey -> Filter
[fFilter] :: Filter -> FilterKey
data FilterKey
FilterKey :: FilterRules -> FilterKey
[fkKey] :: FilterKey -> FilterRules
data FilterRules
FilterRules :: [FilterRule] -> FilterRules
[frFilterRules] :: FilterRules -> [FilterRule]

-- | A filter rule that can act based on the suffix or prefix of an object.
--   As an example, let's create two filter rules:
--   
--   <pre>
--   let suffixRule = FilterRule "suffix" ".jpg"
--   let prefixRule = FilterRule "prefix" "images/"
--   </pre>
--   
--   The <tt>suffixRule</tt> restricts the notification to be triggered
--   only for objects having a suffix of ".jpg", and the
--   <tt>prefixRule</tt> restricts it to objects having a prefix of
--   "images/".
data FilterRule
FilterRule :: Text -> Text -> FilterRule
[frName] :: FilterRule -> Text
[frValue] :: FilterRule -> Text

-- | Retrieve the notification configuration on a bucket.
getBucketNotification :: Bucket -> Minio Notification

-- | Set the notification configuration on a bucket.
putBucketNotification :: Bucket -> Notification -> Minio ()

-- | Remove all notifications configured on a bucket.
removeAllBucketNotification :: Bucket -> Minio ()

module Network.Minio
data Credentials
Credentials :: Text -> Text -> Credentials
[cAccessKey] :: Credentials -> Text
[cSecretKey] :: Credentials -> Text

-- | A Provider is an action that may return Credentials
type Provider = IO (Maybe Credentials)
fromAWSConfigFile :: Provider
fromAWSEnv :: Provider
fromMinioEnv :: Provider

-- | Combines the given list of providers, by calling each one in order
--   until Credentials are found.
findFirst :: [Provider] -> Provider

-- | Connection Info data type. To create a <a>ConnectInfo</a> value, use
--   one of the provided smart constructors or override fields of the
--   Default instance.
data ConnectInfo
setRegion :: Region -> ConnectInfo -> ConnectInfo
setCreds :: Credentials -> ConnectInfo -> ConnectInfo
setCredsFrom :: [Provider] -> ConnectInfo -> IO ConnectInfo

-- | MinioConn holds connection info and a connection pool
data MinioConn
mkMinioConn :: ConnectInfo -> Manager -> IO MinioConn

-- | <a>Minio Play Server</a> ConnectInfo. Credentials are already filled
--   in.
minioPlayCI :: ConnectInfo

-- | Default AWS ConnectInfo. Connects to "us-east-1". Credentials should
--   be supplied before use.
awsCI :: ConnectInfo

-- | Default GCS ConnectInfo. Works only for "Simple Migration" use-case
--   with interoperability mode enabled on GCP console. For more
--   information - <a>https://cloud.google.com/storage/docs/migrating</a>
--   Credentials should be supplied before use.
gcsCI :: ConnectInfo
data Minio a
runMinioWith :: MinioConn -> Minio a -> IO (Either MinioErr a)

-- | Run the Minio action and return the result or an error.
runMinio :: ConnectInfo -> Minio a -> IO (Either MinioErr a)

-- | Represents a bucket in the object store
type Bucket = Text

-- | Creates a new bucket in the object store. The Region can be optionally
--   specified. If not specified, it will use the region configured in
--   ConnectInfo, which is by default, the US Standard Region.
makeBucket :: Bucket -> Maybe Region -> Minio ()

-- | Removes a bucket from the object store.
removeBucket :: Bucket -> Minio ()

-- | Query the object store if a given bucket is present.
bucketExists :: Bucket -> Minio Bool

-- | Represents a region TODO: This could be a Sum Type with all defined
--   regions for AWS.
type Region = Text

-- | Fetch bucket location (region)
getLocation :: Bucket -> Minio Region

-- | BucketInfo returned for list buckets call
data BucketInfo
BucketInfo :: Bucket -> UTCTime -> BucketInfo
[biName] :: BucketInfo -> Bucket
[biCreationDate] :: BucketInfo -> UTCTime

-- | Lists buckets.
listBuckets :: Minio [BucketInfo]

-- | Represents information about an object.
data ObjectInfo
oiObject :: ObjectInfo -> Object
oiModTime :: ObjectInfo -> UTCTime
oiETag :: ObjectInfo -> ETag
oiSize :: ObjectInfo -> Int64
oiMetadata :: ObjectInfo -> Map Text Text

-- | List objects in a bucket matching the given prefix. If recurse is set
--   to True objects matching prefix are recursively listed.
listObjects :: Bucket -> Maybe Text -> Bool -> ConduitM () ObjectInfo Minio ()

-- | List objects in a bucket matching the given prefix. If recurse is set
--   to True objects matching prefix are recursively listed.
listObjectsV1 :: Bucket -> Maybe Text -> Bool -> ConduitM () ObjectInfo Minio ()

-- | A type alias to represent an upload-id for multipart upload
type UploadId = Text

-- | Represents information about a multipart upload.
data UploadInfo
UploadInfo :: Object -> UploadId -> UTCTime -> Int64 -> UploadInfo
[uiKey] :: UploadInfo -> Object
[uiUploadId] :: UploadInfo -> UploadId
[uiInitTime] :: UploadInfo -> UTCTime
[uiSize] :: UploadInfo -> Int64

-- | List incomplete uploads in a bucket matching the given prefix. If
--   recurse is set to True incomplete uploads for the given prefix are
--   recursively listed.
listIncompleteUploads :: Bucket -> Maybe Text -> Bool -> ConduitM () UploadInfo Minio ()

-- | Represents information about an object part in an ongoing multipart
--   upload.
data ObjectPartInfo
ObjectPartInfo :: PartNumber -> ETag -> Int64 -> UTCTime -> ObjectPartInfo
[opiNumber] :: ObjectPartInfo -> PartNumber
[opiETag] :: ObjectPartInfo -> ETag
[opiSize] :: ObjectPartInfo -> Int64
[opiModTime] :: ObjectPartInfo -> UTCTime

-- | List object parts of an ongoing multipart upload for given bucket,
--   object and uploadId.
listIncompleteParts :: Bucket -> Object -> UploadId -> ConduitM () ObjectPartInfo Minio ()

-- | A data-type to represent bucket notification configuration. It is a
--   collection of queue, topic or lambda function configurations. The
--   structure of the types follow closely the XML representation described
--   at
--   <a>https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTnotification.html</a>
data Notification
Notification :: [NotificationConfig] -> [NotificationConfig] -> [NotificationConfig] -> Notification
[nQueueConfigurations] :: Notification -> [NotificationConfig]
[nTopicConfigurations] :: Notification -> [NotificationConfig]
[nCloudFunctionConfigurations] :: Notification -> [NotificationConfig]
defaultNotification :: Notification

-- | A data-type representing the configuration for a particular
--   notification system. It could represent a Queue, Topic or Lambda
--   Function configuration.
data NotificationConfig
NotificationConfig :: Text -> Arn -> [Event] -> Filter -> NotificationConfig
[ncId] :: NotificationConfig -> Text
[ncArn] :: NotificationConfig -> Arn
[ncEvents] :: NotificationConfig -> [Event]
[ncFilter] :: NotificationConfig -> Filter
type Arn = Text

-- | A data-type for events that can occur in the object storage server.
--   Reference:
--   <a>https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html#supported-notification-event-types</a>
data Event
ObjectCreated :: Event
ObjectCreatedPut :: Event
ObjectCreatedPost :: Event
ObjectCreatedCopy :: Event
ObjectCreatedMultipartUpload :: Event
ObjectRemoved :: Event
ObjectRemovedDelete :: Event
ObjectRemovedDeleteMarkerCreated :: Event
ReducedRedundancyLostObject :: Event
data Filter
Filter :: FilterKey -> Filter
[fFilter] :: Filter -> FilterKey
defaultFilter :: Filter
data FilterKey
FilterKey :: FilterRules -> FilterKey
[fkKey] :: FilterKey -> FilterRules
defaultFilterKey :: FilterKey
data FilterRules
FilterRules :: [FilterRule] -> FilterRules
[frFilterRules] :: FilterRules -> [FilterRule]
defaultFilterRules :: FilterRules

-- | A filter rule that can act based on the suffix or prefix of an object.
--   As an example, let's create two filter rules:
--   
--   <pre>
--   let suffixRule = FilterRule "suffix" ".jpg"
--   let prefixRule = FilterRule "prefix" "images/"
--   </pre>
--   
--   The <tt>suffixRule</tt> restricts the notification to be triggered
--   only for objects having a suffix of ".jpg", and the
--   <tt>prefixRule</tt> restricts it to objects having a prefix of
--   "images/".
data FilterRule
FilterRule :: Text -> Text -> FilterRule
[frName] :: FilterRule -> Text
[frValue] :: FilterRule -> Text

-- | Retrieve the notification configuration on a bucket.
getBucketNotification :: Bucket -> Minio Notification

-- | Set the notification configuration on a bucket.
putBucketNotification :: Bucket -> Notification -> Minio ()

-- | Remove all notifications configured on a bucket.
removeAllBucketNotification :: Bucket -> Minio ()

-- | Represents an object name
type Object = Text

-- | Fetch the object and write it to the given file safely. The object is
--   first written to a temporary file in the same directory and then moved
--   to the given path.
fGetObject :: Bucket -> Object -> FilePath -> GetObjectOptions -> Minio ()

-- | Upload the given file to the given object.
fPutObject :: Bucket -> Object -> FilePath -> PutObjectOptions -> Minio ()

-- | Put an object from a conduit source. The size can be provided if
--   known; this helps the library select optimal part sizes to perform a
--   multipart upload. If not specified, it is assumed that the object can
--   be potentially 5TiB and selects multipart sizes appropriately.
putObject :: Bucket -> Object -> ConduitM () ByteString Minio () -> Maybe Int64 -> PutObjectOptions -> Minio ()

-- | Data type represents various options specified for PutObject call. To
--   specify PutObject options use the poo* accessors.
data PutObjectOptions
defaultPutObjectOptions :: PutObjectOptions

-- | Set a standard MIME type describing the format of the object.
pooContentType :: PutObjectOptions -> Maybe Text

-- | Set what content encodings have been applied to the object and thus
--   what decoding mechanisms must be applied to obtain the media-type
--   referenced by the Content-Type header field.
pooContentEncoding :: PutObjectOptions -> Maybe Text

-- | Set presentational information for the object.
pooContentDisposition :: PutObjectOptions -> Maybe Text

-- | Set to describe the language(s) intended for the audience.
pooContentLanguage :: PutObjectOptions -> Maybe Text

-- | Set to specify caching behavior for the object along the request/reply
--   chain.
pooCacheControl :: PutObjectOptions -> Maybe Text

-- | Set to <tt>STANDARD</tt> or <tt>REDUCED_REDUNDANCY</tt> depending on
--   your performance needs, storage class is <tt>STANDARD</tt> by default
--   (i.e when Nothing is passed).
pooStorageClass :: PutObjectOptions -> Maybe Text

-- | Set user defined metadata to store with the object.
pooUserMetadata :: PutObjectOptions -> [(Text, Text)]

-- | Set number of worker threads used to upload an object.
pooNumThreads :: PutObjectOptions -> Maybe Word

-- | Get an object from the object store as a resumable source (conduit).
getObject :: Bucket -> Object -> GetObjectOptions -> Minio (ConduitM () ByteString Minio ())
data GetObjectOptions
defaultGetObjectOptions :: GetObjectOptions

-- | Set object's data of given offset begin and end, [ByteRangeFromTo 0 9]
--   means first ten bytes of the source object.
gooRange :: GetObjectOptions -> Maybe ByteRange

-- | Set matching ETag condition, GetObject which matches the following
--   ETag.
gooIfMatch :: GetObjectOptions -> Maybe ETag

-- | Set matching ETag none condition, GetObject which does not match the
--   following ETag.
gooIfNoneMatch :: GetObjectOptions -> Maybe ETag

-- | Set object modified condition, GetObject modified since given time.
gooIfModifiedSince :: GetObjectOptions -> Maybe UTCTime

-- | Set object unmodified condition, GetObject unmodified since given
--   time.
gooIfUnmodifiedSince :: GetObjectOptions -> Maybe UTCTime

-- | Perform a server-side copy operation to create an object based on the
--   destination specification in DestinationInfo from the source
--   specification in SourceInfo. This function performs a multipart copy
--   operation if the new object is to be greater than 5GiB in size.
copyObject :: DestinationInfo -> SourceInfo -> Minio ()

-- | Represents source object in server-side copy object
data SourceInfo
defaultSourceInfo :: SourceInfo
srcBucket :: SourceInfo -> Text
srcObject :: SourceInfo -> Text
srcRange :: SourceInfo -> Maybe (Int64, Int64)
srcIfMatch :: SourceInfo -> Maybe Text
srcIfNoneMatch :: SourceInfo -> Maybe Text
srcIfModifiedSince :: SourceInfo -> Maybe UTCTime
srcIfUnmodifiedSince :: SourceInfo -> Maybe UTCTime

-- | Represents destination object in server-side copy object
data DestinationInfo
defaultDestinationInfo :: DestinationInfo
dstBucket :: DestinationInfo -> Text
dstObject :: DestinationInfo -> Text

-- | Get an object's metadata from the object store.
statObject :: Bucket -> Object -> Minio ObjectInfo

-- | Remove an object from the object store.
removeObject :: Bucket -> Object -> Minio ()

-- | Removes an ongoing multipart upload of an object.
removeIncompleteUpload :: Bucket -> Object -> Minio ()

-- | Time to expire for a presigned URL. It interpreted as a number of
--   seconds. The maximum duration that can be specified is 7 days.
type UrlExpiry = Int

-- | Generate a URL with authentication signature to PUT (upload) an
--   object. Any extra headers if passed, are signed, and so they are
--   required when the URL is used to upload data. This could be used, for
--   example, to set user-metadata on the object.
--   
--   For a list of possible headers to pass, please refer to the PUT object
--   REST API AWS S3 documentation.
presignedPutObjectUrl :: Bucket -> Object -> UrlExpiry -> RequestHeaders -> Minio ByteString

-- | Generate a URL with authentication signature to GET (download) an
--   object. All extra query parameters and headers passed here will be
--   signed and are required when the generated URL is used. Query
--   parameters could be used to change the response headers sent by the
--   server. Headers can be used to set Etag match conditions among others.
--   
--   For a list of possible request parameters and headers, please refer to
--   the GET object REST API AWS S3 documentation.
presignedGetObjectUrl :: Bucket -> Object -> UrlExpiry -> Query -> RequestHeaders -> Minio ByteString

-- | Generate a URL with authentication signature to make a HEAD request on
--   an object. This is used to fetch metadata about an object. All extra
--   headers passed here will be signed and are required when the generated
--   URL is used.
--   
--   For a list of possible headers to pass, please refer to the HEAD
--   object REST API AWS S3 documentation.
presignedHeadObjectUrl :: Bucket -> Object -> UrlExpiry -> RequestHeaders -> Minio ByteString

-- | A PostPolicy is required to perform uploads via browser forms.
data PostPolicy

-- | Possible validation errors when creating a PostPolicy.
data PostPolicyError
PPEKeyNotSpecified :: PostPolicyError
PPEBucketNotSpecified :: PostPolicyError
PPEConditionKeyEmpty :: PostPolicyError
PPERangeInvalid :: PostPolicyError

-- | This function creates a PostPolicy after validating its arguments.
newPostPolicy :: UTCTime -> [PostPolicyCondition] -> Either PostPolicyError PostPolicy

-- | Generate a presigned URL and POST policy to upload files via a
--   browser. On success, this function returns a URL and POST form-data.
presignedPostPolicy :: PostPolicy -> Minio (ByteString, Map Text ByteString)

-- | Convert Post Policy to a string (e.g. for printing).
showPostPolicy :: PostPolicy -> ByteString

-- | Represents individual conditions in a Post Policy document.
data PostPolicyCondition

-- | Set the bucket name that the upload should use.
ppCondBucket :: Bucket -> PostPolicyCondition

-- | Set the content length range constraint with minimum and maximum byte
--   count values.
ppCondContentLengthRange :: Int64 -> Int64 -> PostPolicyCondition

-- | Set the content-type header for the upload.
ppCondContentType :: Text -> PostPolicyCondition

-- | Set the object name constraint for the upload.
ppCondKey :: Object -> PostPolicyCondition

-- | Set the object name prefix constraint for the upload.
ppCondKeyStartsWith :: Object -> PostPolicyCondition

-- | Status code that the S3-server should send on a successful POST upload
ppCondSuccessActionStatus :: Int -> PostPolicyCondition

-- | Errors thrown by the library
data MinioErr
MErrHTTP :: HttpException -> MinioErr
MErrIO :: IOException -> MinioErr
MErrService :: ServiceErr -> MinioErr
MErrValidation :: MErrV -> MinioErr

-- | Various validation errors
data MErrV
MErrVSinglePUTSizeExceeded :: Int64 -> MErrV
MErrVPutSizeExceeded :: Int64 -> MErrV
MErrVETagHeaderNotFound :: MErrV
MErrVInvalidObjectInfoResponse :: MErrV
MErrVInvalidSrcObjSpec :: Text -> MErrV
MErrVInvalidSrcObjByteRange :: (Int64, Int64) -> MErrV
MErrVCopyObjSingleNoRangeAccepted :: MErrV
MErrVRegionNotSupported :: Text -> MErrV
MErrVXmlParse :: Text -> MErrV
MErrVInvalidBucketName :: Text -> MErrV
MErrVInvalidObjectName :: Text -> MErrV
MErrVInvalidUrlExpiry :: Int -> MErrV
MErrVJsonParse :: Text -> MErrV
MErrVInvalidHealPath :: MErrV
MErrVMissingCredentials :: MErrV

-- | Errors returned by S3 compatible service
data ServiceErr
BucketAlreadyExists :: ServiceErr
BucketAlreadyOwnedByYou :: ServiceErr
NoSuchBucket :: ServiceErr
InvalidBucketName :: ServiceErr
NoSuchKey :: ServiceErr
ServiceErr :: Text -> Text -> ServiceErr
