{-# 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.ElasticBeanstalk.CheckDNSAvailability
(
CheckDNSAvailability (..),
newCheckDNSAvailability,
checkDNSAvailability_cNAMEPrefix,
CheckDNSAvailabilityResponse (..),
newCheckDNSAvailabilityResponse,
checkDNSAvailabilityResponse_fullyQualifiedCNAME,
checkDNSAvailabilityResponse_available,
checkDNSAvailabilityResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import Amazonka.ElasticBeanstalk.Types
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data CheckDNSAvailability = CheckDNSAvailability'
{
CheckDNSAvailability -> Text
cNAMEPrefix :: Prelude.Text
}
deriving (CheckDNSAvailability -> CheckDNSAvailability -> Bool
(CheckDNSAvailability -> CheckDNSAvailability -> Bool)
-> (CheckDNSAvailability -> CheckDNSAvailability -> Bool)
-> Eq CheckDNSAvailability
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CheckDNSAvailability -> CheckDNSAvailability -> Bool
$c/= :: CheckDNSAvailability -> CheckDNSAvailability -> Bool
== :: CheckDNSAvailability -> CheckDNSAvailability -> Bool
$c== :: CheckDNSAvailability -> CheckDNSAvailability -> Bool
Prelude.Eq, ReadPrec [CheckDNSAvailability]
ReadPrec CheckDNSAvailability
Int -> ReadS CheckDNSAvailability
ReadS [CheckDNSAvailability]
(Int -> ReadS CheckDNSAvailability)
-> ReadS [CheckDNSAvailability]
-> ReadPrec CheckDNSAvailability
-> ReadPrec [CheckDNSAvailability]
-> Read CheckDNSAvailability
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CheckDNSAvailability]
$creadListPrec :: ReadPrec [CheckDNSAvailability]
readPrec :: ReadPrec CheckDNSAvailability
$creadPrec :: ReadPrec CheckDNSAvailability
readList :: ReadS [CheckDNSAvailability]
$creadList :: ReadS [CheckDNSAvailability]
readsPrec :: Int -> ReadS CheckDNSAvailability
$creadsPrec :: Int -> ReadS CheckDNSAvailability
Prelude.Read, Int -> CheckDNSAvailability -> ShowS
[CheckDNSAvailability] -> ShowS
CheckDNSAvailability -> String
(Int -> CheckDNSAvailability -> ShowS)
-> (CheckDNSAvailability -> String)
-> ([CheckDNSAvailability] -> ShowS)
-> Show CheckDNSAvailability
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CheckDNSAvailability] -> ShowS
$cshowList :: [CheckDNSAvailability] -> ShowS
show :: CheckDNSAvailability -> String
$cshow :: CheckDNSAvailability -> String
showsPrec :: Int -> CheckDNSAvailability -> ShowS
$cshowsPrec :: Int -> CheckDNSAvailability -> ShowS
Prelude.Show, (forall x. CheckDNSAvailability -> Rep CheckDNSAvailability x)
-> (forall x. Rep CheckDNSAvailability x -> CheckDNSAvailability)
-> Generic CheckDNSAvailability
forall x. Rep CheckDNSAvailability x -> CheckDNSAvailability
forall x. CheckDNSAvailability -> Rep CheckDNSAvailability x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CheckDNSAvailability x -> CheckDNSAvailability
$cfrom :: forall x. CheckDNSAvailability -> Rep CheckDNSAvailability x
Prelude.Generic)
newCheckDNSAvailability ::
Prelude.Text ->
CheckDNSAvailability
newCheckDNSAvailability :: Text -> CheckDNSAvailability
newCheckDNSAvailability Text
pCNAMEPrefix_ =
CheckDNSAvailability' :: Text -> CheckDNSAvailability
CheckDNSAvailability' {$sel:cNAMEPrefix:CheckDNSAvailability' :: Text
cNAMEPrefix = Text
pCNAMEPrefix_}
checkDNSAvailability_cNAMEPrefix :: Lens.Lens' CheckDNSAvailability Prelude.Text
checkDNSAvailability_cNAMEPrefix :: (Text -> f Text) -> CheckDNSAvailability -> f CheckDNSAvailability
checkDNSAvailability_cNAMEPrefix = (CheckDNSAvailability -> Text)
-> (CheckDNSAvailability -> Text -> CheckDNSAvailability)
-> Lens CheckDNSAvailability CheckDNSAvailability Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CheckDNSAvailability' {Text
cNAMEPrefix :: Text
$sel:cNAMEPrefix:CheckDNSAvailability' :: CheckDNSAvailability -> Text
cNAMEPrefix} -> Text
cNAMEPrefix) (\s :: CheckDNSAvailability
s@CheckDNSAvailability' {} Text
a -> CheckDNSAvailability
s {$sel:cNAMEPrefix:CheckDNSAvailability' :: Text
cNAMEPrefix = Text
a} :: CheckDNSAvailability)
instance Core.AWSRequest CheckDNSAvailability where
type
AWSResponse CheckDNSAvailability =
CheckDNSAvailabilityResponse
request :: CheckDNSAvailability -> Request CheckDNSAvailability
request = Service -> CheckDNSAvailability -> Request CheckDNSAvailability
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
response :: Logger
-> Service
-> Proxy CheckDNSAvailability
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CheckDNSAvailability)))
response =
Text
-> (Int
-> ResponseHeaders
-> [Node]
-> Either String (AWSResponse CheckDNSAvailability))
-> Logger
-> Service
-> Proxy CheckDNSAvailability
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CheckDNSAvailability)))
forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
-> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
Text
"CheckDNSAvailabilityResult"
( \Int
s ResponseHeaders
h [Node]
x ->
Maybe Text -> Maybe Bool -> Int -> CheckDNSAvailabilityResponse
CheckDNSAvailabilityResponse'
(Maybe Text -> Maybe Bool -> Int -> CheckDNSAvailabilityResponse)
-> Either String (Maybe Text)
-> Either
String (Maybe Bool -> Int -> CheckDNSAvailabilityResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"FullyQualifiedCNAME")
Either String (Maybe Bool -> Int -> CheckDNSAvailabilityResponse)
-> Either String (Maybe Bool)
-> Either String (Int -> CheckDNSAvailabilityResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Bool)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Available")
Either String (Int -> CheckDNSAvailabilityResponse)
-> Either String Int -> Either String CheckDNSAvailabilityResponse
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))
)
instance Prelude.Hashable CheckDNSAvailability
instance Prelude.NFData CheckDNSAvailability
instance Core.ToHeaders CheckDNSAvailability where
toHeaders :: CheckDNSAvailability -> ResponseHeaders
toHeaders = ResponseHeaders -> CheckDNSAvailability -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath CheckDNSAvailability where
toPath :: CheckDNSAvailability -> ByteString
toPath = ByteString -> CheckDNSAvailability -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery CheckDNSAvailability where
toQuery :: CheckDNSAvailability -> QueryString
toQuery CheckDNSAvailability' {Text
cNAMEPrefix :: Text
$sel:cNAMEPrefix:CheckDNSAvailability' :: CheckDNSAvailability -> Text
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"CheckDNSAvailability" :: Prelude.ByteString),
ByteString
"Version"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2010-12-01" :: Prelude.ByteString),
ByteString
"CNAMEPrefix" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
cNAMEPrefix
]
data CheckDNSAvailabilityResponse = CheckDNSAvailabilityResponse'
{
CheckDNSAvailabilityResponse -> Maybe Text
fullyQualifiedCNAME :: Prelude.Maybe Prelude.Text,
CheckDNSAvailabilityResponse -> Maybe Bool
available :: Prelude.Maybe Prelude.Bool,
CheckDNSAvailabilityResponse -> Int
httpStatus :: Prelude.Int
}
deriving (CheckDNSAvailabilityResponse
-> CheckDNSAvailabilityResponse -> Bool
(CheckDNSAvailabilityResponse
-> CheckDNSAvailabilityResponse -> Bool)
-> (CheckDNSAvailabilityResponse
-> CheckDNSAvailabilityResponse -> Bool)
-> Eq CheckDNSAvailabilityResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CheckDNSAvailabilityResponse
-> CheckDNSAvailabilityResponse -> Bool
$c/= :: CheckDNSAvailabilityResponse
-> CheckDNSAvailabilityResponse -> Bool
== :: CheckDNSAvailabilityResponse
-> CheckDNSAvailabilityResponse -> Bool
$c== :: CheckDNSAvailabilityResponse
-> CheckDNSAvailabilityResponse -> Bool
Prelude.Eq, ReadPrec [CheckDNSAvailabilityResponse]
ReadPrec CheckDNSAvailabilityResponse
Int -> ReadS CheckDNSAvailabilityResponse
ReadS [CheckDNSAvailabilityResponse]
(Int -> ReadS CheckDNSAvailabilityResponse)
-> ReadS [CheckDNSAvailabilityResponse]
-> ReadPrec CheckDNSAvailabilityResponse
-> ReadPrec [CheckDNSAvailabilityResponse]
-> Read CheckDNSAvailabilityResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CheckDNSAvailabilityResponse]
$creadListPrec :: ReadPrec [CheckDNSAvailabilityResponse]
readPrec :: ReadPrec CheckDNSAvailabilityResponse
$creadPrec :: ReadPrec CheckDNSAvailabilityResponse
readList :: ReadS [CheckDNSAvailabilityResponse]
$creadList :: ReadS [CheckDNSAvailabilityResponse]
readsPrec :: Int -> ReadS CheckDNSAvailabilityResponse
$creadsPrec :: Int -> ReadS CheckDNSAvailabilityResponse
Prelude.Read, Int -> CheckDNSAvailabilityResponse -> ShowS
[CheckDNSAvailabilityResponse] -> ShowS
CheckDNSAvailabilityResponse -> String
(Int -> CheckDNSAvailabilityResponse -> ShowS)
-> (CheckDNSAvailabilityResponse -> String)
-> ([CheckDNSAvailabilityResponse] -> ShowS)
-> Show CheckDNSAvailabilityResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CheckDNSAvailabilityResponse] -> ShowS
$cshowList :: [CheckDNSAvailabilityResponse] -> ShowS
show :: CheckDNSAvailabilityResponse -> String
$cshow :: CheckDNSAvailabilityResponse -> String
showsPrec :: Int -> CheckDNSAvailabilityResponse -> ShowS
$cshowsPrec :: Int -> CheckDNSAvailabilityResponse -> ShowS
Prelude.Show, (forall x.
CheckDNSAvailabilityResponse -> Rep CheckDNSAvailabilityResponse x)
-> (forall x.
Rep CheckDNSAvailabilityResponse x -> CheckDNSAvailabilityResponse)
-> Generic CheckDNSAvailabilityResponse
forall x.
Rep CheckDNSAvailabilityResponse x -> CheckDNSAvailabilityResponse
forall x.
CheckDNSAvailabilityResponse -> Rep CheckDNSAvailabilityResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CheckDNSAvailabilityResponse x -> CheckDNSAvailabilityResponse
$cfrom :: forall x.
CheckDNSAvailabilityResponse -> Rep CheckDNSAvailabilityResponse x
Prelude.Generic)
newCheckDNSAvailabilityResponse ::
Prelude.Int ->
CheckDNSAvailabilityResponse
newCheckDNSAvailabilityResponse :: Int -> CheckDNSAvailabilityResponse
newCheckDNSAvailabilityResponse Int
pHttpStatus_ =
CheckDNSAvailabilityResponse' :: Maybe Text -> Maybe Bool -> Int -> CheckDNSAvailabilityResponse
CheckDNSAvailabilityResponse'
{ $sel:fullyQualifiedCNAME:CheckDNSAvailabilityResponse' :: Maybe Text
fullyQualifiedCNAME =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:available:CheckDNSAvailabilityResponse' :: Maybe Bool
available = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:CheckDNSAvailabilityResponse' :: Int
httpStatus = Int
pHttpStatus_
}
checkDNSAvailabilityResponse_fullyQualifiedCNAME :: Lens.Lens' CheckDNSAvailabilityResponse (Prelude.Maybe Prelude.Text)
checkDNSAvailabilityResponse_fullyQualifiedCNAME :: (Maybe Text -> f (Maybe Text))
-> CheckDNSAvailabilityResponse -> f CheckDNSAvailabilityResponse
checkDNSAvailabilityResponse_fullyQualifiedCNAME = (CheckDNSAvailabilityResponse -> Maybe Text)
-> (CheckDNSAvailabilityResponse
-> Maybe Text -> CheckDNSAvailabilityResponse)
-> Lens
CheckDNSAvailabilityResponse
CheckDNSAvailabilityResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CheckDNSAvailabilityResponse' {Maybe Text
fullyQualifiedCNAME :: Maybe Text
$sel:fullyQualifiedCNAME:CheckDNSAvailabilityResponse' :: CheckDNSAvailabilityResponse -> Maybe Text
fullyQualifiedCNAME} -> Maybe Text
fullyQualifiedCNAME) (\s :: CheckDNSAvailabilityResponse
s@CheckDNSAvailabilityResponse' {} Maybe Text
a -> CheckDNSAvailabilityResponse
s {$sel:fullyQualifiedCNAME:CheckDNSAvailabilityResponse' :: Maybe Text
fullyQualifiedCNAME = Maybe Text
a} :: CheckDNSAvailabilityResponse)
checkDNSAvailabilityResponse_available :: Lens.Lens' CheckDNSAvailabilityResponse (Prelude.Maybe Prelude.Bool)
checkDNSAvailabilityResponse_available :: (Maybe Bool -> f (Maybe Bool))
-> CheckDNSAvailabilityResponse -> f CheckDNSAvailabilityResponse
checkDNSAvailabilityResponse_available = (CheckDNSAvailabilityResponse -> Maybe Bool)
-> (CheckDNSAvailabilityResponse
-> Maybe Bool -> CheckDNSAvailabilityResponse)
-> Lens
CheckDNSAvailabilityResponse
CheckDNSAvailabilityResponse
(Maybe Bool)
(Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CheckDNSAvailabilityResponse' {Maybe Bool
available :: Maybe Bool
$sel:available:CheckDNSAvailabilityResponse' :: CheckDNSAvailabilityResponse -> Maybe Bool
available} -> Maybe Bool
available) (\s :: CheckDNSAvailabilityResponse
s@CheckDNSAvailabilityResponse' {} Maybe Bool
a -> CheckDNSAvailabilityResponse
s {$sel:available:CheckDNSAvailabilityResponse' :: Maybe Bool
available = Maybe Bool
a} :: CheckDNSAvailabilityResponse)
checkDNSAvailabilityResponse_httpStatus :: Lens.Lens' CheckDNSAvailabilityResponse Prelude.Int
checkDNSAvailabilityResponse_httpStatus :: (Int -> f Int)
-> CheckDNSAvailabilityResponse -> f CheckDNSAvailabilityResponse
checkDNSAvailabilityResponse_httpStatus = (CheckDNSAvailabilityResponse -> Int)
-> (CheckDNSAvailabilityResponse
-> Int -> CheckDNSAvailabilityResponse)
-> Lens
CheckDNSAvailabilityResponse CheckDNSAvailabilityResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CheckDNSAvailabilityResponse' {Int
httpStatus :: Int
$sel:httpStatus:CheckDNSAvailabilityResponse' :: CheckDNSAvailabilityResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CheckDNSAvailabilityResponse
s@CheckDNSAvailabilityResponse' {} Int
a -> CheckDNSAvailabilityResponse
s {$sel:httpStatus:CheckDNSAvailabilityResponse' :: Int
httpStatus = Int
a} :: CheckDNSAvailabilityResponse)
instance Prelude.NFData CheckDNSAvailabilityResponse