{-# 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.DeleteTagsForDomain
(
DeleteTagsForDomain (..),
newDeleteTagsForDomain,
deleteTagsForDomain_domainName,
deleteTagsForDomain_tagsToDelete,
DeleteTagsForDomainResponse (..),
newDeleteTagsForDomainResponse,
deleteTagsForDomainResponse_httpStatus,
)
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.Route53Domains.Types
data DeleteTagsForDomain = DeleteTagsForDomain'
{
DeleteTagsForDomain -> Text
domainName :: Prelude.Text,
DeleteTagsForDomain -> [Text]
tagsToDelete :: [Prelude.Text]
}
deriving (DeleteTagsForDomain -> DeleteTagsForDomain -> Bool
(DeleteTagsForDomain -> DeleteTagsForDomain -> Bool)
-> (DeleteTagsForDomain -> DeleteTagsForDomain -> Bool)
-> Eq DeleteTagsForDomain
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteTagsForDomain -> DeleteTagsForDomain -> Bool
$c/= :: DeleteTagsForDomain -> DeleteTagsForDomain -> Bool
== :: DeleteTagsForDomain -> DeleteTagsForDomain -> Bool
$c== :: DeleteTagsForDomain -> DeleteTagsForDomain -> Bool
Prelude.Eq, ReadPrec [DeleteTagsForDomain]
ReadPrec DeleteTagsForDomain
Int -> ReadS DeleteTagsForDomain
ReadS [DeleteTagsForDomain]
(Int -> ReadS DeleteTagsForDomain)
-> ReadS [DeleteTagsForDomain]
-> ReadPrec DeleteTagsForDomain
-> ReadPrec [DeleteTagsForDomain]
-> Read DeleteTagsForDomain
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteTagsForDomain]
$creadListPrec :: ReadPrec [DeleteTagsForDomain]
readPrec :: ReadPrec DeleteTagsForDomain
$creadPrec :: ReadPrec DeleteTagsForDomain
readList :: ReadS [DeleteTagsForDomain]
$creadList :: ReadS [DeleteTagsForDomain]
readsPrec :: Int -> ReadS DeleteTagsForDomain
$creadsPrec :: Int -> ReadS DeleteTagsForDomain
Prelude.Read, Int -> DeleteTagsForDomain -> ShowS
[DeleteTagsForDomain] -> ShowS
DeleteTagsForDomain -> String
(Int -> DeleteTagsForDomain -> ShowS)
-> (DeleteTagsForDomain -> String)
-> ([DeleteTagsForDomain] -> ShowS)
-> Show DeleteTagsForDomain
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteTagsForDomain] -> ShowS
$cshowList :: [DeleteTagsForDomain] -> ShowS
show :: DeleteTagsForDomain -> String
$cshow :: DeleteTagsForDomain -> String
showsPrec :: Int -> DeleteTagsForDomain -> ShowS
$cshowsPrec :: Int -> DeleteTagsForDomain -> ShowS
Prelude.Show, (forall x. DeleteTagsForDomain -> Rep DeleteTagsForDomain x)
-> (forall x. Rep DeleteTagsForDomain x -> DeleteTagsForDomain)
-> Generic DeleteTagsForDomain
forall x. Rep DeleteTagsForDomain x -> DeleteTagsForDomain
forall x. DeleteTagsForDomain -> Rep DeleteTagsForDomain x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteTagsForDomain x -> DeleteTagsForDomain
$cfrom :: forall x. DeleteTagsForDomain -> Rep DeleteTagsForDomain x
Prelude.Generic)
newDeleteTagsForDomain ::
Prelude.Text ->
DeleteTagsForDomain
newDeleteTagsForDomain :: Text -> DeleteTagsForDomain
newDeleteTagsForDomain Text
pDomainName_ =
DeleteTagsForDomain' :: Text -> [Text] -> DeleteTagsForDomain
DeleteTagsForDomain'
{ $sel:domainName:DeleteTagsForDomain' :: Text
domainName = Text
pDomainName_,
$sel:tagsToDelete:DeleteTagsForDomain' :: [Text]
tagsToDelete = [Text]
forall a. Monoid a => a
Prelude.mempty
}
deleteTagsForDomain_domainName :: Lens.Lens' DeleteTagsForDomain Prelude.Text
deleteTagsForDomain_domainName :: (Text -> f Text) -> DeleteTagsForDomain -> f DeleteTagsForDomain
deleteTagsForDomain_domainName = (DeleteTagsForDomain -> Text)
-> (DeleteTagsForDomain -> Text -> DeleteTagsForDomain)
-> Lens DeleteTagsForDomain DeleteTagsForDomain Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteTagsForDomain' {Text
domainName :: Text
$sel:domainName:DeleteTagsForDomain' :: DeleteTagsForDomain -> Text
domainName} -> Text
domainName) (\s :: DeleteTagsForDomain
s@DeleteTagsForDomain' {} Text
a -> DeleteTagsForDomain
s {$sel:domainName:DeleteTagsForDomain' :: Text
domainName = Text
a} :: DeleteTagsForDomain)
deleteTagsForDomain_tagsToDelete :: Lens.Lens' DeleteTagsForDomain [Prelude.Text]
deleteTagsForDomain_tagsToDelete :: ([Text] -> f [Text])
-> DeleteTagsForDomain -> f DeleteTagsForDomain
deleteTagsForDomain_tagsToDelete = (DeleteTagsForDomain -> [Text])
-> (DeleteTagsForDomain -> [Text] -> DeleteTagsForDomain)
-> Lens DeleteTagsForDomain DeleteTagsForDomain [Text] [Text]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteTagsForDomain' {[Text]
tagsToDelete :: [Text]
$sel:tagsToDelete:DeleteTagsForDomain' :: DeleteTagsForDomain -> [Text]
tagsToDelete} -> [Text]
tagsToDelete) (\s :: DeleteTagsForDomain
s@DeleteTagsForDomain' {} [Text]
a -> DeleteTagsForDomain
s {$sel:tagsToDelete:DeleteTagsForDomain' :: [Text]
tagsToDelete = [Text]
a} :: DeleteTagsForDomain) (([Text] -> f [Text])
-> DeleteTagsForDomain -> f DeleteTagsForDomain)
-> (([Text] -> f [Text]) -> [Text] -> f [Text])
-> ([Text] -> f [Text])
-> DeleteTagsForDomain
-> f DeleteTagsForDomain
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Text] -> f [Text]) -> [Text] -> f [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.AWSRequest DeleteTagsForDomain where
type
AWSResponse DeleteTagsForDomain =
DeleteTagsForDomainResponse
request :: DeleteTagsForDomain -> Request DeleteTagsForDomain
request = Service -> DeleteTagsForDomain -> Request DeleteTagsForDomain
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteTagsForDomain
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteTagsForDomain)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse DeleteTagsForDomain))
-> Logger
-> Service
-> Proxy DeleteTagsForDomain
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteTagsForDomain)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
( \Int
s ResponseHeaders
h ()
x ->
Int -> DeleteTagsForDomainResponse
DeleteTagsForDomainResponse'
(Int -> DeleteTagsForDomainResponse)
-> Either String Int -> Either String DeleteTagsForDomainResponse
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))
)
instance Prelude.Hashable DeleteTagsForDomain
instance Prelude.NFData DeleteTagsForDomain
instance Core.ToHeaders DeleteTagsForDomain where
toHeaders :: DeleteTagsForDomain -> ResponseHeaders
toHeaders =
ResponseHeaders -> DeleteTagsForDomain -> 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
"Route53Domains_v20140515.DeleteTagsForDomain" ::
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 DeleteTagsForDomain where
toJSON :: DeleteTagsForDomain -> Value
toJSON DeleteTagsForDomain' {[Text]
Text
tagsToDelete :: [Text]
domainName :: Text
$sel:tagsToDelete:DeleteTagsForDomain' :: DeleteTagsForDomain -> [Text]
$sel:domainName:DeleteTagsForDomain' :: DeleteTagsForDomain -> 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
"DomainName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
domainName),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"TagsToDelete" Text -> [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= [Text]
tagsToDelete)
]
)
instance Core.ToPath DeleteTagsForDomain where
toPath :: DeleteTagsForDomain -> ByteString
toPath = ByteString -> DeleteTagsForDomain -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DeleteTagsForDomain where
toQuery :: DeleteTagsForDomain -> QueryString
toQuery = QueryString -> DeleteTagsForDomain -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DeleteTagsForDomainResponse = DeleteTagsForDomainResponse'
{
DeleteTagsForDomainResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteTagsForDomainResponse -> DeleteTagsForDomainResponse -> Bool
(DeleteTagsForDomainResponse
-> DeleteTagsForDomainResponse -> Bool)
-> (DeleteTagsForDomainResponse
-> DeleteTagsForDomainResponse -> Bool)
-> Eq DeleteTagsForDomainResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteTagsForDomainResponse -> DeleteTagsForDomainResponse -> Bool
$c/= :: DeleteTagsForDomainResponse -> DeleteTagsForDomainResponse -> Bool
== :: DeleteTagsForDomainResponse -> DeleteTagsForDomainResponse -> Bool
$c== :: DeleteTagsForDomainResponse -> DeleteTagsForDomainResponse -> Bool
Prelude.Eq, ReadPrec [DeleteTagsForDomainResponse]
ReadPrec DeleteTagsForDomainResponse
Int -> ReadS DeleteTagsForDomainResponse
ReadS [DeleteTagsForDomainResponse]
(Int -> ReadS DeleteTagsForDomainResponse)
-> ReadS [DeleteTagsForDomainResponse]
-> ReadPrec DeleteTagsForDomainResponse
-> ReadPrec [DeleteTagsForDomainResponse]
-> Read DeleteTagsForDomainResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteTagsForDomainResponse]
$creadListPrec :: ReadPrec [DeleteTagsForDomainResponse]
readPrec :: ReadPrec DeleteTagsForDomainResponse
$creadPrec :: ReadPrec DeleteTagsForDomainResponse
readList :: ReadS [DeleteTagsForDomainResponse]
$creadList :: ReadS [DeleteTagsForDomainResponse]
readsPrec :: Int -> ReadS DeleteTagsForDomainResponse
$creadsPrec :: Int -> ReadS DeleteTagsForDomainResponse
Prelude.Read, Int -> DeleteTagsForDomainResponse -> ShowS
[DeleteTagsForDomainResponse] -> ShowS
DeleteTagsForDomainResponse -> String
(Int -> DeleteTagsForDomainResponse -> ShowS)
-> (DeleteTagsForDomainResponse -> String)
-> ([DeleteTagsForDomainResponse] -> ShowS)
-> Show DeleteTagsForDomainResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteTagsForDomainResponse] -> ShowS
$cshowList :: [DeleteTagsForDomainResponse] -> ShowS
show :: DeleteTagsForDomainResponse -> String
$cshow :: DeleteTagsForDomainResponse -> String
showsPrec :: Int -> DeleteTagsForDomainResponse -> ShowS
$cshowsPrec :: Int -> DeleteTagsForDomainResponse -> ShowS
Prelude.Show, (forall x.
DeleteTagsForDomainResponse -> Rep DeleteTagsForDomainResponse x)
-> (forall x.
Rep DeleteTagsForDomainResponse x -> DeleteTagsForDomainResponse)
-> Generic DeleteTagsForDomainResponse
forall x.
Rep DeleteTagsForDomainResponse x -> DeleteTagsForDomainResponse
forall x.
DeleteTagsForDomainResponse -> Rep DeleteTagsForDomainResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteTagsForDomainResponse x -> DeleteTagsForDomainResponse
$cfrom :: forall x.
DeleteTagsForDomainResponse -> Rep DeleteTagsForDomainResponse x
Prelude.Generic)
newDeleteTagsForDomainResponse ::
Prelude.Int ->
DeleteTagsForDomainResponse
newDeleteTagsForDomainResponse :: Int -> DeleteTagsForDomainResponse
newDeleteTagsForDomainResponse Int
pHttpStatus_ =
DeleteTagsForDomainResponse' :: Int -> DeleteTagsForDomainResponse
DeleteTagsForDomainResponse'
{ $sel:httpStatus:DeleteTagsForDomainResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
deleteTagsForDomainResponse_httpStatus :: Lens.Lens' DeleteTagsForDomainResponse Prelude.Int
deleteTagsForDomainResponse_httpStatus :: (Int -> f Int)
-> DeleteTagsForDomainResponse -> f DeleteTagsForDomainResponse
deleteTagsForDomainResponse_httpStatus = (DeleteTagsForDomainResponse -> Int)
-> (DeleteTagsForDomainResponse
-> Int -> DeleteTagsForDomainResponse)
-> Lens
DeleteTagsForDomainResponse DeleteTagsForDomainResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteTagsForDomainResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteTagsForDomainResponse' :: DeleteTagsForDomainResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteTagsForDomainResponse
s@DeleteTagsForDomainResponse' {} Int
a -> DeleteTagsForDomainResponse
s {$sel:httpStatus:DeleteTagsForDomainResponse' :: Int
httpStatus = Int
a} :: DeleteTagsForDomainResponse)
instance Prelude.NFData DeleteTagsForDomainResponse