{-# 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.Shield.DescribeEmergencyContactSettings
(
DescribeEmergencyContactSettings (..),
newDescribeEmergencyContactSettings,
DescribeEmergencyContactSettingsResponse (..),
newDescribeEmergencyContactSettingsResponse,
describeEmergencyContactSettingsResponse_emergencyContactList,
describeEmergencyContactSettingsResponse_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.Shield.Types
data DescribeEmergencyContactSettings = DescribeEmergencyContactSettings'
{
}
deriving (DescribeEmergencyContactSettings
-> DescribeEmergencyContactSettings -> Bool
(DescribeEmergencyContactSettings
-> DescribeEmergencyContactSettings -> Bool)
-> (DescribeEmergencyContactSettings
-> DescribeEmergencyContactSettings -> Bool)
-> Eq DescribeEmergencyContactSettings
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeEmergencyContactSettings
-> DescribeEmergencyContactSettings -> Bool
$c/= :: DescribeEmergencyContactSettings
-> DescribeEmergencyContactSettings -> Bool
== :: DescribeEmergencyContactSettings
-> DescribeEmergencyContactSettings -> Bool
$c== :: DescribeEmergencyContactSettings
-> DescribeEmergencyContactSettings -> Bool
Prelude.Eq, ReadPrec [DescribeEmergencyContactSettings]
ReadPrec DescribeEmergencyContactSettings
Int -> ReadS DescribeEmergencyContactSettings
ReadS [DescribeEmergencyContactSettings]
(Int -> ReadS DescribeEmergencyContactSettings)
-> ReadS [DescribeEmergencyContactSettings]
-> ReadPrec DescribeEmergencyContactSettings
-> ReadPrec [DescribeEmergencyContactSettings]
-> Read DescribeEmergencyContactSettings
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeEmergencyContactSettings]
$creadListPrec :: ReadPrec [DescribeEmergencyContactSettings]
readPrec :: ReadPrec DescribeEmergencyContactSettings
$creadPrec :: ReadPrec DescribeEmergencyContactSettings
readList :: ReadS [DescribeEmergencyContactSettings]
$creadList :: ReadS [DescribeEmergencyContactSettings]
readsPrec :: Int -> ReadS DescribeEmergencyContactSettings
$creadsPrec :: Int -> ReadS DescribeEmergencyContactSettings
Prelude.Read, Int -> DescribeEmergencyContactSettings -> ShowS
[DescribeEmergencyContactSettings] -> ShowS
DescribeEmergencyContactSettings -> String
(Int -> DescribeEmergencyContactSettings -> ShowS)
-> (DescribeEmergencyContactSettings -> String)
-> ([DescribeEmergencyContactSettings] -> ShowS)
-> Show DescribeEmergencyContactSettings
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeEmergencyContactSettings] -> ShowS
$cshowList :: [DescribeEmergencyContactSettings] -> ShowS
show :: DescribeEmergencyContactSettings -> String
$cshow :: DescribeEmergencyContactSettings -> String
showsPrec :: Int -> DescribeEmergencyContactSettings -> ShowS
$cshowsPrec :: Int -> DescribeEmergencyContactSettings -> ShowS
Prelude.Show, (forall x.
DescribeEmergencyContactSettings
-> Rep DescribeEmergencyContactSettings x)
-> (forall x.
Rep DescribeEmergencyContactSettings x
-> DescribeEmergencyContactSettings)
-> Generic DescribeEmergencyContactSettings
forall x.
Rep DescribeEmergencyContactSettings x
-> DescribeEmergencyContactSettings
forall x.
DescribeEmergencyContactSettings
-> Rep DescribeEmergencyContactSettings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeEmergencyContactSettings x
-> DescribeEmergencyContactSettings
$cfrom :: forall x.
DescribeEmergencyContactSettings
-> Rep DescribeEmergencyContactSettings x
Prelude.Generic)
newDescribeEmergencyContactSettings ::
DescribeEmergencyContactSettings
newDescribeEmergencyContactSettings :: DescribeEmergencyContactSettings
newDescribeEmergencyContactSettings =
DescribeEmergencyContactSettings
DescribeEmergencyContactSettings'
instance
Core.AWSRequest
DescribeEmergencyContactSettings
where
type
AWSResponse DescribeEmergencyContactSettings =
DescribeEmergencyContactSettingsResponse
request :: DescribeEmergencyContactSettings
-> Request DescribeEmergencyContactSettings
request = Service
-> DescribeEmergencyContactSettings
-> Request DescribeEmergencyContactSettings
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DescribeEmergencyContactSettings
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse DescribeEmergencyContactSettings)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DescribeEmergencyContactSettings))
-> Logger
-> Service
-> Proxy DescribeEmergencyContactSettings
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse DescribeEmergencyContactSettings)))
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 [EmergencyContact]
-> Int -> DescribeEmergencyContactSettingsResponse
DescribeEmergencyContactSettingsResponse'
(Maybe [EmergencyContact]
-> Int -> DescribeEmergencyContactSettingsResponse)
-> Either String (Maybe [EmergencyContact])
-> Either String (Int -> DescribeEmergencyContactSettingsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x Object -> Key -> Either String (Maybe (Maybe [EmergencyContact]))
forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Core..?> Key
"EmergencyContactList"
Either String (Maybe (Maybe [EmergencyContact]))
-> Maybe [EmergencyContact]
-> Either String (Maybe [EmergencyContact])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [EmergencyContact]
forall a. Monoid a => a
Prelude.mempty
)
Either String (Int -> DescribeEmergencyContactSettingsResponse)
-> Either String Int
-> Either String DescribeEmergencyContactSettingsResponse
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
DescribeEmergencyContactSettings
instance
Prelude.NFData
DescribeEmergencyContactSettings
instance
Core.ToHeaders
DescribeEmergencyContactSettings
where
toHeaders :: DescribeEmergencyContactSettings -> ResponseHeaders
toHeaders =
ResponseHeaders
-> DescribeEmergencyContactSettings -> 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
"AWSShield_20160616.DescribeEmergencyContactSettings" ::
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 DescribeEmergencyContactSettings where
toJSON :: DescribeEmergencyContactSettings -> Value
toJSON = Value -> DescribeEmergencyContactSettings -> Value
forall a b. a -> b -> a
Prelude.const (Object -> Value
Core.Object Object
forall a. Monoid a => a
Prelude.mempty)
instance Core.ToPath DescribeEmergencyContactSettings where
toPath :: DescribeEmergencyContactSettings -> ByteString
toPath = ByteString -> DescribeEmergencyContactSettings -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance
Core.ToQuery
DescribeEmergencyContactSettings
where
toQuery :: DescribeEmergencyContactSettings -> QueryString
toQuery = QueryString -> DescribeEmergencyContactSettings -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DescribeEmergencyContactSettingsResponse = DescribeEmergencyContactSettingsResponse'
{
DescribeEmergencyContactSettingsResponse
-> Maybe [EmergencyContact]
emergencyContactList :: Prelude.Maybe [EmergencyContact],
DescribeEmergencyContactSettingsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DescribeEmergencyContactSettingsResponse
-> DescribeEmergencyContactSettingsResponse -> Bool
(DescribeEmergencyContactSettingsResponse
-> DescribeEmergencyContactSettingsResponse -> Bool)
-> (DescribeEmergencyContactSettingsResponse
-> DescribeEmergencyContactSettingsResponse -> Bool)
-> Eq DescribeEmergencyContactSettingsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeEmergencyContactSettingsResponse
-> DescribeEmergencyContactSettingsResponse -> Bool
$c/= :: DescribeEmergencyContactSettingsResponse
-> DescribeEmergencyContactSettingsResponse -> Bool
== :: DescribeEmergencyContactSettingsResponse
-> DescribeEmergencyContactSettingsResponse -> Bool
$c== :: DescribeEmergencyContactSettingsResponse
-> DescribeEmergencyContactSettingsResponse -> Bool
Prelude.Eq, ReadPrec [DescribeEmergencyContactSettingsResponse]
ReadPrec DescribeEmergencyContactSettingsResponse
Int -> ReadS DescribeEmergencyContactSettingsResponse
ReadS [DescribeEmergencyContactSettingsResponse]
(Int -> ReadS DescribeEmergencyContactSettingsResponse)
-> ReadS [DescribeEmergencyContactSettingsResponse]
-> ReadPrec DescribeEmergencyContactSettingsResponse
-> ReadPrec [DescribeEmergencyContactSettingsResponse]
-> Read DescribeEmergencyContactSettingsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeEmergencyContactSettingsResponse]
$creadListPrec :: ReadPrec [DescribeEmergencyContactSettingsResponse]
readPrec :: ReadPrec DescribeEmergencyContactSettingsResponse
$creadPrec :: ReadPrec DescribeEmergencyContactSettingsResponse
readList :: ReadS [DescribeEmergencyContactSettingsResponse]
$creadList :: ReadS [DescribeEmergencyContactSettingsResponse]
readsPrec :: Int -> ReadS DescribeEmergencyContactSettingsResponse
$creadsPrec :: Int -> ReadS DescribeEmergencyContactSettingsResponse
Prelude.Read, Int -> DescribeEmergencyContactSettingsResponse -> ShowS
[DescribeEmergencyContactSettingsResponse] -> ShowS
DescribeEmergencyContactSettingsResponse -> String
(Int -> DescribeEmergencyContactSettingsResponse -> ShowS)
-> (DescribeEmergencyContactSettingsResponse -> String)
-> ([DescribeEmergencyContactSettingsResponse] -> ShowS)
-> Show DescribeEmergencyContactSettingsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeEmergencyContactSettingsResponse] -> ShowS
$cshowList :: [DescribeEmergencyContactSettingsResponse] -> ShowS
show :: DescribeEmergencyContactSettingsResponse -> String
$cshow :: DescribeEmergencyContactSettingsResponse -> String
showsPrec :: Int -> DescribeEmergencyContactSettingsResponse -> ShowS
$cshowsPrec :: Int -> DescribeEmergencyContactSettingsResponse -> ShowS
Prelude.Show, (forall x.
DescribeEmergencyContactSettingsResponse
-> Rep DescribeEmergencyContactSettingsResponse x)
-> (forall x.
Rep DescribeEmergencyContactSettingsResponse x
-> DescribeEmergencyContactSettingsResponse)
-> Generic DescribeEmergencyContactSettingsResponse
forall x.
Rep DescribeEmergencyContactSettingsResponse x
-> DescribeEmergencyContactSettingsResponse
forall x.
DescribeEmergencyContactSettingsResponse
-> Rep DescribeEmergencyContactSettingsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeEmergencyContactSettingsResponse x
-> DescribeEmergencyContactSettingsResponse
$cfrom :: forall x.
DescribeEmergencyContactSettingsResponse
-> Rep DescribeEmergencyContactSettingsResponse x
Prelude.Generic)
newDescribeEmergencyContactSettingsResponse ::
Prelude.Int ->
DescribeEmergencyContactSettingsResponse
newDescribeEmergencyContactSettingsResponse :: Int -> DescribeEmergencyContactSettingsResponse
newDescribeEmergencyContactSettingsResponse
Int
pHttpStatus_ =
DescribeEmergencyContactSettingsResponse' :: Maybe [EmergencyContact]
-> Int -> DescribeEmergencyContactSettingsResponse
DescribeEmergencyContactSettingsResponse'
{ $sel:emergencyContactList:DescribeEmergencyContactSettingsResponse' :: Maybe [EmergencyContact]
emergencyContactList =
Maybe [EmergencyContact]
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DescribeEmergencyContactSettingsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
describeEmergencyContactSettingsResponse_emergencyContactList :: Lens.Lens' DescribeEmergencyContactSettingsResponse (Prelude.Maybe [EmergencyContact])
describeEmergencyContactSettingsResponse_emergencyContactList :: (Maybe [EmergencyContact] -> f (Maybe [EmergencyContact]))
-> DescribeEmergencyContactSettingsResponse
-> f DescribeEmergencyContactSettingsResponse
describeEmergencyContactSettingsResponse_emergencyContactList = (DescribeEmergencyContactSettingsResponse
-> Maybe [EmergencyContact])
-> (DescribeEmergencyContactSettingsResponse
-> Maybe [EmergencyContact]
-> DescribeEmergencyContactSettingsResponse)
-> Lens
DescribeEmergencyContactSettingsResponse
DescribeEmergencyContactSettingsResponse
(Maybe [EmergencyContact])
(Maybe [EmergencyContact])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeEmergencyContactSettingsResponse' {Maybe [EmergencyContact]
emergencyContactList :: Maybe [EmergencyContact]
$sel:emergencyContactList:DescribeEmergencyContactSettingsResponse' :: DescribeEmergencyContactSettingsResponse
-> Maybe [EmergencyContact]
emergencyContactList} -> Maybe [EmergencyContact]
emergencyContactList) (\s :: DescribeEmergencyContactSettingsResponse
s@DescribeEmergencyContactSettingsResponse' {} Maybe [EmergencyContact]
a -> DescribeEmergencyContactSettingsResponse
s {$sel:emergencyContactList:DescribeEmergencyContactSettingsResponse' :: Maybe [EmergencyContact]
emergencyContactList = Maybe [EmergencyContact]
a} :: DescribeEmergencyContactSettingsResponse) ((Maybe [EmergencyContact] -> f (Maybe [EmergencyContact]))
-> DescribeEmergencyContactSettingsResponse
-> f DescribeEmergencyContactSettingsResponse)
-> ((Maybe [EmergencyContact] -> f (Maybe [EmergencyContact]))
-> Maybe [EmergencyContact] -> f (Maybe [EmergencyContact]))
-> (Maybe [EmergencyContact] -> f (Maybe [EmergencyContact]))
-> DescribeEmergencyContactSettingsResponse
-> f DescribeEmergencyContactSettingsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[EmergencyContact]
[EmergencyContact]
[EmergencyContact]
[EmergencyContact]
-> Iso
(Maybe [EmergencyContact])
(Maybe [EmergencyContact])
(Maybe [EmergencyContact])
(Maybe [EmergencyContact])
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
[EmergencyContact]
[EmergencyContact]
[EmergencyContact]
[EmergencyContact]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
describeEmergencyContactSettingsResponse_httpStatus :: Lens.Lens' DescribeEmergencyContactSettingsResponse Prelude.Int
describeEmergencyContactSettingsResponse_httpStatus :: (Int -> f Int)
-> DescribeEmergencyContactSettingsResponse
-> f DescribeEmergencyContactSettingsResponse
describeEmergencyContactSettingsResponse_httpStatus = (DescribeEmergencyContactSettingsResponse -> Int)
-> (DescribeEmergencyContactSettingsResponse
-> Int -> DescribeEmergencyContactSettingsResponse)
-> Lens
DescribeEmergencyContactSettingsResponse
DescribeEmergencyContactSettingsResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeEmergencyContactSettingsResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeEmergencyContactSettingsResponse' :: DescribeEmergencyContactSettingsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeEmergencyContactSettingsResponse
s@DescribeEmergencyContactSettingsResponse' {} Int
a -> DescribeEmergencyContactSettingsResponse
s {$sel:httpStatus:DescribeEmergencyContactSettingsResponse' :: Int
httpStatus = Int
a} :: DescribeEmergencyContactSettingsResponse)
instance
Prelude.NFData
DescribeEmergencyContactSettingsResponse