aws-0.24.4: Amazon Web Services (AWS) for Haskell

Safe Haskell | None
Language | Haskell2010

Aws.S3.Core

Synopsis

- data S3Authorization
  - = S3AuthorizationHeader
  - | S3AuthorizationQuery
- data RequestStyle
  - = PathStyle
  - | BucketStyle
  - | VHostStyle
- data S3SignPayloadMode
  - = AlwaysUnsigned
  - | SignWithEffort
  - | AlwaysSigned
- data S3SignVersion
  - = S3SignV2
  - | S3SignV4 {
    - _s3SignPayloadMode :: S3SignPayloadMode
    }
- data S3Configuration qt = S3Configuration {
  - s3Protocol :: Protocol
  - s3Endpoint :: ByteString
  - s3Region :: Maybe ByteString
  - s3RequestStyle :: RequestStyle
  - s3Port :: Int
  - s3ServerSideEncryption :: Maybe ServerSideEncryption
  - s3UseUri :: Bool
  - s3DefaultExpiry :: NominalDiffTime
  - s3SignVersion :: S3SignVersion
  - s3UserAgent :: Maybe Text
  }
- s3EndpointUsClassic :: ByteString
- s3EndpointUsWest :: ByteString
- s3EndpointUsWest2 :: ByteString
- s3EndpointEu :: ByteString
- s3EndpointEuWest2 :: ByteString
- s3EndpointApSouthEast :: ByteString
- s3EndpointApSouthEast2 :: ByteString
- s3EndpointApNorthEast :: ByteString
- s3 :: Protocol -> ByteString -> Bool -> S3Configuration qt
- s3v4 :: Protocol -> ByteString -> Bool -> S3SignPayloadMode -> S3Configuration qt
- type ErrorCode = Text
- data S3Error = S3Error {
  - s3StatusCode :: Status
  - s3ErrorCode :: ErrorCode
  - s3ErrorMessage :: Text
  - s3ErrorResource :: Maybe Text
  - s3ErrorHostId :: Maybe Text
  - s3ErrorAccessKeyId :: Maybe Text
  - s3ErrorStringToSign :: Maybe ByteString
  - s3ErrorBucket :: Maybe Text
  - s3ErrorEndpointRaw :: Maybe Text
  - s3ErrorEndpoint :: Maybe ByteString
  }
- data S3Metadata = S3Metadata {
  - s3MAmzId2 :: Maybe Text
  - s3MRequestId :: Maybe Text
  }
- data S3Query = S3Query {
  - s3QMethod :: Method
  - s3QBucket :: Maybe ByteString
  - s3QObject :: Maybe ByteString
  - s3QSubresources :: Query
  - s3QQuery :: Query
  - s3QContentType :: Maybe ByteString
  - s3QContentMd5 :: Maybe (Digest MD5)
  - s3QAmzHeaders :: RequestHeaders
  - s3QOtherHeaders :: RequestHeaders
  - s3QRequestBody :: Maybe RequestBody
  }
- hAmzDate :: HeaderName
- hAmzContentSha256 :: HeaderName
- hAmzAlgorithm :: HeaderName
- hAmzCredential :: HeaderName
- hAmzExpires :: HeaderName
- hAmzSignedHeaders :: HeaderName
- hAmzSignature :: HeaderName
- hAmzSecurityToken :: HeaderName
- s3SignQuery :: S3Query -> S3Configuration qt -> SignatureData -> SignedQuery
- s3UriEncode :: Bool -> ByteString -> ByteString
- s3RenderQuery :: Bool -> Query -> ByteString
- s3ExtractRegion :: ByteString -> ByteString
- s3ResponseConsumer :: HTTPResponseConsumer a -> IORef S3Metadata -> HTTPResponseConsumer a
- s3BinaryResponseConsumer :: HTTPResponseConsumer a -> IORef S3Metadata -> HTTPResponseConsumer a
- s3XmlResponseConsumer :: (Cursor -> Response S3Metadata a) -> IORef S3Metadata -> HTTPResponseConsumer a
- s3ErrorResponseConsumer :: HTTPResponseConsumer a
- type CanonicalUserId = Text
- data UserInfo = UserInfo {
  - userId :: CanonicalUserId
  - userDisplayName :: Maybe Text
  }
- parseUserInfo :: MonadThrow m => Cursor -> m UserInfo
- data CannedAcl
  - = AclPrivate
  - | AclPublicRead
  - | AclPublicReadWrite
  - | AclAuthenticatedRead
  - | AclBucketOwnerRead
  - | AclBucketOwnerFullControl
  - | AclLogDeliveryWrite
