billstclair / elm-s3 / S3.Types

Types for S3 module

Types


type Error
    = HttpError Http.Error
    | AWSError AWS.Http.AWSAppError
    | DecodeError String

Errors returned from S3 operations

HttpError is from the standard Elm Http module.

AWSError is from the AWS.Http module.

DecodeError denotes a Decoder error in parsing S3 account info.


type alias Account =
{ name : String
, region : Maybe String
, isDigitalOcean : Basics.Bool
, accessKey : String
, secretKey : String
, buckets : List String 
}

Information about an S3 account


type alias Bucket =
String

The name of an S3 bucket.


type alias Key =
String

The name of an S3 key.


type alias Mimetype =
String

An HTTP mimetype, e.g. "text/html".


type alias StorageClass =
String

The StorageClass for a key returned from listing a bucket's contents.


type alias Owner =
{ id : String
, displayName : String 
}

The owner of an object returned from listing a bucket's contents.


type alias KeyInfo =
{ key : Key
, lastModified : String
, eTag : String
, size : Basics.Int
, storageClass : StorageClass
, owner : Maybe Owner 
}

Information about a single key returned from listing a bucket's contents.


type alias KeyList =
{ name : String
, prefix : Maybe String
, marker : Maybe String
, nextMarker : Maybe String
, maxKeys : Basics.Int
, isTruncated : Basics.Bool
, keys : List KeyInfo 
}

All the information returned from listing a bucket's contents.

An Elm encoding of the ListBucketResult XML element.


type alias Query =
List QueryElement

A list of QueryElements.


type QueryElement
    = AnyQuery String String
    | XAmzAcl CannedAcl
    | Delimiter String
    | Marker String
    | MaxKeys Basics.Int
    | Prefix String

An element of a Query, used for HTTP headers and query parameters.

AnyQuery allows you to encode any key/value pair.

XAmzAcl is used as a header with S3.putObject.

The others are used as query parameters with S3.listKeys.


type CannedAcl
    = AclPrivate
    | AclPublicRead
    | AclPublicReadWrite
    | AclAwsExecRead
    | AclAuthenticatedRead
    | AclBucketOwnerRead
    | AclBucketOwnerFullControl
    | AclLogDeliveryWrite

Values for the XAmzAcl Query type.

Functions

aclToString : CannedAcl -> String

Convert a CannedAcl to a String.