{-# 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.SSMIncidents.GetIncidentRecord
(
GetIncidentRecord (..),
newGetIncidentRecord,
getIncidentRecord_arn,
GetIncidentRecordResponse (..),
newGetIncidentRecordResponse,
getIncidentRecordResponse_httpStatus,
getIncidentRecordResponse_incidentRecord,
)
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.SSMIncidents.Types
data GetIncidentRecord = GetIncidentRecord'
{
GetIncidentRecord -> Text
arn :: Prelude.Text
}
deriving (GetIncidentRecord -> GetIncidentRecord -> Bool
(GetIncidentRecord -> GetIncidentRecord -> Bool)
-> (GetIncidentRecord -> GetIncidentRecord -> Bool)
-> Eq GetIncidentRecord
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetIncidentRecord -> GetIncidentRecord -> Bool
$c/= :: GetIncidentRecord -> GetIncidentRecord -> Bool
== :: GetIncidentRecord -> GetIncidentRecord -> Bool
$c== :: GetIncidentRecord -> GetIncidentRecord -> Bool
Prelude.Eq, ReadPrec [GetIncidentRecord]
ReadPrec GetIncidentRecord
Int -> ReadS GetIncidentRecord
ReadS [GetIncidentRecord]
(Int -> ReadS GetIncidentRecord)
-> ReadS [GetIncidentRecord]
-> ReadPrec GetIncidentRecord
-> ReadPrec [GetIncidentRecord]
-> Read GetIncidentRecord
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetIncidentRecord]
$creadListPrec :: ReadPrec [GetIncidentRecord]
readPrec :: ReadPrec GetIncidentRecord
$creadPrec :: ReadPrec GetIncidentRecord
readList :: ReadS [GetIncidentRecord]
$creadList :: ReadS [GetIncidentRecord]
readsPrec :: Int -> ReadS GetIncidentRecord
$creadsPrec :: Int -> ReadS GetIncidentRecord
Prelude.Read, Int -> GetIncidentRecord -> ShowS
[GetIncidentRecord] -> ShowS
GetIncidentRecord -> String
(Int -> GetIncidentRecord -> ShowS)
-> (GetIncidentRecord -> String)
-> ([GetIncidentRecord] -> ShowS)
-> Show GetIncidentRecord
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetIncidentRecord] -> ShowS
$cshowList :: [GetIncidentRecord] -> ShowS
show :: GetIncidentRecord -> String
$cshow :: GetIncidentRecord -> String
showsPrec :: Int -> GetIncidentRecord -> ShowS
$cshowsPrec :: Int -> GetIncidentRecord -> ShowS
Prelude.Show, (forall x. GetIncidentRecord -> Rep GetIncidentRecord x)
-> (forall x. Rep GetIncidentRecord x -> GetIncidentRecord)
-> Generic GetIncidentRecord
forall x. Rep GetIncidentRecord x -> GetIncidentRecord
forall x. GetIncidentRecord -> Rep GetIncidentRecord x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetIncidentRecord x -> GetIncidentRecord
$cfrom :: forall x. GetIncidentRecord -> Rep GetIncidentRecord x
Prelude.Generic)
newGetIncidentRecord ::
Prelude.Text ->
GetIncidentRecord
newGetIncidentRecord :: Text -> GetIncidentRecord
newGetIncidentRecord Text
pArn_ =
GetIncidentRecord' :: Text -> GetIncidentRecord
GetIncidentRecord' {$sel:arn:GetIncidentRecord' :: Text
arn = Text
pArn_}
getIncidentRecord_arn :: Lens.Lens' GetIncidentRecord Prelude.Text
getIncidentRecord_arn :: (Text -> f Text) -> GetIncidentRecord -> f GetIncidentRecord
getIncidentRecord_arn = (GetIncidentRecord -> Text)
-> (GetIncidentRecord -> Text -> GetIncidentRecord)
-> Lens GetIncidentRecord GetIncidentRecord Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetIncidentRecord' {Text
arn :: Text
$sel:arn:GetIncidentRecord' :: GetIncidentRecord -> Text
arn} -> Text
arn) (\s :: GetIncidentRecord
s@GetIncidentRecord' {} Text
a -> GetIncidentRecord
s {$sel:arn:GetIncidentRecord' :: Text
arn = Text
a} :: GetIncidentRecord)
instance Core.AWSRequest GetIncidentRecord where
type
AWSResponse GetIncidentRecord =
GetIncidentRecordResponse
request :: GetIncidentRecord -> Request GetIncidentRecord
request = Service -> GetIncidentRecord -> Request GetIncidentRecord
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
response :: Logger
-> Service
-> Proxy GetIncidentRecord
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetIncidentRecord)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse GetIncidentRecord))
-> Logger
-> Service
-> Proxy GetIncidentRecord
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetIncidentRecord)))
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 ->
Int -> IncidentRecord -> GetIncidentRecordResponse
GetIncidentRecordResponse'
(Int -> IncidentRecord -> GetIncidentRecordResponse)
-> Either String Int
-> Either String (IncidentRecord -> GetIncidentRecordResponse)
forall (f :: * -> *) a b. Functor 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 (IncidentRecord -> GetIncidentRecordResponse)
-> Either String IncidentRecord
-> Either String GetIncidentRecordResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String IncidentRecord
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"incidentRecord")
)
instance Prelude.Hashable GetIncidentRecord
instance Prelude.NFData GetIncidentRecord
instance Core.ToHeaders GetIncidentRecord where
toHeaders :: GetIncidentRecord -> ResponseHeaders
toHeaders =
ResponseHeaders -> GetIncidentRecord -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ 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.ToPath GetIncidentRecord where
toPath :: GetIncidentRecord -> ByteString
toPath = ByteString -> GetIncidentRecord -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/getIncidentRecord"
instance Core.ToQuery GetIncidentRecord where
toQuery :: GetIncidentRecord -> QueryString
toQuery GetIncidentRecord' {Text
arn :: Text
$sel:arn:GetIncidentRecord' :: GetIncidentRecord -> Text
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"arn" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
arn]
data GetIncidentRecordResponse = GetIncidentRecordResponse'
{
GetIncidentRecordResponse -> Int
httpStatus :: Prelude.Int,
GetIncidentRecordResponse -> IncidentRecord
incidentRecord :: IncidentRecord
}
deriving (GetIncidentRecordResponse -> GetIncidentRecordResponse -> Bool
(GetIncidentRecordResponse -> GetIncidentRecordResponse -> Bool)
-> (GetIncidentRecordResponse -> GetIncidentRecordResponse -> Bool)
-> Eq GetIncidentRecordResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetIncidentRecordResponse -> GetIncidentRecordResponse -> Bool
$c/= :: GetIncidentRecordResponse -> GetIncidentRecordResponse -> Bool
== :: GetIncidentRecordResponse -> GetIncidentRecordResponse -> Bool
$c== :: GetIncidentRecordResponse -> GetIncidentRecordResponse -> Bool
Prelude.Eq, ReadPrec [GetIncidentRecordResponse]
ReadPrec GetIncidentRecordResponse
Int -> ReadS GetIncidentRecordResponse
ReadS [GetIncidentRecordResponse]
(Int -> ReadS GetIncidentRecordResponse)
-> ReadS [GetIncidentRecordResponse]
-> ReadPrec GetIncidentRecordResponse
-> ReadPrec [GetIncidentRecordResponse]
-> Read GetIncidentRecordResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetIncidentRecordResponse]
$creadListPrec :: ReadPrec [GetIncidentRecordResponse]
readPrec :: ReadPrec GetIncidentRecordResponse
$creadPrec :: ReadPrec GetIncidentRecordResponse
readList :: ReadS [GetIncidentRecordResponse]
$creadList :: ReadS [GetIncidentRecordResponse]
readsPrec :: Int -> ReadS GetIncidentRecordResponse
$creadsPrec :: Int -> ReadS GetIncidentRecordResponse
Prelude.Read, Int -> GetIncidentRecordResponse -> ShowS
[GetIncidentRecordResponse] -> ShowS
GetIncidentRecordResponse -> String
(Int -> GetIncidentRecordResponse -> ShowS)
-> (GetIncidentRecordResponse -> String)
-> ([GetIncidentRecordResponse] -> ShowS)
-> Show GetIncidentRecordResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetIncidentRecordResponse] -> ShowS
$cshowList :: [GetIncidentRecordResponse] -> ShowS
show :: GetIncidentRecordResponse -> String
$cshow :: GetIncidentRecordResponse -> String
showsPrec :: Int -> GetIncidentRecordResponse -> ShowS
$cshowsPrec :: Int -> GetIncidentRecordResponse -> ShowS
Prelude.Show, (forall x.
GetIncidentRecordResponse -> Rep GetIncidentRecordResponse x)
-> (forall x.
Rep GetIncidentRecordResponse x -> GetIncidentRecordResponse)
-> Generic GetIncidentRecordResponse
forall x.
Rep GetIncidentRecordResponse x -> GetIncidentRecordResponse
forall x.
GetIncidentRecordResponse -> Rep GetIncidentRecordResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetIncidentRecordResponse x -> GetIncidentRecordResponse
$cfrom :: forall x.
GetIncidentRecordResponse -> Rep GetIncidentRecordResponse x
Prelude.Generic)
newGetIncidentRecordResponse ::
Prelude.Int ->
IncidentRecord ->
GetIncidentRecordResponse
newGetIncidentRecordResponse :: Int -> IncidentRecord -> GetIncidentRecordResponse
newGetIncidentRecordResponse
Int
pHttpStatus_
IncidentRecord
pIncidentRecord_ =
GetIncidentRecordResponse' :: Int -> IncidentRecord -> GetIncidentRecordResponse
GetIncidentRecordResponse'
{ $sel:httpStatus:GetIncidentRecordResponse' :: Int
httpStatus =
Int
pHttpStatus_,
$sel:incidentRecord:GetIncidentRecordResponse' :: IncidentRecord
incidentRecord = IncidentRecord
pIncidentRecord_
}
getIncidentRecordResponse_httpStatus :: Lens.Lens' GetIncidentRecordResponse Prelude.Int
getIncidentRecordResponse_httpStatus :: (Int -> f Int)
-> GetIncidentRecordResponse -> f GetIncidentRecordResponse
getIncidentRecordResponse_httpStatus = (GetIncidentRecordResponse -> Int)
-> (GetIncidentRecordResponse -> Int -> GetIncidentRecordResponse)
-> Lens GetIncidentRecordResponse GetIncidentRecordResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetIncidentRecordResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetIncidentRecordResponse' :: GetIncidentRecordResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetIncidentRecordResponse
s@GetIncidentRecordResponse' {} Int
a -> GetIncidentRecordResponse
s {$sel:httpStatus:GetIncidentRecordResponse' :: Int
httpStatus = Int
a} :: GetIncidentRecordResponse)
getIncidentRecordResponse_incidentRecord :: Lens.Lens' GetIncidentRecordResponse IncidentRecord
getIncidentRecordResponse_incidentRecord :: (IncidentRecord -> f IncidentRecord)
-> GetIncidentRecordResponse -> f GetIncidentRecordResponse
getIncidentRecordResponse_incidentRecord = (GetIncidentRecordResponse -> IncidentRecord)
-> (GetIncidentRecordResponse
-> IncidentRecord -> GetIncidentRecordResponse)
-> Lens
GetIncidentRecordResponse
GetIncidentRecordResponse
IncidentRecord
IncidentRecord
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetIncidentRecordResponse' {IncidentRecord
incidentRecord :: IncidentRecord
$sel:incidentRecord:GetIncidentRecordResponse' :: GetIncidentRecordResponse -> IncidentRecord
incidentRecord} -> IncidentRecord
incidentRecord) (\s :: GetIncidentRecordResponse
s@GetIncidentRecordResponse' {} IncidentRecord
a -> GetIncidentRecordResponse
s {$sel:incidentRecord:GetIncidentRecordResponse' :: IncidentRecord
incidentRecord = IncidentRecord
a} :: GetIncidentRecordResponse)
instance Prelude.NFData GetIncidentRecordResponse