- writeCannedAcl :: CannedAcl -> Text
- data StorageClass
  - = Standard
  - | StandardInfrequentAccess
  - | ReducedRedundancy
  - | Glacier
  - | OtherStorageClass Text
- parseStorageClass :: Text -> StorageClass
- writeStorageClass :: StorageClass -> Text
- data ServerSideEncryption = AES256
- parseServerSideEncryption :: MonadThrow m => Text -> m ServerSideEncryption
- writeServerSideEncryption :: ServerSideEncryption -> Text
- type Bucket = Text
- data BucketInfo = BucketInfo {
  - bucketName :: Bucket
  - bucketCreationDate :: UTCTime
  }
- type Object = Text
- data ObjectId = ObjectId {
  - oidBucket :: Bucket
  - oidObject :: Object
  - oidVersion :: Maybe Text
  }
- data ObjectVersionInfo
  - = ObjectVersion {
    - oviKey :: Text
    - oviVersionId :: Text
    - oviIsLatest :: Bool
    - oviLastModified :: UTCTime
    - oviETag :: Text
    - oviSize :: Integer
    - oviStorageClass :: StorageClass
    - oviOwner :: Maybe UserInfo
    }
  - | DeleteMarker {
    - oviKey :: Text
    - oviVersionId :: Text
    - oviIsLatest :: Bool
    - oviLastModified :: UTCTime
    - oviOwner :: Maybe UserInfo
    }
- parseObjectVersionInfo :: MonadThrow m => Cursor -> m ObjectVersionInfo
- data ObjectInfo = ObjectInfo {
  - objectKey :: Text
  - objectLastModified :: UTCTime
  - objectETag :: Text
  - objectSize :: Integer
  - objectStorageClass :: StorageClass
  - objectOwner :: Maybe UserInfo
  }
- parseObjectInfo :: MonadThrow m => Cursor -> m ObjectInfo
- data ObjectMetadata = ObjectMetadata {
  - omDeleteMarker :: Bool
  - omETag :: Text
  - omLastModified :: UTCTime
  - omVersionId :: Maybe Text
  - omUserMetadata :: [(Text, Text)]
  - omMissingUserMetadata :: Maybe Text
  - omServerSideEncryption :: Maybe ServerSideEncryption
  }
- parseObjectMetadata :: MonadThrow m => ResponseHeaders -> m ObjectMetadata
- type LocationConstraint = Text
- locationUsClassic :: LocationConstraint
- locationUsWest :: LocationConstraint
- locationUsWest2 :: LocationConstraint
- locationEu :: LocationConstraint
- locationEuWest2 :: LocationConstraint
- locationEuFrankfurt :: LocationConstraint
- locationApSouthEast :: LocationConstraint
- locationApSouthEast2 :: LocationConstraint
- locationApNorthEast :: LocationConstraint
- locationSA :: LocationConstraint
- normaliseLocation :: LocationConstraint -> LocationConstraint

# Documentation

data S3Authorization #

Constructors

S3AuthorizationHeader |
S3AuthorizationQuery |

#### Instances

Instances details

Show S3Authorization # |
Instance details Defined in Aws.S3.Core Methods showsPrec :: Int -> S3Authorization -> ShowS # show :: S3Authorization -> String # showList :: [S3Authorization] -> ShowS #

data RequestStyle #

Constructors

PathStyle | Requires correctly setting region endpoint, but allows non-DNS compliant bucket names in the US standard region.
BucketStyle | Bucket name must be DNS compliant.
VHostStyle |

#### Instances

Instances details

Show RequestStyle # |
Instance details Defined in Aws.S3.Core Methods showsPrec :: Int -> RequestStyle -> ShowS # show :: RequestStyle -> String # showList :: [RequestStyle] -> ShowS #

data S3SignPayloadMode #

Constructors

AlwaysUnsigned | Always use the "UNSIGNED-PAYLOAD" option.
SignWithEffort | Sign the payload when `RequestBody` is a on-memory one (`RequestBodyLBS` or `RequestBodyBS`). Otherwise use the "UNSINGED-PAYLOAD" option.
AlwaysSigned | Always sign the payload. Note: `error` called when `RequestBody` is a streaming one.

#### Instances

Instances details

