{-# 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.Support.DescribeSeverityLevels
(
DescribeSeverityLevels (..),
newDescribeSeverityLevels,
describeSeverityLevels_language,
DescribeSeverityLevelsResponse (..),
newDescribeSeverityLevelsResponse,
describeSeverityLevelsResponse_severityLevels,
describeSeverityLevelsResponse_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.Support.Types
data DescribeSeverityLevels = DescribeSeverityLevels'
{
DescribeSeverityLevels -> Maybe Text
language :: Prelude.Maybe Prelude.Text
}
deriving (DescribeSeverityLevels -> DescribeSeverityLevels -> Bool
(DescribeSeverityLevels -> DescribeSeverityLevels -> Bool)
-> (DescribeSeverityLevels -> DescribeSeverityLevels -> Bool)
-> Eq DescribeSeverityLevels
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeSeverityLevels -> DescribeSeverityLevels -> Bool
$c/= :: DescribeSeverityLevels -> DescribeSeverityLevels -> Bool
== :: DescribeSeverityLevels -> DescribeSeverityLevels -> Bool
$c== :: DescribeSeverityLevels -> DescribeSeverityLevels -> Bool
Prelude.Eq, ReadPrec [DescribeSeverityLevels]
ReadPrec DescribeSeverityLevels
Int -> ReadS DescribeSeverityLevels
ReadS [DescribeSeverityLevels]
(Int -> ReadS DescribeSeverityLevels)
-> ReadS [DescribeSeverityLevels]
-> ReadPrec DescribeSeverityLevels
-> ReadPrec [DescribeSeverityLevels]
-> Read DescribeSeverityLevels
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeSeverityLevels]
$creadListPrec :: ReadPrec [DescribeSeverityLevels]
readPrec :: ReadPrec DescribeSeverityLevels
$creadPrec :: ReadPrec DescribeSeverityLevels
readList :: ReadS [DescribeSeverityLevels]
$creadList :: ReadS [DescribeSeverityLevels]
readsPrec :: Int -> ReadS DescribeSeverityLevels
$creadsPrec :: Int -> ReadS DescribeSeverityLevels
Prelude.Read, Int -> DescribeSeverityLevels -> ShowS
[DescribeSeverityLevels] -> ShowS
DescribeSeverityLevels -> String
(Int -> DescribeSeverityLevels -> ShowS)
-> (DescribeSeverityLevels -> String)
-> ([DescribeSeverityLevels] -> ShowS)
-> Show DescribeSeverityLevels
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeSeverityLevels] -> ShowS
$cshowList :: [DescribeSeverityLevels] -> ShowS
show :: DescribeSeverityLevels -> String
$cshow :: DescribeSeverityLevels -> String
showsPrec :: Int -> DescribeSeverityLevels -> ShowS
$cshowsPrec :: Int -> DescribeSeverityLevels -> ShowS
Prelude.Show, (forall x. DescribeSeverityLevels -> Rep DescribeSeverityLevels x)
-> (forall x.
Rep DescribeSeverityLevels x -> DescribeSeverityLevels)
-> Generic DescribeSeverityLevels
forall x. Rep DescribeSeverityLevels x -> DescribeSeverityLevels
forall x. DescribeSeverityLevels -> Rep DescribeSeverityLevels x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeSeverityLevels x -> DescribeSeverityLevels
$cfrom :: forall x. DescribeSeverityLevels -> Rep DescribeSeverityLevels x
Prelude.Generic)
newDescribeSeverityLevels ::
DescribeSeverityLevels
newDescribeSeverityLevels :: DescribeSeverityLevels
newDescribeSeverityLevels =
DescribeSeverityLevels' :: Maybe Text -> DescribeSeverityLevels
DescribeSeverityLevels' {$sel:language:DescribeSeverityLevels' :: Maybe Text
language = Maybe Text
forall a. Maybe a
Prelude.Nothing}
describeSeverityLevels_language :: Lens.Lens' DescribeSeverityLevels (Prelude.Maybe Prelude.Text)
describeSeverityLevels_language :: (Maybe Text -> f (Maybe Text))
-> DescribeSeverityLevels -> f DescribeSeverityLevels
describeSeverityLevels_language = (DescribeSeverityLevels -> Maybe Text)
-> (DescribeSeverityLevels -> Maybe Text -> DescribeSeverityLevels)
-> Lens
DescribeSeverityLevels
DescribeSeverityLevels
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeSeverityLevels' {Maybe Text
language :: Maybe Text
$sel:language:DescribeSeverityLevels' :: DescribeSeverityLevels -> Maybe Text
language} -> Maybe Text
language) (\s :: DescribeSeverityLevels
s@DescribeSeverityLevels' {} Maybe Text
a -> DescribeSeverityLevels
s {$sel:language:DescribeSeverityLevels' :: Maybe Text
language = Maybe Text
a} :: DescribeSeverityLevels)
instance Core.AWSRequest DescribeSeverityLevels where
type
AWSResponse DescribeSeverityLevels =
DescribeSeverityLevelsResponse
request :: DescribeSeverityLevels -> Request DescribeSeverityLevels
request = Service -> DescribeSeverityLevels -> Request DescribeSeverityLevels
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DescribeSeverityLevels
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeSeverityLevels)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DescribeSeverityLevels))
-> Logger
-> Service
-> Proxy DescribeSeverityLevels
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeSeverityLevels)))
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 [SeverityLevel] -> Int -> DescribeSeverityLevelsResponse
DescribeSeverityLevelsResponse'
(Maybe [SeverityLevel] -> Int -> DescribeSeverityLevelsResponse)
-> Either String (Maybe [SeverityLevel])
-> Either String (Int -> DescribeSeverityLevelsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe (Maybe [SeverityLevel]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"severityLevels" Either String (Maybe (Maybe [SeverityLevel]))
-> Maybe [SeverityLevel] -> Either String (Maybe [SeverityLevel])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [SeverityLevel]
forall a. Monoid a => a
Prelude.mempty)
Either String (Int -> DescribeSeverityLevelsResponse)
-> Either String Int
-> Either String DescribeSeverityLevelsResponse
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 DescribeSeverityLevels
instance Prelude.NFData DescribeSeverityLevels
instance Core.ToHeaders DescribeSeverityLevels where
toHeaders :: DescribeSeverityLevels -> ResponseHeaders
toHeaders =
ResponseHeaders -> DescribeSeverityLevels -> 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
"AWSSupport_20130415.DescribeSeverityLevels" ::
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 DescribeSeverityLevels where
toJSON :: DescribeSeverityLevels -> Value
toJSON DescribeSeverityLevels' {Maybe Text
language :: Maybe Text
$sel:language:DescribeSeverityLevels' :: DescribeSeverityLevels -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[(Text
"language" 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
language]
)
instance Core.ToPath DescribeSeverityLevels where
toPath :: DescribeSeverityLevels -> ByteString
toPath = ByteString -> DescribeSeverityLevels -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DescribeSeverityLevels where
toQuery :: DescribeSeverityLevels -> QueryString
toQuery = QueryString -> DescribeSeverityLevels -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DescribeSeverityLevelsResponse = DescribeSeverityLevelsResponse'
{
DescribeSeverityLevelsResponse -> Maybe [SeverityLevel]
severityLevels :: Prelude.Maybe [SeverityLevel],
DescribeSeverityLevelsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DescribeSeverityLevelsResponse
-> DescribeSeverityLevelsResponse -> Bool
(DescribeSeverityLevelsResponse
-> DescribeSeverityLevelsResponse -> Bool)
-> (DescribeSeverityLevelsResponse
-> DescribeSeverityLevelsResponse -> Bool)
-> Eq DescribeSeverityLevelsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeSeverityLevelsResponse
-> DescribeSeverityLevelsResponse -> Bool
$c/= :: DescribeSeverityLevelsResponse
-> DescribeSeverityLevelsResponse -> Bool
== :: DescribeSeverityLevelsResponse
-> DescribeSeverityLevelsResponse -> Bool
$c== :: DescribeSeverityLevelsResponse
-> DescribeSeverityLevelsResponse -> Bool
Prelude.Eq, ReadPrec [DescribeSeverityLevelsResponse]
ReadPrec DescribeSeverityLevelsResponse
Int -> ReadS DescribeSeverityLevelsResponse
ReadS [DescribeSeverityLevelsResponse]
(Int -> ReadS DescribeSeverityLevelsResponse)
-> ReadS [DescribeSeverityLevelsResponse]
-> ReadPrec DescribeSeverityLevelsResponse
-> ReadPrec [DescribeSeverityLevelsResponse]
-> Read DescribeSeverityLevelsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeSeverityLevelsResponse]
$creadListPrec :: ReadPrec [DescribeSeverityLevelsResponse]
readPrec :: ReadPrec DescribeSeverityLevelsResponse
$creadPrec :: ReadPrec DescribeSeverityLevelsResponse
readList :: ReadS [DescribeSeverityLevelsResponse]
$creadList :: ReadS [DescribeSeverityLevelsResponse]
readsPrec :: Int -> ReadS DescribeSeverityLevelsResponse
$creadsPrec :: Int -> ReadS DescribeSeverityLevelsResponse
Prelude.Read, Int -> DescribeSeverityLevelsResponse -> ShowS
[DescribeSeverityLevelsResponse] -> ShowS
DescribeSeverityLevelsResponse -> String
(Int -> DescribeSeverityLevelsResponse -> ShowS)
-> (DescribeSeverityLevelsResponse -> String)
-> ([DescribeSeverityLevelsResponse] -> ShowS)
-> Show DescribeSeverityLevelsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeSeverityLevelsResponse] -> ShowS
$cshowList :: [DescribeSeverityLevelsResponse] -> ShowS
show :: DescribeSeverityLevelsResponse -> String
$cshow :: DescribeSeverityLevelsResponse -> String
showsPrec :: Int -> DescribeSeverityLevelsResponse -> ShowS
$cshowsPrec :: Int -> DescribeSeverityLevelsResponse -> ShowS
Prelude.Show, (forall x.
DescribeSeverityLevelsResponse
-> Rep DescribeSeverityLevelsResponse x)
-> (forall x.
Rep DescribeSeverityLevelsResponse x
-> DescribeSeverityLevelsResponse)
-> Generic DescribeSeverityLevelsResponse
forall x.
Rep DescribeSeverityLevelsResponse x
-> DescribeSeverityLevelsResponse
forall x.
DescribeSeverityLevelsResponse
-> Rep DescribeSeverityLevelsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeSeverityLevelsResponse x
-> DescribeSeverityLevelsResponse
$cfrom :: forall x.
DescribeSeverityLevelsResponse
-> Rep DescribeSeverityLevelsResponse x
Prelude.Generic)
newDescribeSeverityLevelsResponse ::
Prelude.Int ->
DescribeSeverityLevelsResponse
newDescribeSeverityLevelsResponse :: Int -> DescribeSeverityLevelsResponse
newDescribeSeverityLevelsResponse Int
pHttpStatus_ =
DescribeSeverityLevelsResponse' :: Maybe [SeverityLevel] -> Int -> DescribeSeverityLevelsResponse
DescribeSeverityLevelsResponse'
{ $sel:severityLevels:DescribeSeverityLevelsResponse' :: Maybe [SeverityLevel]
severityLevels =
Maybe [SeverityLevel]
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DescribeSeverityLevelsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
describeSeverityLevelsResponse_severityLevels :: Lens.Lens' DescribeSeverityLevelsResponse (Prelude.Maybe [SeverityLevel])
describeSeverityLevelsResponse_severityLevels :: (Maybe [SeverityLevel] -> f (Maybe [SeverityLevel]))
-> DescribeSeverityLevelsResponse
-> f DescribeSeverityLevelsResponse
describeSeverityLevelsResponse_severityLevels = (DescribeSeverityLevelsResponse -> Maybe [SeverityLevel])
-> (DescribeSeverityLevelsResponse
-> Maybe [SeverityLevel] -> DescribeSeverityLevelsResponse)
-> Lens
DescribeSeverityLevelsResponse
DescribeSeverityLevelsResponse
(Maybe [SeverityLevel])
(Maybe [SeverityLevel])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeSeverityLevelsResponse' {Maybe [SeverityLevel]
severityLevels :: Maybe [SeverityLevel]
$sel:severityLevels:DescribeSeverityLevelsResponse' :: DescribeSeverityLevelsResponse -> Maybe [SeverityLevel]
severityLevels} -> Maybe [SeverityLevel]
severityLevels) (\s :: DescribeSeverityLevelsResponse
s@DescribeSeverityLevelsResponse' {} Maybe [SeverityLevel]
a -> DescribeSeverityLevelsResponse
s {$sel:severityLevels:DescribeSeverityLevelsResponse' :: Maybe [SeverityLevel]
severityLevels = Maybe [SeverityLevel]
a} :: DescribeSeverityLevelsResponse) ((Maybe [SeverityLevel] -> f (Maybe [SeverityLevel]))
-> DescribeSeverityLevelsResponse
-> f DescribeSeverityLevelsResponse)
-> ((Maybe [SeverityLevel] -> f (Maybe [SeverityLevel]))
-> Maybe [SeverityLevel] -> f (Maybe [SeverityLevel]))
-> (Maybe [SeverityLevel] -> f (Maybe [SeverityLevel]))
-> DescribeSeverityLevelsResponse
-> f DescribeSeverityLevelsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[SeverityLevel] [SeverityLevel] [SeverityLevel] [SeverityLevel]
-> Iso
(Maybe [SeverityLevel])
(Maybe [SeverityLevel])
(Maybe [SeverityLevel])
(Maybe [SeverityLevel])
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
[SeverityLevel] [SeverityLevel] [SeverityLevel] [SeverityLevel]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
describeSeverityLevelsResponse_httpStatus :: Lens.Lens' DescribeSeverityLevelsResponse Prelude.Int
describeSeverityLevelsResponse_httpStatus :: (Int -> f Int)
-> DescribeSeverityLevelsResponse
-> f DescribeSeverityLevelsResponse
describeSeverityLevelsResponse_httpStatus = (DescribeSeverityLevelsResponse -> Int)
-> (DescribeSeverityLevelsResponse
-> Int -> DescribeSeverityLevelsResponse)
-> Lens
DescribeSeverityLevelsResponse
DescribeSeverityLevelsResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeSeverityLevelsResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeSeverityLevelsResponse' :: DescribeSeverityLevelsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeSeverityLevelsResponse
s@DescribeSeverityLevelsResponse' {} Int
a -> DescribeSeverityLevelsResponse
s {$sel:httpStatus:DescribeSeverityLevelsResponse' :: Int
httpStatus = Int
a} :: DescribeSeverityLevelsResponse)
instance
Prelude.NFData
DescribeSeverityLevelsResponse