{-# 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.Route53.DeleteHostedZone
(
DeleteHostedZone (..),
newDeleteHostedZone,
deleteHostedZone_id,
DeleteHostedZoneResponse (..),
newDeleteHostedZoneResponse,
deleteHostedZoneResponse_httpStatus,
deleteHostedZoneResponse_changeInfo,
)
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.Route53.Types
data DeleteHostedZone = DeleteHostedZone'
{
DeleteHostedZone -> ResourceId
id :: ResourceId
}
deriving (DeleteHostedZone -> DeleteHostedZone -> Bool
(DeleteHostedZone -> DeleteHostedZone -> Bool)
-> (DeleteHostedZone -> DeleteHostedZone -> Bool)
-> Eq DeleteHostedZone
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteHostedZone -> DeleteHostedZone -> Bool
$c/= :: DeleteHostedZone -> DeleteHostedZone -> Bool
== :: DeleteHostedZone -> DeleteHostedZone -> Bool
$c== :: DeleteHostedZone -> DeleteHostedZone -> Bool
Prelude.Eq, ReadPrec [DeleteHostedZone]
ReadPrec DeleteHostedZone
Int -> ReadS DeleteHostedZone
ReadS [DeleteHostedZone]
(Int -> ReadS DeleteHostedZone)
-> ReadS [DeleteHostedZone]
-> ReadPrec DeleteHostedZone
-> ReadPrec [DeleteHostedZone]
-> Read DeleteHostedZone
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteHostedZone]
$creadListPrec :: ReadPrec [DeleteHostedZone]
readPrec :: ReadPrec DeleteHostedZone
$creadPrec :: ReadPrec DeleteHostedZone
readList :: ReadS [DeleteHostedZone]
$creadList :: ReadS [DeleteHostedZone]
readsPrec :: Int -> ReadS DeleteHostedZone
$creadsPrec :: Int -> ReadS DeleteHostedZone
Prelude.Read, Int -> DeleteHostedZone -> ShowS
[DeleteHostedZone] -> ShowS
DeleteHostedZone -> String
(Int -> DeleteHostedZone -> ShowS)
-> (DeleteHostedZone -> String)
-> ([DeleteHostedZone] -> ShowS)
-> Show DeleteHostedZone
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteHostedZone] -> ShowS
$cshowList :: [DeleteHostedZone] -> ShowS
show :: DeleteHostedZone -> String
$cshow :: DeleteHostedZone -> String
showsPrec :: Int -> DeleteHostedZone -> ShowS
$cshowsPrec :: Int -> DeleteHostedZone -> ShowS
Prelude.Show, (forall x. DeleteHostedZone -> Rep DeleteHostedZone x)
-> (forall x. Rep DeleteHostedZone x -> DeleteHostedZone)
-> Generic DeleteHostedZone
forall x. Rep DeleteHostedZone x -> DeleteHostedZone
forall x. DeleteHostedZone -> Rep DeleteHostedZone x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteHostedZone x -> DeleteHostedZone
$cfrom :: forall x. DeleteHostedZone -> Rep DeleteHostedZone x
Prelude.Generic)
newDeleteHostedZone ::
ResourceId ->
DeleteHostedZone
newDeleteHostedZone :: ResourceId -> DeleteHostedZone
newDeleteHostedZone ResourceId
pId_ =
DeleteHostedZone' :: ResourceId -> DeleteHostedZone
DeleteHostedZone' {$sel:id:DeleteHostedZone' :: ResourceId
id = ResourceId
pId_}
deleteHostedZone_id :: Lens.Lens' DeleteHostedZone ResourceId
deleteHostedZone_id :: (ResourceId -> f ResourceId)
-> DeleteHostedZone -> f DeleteHostedZone
deleteHostedZone_id = (DeleteHostedZone -> ResourceId)
-> (DeleteHostedZone -> ResourceId -> DeleteHostedZone)
-> Lens DeleteHostedZone DeleteHostedZone ResourceId ResourceId
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteHostedZone' {ResourceId
id :: ResourceId
$sel:id:DeleteHostedZone' :: DeleteHostedZone -> ResourceId
id} -> ResourceId
id) (\s :: DeleteHostedZone
s@DeleteHostedZone' {} ResourceId
a -> DeleteHostedZone
s {$sel:id:DeleteHostedZone' :: ResourceId
id = ResourceId
a} :: DeleteHostedZone)
instance Core.AWSRequest DeleteHostedZone where
type
AWSResponse DeleteHostedZone =
DeleteHostedZoneResponse
request :: DeleteHostedZone -> Request DeleteHostedZone
request = Service -> DeleteHostedZone -> Request DeleteHostedZone
forall a. ToRequest a => Service -> a -> Request a
Request.delete Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteHostedZone
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteHostedZone)))
response =
(Int
-> ResponseHeaders
-> [Node]
-> Either String (AWSResponse DeleteHostedZone))
-> Logger
-> Service
-> Proxy DeleteHostedZone
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteHostedZone)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXML
( \Int
s ResponseHeaders
h [Node]
x ->
Int -> ChangeInfo -> DeleteHostedZoneResponse
DeleteHostedZoneResponse'
(Int -> ChangeInfo -> DeleteHostedZoneResponse)
-> Either String Int
-> Either String (ChangeInfo -> DeleteHostedZoneResponse)
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 (ChangeInfo -> DeleteHostedZoneResponse)
-> Either String ChangeInfo
-> Either String DeleteHostedZoneResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String ChangeInfo
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"ChangeInfo")
)
instance Prelude.Hashable DeleteHostedZone
instance Prelude.NFData DeleteHostedZone
instance Core.ToHeaders DeleteHostedZone where
toHeaders :: DeleteHostedZone -> ResponseHeaders
toHeaders = ResponseHeaders -> DeleteHostedZone -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath DeleteHostedZone where
toPath :: DeleteHostedZone -> ByteString
toPath DeleteHostedZone' {ResourceId
id :: ResourceId
$sel:id:DeleteHostedZone' :: DeleteHostedZone -> ResourceId
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/2013-04-01/hostedzone/", ResourceId -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS ResourceId
id]
instance Core.ToQuery DeleteHostedZone where
toQuery :: DeleteHostedZone -> QueryString
toQuery = QueryString -> DeleteHostedZone -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DeleteHostedZoneResponse = DeleteHostedZoneResponse'
{
DeleteHostedZoneResponse -> Int
httpStatus :: Prelude.Int,
DeleteHostedZoneResponse -> ChangeInfo
changeInfo :: ChangeInfo
}
deriving (DeleteHostedZoneResponse -> DeleteHostedZoneResponse -> Bool
(DeleteHostedZoneResponse -> DeleteHostedZoneResponse -> Bool)
-> (DeleteHostedZoneResponse -> DeleteHostedZoneResponse -> Bool)
-> Eq DeleteHostedZoneResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteHostedZoneResponse -> DeleteHostedZoneResponse -> Bool
$c/= :: DeleteHostedZoneResponse -> DeleteHostedZoneResponse -> Bool
== :: DeleteHostedZoneResponse -> DeleteHostedZoneResponse -> Bool
$c== :: DeleteHostedZoneResponse -> DeleteHostedZoneResponse -> Bool
Prelude.Eq, ReadPrec [DeleteHostedZoneResponse]
ReadPrec DeleteHostedZoneResponse
Int -> ReadS DeleteHostedZoneResponse
ReadS [DeleteHostedZoneResponse]
(Int -> ReadS DeleteHostedZoneResponse)
-> ReadS [DeleteHostedZoneResponse]
-> ReadPrec DeleteHostedZoneResponse
-> ReadPrec [DeleteHostedZoneResponse]
-> Read DeleteHostedZoneResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteHostedZoneResponse]
$creadListPrec :: ReadPrec [DeleteHostedZoneResponse]
readPrec :: ReadPrec DeleteHostedZoneResponse
$creadPrec :: ReadPrec DeleteHostedZoneResponse
readList :: ReadS [DeleteHostedZoneResponse]
$creadList :: ReadS [DeleteHostedZoneResponse]
readsPrec :: Int -> ReadS DeleteHostedZoneResponse
$creadsPrec :: Int -> ReadS DeleteHostedZoneResponse
Prelude.Read, Int -> DeleteHostedZoneResponse -> ShowS
[DeleteHostedZoneResponse] -> ShowS
DeleteHostedZoneResponse -> String
(Int -> DeleteHostedZoneResponse -> ShowS)
-> (DeleteHostedZoneResponse -> String)
-> ([DeleteHostedZoneResponse] -> ShowS)
-> Show DeleteHostedZoneResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteHostedZoneResponse] -> ShowS
$cshowList :: [DeleteHostedZoneResponse] -> ShowS
show :: DeleteHostedZoneResponse -> String
$cshow :: DeleteHostedZoneResponse -> String
showsPrec :: Int -> DeleteHostedZoneResponse -> ShowS
$cshowsPrec :: Int -> DeleteHostedZoneResponse -> ShowS
Prelude.Show, (forall x.
DeleteHostedZoneResponse -> Rep DeleteHostedZoneResponse x)
-> (forall x.
Rep DeleteHostedZoneResponse x -> DeleteHostedZoneResponse)
-> Generic DeleteHostedZoneResponse
forall x.
Rep DeleteHostedZoneResponse x -> DeleteHostedZoneResponse
forall x.
DeleteHostedZoneResponse -> Rep DeleteHostedZoneResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteHostedZoneResponse x -> DeleteHostedZoneResponse
$cfrom :: forall x.
DeleteHostedZoneResponse -> Rep DeleteHostedZoneResponse x
Prelude.Generic)
newDeleteHostedZoneResponse ::
Prelude.Int ->
ChangeInfo ->
DeleteHostedZoneResponse
newDeleteHostedZoneResponse :: Int -> ChangeInfo -> DeleteHostedZoneResponse
newDeleteHostedZoneResponse Int
pHttpStatus_ ChangeInfo
pChangeInfo_ =
DeleteHostedZoneResponse' :: Int -> ChangeInfo -> DeleteHostedZoneResponse
DeleteHostedZoneResponse'
{ $sel:httpStatus:DeleteHostedZoneResponse' :: Int
httpStatus =
Int
pHttpStatus_,
$sel:changeInfo:DeleteHostedZoneResponse' :: ChangeInfo
changeInfo = ChangeInfo
pChangeInfo_
}
deleteHostedZoneResponse_httpStatus :: Lens.Lens' DeleteHostedZoneResponse Prelude.Int
deleteHostedZoneResponse_httpStatus :: (Int -> f Int)
-> DeleteHostedZoneResponse -> f DeleteHostedZoneResponse
deleteHostedZoneResponse_httpStatus = (DeleteHostedZoneResponse -> Int)
-> (DeleteHostedZoneResponse -> Int -> DeleteHostedZoneResponse)
-> Lens DeleteHostedZoneResponse DeleteHostedZoneResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteHostedZoneResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteHostedZoneResponse' :: DeleteHostedZoneResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteHostedZoneResponse
s@DeleteHostedZoneResponse' {} Int
a -> DeleteHostedZoneResponse
s {$sel:httpStatus:DeleteHostedZoneResponse' :: Int
httpStatus = Int
a} :: DeleteHostedZoneResponse)
deleteHostedZoneResponse_changeInfo :: Lens.Lens' DeleteHostedZoneResponse ChangeInfo
deleteHostedZoneResponse_changeInfo :: (ChangeInfo -> f ChangeInfo)
-> DeleteHostedZoneResponse -> f DeleteHostedZoneResponse
deleteHostedZoneResponse_changeInfo = (DeleteHostedZoneResponse -> ChangeInfo)
-> (DeleteHostedZoneResponse
-> ChangeInfo -> DeleteHostedZoneResponse)
-> Lens
DeleteHostedZoneResponse
DeleteHostedZoneResponse
ChangeInfo
ChangeInfo
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteHostedZoneResponse' {ChangeInfo
changeInfo :: ChangeInfo
$sel:changeInfo:DeleteHostedZoneResponse' :: DeleteHostedZoneResponse -> ChangeInfo
changeInfo} -> ChangeInfo
changeInfo) (\s :: DeleteHostedZoneResponse
s@DeleteHostedZoneResponse' {} ChangeInfo
a -> DeleteHostedZoneResponse
s {$sel:changeInfo:DeleteHostedZoneResponse' :: ChangeInfo
changeInfo = ChangeInfo
a} :: DeleteHostedZoneResponse)
instance Prelude.NFData DeleteHostedZoneResponse