Read S3SignPayloadMode # |
Instance details Defined in Aws.S3.Core Methods readsPrec :: Int -> ReadS S3SignPayloadMode # readList :: ReadS [S3SignPayloadMode] # readPrec :: ReadPrec S3SignPayloadMode # readListPrec :: ReadPrec [S3SignPayloadMode] #
Show S3SignPayloadMode # |
Instance details Defined in Aws.S3.Core Methods showsPrec :: Int -> S3SignPayloadMode -> ShowS # show :: S3SignPayloadMode -> String # showList :: [S3SignPayloadMode] -> ShowS #
Eq S3SignPayloadMode # |
Instance details Defined in Aws.S3.Core Methods (==) :: S3SignPayloadMode -> S3SignPayloadMode -> Bool # (/=) :: S3SignPayloadMode -> S3SignPayloadMode -> Bool #

data S3SignVersion #

Constructors

S3SignV2 |
S3SignV4 |

Fields

- _s3SignPayloadMode :: S3SignPayloadMode

#### Instances

Instances details

Read S3SignVersion # |
Instance details Defined in Aws.S3.Core Methods readsPrec :: Int -> ReadS S3SignVersion # readList :: ReadS [S3SignVersion] # readPrec :: ReadPrec S3SignVersion # readListPrec :: ReadPrec [S3SignVersion] #
Show S3SignVersion # |
Instance details Defined in Aws.S3.Core Methods showsPrec :: Int -> S3SignVersion -> ShowS # show :: S3SignVersion -> String # showList :: [S3SignVersion] -> ShowS #
Eq S3SignVersion # |
Instance details Defined in Aws.S3.Core Methods (==) :: S3SignVersion -> S3SignVersion -> Bool # (/=) :: S3SignVersion -> S3SignVersion -> Bool #

data S3Configuration qt #

Constructors

S3Configuration |

Fields

- s3Protocol :: Protocol
- s3Endpoint :: ByteString
- s3Region :: Maybe ByteString
- s3RequestStyle :: RequestStyle
- s3Port :: Int
- s3ServerSideEncryption :: Maybe ServerSideEncryption
- s3UseUri :: Bool
- s3DefaultExpiry :: NominalDiffTime
- s3SignVersion :: S3SignVersion
- s3UserAgent :: Maybe Text

#### Instances

Instances details

DefaultServiceConfiguration (S3Configuration NormalQuery) # |
Instance details Defined in Aws.S3.Core Methods defServiceConfig :: S3Configuration NormalQuery # debugServiceConfig :: S3Configuration NormalQuery #
DefaultServiceConfiguration (S3Configuration UriOnlyQuery) # |
Instance details Defined in Aws.S3.Core Methods defServiceConfig :: S3Configuration UriOnlyQuery # debugServiceConfig :: S3Configuration UriOnlyQuery #
Show (S3Configuration qt) # |
Instance details Defined in Aws.S3.Core Methods showsPrec :: Int -> S3Configuration qt -> ShowS # show :: S3Configuration qt -> String # showList :: [S3Configuration qt] -> ShowS #

s3EndpointUsClassic :: ByteString #

s3EndpointUsWest :: ByteString #

s3EndpointUsWest2 :: ByteString #

s3EndpointEu :: ByteString #

s3EndpointEuWest2 :: ByteString #

s3EndpointApSouthEast :: ByteString #

s3EndpointApSouthEast2 :: ByteString #

s3EndpointApNorthEast :: ByteString #

s3 :: Protocol -> ByteString -> Bool -> S3Configuration qt #

s3v4 :: Protocol -> ByteString -> Bool -> S3SignPayloadMode -> S3Configuration qt #

type ErrorCode = Text #

data S3Error #

Constructors

S3Error |

Fields

- s3StatusCode :: Status
- s3ErrorCode :: ErrorCode
- s3ErrorMessage :: Text
- s3ErrorResource :: Maybe Text
- s3ErrorHostId :: Maybe Text
- s3ErrorAccessKeyId :: Maybe Text
- s3ErrorStringToSign :: Maybe ByteString
- s3ErrorBucket :: Maybe Text
- s3ErrorEndpointRaw :: Maybe Text
- s3ErrorEndpoint :: Maybe ByteString

#### Instances

Instances details

Exception S3Error # |
Instance details Defined in Aws.S3.Core Methods toException :: S3Error -> SomeException # fromException :: SomeException -> Maybe S3Error # displayException :: S3Error -> String # backtraceDesired :: S3Error -> Bool #
Show S3Error # |
Instance details Defined in Aws.S3.Core Methods showsPrec :: Int -> S3Error -> ShowS # show :: S3Error -> String # showList :: [S3Error] -> ShowS #

data S3Metadata #

Constructors

S3Metadata |

Fields

- s3MAmzId2 :: Maybe Text
- s3MRequestId :: Maybe Text

#### Instances

Instances details

