{-# 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.SWF.DescribeDomain
(
DescribeDomain (..),
newDescribeDomain,
describeDomain_name,
DescribeDomainResponse (..),
newDescribeDomainResponse,
describeDomainResponse_httpStatus,
describeDomainResponse_domainInfo,
describeDomainResponse_configuration,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.SWF.Types
data DescribeDomain = DescribeDomain'
{
DescribeDomain -> Text
name :: Prelude.Text
}
deriving (DescribeDomain -> DescribeDomain -> Bool
(DescribeDomain -> DescribeDomain -> Bool)
-> (DescribeDomain -> DescribeDomain -> Bool) -> Eq DescribeDomain
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeDomain -> DescribeDomain -> Bool
$c/= :: DescribeDomain -> DescribeDomain -> Bool
== :: DescribeDomain -> DescribeDomain -> Bool
$c== :: DescribeDomain -> DescribeDomain -> Bool
Prelude.Eq, ReadPrec [DescribeDomain]
ReadPrec DescribeDomain
Int -> ReadS DescribeDomain
ReadS [DescribeDomain]
(Int -> ReadS DescribeDomain)
-> ReadS [DescribeDomain]
-> ReadPrec DescribeDomain
-> ReadPrec [DescribeDomain]
-> Read DescribeDomain
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeDomain]
$creadListPrec :: ReadPrec [DescribeDomain]
readPrec :: ReadPrec DescribeDomain
$creadPrec :: ReadPrec DescribeDomain
readList :: ReadS [DescribeDomain]
$creadList :: ReadS [DescribeDomain]
readsPrec :: Int -> ReadS DescribeDomain
$creadsPrec :: Int -> ReadS DescribeDomain
Prelude.Read, Int -> DescribeDomain -> ShowS
[DescribeDomain] -> ShowS
DescribeDomain -> String
(Int -> DescribeDomain -> ShowS)
-> (DescribeDomain -> String)
-> ([DescribeDomain] -> ShowS)
-> Show DescribeDomain
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeDomain] -> ShowS
$cshowList :: [DescribeDomain] -> ShowS
show :: DescribeDomain -> String
$cshow :: DescribeDomain -> String
showsPrec :: Int -> DescribeDomain -> ShowS
$cshowsPrec :: Int -> DescribeDomain -> ShowS
Prelude.Show, (forall x. DescribeDomain -> Rep DescribeDomain x)
-> (forall x. Rep DescribeDomain x -> DescribeDomain)
-> Generic DescribeDomain
forall x. Rep DescribeDomain x -> DescribeDomain
forall x. DescribeDomain -> Rep DescribeDomain x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeDomain x -> DescribeDomain
$cfrom :: forall x. DescribeDomain -> Rep DescribeDomain x
Prelude.Generic)
newDescribeDomain ::
Prelude.Text ->
DescribeDomain
newDescribeDomain :: Text -> DescribeDomain
newDescribeDomain Text
pName_ =
DescribeDomain' :: Text -> DescribeDomain
DescribeDomain' {$sel:name:DescribeDomain' :: Text
name = Text
pName_}
describeDomain_name :: Lens.Lens' DescribeDomain Prelude.Text
describeDomain_name :: (Text -> f Text) -> DescribeDomain -> f DescribeDomain
describeDomain_name = (DescribeDomain -> Text)
-> (DescribeDomain -> Text -> DescribeDomain)
-> Lens DescribeDomain DescribeDomain Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDomain' {Text
name :: Text
$sel:name:DescribeDomain' :: DescribeDomain -> Text
name} -> Text
name) (\s :: DescribeDomain
s@DescribeDomain' {} Text
a -> DescribeDomain
s {$sel:name:DescribeDomain' :: Text
name = Text
a} :: DescribeDomain)
instance Core.AWSRequest DescribeDomain where
type
AWSResponse DescribeDomain =
DescribeDomainResponse
request :: DescribeDomain -> Request DescribeDomain
request = Service -> DescribeDomain -> Request DescribeDomain
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DescribeDomain
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DescribeDomain)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DescribeDomain))
-> Logger
-> Service
-> Proxy DescribeDomain
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DescribeDomain)))
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 -> DomainInfo -> DomainConfiguration -> DescribeDomainResponse
DescribeDomainResponse'
(Int
-> DomainInfo -> DomainConfiguration -> DescribeDomainResponse)
-> Either String Int
-> Either
String
(DomainInfo -> DomainConfiguration -> DescribeDomainResponse)
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
(DomainInfo -> DomainConfiguration -> DescribeDomainResponse)
-> Either String DomainInfo
-> Either String (DomainConfiguration -> DescribeDomainResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String DomainInfo
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"domainInfo")
Either String (DomainConfiguration -> DescribeDomainResponse)
-> Either String DomainConfiguration
-> Either String DescribeDomainResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String DomainConfiguration
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"configuration")
)
instance Prelude.Hashable DescribeDomain
instance Prelude.NFData DescribeDomain
instance Core.ToHeaders DescribeDomain where
toHeaders :: DescribeDomain -> ResponseHeaders
toHeaders =
ResponseHeaders -> DescribeDomain -> 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
"SimpleWorkflowService.DescribeDomain" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.0" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON DescribeDomain where
toJSON :: DescribeDomain -> Value
toJSON DescribeDomain' {Text
name :: Text
$sel:name:DescribeDomain' :: DescribeDomain -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
name)]
)
instance Core.ToPath DescribeDomain where
toPath :: DescribeDomain -> ByteString
toPath = ByteString -> DescribeDomain -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DescribeDomain where
toQuery :: DescribeDomain -> QueryString
toQuery = QueryString -> DescribeDomain -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DescribeDomainResponse = DescribeDomainResponse'
{
DescribeDomainResponse -> Int
httpStatus :: Prelude.Int,
DescribeDomainResponse -> DomainInfo
domainInfo :: DomainInfo,
DescribeDomainResponse -> DomainConfiguration
configuration :: DomainConfiguration
}
deriving (DescribeDomainResponse -> DescribeDomainResponse -> Bool
(DescribeDomainResponse -> DescribeDomainResponse -> Bool)
-> (DescribeDomainResponse -> DescribeDomainResponse -> Bool)
-> Eq DescribeDomainResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeDomainResponse -> DescribeDomainResponse -> Bool
$c/= :: DescribeDomainResponse -> DescribeDomainResponse -> Bool
== :: DescribeDomainResponse -> DescribeDomainResponse -> Bool
$c== :: DescribeDomainResponse -> DescribeDomainResponse -> Bool
Prelude.Eq, ReadPrec [DescribeDomainResponse]
ReadPrec DescribeDomainResponse
Int -> ReadS DescribeDomainResponse
ReadS [DescribeDomainResponse]
(Int -> ReadS DescribeDomainResponse)
-> ReadS [DescribeDomainResponse]
-> ReadPrec DescribeDomainResponse
-> ReadPrec [DescribeDomainResponse]
-> Read DescribeDomainResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeDomainResponse]
$creadListPrec :: ReadPrec [DescribeDomainResponse]
readPrec :: ReadPrec DescribeDomainResponse
$creadPrec :: ReadPrec DescribeDomainResponse
readList :: ReadS [DescribeDomainResponse]
$creadList :: ReadS [DescribeDomainResponse]
readsPrec :: Int -> ReadS DescribeDomainResponse
$creadsPrec :: Int -> ReadS DescribeDomainResponse
Prelude.Read, Int -> DescribeDomainResponse -> ShowS
[DescribeDomainResponse] -> ShowS
DescribeDomainResponse -> String
(Int -> DescribeDomainResponse -> ShowS)
-> (DescribeDomainResponse -> String)
-> ([DescribeDomainResponse] -> ShowS)
-> Show DescribeDomainResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeDomainResponse] -> ShowS
$cshowList :: [DescribeDomainResponse] -> ShowS
show :: DescribeDomainResponse -> String
$cshow :: DescribeDomainResponse -> String
showsPrec :: Int -> DescribeDomainResponse -> ShowS
$cshowsPrec :: Int -> DescribeDomainResponse -> ShowS
Prelude.Show, (forall x. DescribeDomainResponse -> Rep DescribeDomainResponse x)
-> (forall x.
Rep DescribeDomainResponse x -> DescribeDomainResponse)
-> Generic DescribeDomainResponse
forall x. Rep DescribeDomainResponse x -> DescribeDomainResponse
forall x. DescribeDomainResponse -> Rep DescribeDomainResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeDomainResponse x -> DescribeDomainResponse
$cfrom :: forall x. DescribeDomainResponse -> Rep DescribeDomainResponse x
Prelude.Generic)
newDescribeDomainResponse ::
Prelude.Int ->
DomainInfo ->
DomainConfiguration ->
DescribeDomainResponse
newDescribeDomainResponse :: Int -> DomainInfo -> DomainConfiguration -> DescribeDomainResponse
newDescribeDomainResponse
Int
pHttpStatus_
DomainInfo
pDomainInfo_
DomainConfiguration
pConfiguration_ =
DescribeDomainResponse' :: Int -> DomainInfo -> DomainConfiguration -> DescribeDomainResponse
DescribeDomainResponse'
{ $sel:httpStatus:DescribeDomainResponse' :: Int
httpStatus = Int
pHttpStatus_,
$sel:domainInfo:DescribeDomainResponse' :: DomainInfo
domainInfo = DomainInfo
pDomainInfo_,
$sel:configuration:DescribeDomainResponse' :: DomainConfiguration
configuration = DomainConfiguration
pConfiguration_
}
describeDomainResponse_httpStatus :: Lens.Lens' DescribeDomainResponse Prelude.Int
describeDomainResponse_httpStatus :: (Int -> f Int)
-> DescribeDomainResponse -> f DescribeDomainResponse
describeDomainResponse_httpStatus = (DescribeDomainResponse -> Int)
-> (DescribeDomainResponse -> Int -> DescribeDomainResponse)
-> Lens DescribeDomainResponse DescribeDomainResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDomainResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeDomainResponse' :: DescribeDomainResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeDomainResponse
s@DescribeDomainResponse' {} Int
a -> DescribeDomainResponse
s {$sel:httpStatus:DescribeDomainResponse' :: Int
httpStatus = Int
a} :: DescribeDomainResponse)
describeDomainResponse_domainInfo :: Lens.Lens' DescribeDomainResponse DomainInfo
describeDomainResponse_domainInfo :: (DomainInfo -> f DomainInfo)
-> DescribeDomainResponse -> f DescribeDomainResponse
describeDomainResponse_domainInfo = (DescribeDomainResponse -> DomainInfo)
-> (DescribeDomainResponse -> DomainInfo -> DescribeDomainResponse)
-> Lens
DescribeDomainResponse DescribeDomainResponse DomainInfo DomainInfo
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDomainResponse' {DomainInfo
domainInfo :: DomainInfo
$sel:domainInfo:DescribeDomainResponse' :: DescribeDomainResponse -> DomainInfo
domainInfo} -> DomainInfo
domainInfo) (\s :: DescribeDomainResponse
s@DescribeDomainResponse' {} DomainInfo
a -> DescribeDomainResponse
s {$sel:domainInfo:DescribeDomainResponse' :: DomainInfo
domainInfo = DomainInfo
a} :: DescribeDomainResponse)
describeDomainResponse_configuration :: Lens.Lens' DescribeDomainResponse DomainConfiguration
describeDomainResponse_configuration :: (DomainConfiguration -> f DomainConfiguration)
-> DescribeDomainResponse -> f DescribeDomainResponse
describeDomainResponse_configuration = (DescribeDomainResponse -> DomainConfiguration)
-> (DescribeDomainResponse
-> DomainConfiguration -> DescribeDomainResponse)
-> Lens
DescribeDomainResponse
DescribeDomainResponse
DomainConfiguration
DomainConfiguration
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDomainResponse' {DomainConfiguration
configuration :: DomainConfiguration
$sel:configuration:DescribeDomainResponse' :: DescribeDomainResponse -> DomainConfiguration
configuration} -> DomainConfiguration
configuration) (\s :: DescribeDomainResponse
s@DescribeDomainResponse' {} DomainConfiguration
a -> DescribeDomainResponse
s {$sel:configuration:DescribeDomainResponse' :: DomainConfiguration
configuration = DomainConfiguration
a} :: DescribeDomainResponse)
instance Prelude.NFData DescribeDomainResponse