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 Source #

Constructors

S3AuthorizationHeader |
S3AuthorizationQuery |

#### Instances

Instances details

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

data RequestStyle Source #

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 Source # |
Instance details Defined in Aws.S3.Core Methods showsPrec :: Int -> RequestStyle -> ShowS Source # show :: RequestStyle -> String Source # showList :: [RequestStyle] -> ShowS Source #

data S3SignPayloadMode Source #

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

data S3SignVersion Source #

Constructors

S3SignV2 |
S3SignV4 |

Fields

- _s3SignPayloadMode :: S3SignPayloadMode

#### Instances

Instances details

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

data S3Configuration qt Source #

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

s3EndpointUsClassic :: ByteString Source #

s3EndpointUsWest :: ByteString Source #

s3EndpointUsWest2 :: ByteString Source #

s3EndpointEu :: ByteString Source #

s3EndpointEuWest2 :: ByteString Source #

s3EndpointApSouthEast :: ByteString Source #

s3EndpointApSouthEast2 :: ByteString Source #

s3EndpointApNorthEast :: ByteString Source #

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

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

type ErrorCode = Text Source #

data S3Error Source #

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

data S3Metadata Source #

Constructors

S3Metadata |

Fields

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

#### Instances

Instances details

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

data S3Query Source #

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 Source # |
Instance details Defined in Aws.S3.Core Methods showsPrec :: Int -> S3Query -> ShowS Source # show :: S3Query -> String Source # showList :: [S3Query] -> ShowS Source #

hAmzDate :: HeaderName Source #

hAmzContentSha256 :: HeaderName Source #

hAmzAlgorithm :: HeaderName Source #

hAmzCredential :: HeaderName Source #

hAmzExpires :: HeaderName Source #

hAmzSignedHeaders :: HeaderName Source #

hAmzSignature :: HeaderName Source #

hAmzSecurityToken :: HeaderName Source #

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

s3UriEncode Source #

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 Source #

Arguments

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

s3ExtractRegion :: ByteString -> ByteString Source #

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 Source #

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

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

s3ErrorResponseConsumer :: HTTPResponseConsumer a Source #

type CanonicalUserId = Text Source #

data UserInfo Source #

Constructors

UserInfo |

Fields

- userId :: CanonicalUserId
- userDisplayName :: Maybe Text

#### Instances

Instances details

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

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

data CannedAcl Source #

Constructors

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

#### Instances

Instances details

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

writeCannedAcl :: CannedAcl -> Text Source #

data StorageClass Source #

Constructors

Standard |
StandardInfrequentAccess |
ReducedRedundancy |
Glacier |
OtherStorageClass Text |

#### Instances

Instances details

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

parseStorageClass :: Text -> StorageClass Source #

writeStorageClass :: StorageClass -> Text Source #

data ServerSideEncryption Source #

Constructors

AES256 |

#### Instances

Instances details

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

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

writeServerSideEncryption :: ServerSideEncryption -> Text Source #

type Bucket = Text Source #

data BucketInfo Source #

Constructors

BucketInfo |

Fields

- bucketName :: Bucket
- bucketCreationDate :: UTCTime

#### Instances

Instances details

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

type Object = Text Source #

data ObjectId Source #

Constructors

ObjectId |

Fields

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

#### Instances

Instances details

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

data ObjectVersionInfo Source #

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

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

data ObjectInfo Source #

Constructors

ObjectInfo |

Fields

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

#### Instances

Instances details

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

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

data ObjectMetadata Source #

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 Source # |
Instance details Defined in Aws.S3.Core Methods showsPrec :: Int -> ObjectMetadata -> ShowS Source # show :: ObjectMetadata -> String Source # showList :: [ObjectMetadata] -> ShowS Source #

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

type LocationConstraint = Text Source #

locationUsClassic :: LocationConstraint Source #

locationUsWest :: LocationConstraint Source #

locationUsWest2 :: LocationConstraint Source #

locationEu :: LocationConstraint Source #

locationEuWest2 :: LocationConstraint Source #

locationEuFrankfurt :: LocationConstraint Source #

locationApSouthEast :: LocationConstraint Source #

locationApSouthEast2 :: LocationConstraint Source #

locationApNorthEast :: LocationConstraint Source #

locationSA :: LocationConstraint Source #

normaliseLocation :: LocationConstraint -> LocationConstraint Source #