Loggable S3Metadata # |
Instance details Defined in Aws.S3.Core Methods toLogText :: S3Metadata -> Text #
Monoid S3Metadata # |
Instance details Defined in Aws.S3.Core Methods mempty :: S3Metadata # mappend :: S3Metadata -> S3Metadata -> S3Metadata # mconcat :: [S3Metadata] -> S3Metadata #
Semigroup S3Metadata # |
Instance details Defined in Aws.S3.Core Methods (<>) :: S3Metadata -> S3Metadata -> S3Metadata # sconcat :: NonEmpty S3Metadata -> S3Metadata # stimes :: Integral b => b -> S3Metadata -> S3Metadata #
Show S3Metadata # |
Instance details Defined in Aws.S3.Core Methods showsPrec :: Int -> S3Metadata -> ShowS # show :: S3Metadata -> String # showList :: [S3Metadata] -> ShowS #

data S3Query #

Constructors

S3Query |

Fields

- s3QMethod :: Method
- s3QBucket :: Maybe ByteString
- s3QObject :: Maybe ByteString
- s3QSubresources :: Query
- s3QQuery :: Query
- s3QContentType :: Maybe ByteString
- s3QContentMd5 :: Maybe (Digest MD5)
- s3QAmzHeaders :: RequestHeaders
- s3QOtherHeaders :: RequestHeaders
- s3QRequestBody :: Maybe RequestBody

#### Instances

Instances details

Show S3Query # |
Instance details Defined in Aws.S3.Core Methods showsPrec :: Int -> S3Query -> ShowS # show :: S3Query -> String # showList :: [S3Query] -> ShowS #

hAmzDate :: HeaderName #

hAmzContentSha256 :: HeaderName #

hAmzAlgorithm :: HeaderName #

hAmzCredential :: HeaderName #

hAmzExpires :: HeaderName #

hAmzSignedHeaders :: HeaderName #

hAmzSignature :: HeaderName #

hAmzSecurityToken :: HeaderName #

s3SignQuery :: S3Query -> S3Configuration qt -> SignatureData -> SignedQuery #

s3UriEncode #

Arguments

:: Bool | Whether encode slash characters
-> ByteString |
-> ByteString |

Custom UriEncode function see http://docs.aws.amazon.com/AmazonS3/latest/API/sig-v4-header-based-auth.html

s3RenderQuery #

Arguments

:: Bool | Whether prepend a question mark
-> Query |
-> ByteString |

s3ExtractRegion :: ByteString -> ByteString #

Extract a S3 region from the S3 endpoint. AWS encodes the region names in the hostnames of endpoints in a way that makes this possible, see: http://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region For other S3 implementations, may instead need to specify s3Region.

s3ResponseConsumer :: HTTPResponseConsumer a -> IORef S3Metadata -> HTTPResponseConsumer a #

s3BinaryResponseConsumer :: HTTPResponseConsumer a -> IORef S3Metadata -> HTTPResponseConsumer a #

s3XmlResponseConsumer :: (Cursor -> Response S3Metadata a) -> IORef S3Metadata -> HTTPResponseConsumer a #

s3ErrorResponseConsumer :: HTTPResponseConsumer a #

type CanonicalUserId = Text #

data UserInfo #

Constructors

UserInfo |

Fields

- userId :: CanonicalUserId
- userDisplayName :: Maybe Text

#### Instances

Instances details

Show UserInfo # |
Instance details Defined in Aws.S3.Core Methods showsPrec :: Int -> UserInfo -> ShowS # show :: UserInfo -> String # showList :: [UserInfo] -> ShowS #

parseUserInfo :: MonadThrow m => Cursor -> m UserInfo #

data CannedAcl #

Constructors

AclPrivate |
AclPublicRead |
AclPublicReadWrite |
AclAuthenticatedRead |
AclBucketOwnerRead |
AclBucketOwnerFullControl |
AclLogDeliveryWrite |

#### Instances

Instances details

Show CannedAcl # |
Instance details Defined in Aws.S3.Core Methods showsPrec :: Int -> CannedAcl -> ShowS # show :: CannedAcl -> String # showList :: [CannedAcl] -> ShowS #

writeCannedAcl :: CannedAcl -> Text #

data StorageClass #

Constructors

Standard |
StandardInfrequentAccess |
ReducedRedundancy |
Glacier |
OtherStorageClass Text |

#### Instances

Instances details

Show StorageClass # |
Instance details Defined in Aws.S3.Core Methods showsPrec :: Int -> StorageClass -> ShowS # show :: StorageClass -> String # showList :: [StorageClass] -> ShowS #

parseStorageClass :: Text -> StorageClass #

writeStorageClass :: StorageClass -> Text #

data ServerSideEncryption #

