{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.KinesisAnalyticsV2.CreateApplicationPresignedUrl
(
CreateApplicationPresignedUrl (..),
newCreateApplicationPresignedUrl,
createApplicationPresignedUrl_sessionExpirationDurationInSeconds,
createApplicationPresignedUrl_applicationName,
createApplicationPresignedUrl_urlType,
CreateApplicationPresignedUrlResponse (..),
newCreateApplicationPresignedUrlResponse,
createApplicationPresignedUrlResponse_authorizedUrl,
createApplicationPresignedUrlResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.KinesisAnalyticsV2.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data CreateApplicationPresignedUrl = CreateApplicationPresignedUrl'
{
CreateApplicationPresignedUrl -> Maybe Natural
sessionExpirationDurationInSeconds :: Prelude.Maybe Prelude.Natural,
CreateApplicationPresignedUrl -> Text
applicationName :: Prelude.Text,
CreateApplicationPresignedUrl -> UrlType
urlType :: UrlType
}
deriving (CreateApplicationPresignedUrl
-> CreateApplicationPresignedUrl -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateApplicationPresignedUrl
-> CreateApplicationPresignedUrl -> Bool
$c/= :: CreateApplicationPresignedUrl
-> CreateApplicationPresignedUrl -> Bool
== :: CreateApplicationPresignedUrl
-> CreateApplicationPresignedUrl -> Bool
$c== :: CreateApplicationPresignedUrl
-> CreateApplicationPresignedUrl -> Bool
Prelude.Eq, ReadPrec [CreateApplicationPresignedUrl]
ReadPrec CreateApplicationPresignedUrl
Int -> ReadS CreateApplicationPresignedUrl
ReadS [CreateApplicationPresignedUrl]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateApplicationPresignedUrl]
$creadListPrec :: ReadPrec [CreateApplicationPresignedUrl]
readPrec :: ReadPrec CreateApplicationPresignedUrl
$creadPrec :: ReadPrec CreateApplicationPresignedUrl
readList :: ReadS [CreateApplicationPresignedUrl]
$creadList :: ReadS [CreateApplicationPresignedUrl]
readsPrec :: Int -> ReadS CreateApplicationPresignedUrl
$creadsPrec :: Int -> ReadS CreateApplicationPresignedUrl
Prelude.Read, Int -> CreateApplicationPresignedUrl -> ShowS
[CreateApplicationPresignedUrl] -> ShowS
CreateApplicationPresignedUrl -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateApplicationPresignedUrl] -> ShowS
$cshowList :: [CreateApplicationPresignedUrl] -> ShowS
show :: CreateApplicationPresignedUrl -> String
$cshow :: CreateApplicationPresignedUrl -> String
showsPrec :: Int -> CreateApplicationPresignedUrl -> ShowS
$cshowsPrec :: Int -> CreateApplicationPresignedUrl -> ShowS
Prelude.Show, forall x.
Rep CreateApplicationPresignedUrl x
-> CreateApplicationPresignedUrl
forall x.
CreateApplicationPresignedUrl
-> Rep CreateApplicationPresignedUrl x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateApplicationPresignedUrl x
-> CreateApplicationPresignedUrl
$cfrom :: forall x.
CreateApplicationPresignedUrl
-> Rep CreateApplicationPresignedUrl x
Prelude.Generic)
newCreateApplicationPresignedUrl ::
Prelude.Text ->
UrlType ->
CreateApplicationPresignedUrl
newCreateApplicationPresignedUrl :: Text -> UrlType -> CreateApplicationPresignedUrl
newCreateApplicationPresignedUrl
Text
pApplicationName_
UrlType
pUrlType_ =
CreateApplicationPresignedUrl'
{ $sel:sessionExpirationDurationInSeconds:CreateApplicationPresignedUrl' :: Maybe Natural
sessionExpirationDurationInSeconds =
forall a. Maybe a
Prelude.Nothing,
$sel:applicationName:CreateApplicationPresignedUrl' :: Text
applicationName = Text
pApplicationName_,
$sel:urlType:CreateApplicationPresignedUrl' :: UrlType
urlType = UrlType
pUrlType_
}
createApplicationPresignedUrl_sessionExpirationDurationInSeconds :: Lens.Lens' CreateApplicationPresignedUrl (Prelude.Maybe Prelude.Natural)
createApplicationPresignedUrl_sessionExpirationDurationInSeconds :: Lens' CreateApplicationPresignedUrl (Maybe Natural)
createApplicationPresignedUrl_sessionExpirationDurationInSeconds = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateApplicationPresignedUrl' {Maybe Natural
sessionExpirationDurationInSeconds :: Maybe Natural
$sel:sessionExpirationDurationInSeconds:CreateApplicationPresignedUrl' :: CreateApplicationPresignedUrl -> Maybe Natural
sessionExpirationDurationInSeconds} -> Maybe Natural
sessionExpirationDurationInSeconds) (\s :: CreateApplicationPresignedUrl
s@CreateApplicationPresignedUrl' {} Maybe Natural
a -> CreateApplicationPresignedUrl
s {$sel:sessionExpirationDurationInSeconds:CreateApplicationPresignedUrl' :: Maybe Natural
sessionExpirationDurationInSeconds = Maybe Natural
a} :: CreateApplicationPresignedUrl)
createApplicationPresignedUrl_applicationName :: Lens.Lens' CreateApplicationPresignedUrl Prelude.Text
createApplicationPresignedUrl_applicationName :: Lens' CreateApplicationPresignedUrl Text
createApplicationPresignedUrl_applicationName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateApplicationPresignedUrl' {Text
applicationName :: Text
$sel:applicationName:CreateApplicationPresignedUrl' :: CreateApplicationPresignedUrl -> Text
applicationName} -> Text
applicationName) (\s :: CreateApplicationPresignedUrl
s@CreateApplicationPresignedUrl' {} Text
a -> CreateApplicationPresignedUrl
s {$sel:applicationName:CreateApplicationPresignedUrl' :: Text
applicationName = Text
a} :: CreateApplicationPresignedUrl)
createApplicationPresignedUrl_urlType :: Lens.Lens' CreateApplicationPresignedUrl UrlType
createApplicationPresignedUrl_urlType :: Lens' CreateApplicationPresignedUrl UrlType
createApplicationPresignedUrl_urlType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateApplicationPresignedUrl' {UrlType
urlType :: UrlType
$sel:urlType:CreateApplicationPresignedUrl' :: CreateApplicationPresignedUrl -> UrlType
urlType} -> UrlType
urlType) (\s :: CreateApplicationPresignedUrl
s@CreateApplicationPresignedUrl' {} UrlType
a -> CreateApplicationPresignedUrl
s {$sel:urlType:CreateApplicationPresignedUrl' :: UrlType
urlType = UrlType
a} :: CreateApplicationPresignedUrl)
instance
Core.AWSRequest
CreateApplicationPresignedUrl
where
type
AWSResponse CreateApplicationPresignedUrl =
CreateApplicationPresignedUrlResponse
request :: (Service -> Service)
-> CreateApplicationPresignedUrl
-> Request CreateApplicationPresignedUrl
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy CreateApplicationPresignedUrl
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CreateApplicationPresignedUrl)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe Text -> Int -> CreateApplicationPresignedUrlResponse
CreateApplicationPresignedUrlResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"AuthorizedUrl")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance
Prelude.Hashable
CreateApplicationPresignedUrl
where
hashWithSalt :: Int -> CreateApplicationPresignedUrl -> Int
hashWithSalt Int
_salt CreateApplicationPresignedUrl' {Maybe Natural
Text
UrlType
urlType :: UrlType
applicationName :: Text
sessionExpirationDurationInSeconds :: Maybe Natural
$sel:urlType:CreateApplicationPresignedUrl' :: CreateApplicationPresignedUrl -> UrlType
$sel:applicationName:CreateApplicationPresignedUrl' :: CreateApplicationPresignedUrl -> Text
$sel:sessionExpirationDurationInSeconds:CreateApplicationPresignedUrl' :: CreateApplicationPresignedUrl -> Maybe Natural
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
sessionExpirationDurationInSeconds
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
applicationName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` UrlType
urlType
instance Prelude.NFData CreateApplicationPresignedUrl where
rnf :: CreateApplicationPresignedUrl -> ()
rnf CreateApplicationPresignedUrl' {Maybe Natural
Text
UrlType
urlType :: UrlType
applicationName :: Text
sessionExpirationDurationInSeconds :: Maybe Natural
$sel:urlType:CreateApplicationPresignedUrl' :: CreateApplicationPresignedUrl -> UrlType
$sel:applicationName:CreateApplicationPresignedUrl' :: CreateApplicationPresignedUrl -> Text
$sel:sessionExpirationDurationInSeconds:CreateApplicationPresignedUrl' :: CreateApplicationPresignedUrl -> Maybe Natural
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
sessionExpirationDurationInSeconds
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
applicationName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf UrlType
urlType
instance Data.ToHeaders CreateApplicationPresignedUrl where
toHeaders :: CreateApplicationPresignedUrl -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"KinesisAnalytics_20180523.CreateApplicationPresignedUrl" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON CreateApplicationPresignedUrl where
toJSON :: CreateApplicationPresignedUrl -> Value
toJSON CreateApplicationPresignedUrl' {Maybe Natural
Text
UrlType
urlType :: UrlType
applicationName :: Text
sessionExpirationDurationInSeconds :: Maybe Natural
$sel:urlType:CreateApplicationPresignedUrl' :: CreateApplicationPresignedUrl -> UrlType
$sel:applicationName:CreateApplicationPresignedUrl' :: CreateApplicationPresignedUrl -> Text
$sel:sessionExpirationDurationInSeconds:CreateApplicationPresignedUrl' :: CreateApplicationPresignedUrl -> Maybe Natural
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"SessionExpirationDurationInSeconds" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
sessionExpirationDurationInSeconds,
forall a. a -> Maybe a
Prelude.Just
(Key
"ApplicationName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
applicationName),
forall a. a -> Maybe a
Prelude.Just (Key
"UrlType" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= UrlType
urlType)
]
)
instance Data.ToPath CreateApplicationPresignedUrl where
toPath :: CreateApplicationPresignedUrl -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery CreateApplicationPresignedUrl where
toQuery :: CreateApplicationPresignedUrl -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data CreateApplicationPresignedUrlResponse = CreateApplicationPresignedUrlResponse'
{
CreateApplicationPresignedUrlResponse -> Maybe Text
authorizedUrl :: Prelude.Maybe Prelude.Text,
CreateApplicationPresignedUrlResponse -> Int
httpStatus :: Prelude.Int
}
deriving (CreateApplicationPresignedUrlResponse
-> CreateApplicationPresignedUrlResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateApplicationPresignedUrlResponse
-> CreateApplicationPresignedUrlResponse -> Bool
$c/= :: CreateApplicationPresignedUrlResponse
-> CreateApplicationPresignedUrlResponse -> Bool
== :: CreateApplicationPresignedUrlResponse
-> CreateApplicationPresignedUrlResponse -> Bool
$c== :: CreateApplicationPresignedUrlResponse
-> CreateApplicationPresignedUrlResponse -> Bool
Prelude.Eq, ReadPrec [CreateApplicationPresignedUrlResponse]
ReadPrec CreateApplicationPresignedUrlResponse
Int -> ReadS CreateApplicationPresignedUrlResponse
ReadS [CreateApplicationPresignedUrlResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateApplicationPresignedUrlResponse]
$creadListPrec :: ReadPrec [CreateApplicationPresignedUrlResponse]
readPrec :: ReadPrec CreateApplicationPresignedUrlResponse
$creadPrec :: ReadPrec CreateApplicationPresignedUrlResponse
readList :: ReadS [CreateApplicationPresignedUrlResponse]
$creadList :: ReadS [CreateApplicationPresignedUrlResponse]
readsPrec :: Int -> ReadS CreateApplicationPresignedUrlResponse
$creadsPrec :: Int -> ReadS CreateApplicationPresignedUrlResponse
Prelude.Read, Int -> CreateApplicationPresignedUrlResponse -> ShowS
[CreateApplicationPresignedUrlResponse] -> ShowS
CreateApplicationPresignedUrlResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateApplicationPresignedUrlResponse] -> ShowS
$cshowList :: [CreateApplicationPresignedUrlResponse] -> ShowS
show :: CreateApplicationPresignedUrlResponse -> String
$cshow :: CreateApplicationPresignedUrlResponse -> String
showsPrec :: Int -> CreateApplicationPresignedUrlResponse -> ShowS
$cshowsPrec :: Int -> CreateApplicationPresignedUrlResponse -> ShowS
Prelude.Show, forall x.
Rep CreateApplicationPresignedUrlResponse x
-> CreateApplicationPresignedUrlResponse
forall x.
CreateApplicationPresignedUrlResponse
-> Rep CreateApplicationPresignedUrlResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateApplicationPresignedUrlResponse x
-> CreateApplicationPresignedUrlResponse
$cfrom :: forall x.
CreateApplicationPresignedUrlResponse
-> Rep CreateApplicationPresignedUrlResponse x
Prelude.Generic)
newCreateApplicationPresignedUrlResponse ::
Prelude.Int ->
CreateApplicationPresignedUrlResponse
newCreateApplicationPresignedUrlResponse :: Int -> CreateApplicationPresignedUrlResponse
newCreateApplicationPresignedUrlResponse Int
pHttpStatus_ =
CreateApplicationPresignedUrlResponse'
{ $sel:authorizedUrl:CreateApplicationPresignedUrlResponse' :: Maybe Text
authorizedUrl =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:CreateApplicationPresignedUrlResponse' :: Int
httpStatus = Int
pHttpStatus_
}
createApplicationPresignedUrlResponse_authorizedUrl :: Lens.Lens' CreateApplicationPresignedUrlResponse (Prelude.Maybe Prelude.Text)
createApplicationPresignedUrlResponse_authorizedUrl :: Lens' CreateApplicationPresignedUrlResponse (Maybe Text)
createApplicationPresignedUrlResponse_authorizedUrl = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateApplicationPresignedUrlResponse' {Maybe Text
authorizedUrl :: Maybe Text
$sel:authorizedUrl:CreateApplicationPresignedUrlResponse' :: CreateApplicationPresignedUrlResponse -> Maybe Text
authorizedUrl} -> Maybe Text
authorizedUrl) (\s :: CreateApplicationPresignedUrlResponse
s@CreateApplicationPresignedUrlResponse' {} Maybe Text
a -> CreateApplicationPresignedUrlResponse
s {$sel:authorizedUrl:CreateApplicationPresignedUrlResponse' :: Maybe Text
authorizedUrl = Maybe Text
a} :: CreateApplicationPresignedUrlResponse)
createApplicationPresignedUrlResponse_httpStatus :: Lens.Lens' CreateApplicationPresignedUrlResponse Prelude.Int
createApplicationPresignedUrlResponse_httpStatus :: Lens' CreateApplicationPresignedUrlResponse Int
createApplicationPresignedUrlResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateApplicationPresignedUrlResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateApplicationPresignedUrlResponse' :: CreateApplicationPresignedUrlResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateApplicationPresignedUrlResponse
s@CreateApplicationPresignedUrlResponse' {} Int
a -> CreateApplicationPresignedUrlResponse
s {$sel:httpStatus:CreateApplicationPresignedUrlResponse' :: Int
httpStatus = Int
a} :: CreateApplicationPresignedUrlResponse)
instance
Prelude.NFData
CreateApplicationPresignedUrlResponse
where
rnf :: CreateApplicationPresignedUrlResponse -> ()
rnf CreateApplicationPresignedUrlResponse' {Int
Maybe Text
httpStatus :: Int
authorizedUrl :: Maybe Text
$sel:httpStatus:CreateApplicationPresignedUrlResponse' :: CreateApplicationPresignedUrlResponse -> Int
$sel:authorizedUrl:CreateApplicationPresignedUrlResponse' :: CreateApplicationPresignedUrlResponse -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
authorizedUrl
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus