{-# LANGUAGE BangPatterns #-}
module Amazonka.Presign where
import Amazonka.Data
import Amazonka.Prelude
import Amazonka.Request (clientRequestURL)
import Amazonka.Types hiding (presign)
import qualified Network.HTTP.Types as HTTP
presignURL ::
(AWSRequest a) =>
AuthEnv ->
Region ->
UTCTime ->
Seconds ->
a ->
ByteString
presignURL :: forall a.
AWSRequest a =>
AuthEnv -> Region -> UTCTime -> Seconds -> a -> ByteString
presignURL AuthEnv
a Region
r UTCTime
e Seconds
ts = ClientRequest -> ByteString
clientRequestURL forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a.
AWSRequest a =>
AuthEnv -> Region -> UTCTime -> Seconds -> a -> ClientRequest
presign AuthEnv
a Region
r UTCTime
e Seconds
ts
presign ::
(AWSRequest a) =>
AuthEnv ->
Region ->
UTCTime ->
Seconds ->
a ->
ClientRequest
presign :: forall a.
AWSRequest a =>
AuthEnv -> Region -> UTCTime -> Seconds -> a -> ClientRequest
presign =
forall a.
AWSRequest a =>
(Service -> Service)
-> AuthEnv -> Region -> UTCTime -> Seconds -> a -> ClientRequest
presignWith forall a. a -> a
id
presignWith ::
(AWSRequest a) =>
(Service -> Service) ->
AuthEnv ->
Region ->
UTCTime ->
Seconds ->
a ->
ClientRequest
presignWith :: forall a.
AWSRequest a =>
(Service -> Service)
-> AuthEnv -> Region -> UTCTime -> Seconds -> a -> ClientRequest
presignWith = forall a.
AWSRequest a =>
([Header] -> [Header])
-> (Service -> Service)
-> AuthEnv
-> Region
-> UTCTime
-> Seconds
-> a
-> ClientRequest
presignWithHeaders [Header] -> [Header]
defaultHeaders
defaultHeaders :: [HTTP.Header] -> [HTTP.Header]
= forall a. (a -> Bool) -> [a] -> [a]
filter ((forall a. Eq a => a -> a -> Bool
/= HeaderName
hExpect) forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. (a, b) -> a
fst)
presignWithHeaders ::
forall a.
(AWSRequest a) =>
([Header] -> [Header]) ->
(Service -> Service) ->
AuthEnv ->
Region ->
UTCTime ->
Seconds ->
a ->
ClientRequest
[Header] -> [Header]
f Service -> Service
g AuthEnv
ae Region
r UTCTime
ts Seconds
ex a
x =
let rq :: Request a
rq@Request {[Header]
$sel:headers:Request :: forall a. Request a -> [Header]
headers :: [Header]
headers} = forall a. AWSRequest a => (Service -> Service) -> a -> Request a
request Service -> Service
g a
x
rq' :: Request a
rq' :: Request a
rq' = Request a
rq {$sel:headers:Request :: [Header]
headers = [Header] -> [Header]
f [Header]
headers}
!creq :: ClientRequest
creq = forall a. Signed a -> ClientRequest
signedRequest forall a b. (a -> b) -> a -> b
$ forall a. Seconds -> Algorithm a
requestPresign Seconds
ex Request a
rq' AuthEnv
ae Region
r UTCTime
ts
in ClientRequest
creq