Constructors

AES256 |

#### Instances

Instances details

Show ServerSideEncryption # |
Instance details Defined in Aws.S3.Core Methods showsPrec :: Int -> ServerSideEncryption -> ShowS # show :: ServerSideEncryption -> String # showList :: [ServerSideEncryption] -> ShowS #

parseServerSideEncryption :: MonadThrow m => Text -> m ServerSideEncryption #

writeServerSideEncryption :: ServerSideEncryption -> Text #

type Bucket = Text #

data BucketInfo #

Constructors

BucketInfo |

Fields

- bucketName :: Bucket
- bucketCreationDate :: UTCTime

#### Instances

Instances details

Show BucketInfo # |
Instance details Defined in Aws.S3.Core Methods showsPrec :: Int -> BucketInfo -> ShowS # show :: BucketInfo -> String # showList :: [BucketInfo] -> ShowS #

type Object = Text #

data ObjectId #

Constructors

ObjectId |

Fields

- oidBucket :: Bucket
- oidObject :: Object
- oidVersion :: Maybe Text

#### Instances

Instances details

Show ObjectId # |
Instance details Defined in Aws.S3.Core Methods showsPrec :: Int -> ObjectId -> ShowS # show :: ObjectId -> String # showList :: [ObjectId] -> ShowS #

data ObjectVersionInfo #

Constructors

ObjectVersion |

Fields

- oviKey :: Text
- oviVersionId :: Text
- oviIsLatest :: Bool
- oviLastModified :: UTCTime
- oviETag :: Text
- oviSize :: Integer
- oviStorageClass :: StorageClass
- oviOwner :: Maybe UserInfo

DeleteMarker |

Fields

- oviKey :: Text
- oviVersionId :: Text
- oviIsLatest :: Bool
- oviLastModified :: UTCTime
- oviOwner :: Maybe UserInfo

#### Instances

Instances details

Show ObjectVersionInfo # |
Instance details Defined in Aws.S3.Core Methods showsPrec :: Int -> ObjectVersionInfo -> ShowS # show :: ObjectVersionInfo -> String # showList :: [ObjectVersionInfo] -> ShowS #
ListResponse GetBucketObjectVersionsResponse ObjectVersionInfo # |
Instance details Defined in Aws.S3.Commands.GetBucketObjectVersions Methods listResponse :: GetBucketObjectVersionsResponse -> [ObjectVersionInfo] #

parseObjectVersionInfo :: MonadThrow m => Cursor -> m ObjectVersionInfo #

data ObjectInfo #

Constructors

ObjectInfo |

Fields

- objectKey :: Text
- objectLastModified :: UTCTime
- objectETag :: Text
- objectSize :: Integer
- objectStorageClass :: StorageClass
- objectOwner :: Maybe UserInfo

#### Instances

Instances details

Show ObjectInfo # |
Instance details Defined in Aws.S3.Core Methods showsPrec :: Int -> ObjectInfo -> ShowS # show :: ObjectInfo -> String # showList :: [ObjectInfo] -> ShowS #
ListResponse GetBucketResponse ObjectInfo # |
Instance details Defined in Aws.S3.Commands.GetBucket Methods listResponse :: GetBucketResponse -> [ObjectInfo] #

parseObjectInfo :: MonadThrow m => Cursor -> m ObjectInfo #

data ObjectMetadata #

Constructors

ObjectMetadata |

Fields

- omDeleteMarker :: Bool
- omETag :: Text
- omLastModified :: UTCTime
- omVersionId :: Maybe Text
- omUserMetadata :: [(Text, Text)]
- omMissingUserMetadata :: Maybe Text
- omServerSideEncryption :: Maybe ServerSideEncryption

#### Instances

Instances details

Show ObjectMetadata # |
Instance details Defined in Aws.S3.Core Methods showsPrec :: Int -> ObjectMetadata -> ShowS # show :: ObjectMetadata -> String # showList :: [ObjectMetadata] -> ShowS #

parseObjectMetadata :: MonadThrow m => ResponseHeaders -> m ObjectMetadata #

type LocationConstraint = Text #

locationUsClassic :: LocationConstraint #

locationUsWest :: LocationConstraint #

locationUsWest2 :: LocationConstraint #

locationEu :: LocationConstraint #

locationEuWest2 :: LocationConstraint #

locationEuFrankfurt :: LocationConstraint #

locationApSouthEast :: LocationConstraint #

locationApSouthEast2 :: LocationConstraint #

locationApNorthEast :: LocationConstraint #

locationSA :: LocationConstraint #

normaliseLocation :: LocationConstraint -> LocationConstraint #