{-# 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.DescribeApplication
(
DescribeApplication (..),
newDescribeApplication,
describeApplication_includeAdditionalDetails,
describeApplication_applicationName,
DescribeApplicationResponse (..),
newDescribeApplicationResponse,
describeApplicationResponse_httpStatus,
describeApplicationResponse_applicationDetail,
)
where
import qualified Amazonka.Core as Core
import Amazonka.KinesisAnalyticsV2.Types
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data DescribeApplication = DescribeApplication'
{
DescribeApplication -> Maybe Bool
includeAdditionalDetails :: Prelude.Maybe Prelude.Bool,
DescribeApplication -> Text
applicationName :: Prelude.Text
}
deriving (DescribeApplication -> DescribeApplication -> Bool
(DescribeApplication -> DescribeApplication -> Bool)
-> (DescribeApplication -> DescribeApplication -> Bool)
-> Eq DescribeApplication
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeApplication -> DescribeApplication -> Bool
$c/= :: DescribeApplication -> DescribeApplication -> Bool
== :: DescribeApplication -> DescribeApplication -> Bool
$c== :: DescribeApplication -> DescribeApplication -> Bool
Prelude.Eq, ReadPrec [DescribeApplication]
ReadPrec DescribeApplication
Int -> ReadS DescribeApplication
ReadS [DescribeApplication]
(Int -> ReadS DescribeApplication)
-> ReadS [DescribeApplication]
-> ReadPrec DescribeApplication
-> ReadPrec [DescribeApplication]
-> Read DescribeApplication
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeApplication]
$creadListPrec :: ReadPrec [DescribeApplication]
readPrec :: ReadPrec DescribeApplication
$creadPrec :: ReadPrec DescribeApplication
readList :: ReadS [DescribeApplication]
$creadList :: ReadS [DescribeApplication]
readsPrec :: Int -> ReadS DescribeApplication
$creadsPrec :: Int -> ReadS DescribeApplication
Prelude.Read, Int -> DescribeApplication -> ShowS
[DescribeApplication] -> ShowS
DescribeApplication -> String
(Int -> DescribeApplication -> ShowS)
-> (DescribeApplication -> String)
-> ([DescribeApplication] -> ShowS)
-> Show DescribeApplication
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeApplication] -> ShowS
$cshowList :: [DescribeApplication] -> ShowS
show :: DescribeApplication -> String
$cshow :: DescribeApplication -> String
showsPrec :: Int -> DescribeApplication -> ShowS
$cshowsPrec :: Int -> DescribeApplication -> ShowS
Prelude.Show, (forall x. DescribeApplication -> Rep DescribeApplication x)
-> (forall x. Rep DescribeApplication x -> DescribeApplication)
-> Generic DescribeApplication
forall x. Rep DescribeApplication x -> DescribeApplication
forall x. DescribeApplication -> Rep DescribeApplication x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeApplication x -> DescribeApplication
$cfrom :: forall x. DescribeApplication -> Rep DescribeApplication x
Prelude.Generic)
newDescribeApplication ::
Prelude.Text ->
DescribeApplication
newDescribeApplication :: Text -> DescribeApplication
newDescribeApplication Text
pApplicationName_ =
DescribeApplication' :: Maybe Bool -> Text -> DescribeApplication
DescribeApplication'
{ $sel:includeAdditionalDetails:DescribeApplication' :: Maybe Bool
includeAdditionalDetails =
Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:applicationName:DescribeApplication' :: Text
applicationName = Text
pApplicationName_
}
describeApplication_includeAdditionalDetails :: Lens.Lens' DescribeApplication (Prelude.Maybe Prelude.Bool)
describeApplication_includeAdditionalDetails :: (Maybe Bool -> f (Maybe Bool))
-> DescribeApplication -> f DescribeApplication
describeApplication_includeAdditionalDetails = (DescribeApplication -> Maybe Bool)
-> (DescribeApplication -> Maybe Bool -> DescribeApplication)
-> Lens
DescribeApplication DescribeApplication (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeApplication' {Maybe Bool
includeAdditionalDetails :: Maybe Bool
$sel:includeAdditionalDetails:DescribeApplication' :: DescribeApplication -> Maybe Bool
includeAdditionalDetails} -> Maybe Bool
includeAdditionalDetails) (\s :: DescribeApplication
s@DescribeApplication' {} Maybe Bool
a -> DescribeApplication
s {$sel:includeAdditionalDetails:DescribeApplication' :: Maybe Bool
includeAdditionalDetails = Maybe Bool
a} :: DescribeApplication)
describeApplication_applicationName :: Lens.Lens' DescribeApplication Prelude.Text
describeApplication_applicationName :: (Text -> f Text) -> DescribeApplication -> f DescribeApplication
describeApplication_applicationName = (DescribeApplication -> Text)
-> (DescribeApplication -> Text -> DescribeApplication)
-> Lens DescribeApplication DescribeApplication Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeApplication' {Text
applicationName :: Text
$sel:applicationName:DescribeApplication' :: DescribeApplication -> Text
applicationName} -> Text
applicationName) (\s :: DescribeApplication
s@DescribeApplication' {} Text
a -> DescribeApplication
s {$sel:applicationName:DescribeApplication' :: Text
applicationName = Text
a} :: DescribeApplication)
instance Core.AWSRequest DescribeApplication where
type
AWSResponse DescribeApplication =
DescribeApplicationResponse
request :: DescribeApplication -> Request DescribeApplication
request = Service -> DescribeApplication -> Request DescribeApplication
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DescribeApplication
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeApplication)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DescribeApplication))
-> Logger
-> Service
-> Proxy DescribeApplication
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeApplication)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Int -> ApplicationDetail -> DescribeApplicationResponse
DescribeApplicationResponse'
(Int -> ApplicationDetail -> DescribeApplicationResponse)
-> Either String Int
-> Either String (ApplicationDetail -> DescribeApplicationResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
Either String (ApplicationDetail -> DescribeApplicationResponse)
-> Either String ApplicationDetail
-> Either String DescribeApplicationResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String ApplicationDetail
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"ApplicationDetail")
)
instance Prelude.Hashable DescribeApplication
instance Prelude.NFData DescribeApplication
instance Core.ToHeaders DescribeApplication where
toHeaders :: DescribeApplication -> ResponseHeaders
toHeaders =
ResponseHeaders -> DescribeApplication -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"KinesisAnalytics_20180523.DescribeApplication" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON DescribeApplication where
toJSON :: DescribeApplication -> Value
toJSON DescribeApplication' {Maybe Bool
Text
applicationName :: Text
includeAdditionalDetails :: Maybe Bool
$sel:applicationName:DescribeApplication' :: DescribeApplication -> Text
$sel:includeAdditionalDetails:DescribeApplication' :: DescribeApplication -> Maybe Bool
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"IncludeAdditionalDetails" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
includeAdditionalDetails,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"ApplicationName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
applicationName)
]
)
instance Core.ToPath DescribeApplication where
toPath :: DescribeApplication -> ByteString
toPath = ByteString -> DescribeApplication -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DescribeApplication where
toQuery :: DescribeApplication -> QueryString
toQuery = QueryString -> DescribeApplication -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DescribeApplicationResponse = DescribeApplicationResponse'
{
DescribeApplicationResponse -> Int
httpStatus :: Prelude.Int,
DescribeApplicationResponse -> ApplicationDetail
applicationDetail :: ApplicationDetail
}
deriving (DescribeApplicationResponse -> DescribeApplicationResponse -> Bool
(DescribeApplicationResponse
-> DescribeApplicationResponse -> Bool)
-> (DescribeApplicationResponse
-> DescribeApplicationResponse -> Bool)
-> Eq DescribeApplicationResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeApplicationResponse -> DescribeApplicationResponse -> Bool
$c/= :: DescribeApplicationResponse -> DescribeApplicationResponse -> Bool
== :: DescribeApplicationResponse -> DescribeApplicationResponse -> Bool
$c== :: DescribeApplicationResponse -> DescribeApplicationResponse -> Bool
Prelude.Eq, ReadPrec [DescribeApplicationResponse]
ReadPrec DescribeApplicationResponse
Int -> ReadS DescribeApplicationResponse
ReadS [DescribeApplicationResponse]
(Int -> ReadS DescribeApplicationResponse)
-> ReadS [DescribeApplicationResponse]
-> ReadPrec DescribeApplicationResponse
-> ReadPrec [DescribeApplicationResponse]
-> Read DescribeApplicationResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeApplicationResponse]
$creadListPrec :: ReadPrec [DescribeApplicationResponse]
readPrec :: ReadPrec DescribeApplicationResponse
$creadPrec :: ReadPrec DescribeApplicationResponse
readList :: ReadS [DescribeApplicationResponse]
$creadList :: ReadS [DescribeApplicationResponse]
readsPrec :: Int -> ReadS DescribeApplicationResponse
$creadsPrec :: Int -> ReadS DescribeApplicationResponse
Prelude.Read, Int -> DescribeApplicationResponse -> ShowS
[DescribeApplicationResponse] -> ShowS
DescribeApplicationResponse -> String
(Int -> DescribeApplicationResponse -> ShowS)
-> (DescribeApplicationResponse -> String)
-> ([DescribeApplicationResponse] -> ShowS)
-> Show DescribeApplicationResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeApplicationResponse] -> ShowS
$cshowList :: [DescribeApplicationResponse] -> ShowS
show :: DescribeApplicationResponse -> String
$cshow :: DescribeApplicationResponse -> String
showsPrec :: Int -> DescribeApplicationResponse -> ShowS
$cshowsPrec :: Int -> DescribeApplicationResponse -> ShowS
Prelude.Show, (forall x.
DescribeApplicationResponse -> Rep DescribeApplicationResponse x)
-> (forall x.
Rep DescribeApplicationResponse x -> DescribeApplicationResponse)
-> Generic DescribeApplicationResponse
forall x.
Rep DescribeApplicationResponse x -> DescribeApplicationResponse
forall x.
DescribeApplicationResponse -> Rep DescribeApplicationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeApplicationResponse x -> DescribeApplicationResponse
$cfrom :: forall x.
DescribeApplicationResponse -> Rep DescribeApplicationResponse x
Prelude.Generic)
newDescribeApplicationResponse ::
Prelude.Int ->
ApplicationDetail ->
DescribeApplicationResponse
newDescribeApplicationResponse :: Int -> ApplicationDetail -> DescribeApplicationResponse
newDescribeApplicationResponse
Int
pHttpStatus_
ApplicationDetail
pApplicationDetail_ =
DescribeApplicationResponse' :: Int -> ApplicationDetail -> DescribeApplicationResponse
DescribeApplicationResponse'
{ $sel:httpStatus:DescribeApplicationResponse' :: Int
httpStatus =
Int
pHttpStatus_,
$sel:applicationDetail:DescribeApplicationResponse' :: ApplicationDetail
applicationDetail = ApplicationDetail
pApplicationDetail_
}
describeApplicationResponse_httpStatus :: Lens.Lens' DescribeApplicationResponse Prelude.Int
describeApplicationResponse_httpStatus :: (Int -> f Int)
-> DescribeApplicationResponse -> f DescribeApplicationResponse
describeApplicationResponse_httpStatus = (DescribeApplicationResponse -> Int)
-> (DescribeApplicationResponse
-> Int -> DescribeApplicationResponse)
-> Lens
DescribeApplicationResponse DescribeApplicationResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeApplicationResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeApplicationResponse' :: DescribeApplicationResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeApplicationResponse
s@DescribeApplicationResponse' {} Int
a -> DescribeApplicationResponse
s {$sel:httpStatus:DescribeApplicationResponse' :: Int
httpStatus = Int
a} :: DescribeApplicationResponse)
describeApplicationResponse_applicationDetail :: Lens.Lens' DescribeApplicationResponse ApplicationDetail
describeApplicationResponse_applicationDetail :: (ApplicationDetail -> f ApplicationDetail)
-> DescribeApplicationResponse -> f DescribeApplicationResponse
describeApplicationResponse_applicationDetail = (DescribeApplicationResponse -> ApplicationDetail)
-> (DescribeApplicationResponse
-> ApplicationDetail -> DescribeApplicationResponse)
-> Lens
DescribeApplicationResponse
DescribeApplicationResponse
ApplicationDetail
ApplicationDetail
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeApplicationResponse' {ApplicationDetail
applicationDetail :: ApplicationDetail
$sel:applicationDetail:DescribeApplicationResponse' :: DescribeApplicationResponse -> ApplicationDetail
applicationDetail} -> ApplicationDetail
applicationDetail) (\s :: DescribeApplicationResponse
s@DescribeApplicationResponse' {} ApplicationDetail
a -> DescribeApplicationResponse
s {$sel:applicationDetail:DescribeApplicationResponse' :: ApplicationDetail
applicationDetail = ApplicationDetail
a} :: DescribeApplicationResponse)
instance Prelude.NFData DescribeApplicationResponse