{-# 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.Route53Domains.ListTagsForDomain
(
ListTagsForDomain (..),
newListTagsForDomain,
listTagsForDomain_domainName,
ListTagsForDomainResponse (..),
newListTagsForDomainResponse,
listTagsForDomainResponse_tagList,
listTagsForDomainResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.Route53Domains.Types
data ListTagsForDomain = ListTagsForDomain'
{
ListTagsForDomain -> Text
domainName :: Prelude.Text
}
deriving (ListTagsForDomain -> ListTagsForDomain -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListTagsForDomain -> ListTagsForDomain -> Bool
$c/= :: ListTagsForDomain -> ListTagsForDomain -> Bool
== :: ListTagsForDomain -> ListTagsForDomain -> Bool
$c== :: ListTagsForDomain -> ListTagsForDomain -> Bool
Prelude.Eq, ReadPrec [ListTagsForDomain]
ReadPrec ListTagsForDomain
Int -> ReadS ListTagsForDomain
ReadS [ListTagsForDomain]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListTagsForDomain]
$creadListPrec :: ReadPrec [ListTagsForDomain]
readPrec :: ReadPrec ListTagsForDomain
$creadPrec :: ReadPrec ListTagsForDomain
readList :: ReadS [ListTagsForDomain]
$creadList :: ReadS [ListTagsForDomain]
readsPrec :: Int -> ReadS ListTagsForDomain
$creadsPrec :: Int -> ReadS ListTagsForDomain
Prelude.Read, Int -> ListTagsForDomain -> ShowS
[ListTagsForDomain] -> ShowS
ListTagsForDomain -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListTagsForDomain] -> ShowS
$cshowList :: [ListTagsForDomain] -> ShowS
show :: ListTagsForDomain -> String
$cshow :: ListTagsForDomain -> String
showsPrec :: Int -> ListTagsForDomain -> ShowS
$cshowsPrec :: Int -> ListTagsForDomain -> ShowS
Prelude.Show, forall x. Rep ListTagsForDomain x -> ListTagsForDomain
forall x. ListTagsForDomain -> Rep ListTagsForDomain x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListTagsForDomain x -> ListTagsForDomain
$cfrom :: forall x. ListTagsForDomain -> Rep ListTagsForDomain x
Prelude.Generic)
newListTagsForDomain ::
Prelude.Text ->
ListTagsForDomain
newListTagsForDomain :: Text -> ListTagsForDomain
newListTagsForDomain Text
pDomainName_ =
ListTagsForDomain' {$sel:domainName:ListTagsForDomain' :: Text
domainName = Text
pDomainName_}
listTagsForDomain_domainName :: Lens.Lens' ListTagsForDomain Prelude.Text
listTagsForDomain_domainName :: Lens' ListTagsForDomain Text
listTagsForDomain_domainName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTagsForDomain' {Text
domainName :: Text
$sel:domainName:ListTagsForDomain' :: ListTagsForDomain -> Text
domainName} -> Text
domainName) (\s :: ListTagsForDomain
s@ListTagsForDomain' {} Text
a -> ListTagsForDomain
s {$sel:domainName:ListTagsForDomain' :: Text
domainName = Text
a} :: ListTagsForDomain)
instance Core.AWSRequest ListTagsForDomain where
type
AWSResponse ListTagsForDomain =
ListTagsForDomainResponse
request :: (Service -> Service)
-> ListTagsForDomain -> Request ListTagsForDomain
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 ListTagsForDomain
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ListTagsForDomain)))
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 [Tag] -> Int -> ListTagsForDomainResponse
ListTagsForDomainResponse'
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
"TagList" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
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 ListTagsForDomain where
hashWithSalt :: Int -> ListTagsForDomain -> Int
hashWithSalt Int
_salt ListTagsForDomain' {Text
domainName :: Text
$sel:domainName:ListTagsForDomain' :: ListTagsForDomain -> Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
domainName
instance Prelude.NFData ListTagsForDomain where
rnf :: ListTagsForDomain -> ()
rnf ListTagsForDomain' {Text
domainName :: Text
$sel:domainName:ListTagsForDomain' :: ListTagsForDomain -> Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Text
domainName
instance Data.ToHeaders ListTagsForDomain where
toHeaders :: ListTagsForDomain -> 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
"Route53Domains_v20140515.ListTagsForDomain" ::
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 ListTagsForDomain where
toJSON :: ListTagsForDomain -> Value
toJSON ListTagsForDomain' {Text
domainName :: Text
$sel:domainName:ListTagsForDomain' :: ListTagsForDomain -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[forall a. a -> Maybe a
Prelude.Just (Key
"DomainName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
domainName)]
)
instance Data.ToPath ListTagsForDomain where
toPath :: ListTagsForDomain -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery ListTagsForDomain where
toQuery :: ListTagsForDomain -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data ListTagsForDomainResponse = ListTagsForDomainResponse'
{
ListTagsForDomainResponse -> Maybe [Tag]
tagList :: Prelude.Maybe [Tag],
ListTagsForDomainResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ListTagsForDomainResponse -> ListTagsForDomainResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListTagsForDomainResponse -> ListTagsForDomainResponse -> Bool
$c/= :: ListTagsForDomainResponse -> ListTagsForDomainResponse -> Bool
== :: ListTagsForDomainResponse -> ListTagsForDomainResponse -> Bool
$c== :: ListTagsForDomainResponse -> ListTagsForDomainResponse -> Bool
Prelude.Eq, ReadPrec [ListTagsForDomainResponse]
ReadPrec ListTagsForDomainResponse
Int -> ReadS ListTagsForDomainResponse
ReadS [ListTagsForDomainResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListTagsForDomainResponse]
$creadListPrec :: ReadPrec [ListTagsForDomainResponse]
readPrec :: ReadPrec ListTagsForDomainResponse
$creadPrec :: ReadPrec ListTagsForDomainResponse
readList :: ReadS [ListTagsForDomainResponse]
$creadList :: ReadS [ListTagsForDomainResponse]
readsPrec :: Int -> ReadS ListTagsForDomainResponse
$creadsPrec :: Int -> ReadS ListTagsForDomainResponse
Prelude.Read, Int -> ListTagsForDomainResponse -> ShowS
[ListTagsForDomainResponse] -> ShowS
ListTagsForDomainResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListTagsForDomainResponse] -> ShowS
$cshowList :: [ListTagsForDomainResponse] -> ShowS
show :: ListTagsForDomainResponse -> String
$cshow :: ListTagsForDomainResponse -> String
showsPrec :: Int -> ListTagsForDomainResponse -> ShowS
$cshowsPrec :: Int -> ListTagsForDomainResponse -> ShowS
Prelude.Show, forall x.
Rep ListTagsForDomainResponse x -> ListTagsForDomainResponse
forall x.
ListTagsForDomainResponse -> Rep ListTagsForDomainResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListTagsForDomainResponse x -> ListTagsForDomainResponse
$cfrom :: forall x.
ListTagsForDomainResponse -> Rep ListTagsForDomainResponse x
Prelude.Generic)
newListTagsForDomainResponse ::
Prelude.Int ->
ListTagsForDomainResponse
newListTagsForDomainResponse :: Int -> ListTagsForDomainResponse
newListTagsForDomainResponse Int
pHttpStatus_ =
ListTagsForDomainResponse'
{ $sel:tagList:ListTagsForDomainResponse' :: Maybe [Tag]
tagList =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListTagsForDomainResponse' :: Int
httpStatus = Int
pHttpStatus_
}
listTagsForDomainResponse_tagList :: Lens.Lens' ListTagsForDomainResponse (Prelude.Maybe [Tag])
listTagsForDomainResponse_tagList :: Lens' ListTagsForDomainResponse (Maybe [Tag])
listTagsForDomainResponse_tagList = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTagsForDomainResponse' {Maybe [Tag]
tagList :: Maybe [Tag]
$sel:tagList:ListTagsForDomainResponse' :: ListTagsForDomainResponse -> Maybe [Tag]
tagList} -> Maybe [Tag]
tagList) (\s :: ListTagsForDomainResponse
s@ListTagsForDomainResponse' {} Maybe [Tag]
a -> ListTagsForDomainResponse
s {$sel:tagList:ListTagsForDomainResponse' :: Maybe [Tag]
tagList = Maybe [Tag]
a} :: ListTagsForDomainResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
listTagsForDomainResponse_httpStatus :: Lens.Lens' ListTagsForDomainResponse Prelude.Int
listTagsForDomainResponse_httpStatus :: Lens' ListTagsForDomainResponse Int
listTagsForDomainResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTagsForDomainResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListTagsForDomainResponse' :: ListTagsForDomainResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListTagsForDomainResponse
s@ListTagsForDomainResponse' {} Int
a -> ListTagsForDomainResponse
s {$sel:httpStatus:ListTagsForDomainResponse' :: Int
httpStatus = Int
a} :: ListTagsForDomainResponse)
instance Prelude.NFData ListTagsForDomainResponse where
rnf :: ListTagsForDomainResponse -> ()
rnf ListTagsForDomainResponse' {Int
Maybe [Tag]
httpStatus :: Int
tagList :: Maybe [Tag]
$sel:httpStatus:ListTagsForDomainResponse' :: ListTagsForDomainResponse -> Int
$sel:tagList:ListTagsForDomainResponse' :: ListTagsForDomainResponse -> Maybe [Tag]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [Tag]
tagList
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus