{-# 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.GetHostedZone
(
GetHostedZone (..),
newGetHostedZone,
getHostedZone_id,
GetHostedZoneResponse (..),
newGetHostedZoneResponse,
getHostedZoneResponse_vPCs,
getHostedZoneResponse_delegationSet,
getHostedZoneResponse_httpStatus,
getHostedZoneResponse_hostedZone,
)
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 GetHostedZone = GetHostedZone'
{
GetHostedZone -> ResourceId
id :: ResourceId
}
deriving (GetHostedZone -> GetHostedZone -> Bool
(GetHostedZone -> GetHostedZone -> Bool)
-> (GetHostedZone -> GetHostedZone -> Bool) -> Eq GetHostedZone
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetHostedZone -> GetHostedZone -> Bool
$c/= :: GetHostedZone -> GetHostedZone -> Bool
== :: GetHostedZone -> GetHostedZone -> Bool
$c== :: GetHostedZone -> GetHostedZone -> Bool
Prelude.Eq, ReadPrec [GetHostedZone]
ReadPrec GetHostedZone
Int -> ReadS GetHostedZone
ReadS [GetHostedZone]
(Int -> ReadS GetHostedZone)
-> ReadS [GetHostedZone]
-> ReadPrec GetHostedZone
-> ReadPrec [GetHostedZone]
-> Read GetHostedZone
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetHostedZone]
$creadListPrec :: ReadPrec [GetHostedZone]
readPrec :: ReadPrec GetHostedZone
$creadPrec :: ReadPrec GetHostedZone
readList :: ReadS [GetHostedZone]
$creadList :: ReadS [GetHostedZone]
readsPrec :: Int -> ReadS GetHostedZone
$creadsPrec :: Int -> ReadS GetHostedZone
Prelude.Read, Int -> GetHostedZone -> ShowS
[GetHostedZone] -> ShowS
GetHostedZone -> String
(Int -> GetHostedZone -> ShowS)
-> (GetHostedZone -> String)
-> ([GetHostedZone] -> ShowS)
-> Show GetHostedZone
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetHostedZone] -> ShowS
$cshowList :: [GetHostedZone] -> ShowS
show :: GetHostedZone -> String
$cshow :: GetHostedZone -> String
showsPrec :: Int -> GetHostedZone -> ShowS
$cshowsPrec :: Int -> GetHostedZone -> ShowS
Prelude.Show, (forall x. GetHostedZone -> Rep GetHostedZone x)
-> (forall x. Rep GetHostedZone x -> GetHostedZone)
-> Generic GetHostedZone
forall x. Rep GetHostedZone x -> GetHostedZone
forall x. GetHostedZone -> Rep GetHostedZone x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetHostedZone x -> GetHostedZone
$cfrom :: forall x. GetHostedZone -> Rep GetHostedZone x
Prelude.Generic)
newGetHostedZone ::
ResourceId ->
GetHostedZone
newGetHostedZone :: ResourceId -> GetHostedZone
newGetHostedZone ResourceId
pId_ = GetHostedZone' :: ResourceId -> GetHostedZone
GetHostedZone' {$sel:id:GetHostedZone' :: ResourceId
id = ResourceId
pId_}
getHostedZone_id :: Lens.Lens' GetHostedZone ResourceId
getHostedZone_id :: (ResourceId -> f ResourceId) -> GetHostedZone -> f GetHostedZone
getHostedZone_id = (GetHostedZone -> ResourceId)
-> (GetHostedZone -> ResourceId -> GetHostedZone)
-> Lens GetHostedZone GetHostedZone ResourceId ResourceId
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetHostedZone' {ResourceId
id :: ResourceId
$sel:id:GetHostedZone' :: GetHostedZone -> ResourceId
id} -> ResourceId
id) (\s :: GetHostedZone
s@GetHostedZone' {} ResourceId
a -> GetHostedZone
s {$sel:id:GetHostedZone' :: ResourceId
id = ResourceId
a} :: GetHostedZone)
instance Core.AWSRequest GetHostedZone where
type
AWSResponse GetHostedZone =
GetHostedZoneResponse
request :: GetHostedZone -> Request GetHostedZone
request = Service -> GetHostedZone -> Request GetHostedZone
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
response :: Logger
-> Service
-> Proxy GetHostedZone
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetHostedZone)))
response =
(Int
-> ResponseHeaders
-> [Node]
-> Either String (AWSResponse GetHostedZone))
-> Logger
-> Service
-> Proxy GetHostedZone
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetHostedZone)))
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 ->
Maybe (NonEmpty VPC)
-> Maybe DelegationSet
-> Int
-> HostedZone
-> GetHostedZoneResponse
GetHostedZoneResponse'
(Maybe (NonEmpty VPC)
-> Maybe DelegationSet
-> Int
-> HostedZone
-> GetHostedZoneResponse)
-> Either String (Maybe (NonEmpty VPC))
-> Either
String
(Maybe DelegationSet -> Int -> HostedZone -> GetHostedZoneResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( [Node]
x [Node] -> Text -> Either String (Maybe [Node])
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"VPCs" Either String (Maybe [Node]) -> [Node] -> Either String [Node]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [Node]
forall a. Monoid a => a
Prelude.mempty
Either String [Node]
-> ([Node] -> Either String (Maybe (NonEmpty VPC)))
-> Either String (Maybe (NonEmpty VPC))
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= ([Node] -> Either String (NonEmpty VPC))
-> [Node] -> Either String (Maybe (NonEmpty VPC))
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (Text -> [Node] -> Either String (NonEmpty VPC)
forall a. FromXML a => Text -> [Node] -> Either String (NonEmpty a)
Core.parseXMLList1 Text
"VPC")
)
Either
String
(Maybe DelegationSet -> Int -> HostedZone -> GetHostedZoneResponse)
-> Either String (Maybe DelegationSet)
-> Either String (Int -> HostedZone -> GetHostedZoneResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe DelegationSet)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"DelegationSet")
Either String (Int -> HostedZone -> GetHostedZoneResponse)
-> Either String Int
-> Either String (HostedZone -> GetHostedZoneResponse)
forall (f :: * -> *) a b. Applicative f => 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 (HostedZone -> GetHostedZoneResponse)
-> Either String HostedZone -> Either String GetHostedZoneResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String HostedZone
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"HostedZone")
)
instance Prelude.Hashable GetHostedZone
instance Prelude.NFData GetHostedZone
instance Core.ToHeaders GetHostedZone where
toHeaders :: GetHostedZone -> ResponseHeaders
toHeaders = ResponseHeaders -> GetHostedZone -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath GetHostedZone where
toPath :: GetHostedZone -> ByteString
toPath GetHostedZone' {ResourceId
id :: ResourceId
$sel:id:GetHostedZone' :: GetHostedZone -> 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 GetHostedZone where
toQuery :: GetHostedZone -> QueryString
toQuery = QueryString -> GetHostedZone -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data GetHostedZoneResponse = GetHostedZoneResponse'
{
GetHostedZoneResponse -> Maybe (NonEmpty VPC)
vPCs :: Prelude.Maybe (Prelude.NonEmpty VPC),
GetHostedZoneResponse -> Maybe DelegationSet
delegationSet :: Prelude.Maybe DelegationSet,
GetHostedZoneResponse -> Int
httpStatus :: Prelude.Int,
GetHostedZoneResponse -> HostedZone
hostedZone :: HostedZone
}
deriving (GetHostedZoneResponse -> GetHostedZoneResponse -> Bool
(GetHostedZoneResponse -> GetHostedZoneResponse -> Bool)
-> (GetHostedZoneResponse -> GetHostedZoneResponse -> Bool)
-> Eq GetHostedZoneResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetHostedZoneResponse -> GetHostedZoneResponse -> Bool
$c/= :: GetHostedZoneResponse -> GetHostedZoneResponse -> Bool
== :: GetHostedZoneResponse -> GetHostedZoneResponse -> Bool
$c== :: GetHostedZoneResponse -> GetHostedZoneResponse -> Bool
Prelude.Eq, ReadPrec [GetHostedZoneResponse]
ReadPrec GetHostedZoneResponse
Int -> ReadS GetHostedZoneResponse
ReadS [GetHostedZoneResponse]
(Int -> ReadS GetHostedZoneResponse)
-> ReadS [GetHostedZoneResponse]
-> ReadPrec GetHostedZoneResponse
-> ReadPrec [GetHostedZoneResponse]
-> Read GetHostedZoneResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetHostedZoneResponse]
$creadListPrec :: ReadPrec [GetHostedZoneResponse]
readPrec :: ReadPrec GetHostedZoneResponse
$creadPrec :: ReadPrec GetHostedZoneResponse
readList :: ReadS [GetHostedZoneResponse]
$creadList :: ReadS [GetHostedZoneResponse]
readsPrec :: Int -> ReadS GetHostedZoneResponse
$creadsPrec :: Int -> ReadS GetHostedZoneResponse
Prelude.Read, Int -> GetHostedZoneResponse -> ShowS
[GetHostedZoneResponse] -> ShowS
GetHostedZoneResponse -> String
(Int -> GetHostedZoneResponse -> ShowS)
-> (GetHostedZoneResponse -> String)
-> ([GetHostedZoneResponse] -> ShowS)
-> Show GetHostedZoneResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetHostedZoneResponse] -> ShowS
$cshowList :: [GetHostedZoneResponse] -> ShowS
show :: GetHostedZoneResponse -> String
$cshow :: GetHostedZoneResponse -> String
showsPrec :: Int -> GetHostedZoneResponse -> ShowS
$cshowsPrec :: Int -> GetHostedZoneResponse -> ShowS
Prelude.Show, (forall x. GetHostedZoneResponse -> Rep GetHostedZoneResponse x)
-> (forall x. Rep GetHostedZoneResponse x -> GetHostedZoneResponse)
-> Generic GetHostedZoneResponse
forall x. Rep GetHostedZoneResponse x -> GetHostedZoneResponse
forall x. GetHostedZoneResponse -> Rep GetHostedZoneResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetHostedZoneResponse x -> GetHostedZoneResponse
$cfrom :: forall x. GetHostedZoneResponse -> Rep GetHostedZoneResponse x
Prelude.Generic)
newGetHostedZoneResponse ::
Prelude.Int ->
HostedZone ->
GetHostedZoneResponse
newGetHostedZoneResponse :: Int -> HostedZone -> GetHostedZoneResponse
newGetHostedZoneResponse Int
pHttpStatus_ HostedZone
pHostedZone_ =
GetHostedZoneResponse' :: Maybe (NonEmpty VPC)
-> Maybe DelegationSet
-> Int
-> HostedZone
-> GetHostedZoneResponse
GetHostedZoneResponse'
{ $sel:vPCs:GetHostedZoneResponse' :: Maybe (NonEmpty VPC)
vPCs = Maybe (NonEmpty VPC)
forall a. Maybe a
Prelude.Nothing,
$sel:delegationSet:GetHostedZoneResponse' :: Maybe DelegationSet
delegationSet = Maybe DelegationSet
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetHostedZoneResponse' :: Int
httpStatus = Int
pHttpStatus_,
$sel:hostedZone:GetHostedZoneResponse' :: HostedZone
hostedZone = HostedZone
pHostedZone_
}
getHostedZoneResponse_vPCs :: Lens.Lens' GetHostedZoneResponse (Prelude.Maybe (Prelude.NonEmpty VPC))
getHostedZoneResponse_vPCs :: (Maybe (NonEmpty VPC) -> f (Maybe (NonEmpty VPC)))
-> GetHostedZoneResponse -> f GetHostedZoneResponse
getHostedZoneResponse_vPCs = (GetHostedZoneResponse -> Maybe (NonEmpty VPC))
-> (GetHostedZoneResponse
-> Maybe (NonEmpty VPC) -> GetHostedZoneResponse)
-> Lens
GetHostedZoneResponse
GetHostedZoneResponse
(Maybe (NonEmpty VPC))
(Maybe (NonEmpty VPC))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetHostedZoneResponse' {Maybe (NonEmpty VPC)
vPCs :: Maybe (NonEmpty VPC)
$sel:vPCs:GetHostedZoneResponse' :: GetHostedZoneResponse -> Maybe (NonEmpty VPC)
vPCs} -> Maybe (NonEmpty VPC)
vPCs) (\s :: GetHostedZoneResponse
s@GetHostedZoneResponse' {} Maybe (NonEmpty VPC)
a -> GetHostedZoneResponse
s {$sel:vPCs:GetHostedZoneResponse' :: Maybe (NonEmpty VPC)
vPCs = Maybe (NonEmpty VPC)
a} :: GetHostedZoneResponse) ((Maybe (NonEmpty VPC) -> f (Maybe (NonEmpty VPC)))
-> GetHostedZoneResponse -> f GetHostedZoneResponse)
-> ((Maybe (NonEmpty VPC) -> f (Maybe (NonEmpty VPC)))
-> Maybe (NonEmpty VPC) -> f (Maybe (NonEmpty VPC)))
-> (Maybe (NonEmpty VPC) -> f (Maybe (NonEmpty VPC)))
-> GetHostedZoneResponse
-> f GetHostedZoneResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (NonEmpty VPC) (NonEmpty VPC) (NonEmpty VPC) (NonEmpty VPC)
-> Iso
(Maybe (NonEmpty VPC))
(Maybe (NonEmpty VPC))
(Maybe (NonEmpty VPC))
(Maybe (NonEmpty VPC))
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 AnIso (NonEmpty VPC) (NonEmpty VPC) (NonEmpty VPC) (NonEmpty VPC)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
getHostedZoneResponse_delegationSet :: Lens.Lens' GetHostedZoneResponse (Prelude.Maybe DelegationSet)
getHostedZoneResponse_delegationSet :: (Maybe DelegationSet -> f (Maybe DelegationSet))
-> GetHostedZoneResponse -> f GetHostedZoneResponse
getHostedZoneResponse_delegationSet = (GetHostedZoneResponse -> Maybe DelegationSet)
-> (GetHostedZoneResponse
-> Maybe DelegationSet -> GetHostedZoneResponse)
-> Lens
GetHostedZoneResponse
GetHostedZoneResponse
(Maybe DelegationSet)
(Maybe DelegationSet)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetHostedZoneResponse' {Maybe DelegationSet
delegationSet :: Maybe DelegationSet
$sel:delegationSet:GetHostedZoneResponse' :: GetHostedZoneResponse -> Maybe DelegationSet
delegationSet} -> Maybe DelegationSet
delegationSet) (\s :: GetHostedZoneResponse
s@GetHostedZoneResponse' {} Maybe DelegationSet
a -> GetHostedZoneResponse
s {$sel:delegationSet:GetHostedZoneResponse' :: Maybe DelegationSet
delegationSet = Maybe DelegationSet
a} :: GetHostedZoneResponse)
getHostedZoneResponse_httpStatus :: Lens.Lens' GetHostedZoneResponse Prelude.Int
getHostedZoneResponse_httpStatus :: (Int -> f Int) -> GetHostedZoneResponse -> f GetHostedZoneResponse
getHostedZoneResponse_httpStatus = (GetHostedZoneResponse -> Int)
-> (GetHostedZoneResponse -> Int -> GetHostedZoneResponse)
-> Lens GetHostedZoneResponse GetHostedZoneResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetHostedZoneResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetHostedZoneResponse' :: GetHostedZoneResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetHostedZoneResponse
s@GetHostedZoneResponse' {} Int
a -> GetHostedZoneResponse
s {$sel:httpStatus:GetHostedZoneResponse' :: Int
httpStatus = Int
a} :: GetHostedZoneResponse)
getHostedZoneResponse_hostedZone :: Lens.Lens' GetHostedZoneResponse HostedZone
getHostedZoneResponse_hostedZone :: (HostedZone -> f HostedZone)
-> GetHostedZoneResponse -> f GetHostedZoneResponse
getHostedZoneResponse_hostedZone = (GetHostedZoneResponse -> HostedZone)
-> (GetHostedZoneResponse -> HostedZone -> GetHostedZoneResponse)
-> Lens
GetHostedZoneResponse GetHostedZoneResponse HostedZone HostedZone
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetHostedZoneResponse' {HostedZone
hostedZone :: HostedZone
$sel:hostedZone:GetHostedZoneResponse' :: GetHostedZoneResponse -> HostedZone
hostedZone} -> HostedZone
hostedZone) (\s :: GetHostedZoneResponse
s@GetHostedZoneResponse' {} HostedZone
a -> GetHostedZoneResponse
s {$sel:hostedZone:GetHostedZoneResponse' :: HostedZone
hostedZone = HostedZone
a} :: GetHostedZoneResponse)
instance Prelude.NFData GetHostedZoneResponse