{-# 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.GetContactReachabilityStatus
(
GetContactReachabilityStatus (..),
newGetContactReachabilityStatus,
getContactReachabilityStatus_domainName,
GetContactReachabilityStatusResponse (..),
newGetContactReachabilityStatusResponse,
getContactReachabilityStatusResponse_status,
getContactReachabilityStatusResponse_domainName,
getContactReachabilityStatusResponse_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 GetContactReachabilityStatus = GetContactReachabilityStatus'
{
GetContactReachabilityStatus -> Maybe Text
domainName :: Prelude.Maybe Prelude.Text
}
deriving (GetContactReachabilityStatus
-> GetContactReachabilityStatus -> Bool
(GetContactReachabilityStatus
-> GetContactReachabilityStatus -> Bool)
-> (GetContactReachabilityStatus
-> GetContactReachabilityStatus -> Bool)
-> Eq GetContactReachabilityStatus
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetContactReachabilityStatus
-> GetContactReachabilityStatus -> Bool
$c/= :: GetContactReachabilityStatus
-> GetContactReachabilityStatus -> Bool
== :: GetContactReachabilityStatus
-> GetContactReachabilityStatus -> Bool
$c== :: GetContactReachabilityStatus
-> GetContactReachabilityStatus -> Bool
Prelude.Eq, ReadPrec [GetContactReachabilityStatus]
ReadPrec GetContactReachabilityStatus
Int -> ReadS GetContactReachabilityStatus
ReadS [GetContactReachabilityStatus]
(Int -> ReadS GetContactReachabilityStatus)
-> ReadS [GetContactReachabilityStatus]
-> ReadPrec GetContactReachabilityStatus
-> ReadPrec [GetContactReachabilityStatus]
-> Read GetContactReachabilityStatus
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetContactReachabilityStatus]
$creadListPrec :: ReadPrec [GetContactReachabilityStatus]
readPrec :: ReadPrec GetContactReachabilityStatus
$creadPrec :: ReadPrec GetContactReachabilityStatus
readList :: ReadS [GetContactReachabilityStatus]
$creadList :: ReadS [GetContactReachabilityStatus]
readsPrec :: Int -> ReadS GetContactReachabilityStatus
$creadsPrec :: Int -> ReadS GetContactReachabilityStatus
Prelude.Read, Int -> GetContactReachabilityStatus -> ShowS
[GetContactReachabilityStatus] -> ShowS
GetContactReachabilityStatus -> String
(Int -> GetContactReachabilityStatus -> ShowS)
-> (GetContactReachabilityStatus -> String)
-> ([GetContactReachabilityStatus] -> ShowS)
-> Show GetContactReachabilityStatus
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetContactReachabilityStatus] -> ShowS
$cshowList :: [GetContactReachabilityStatus] -> ShowS
show :: GetContactReachabilityStatus -> String
$cshow :: GetContactReachabilityStatus -> String
showsPrec :: Int -> GetContactReachabilityStatus -> ShowS
$cshowsPrec :: Int -> GetContactReachabilityStatus -> ShowS
Prelude.Show, (forall x.
GetContactReachabilityStatus -> Rep GetContactReachabilityStatus x)
-> (forall x.
Rep GetContactReachabilityStatus x -> GetContactReachabilityStatus)
-> Generic GetContactReachabilityStatus
forall x.
Rep GetContactReachabilityStatus x -> GetContactReachabilityStatus
forall x.
GetContactReachabilityStatus -> Rep GetContactReachabilityStatus x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetContactReachabilityStatus x -> GetContactReachabilityStatus
$cfrom :: forall x.
GetContactReachabilityStatus -> Rep GetContactReachabilityStatus x
Prelude.Generic)
newGetContactReachabilityStatus ::
GetContactReachabilityStatus
newGetContactReachabilityStatus :: GetContactReachabilityStatus
newGetContactReachabilityStatus =
GetContactReachabilityStatus' :: Maybe Text -> GetContactReachabilityStatus
GetContactReachabilityStatus'
{ $sel:domainName:GetContactReachabilityStatus' :: Maybe Text
domainName =
Maybe Text
forall a. Maybe a
Prelude.Nothing
}
getContactReachabilityStatus_domainName :: Lens.Lens' GetContactReachabilityStatus (Prelude.Maybe Prelude.Text)
getContactReachabilityStatus_domainName :: (Maybe Text -> f (Maybe Text))
-> GetContactReachabilityStatus -> f GetContactReachabilityStatus
getContactReachabilityStatus_domainName = (GetContactReachabilityStatus -> Maybe Text)
-> (GetContactReachabilityStatus
-> Maybe Text -> GetContactReachabilityStatus)
-> Lens
GetContactReachabilityStatus
GetContactReachabilityStatus
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetContactReachabilityStatus' {Maybe Text
domainName :: Maybe Text
$sel:domainName:GetContactReachabilityStatus' :: GetContactReachabilityStatus -> Maybe Text
domainName} -> Maybe Text
domainName) (\s :: GetContactReachabilityStatus
s@GetContactReachabilityStatus' {} Maybe Text
a -> GetContactReachabilityStatus
s {$sel:domainName:GetContactReachabilityStatus' :: Maybe Text
domainName = Maybe Text
a} :: GetContactReachabilityStatus)
instance Core.AWSRequest GetContactReachabilityStatus where
type
AWSResponse GetContactReachabilityStatus =
GetContactReachabilityStatusResponse
request :: GetContactReachabilityStatus
-> Request GetContactReachabilityStatus
request = Service
-> GetContactReachabilityStatus
-> Request GetContactReachabilityStatus
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy GetContactReachabilityStatus
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetContactReachabilityStatus)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse GetContactReachabilityStatus))
-> Logger
-> Service
-> Proxy GetContactReachabilityStatus
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetContactReachabilityStatus)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe ReachabilityStatus
-> Maybe Text -> Int -> GetContactReachabilityStatusResponse
GetContactReachabilityStatusResponse'
(Maybe ReachabilityStatus
-> Maybe Text -> Int -> GetContactReachabilityStatusResponse)
-> Either String (Maybe ReachabilityStatus)
-> Either
String (Maybe Text -> Int -> GetContactReachabilityStatusResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe ReachabilityStatus)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"status")
Either
String (Maybe Text -> Int -> GetContactReachabilityStatusResponse)
-> Either String (Maybe Text)
-> Either String (Int -> GetContactReachabilityStatusResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"domainName")
Either String (Int -> GetContactReachabilityStatusResponse)
-> Either String Int
-> Either String GetContactReachabilityStatusResponse
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
GetContactReachabilityStatus
instance Prelude.NFData GetContactReachabilityStatus
instance Core.ToHeaders GetContactReachabilityStatus where
toHeaders :: GetContactReachabilityStatus -> ResponseHeaders
toHeaders =
ResponseHeaders -> GetContactReachabilityStatus -> 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.GetContactReachabilityStatus" ::
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 GetContactReachabilityStatus where
toJSON :: GetContactReachabilityStatus -> Value
toJSON GetContactReachabilityStatus' {Maybe Text
domainName :: Maybe Text
$sel:domainName:GetContactReachabilityStatus' :: GetContactReachabilityStatus -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[(Text
"domainName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
domainName]
)
instance Core.ToPath GetContactReachabilityStatus where
toPath :: GetContactReachabilityStatus -> ByteString
toPath = ByteString -> GetContactReachabilityStatus -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery GetContactReachabilityStatus where
toQuery :: GetContactReachabilityStatus -> QueryString
toQuery = QueryString -> GetContactReachabilityStatus -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data GetContactReachabilityStatusResponse = GetContactReachabilityStatusResponse'
{
GetContactReachabilityStatusResponse -> Maybe ReachabilityStatus
status :: Prelude.Maybe ReachabilityStatus,
GetContactReachabilityStatusResponse -> Maybe Text
domainName :: Prelude.Maybe Prelude.Text,
GetContactReachabilityStatusResponse -> Int
httpStatus :: Prelude.Int
}
deriving (GetContactReachabilityStatusResponse
-> GetContactReachabilityStatusResponse -> Bool
(GetContactReachabilityStatusResponse
-> GetContactReachabilityStatusResponse -> Bool)
-> (GetContactReachabilityStatusResponse
-> GetContactReachabilityStatusResponse -> Bool)
-> Eq GetContactReachabilityStatusResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetContactReachabilityStatusResponse
-> GetContactReachabilityStatusResponse -> Bool
$c/= :: GetContactReachabilityStatusResponse
-> GetContactReachabilityStatusResponse -> Bool
== :: GetContactReachabilityStatusResponse
-> GetContactReachabilityStatusResponse -> Bool
$c== :: GetContactReachabilityStatusResponse
-> GetContactReachabilityStatusResponse -> Bool
Prelude.Eq, ReadPrec [GetContactReachabilityStatusResponse]
ReadPrec GetContactReachabilityStatusResponse
Int -> ReadS GetContactReachabilityStatusResponse
ReadS [GetContactReachabilityStatusResponse]
(Int -> ReadS GetContactReachabilityStatusResponse)
-> ReadS [GetContactReachabilityStatusResponse]
-> ReadPrec GetContactReachabilityStatusResponse
-> ReadPrec [GetContactReachabilityStatusResponse]
-> Read GetContactReachabilityStatusResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetContactReachabilityStatusResponse]
$creadListPrec :: ReadPrec [GetContactReachabilityStatusResponse]
readPrec :: ReadPrec GetContactReachabilityStatusResponse
$creadPrec :: ReadPrec GetContactReachabilityStatusResponse
readList :: ReadS [GetContactReachabilityStatusResponse]
$creadList :: ReadS [GetContactReachabilityStatusResponse]
readsPrec :: Int -> ReadS GetContactReachabilityStatusResponse
$creadsPrec :: Int -> ReadS GetContactReachabilityStatusResponse
Prelude.Read, Int -> GetContactReachabilityStatusResponse -> ShowS
[GetContactReachabilityStatusResponse] -> ShowS
GetContactReachabilityStatusResponse -> String
(Int -> GetContactReachabilityStatusResponse -> ShowS)
-> (GetContactReachabilityStatusResponse -> String)
-> ([GetContactReachabilityStatusResponse] -> ShowS)
-> Show GetContactReachabilityStatusResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetContactReachabilityStatusResponse] -> ShowS
$cshowList :: [GetContactReachabilityStatusResponse] -> ShowS
show :: GetContactReachabilityStatusResponse -> String
$cshow :: GetContactReachabilityStatusResponse -> String
showsPrec :: Int -> GetContactReachabilityStatusResponse -> ShowS
$cshowsPrec :: Int -> GetContactReachabilityStatusResponse -> ShowS
Prelude.Show, (forall x.
GetContactReachabilityStatusResponse
-> Rep GetContactReachabilityStatusResponse x)
-> (forall x.
Rep GetContactReachabilityStatusResponse x
-> GetContactReachabilityStatusResponse)
-> Generic GetContactReachabilityStatusResponse
forall x.
Rep GetContactReachabilityStatusResponse x
-> GetContactReachabilityStatusResponse
forall x.
GetContactReachabilityStatusResponse
-> Rep GetContactReachabilityStatusResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetContactReachabilityStatusResponse x
-> GetContactReachabilityStatusResponse
$cfrom :: forall x.
GetContactReachabilityStatusResponse
-> Rep GetContactReachabilityStatusResponse x
Prelude.Generic)
newGetContactReachabilityStatusResponse ::
Prelude.Int ->
GetContactReachabilityStatusResponse
newGetContactReachabilityStatusResponse :: Int -> GetContactReachabilityStatusResponse
newGetContactReachabilityStatusResponse Int
pHttpStatus_ =
GetContactReachabilityStatusResponse' :: Maybe ReachabilityStatus
-> Maybe Text -> Int -> GetContactReachabilityStatusResponse
GetContactReachabilityStatusResponse'
{ $sel:status:GetContactReachabilityStatusResponse' :: Maybe ReachabilityStatus
status =
Maybe ReachabilityStatus
forall a. Maybe a
Prelude.Nothing,
$sel:domainName:GetContactReachabilityStatusResponse' :: Maybe Text
domainName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetContactReachabilityStatusResponse' :: Int
httpStatus = Int
pHttpStatus_
}
getContactReachabilityStatusResponse_status :: Lens.Lens' GetContactReachabilityStatusResponse (Prelude.Maybe ReachabilityStatus)
getContactReachabilityStatusResponse_status :: (Maybe ReachabilityStatus -> f (Maybe ReachabilityStatus))
-> GetContactReachabilityStatusResponse
-> f GetContactReachabilityStatusResponse
getContactReachabilityStatusResponse_status = (GetContactReachabilityStatusResponse -> Maybe ReachabilityStatus)
-> (GetContactReachabilityStatusResponse
-> Maybe ReachabilityStatus
-> GetContactReachabilityStatusResponse)
-> Lens
GetContactReachabilityStatusResponse
GetContactReachabilityStatusResponse
(Maybe ReachabilityStatus)
(Maybe ReachabilityStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetContactReachabilityStatusResponse' {Maybe ReachabilityStatus
status :: Maybe ReachabilityStatus
$sel:status:GetContactReachabilityStatusResponse' :: GetContactReachabilityStatusResponse -> Maybe ReachabilityStatus
status} -> Maybe ReachabilityStatus
status) (\s :: GetContactReachabilityStatusResponse
s@GetContactReachabilityStatusResponse' {} Maybe ReachabilityStatus
a -> GetContactReachabilityStatusResponse
s {$sel:status:GetContactReachabilityStatusResponse' :: Maybe ReachabilityStatus
status = Maybe ReachabilityStatus
a} :: GetContactReachabilityStatusResponse)
getContactReachabilityStatusResponse_domainName :: Lens.Lens' GetContactReachabilityStatusResponse (Prelude.Maybe Prelude.Text)
getContactReachabilityStatusResponse_domainName :: (Maybe Text -> f (Maybe Text))
-> GetContactReachabilityStatusResponse
-> f GetContactReachabilityStatusResponse
getContactReachabilityStatusResponse_domainName = (GetContactReachabilityStatusResponse -> Maybe Text)
-> (GetContactReachabilityStatusResponse
-> Maybe Text -> GetContactReachabilityStatusResponse)
-> Lens
GetContactReachabilityStatusResponse
GetContactReachabilityStatusResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetContactReachabilityStatusResponse' {Maybe Text
domainName :: Maybe Text
$sel:domainName:GetContactReachabilityStatusResponse' :: GetContactReachabilityStatusResponse -> Maybe Text
domainName} -> Maybe Text
domainName) (\s :: GetContactReachabilityStatusResponse
s@GetContactReachabilityStatusResponse' {} Maybe Text
a -> GetContactReachabilityStatusResponse
s {$sel:domainName:GetContactReachabilityStatusResponse' :: Maybe Text
domainName = Maybe Text
a} :: GetContactReachabilityStatusResponse)
getContactReachabilityStatusResponse_httpStatus :: Lens.Lens' GetContactReachabilityStatusResponse Prelude.Int
getContactReachabilityStatusResponse_httpStatus :: (Int -> f Int)
-> GetContactReachabilityStatusResponse
-> f GetContactReachabilityStatusResponse
getContactReachabilityStatusResponse_httpStatus = (GetContactReachabilityStatusResponse -> Int)
-> (GetContactReachabilityStatusResponse
-> Int -> GetContactReachabilityStatusResponse)
-> Lens
GetContactReachabilityStatusResponse
GetContactReachabilityStatusResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetContactReachabilityStatusResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetContactReachabilityStatusResponse' :: GetContactReachabilityStatusResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetContactReachabilityStatusResponse
s@GetContactReachabilityStatusResponse' {} Int
a -> GetContactReachabilityStatusResponse
s {$sel:httpStatus:GetContactReachabilityStatusResponse' :: Int
httpStatus = Int
a} :: GetContactReachabilityStatusResponse)
instance
Prelude.NFData
GetContactReachabilityStatusResponse