{-# 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.ListIncidentRecords
(
ListIncidentRecords (..),
newListIncidentRecords,
listIncidentRecords_filters,
listIncidentRecords_maxResults,
listIncidentRecords_nextToken,
ListIncidentRecordsResponse (..),
newListIncidentRecordsResponse,
listIncidentRecordsResponse_nextToken,
listIncidentRecordsResponse_httpStatus,
listIncidentRecordsResponse_incidentRecordSummaries,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.SSMIncidents.Types
data ListIncidentRecords = ListIncidentRecords'
{
ListIncidentRecords -> Maybe [Filter]
filters :: Prelude.Maybe [Filter],
ListIncidentRecords -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
ListIncidentRecords -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text
}
deriving (ListIncidentRecords -> ListIncidentRecords -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListIncidentRecords -> ListIncidentRecords -> Bool
$c/= :: ListIncidentRecords -> ListIncidentRecords -> Bool
== :: ListIncidentRecords -> ListIncidentRecords -> Bool
$c== :: ListIncidentRecords -> ListIncidentRecords -> Bool
Prelude.Eq, ReadPrec [ListIncidentRecords]
ReadPrec ListIncidentRecords
Int -> ReadS ListIncidentRecords
ReadS [ListIncidentRecords]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListIncidentRecords]
$creadListPrec :: ReadPrec [ListIncidentRecords]
readPrec :: ReadPrec ListIncidentRecords
$creadPrec :: ReadPrec ListIncidentRecords
readList :: ReadS [ListIncidentRecords]
$creadList :: ReadS [ListIncidentRecords]
readsPrec :: Int -> ReadS ListIncidentRecords
$creadsPrec :: Int -> ReadS ListIncidentRecords
Prelude.Read, Int -> ListIncidentRecords -> ShowS
[ListIncidentRecords] -> ShowS
ListIncidentRecords -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListIncidentRecords] -> ShowS
$cshowList :: [ListIncidentRecords] -> ShowS
show :: ListIncidentRecords -> String
$cshow :: ListIncidentRecords -> String
showsPrec :: Int -> ListIncidentRecords -> ShowS
$cshowsPrec :: Int -> ListIncidentRecords -> ShowS
Prelude.Show, forall x. Rep ListIncidentRecords x -> ListIncidentRecords
forall x. ListIncidentRecords -> Rep ListIncidentRecords x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListIncidentRecords x -> ListIncidentRecords
$cfrom :: forall x. ListIncidentRecords -> Rep ListIncidentRecords x
Prelude.Generic)
newListIncidentRecords ::
ListIncidentRecords
newListIncidentRecords :: ListIncidentRecords
newListIncidentRecords =
ListIncidentRecords'
{ $sel:filters:ListIncidentRecords' :: Maybe [Filter]
filters = forall a. Maybe a
Prelude.Nothing,
$sel:maxResults:ListIncidentRecords' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListIncidentRecords' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing
}
listIncidentRecords_filters :: Lens.Lens' ListIncidentRecords (Prelude.Maybe [Filter])
listIncidentRecords_filters :: Lens' ListIncidentRecords (Maybe [Filter])
listIncidentRecords_filters = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListIncidentRecords' {Maybe [Filter]
filters :: Maybe [Filter]
$sel:filters:ListIncidentRecords' :: ListIncidentRecords -> Maybe [Filter]
filters} -> Maybe [Filter]
filters) (\s :: ListIncidentRecords
s@ListIncidentRecords' {} Maybe [Filter]
a -> ListIncidentRecords
s {$sel:filters:ListIncidentRecords' :: Maybe [Filter]
filters = Maybe [Filter]
a} :: ListIncidentRecords) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
listIncidentRecords_maxResults :: Lens.Lens' ListIncidentRecords (Prelude.Maybe Prelude.Natural)
listIncidentRecords_maxResults :: Lens' ListIncidentRecords (Maybe Natural)
listIncidentRecords_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListIncidentRecords' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListIncidentRecords' :: ListIncidentRecords -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListIncidentRecords
s@ListIncidentRecords' {} Maybe Natural
a -> ListIncidentRecords
s {$sel:maxResults:ListIncidentRecords' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListIncidentRecords)
listIncidentRecords_nextToken :: Lens.Lens' ListIncidentRecords (Prelude.Maybe Prelude.Text)
listIncidentRecords_nextToken :: Lens' ListIncidentRecords (Maybe Text)
listIncidentRecords_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListIncidentRecords' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListIncidentRecords' :: ListIncidentRecords -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListIncidentRecords
s@ListIncidentRecords' {} Maybe Text
a -> ListIncidentRecords
s {$sel:nextToken:ListIncidentRecords' :: Maybe Text
nextToken = Maybe Text
a} :: ListIncidentRecords)
instance Core.AWSPager ListIncidentRecords where
page :: ListIncidentRecords
-> AWSResponse ListIncidentRecords -> Maybe ListIncidentRecords
page ListIncidentRecords
rq AWSResponse ListIncidentRecords
rs
| forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse ListIncidentRecords
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListIncidentRecordsResponse (Maybe Text)
listIncidentRecordsResponse_nextToken
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
) =
forall a. Maybe a
Prelude.Nothing
| forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse ListIncidentRecords
rs
forall s a. s -> Getting a s a -> a
Lens.^. Lens' ListIncidentRecordsResponse [IncidentRecordSummary]
listIncidentRecordsResponse_incidentRecordSummaries
) =
forall a. Maybe a
Prelude.Nothing
| Bool
Prelude.otherwise =
forall a. a -> Maybe a
Prelude.Just
forall a b. (a -> b) -> a -> b
Prelude.$ ListIncidentRecords
rq
forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListIncidentRecords (Maybe Text)
listIncidentRecords_nextToken
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListIncidentRecords
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListIncidentRecordsResponse (Maybe Text)
listIncidentRecordsResponse_nextToken
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
instance Core.AWSRequest ListIncidentRecords where
type
AWSResponse ListIncidentRecords =
ListIncidentRecordsResponse
request :: (Service -> Service)
-> ListIncidentRecords -> Request ListIncidentRecords
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy ListIncidentRecords
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ListIncidentRecords)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe Text
-> Int -> [IncidentRecordSummary] -> ListIncidentRecordsResponse
ListIncidentRecordsResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"nextToken")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x
forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"incidentRecordSummaries"
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
)
)
instance Prelude.Hashable ListIncidentRecords where
hashWithSalt :: Int -> ListIncidentRecords -> Int
hashWithSalt Int
_salt ListIncidentRecords' {Maybe Natural
Maybe [Filter]
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
filters :: Maybe [Filter]
$sel:nextToken:ListIncidentRecords' :: ListIncidentRecords -> Maybe Text
$sel:maxResults:ListIncidentRecords' :: ListIncidentRecords -> Maybe Natural
$sel:filters:ListIncidentRecords' :: ListIncidentRecords -> Maybe [Filter]
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Filter]
filters
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxResults
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
instance Prelude.NFData ListIncidentRecords where
rnf :: ListIncidentRecords -> ()
rnf ListIncidentRecords' {Maybe Natural
Maybe [Filter]
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
filters :: Maybe [Filter]
$sel:nextToken:ListIncidentRecords' :: ListIncidentRecords -> Maybe Text
$sel:maxResults:ListIncidentRecords' :: ListIncidentRecords -> Maybe Natural
$sel:filters:ListIncidentRecords' :: ListIncidentRecords -> Maybe [Filter]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [Filter]
filters
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
maxResults
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
instance Data.ToHeaders ListIncidentRecords where
toHeaders :: ListIncidentRecords -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON ListIncidentRecords where
toJSON :: ListIncidentRecords -> Value
toJSON ListIncidentRecords' {Maybe Natural
Maybe [Filter]
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
filters :: Maybe [Filter]
$sel:nextToken:ListIncidentRecords' :: ListIncidentRecords -> Maybe Text
$sel:maxResults:ListIncidentRecords' :: ListIncidentRecords -> Maybe Natural
$sel:filters:ListIncidentRecords' :: ListIncidentRecords -> Maybe [Filter]
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"filters" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Filter]
filters,
(Key
"maxResults" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxResults,
(Key
"nextToken" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextToken
]
)
instance Data.ToPath ListIncidentRecords where
toPath :: ListIncidentRecords -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/listIncidentRecords"
instance Data.ToQuery ListIncidentRecords where
toQuery :: ListIncidentRecords -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data ListIncidentRecordsResponse = ListIncidentRecordsResponse'
{
ListIncidentRecordsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListIncidentRecordsResponse -> Int
httpStatus :: Prelude.Int,
ListIncidentRecordsResponse -> [IncidentRecordSummary]
incidentRecordSummaries :: [IncidentRecordSummary]
}
deriving (ListIncidentRecordsResponse -> ListIncidentRecordsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListIncidentRecordsResponse -> ListIncidentRecordsResponse -> Bool
$c/= :: ListIncidentRecordsResponse -> ListIncidentRecordsResponse -> Bool
== :: ListIncidentRecordsResponse -> ListIncidentRecordsResponse -> Bool
$c== :: ListIncidentRecordsResponse -> ListIncidentRecordsResponse -> Bool
Prelude.Eq, ReadPrec [ListIncidentRecordsResponse]
ReadPrec ListIncidentRecordsResponse
Int -> ReadS ListIncidentRecordsResponse
ReadS [ListIncidentRecordsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListIncidentRecordsResponse]
$creadListPrec :: ReadPrec [ListIncidentRecordsResponse]
readPrec :: ReadPrec ListIncidentRecordsResponse
$creadPrec :: ReadPrec ListIncidentRecordsResponse
readList :: ReadS [ListIncidentRecordsResponse]
$creadList :: ReadS [ListIncidentRecordsResponse]
readsPrec :: Int -> ReadS ListIncidentRecordsResponse
$creadsPrec :: Int -> ReadS ListIncidentRecordsResponse
Prelude.Read, Int -> ListIncidentRecordsResponse -> ShowS
[ListIncidentRecordsResponse] -> ShowS
ListIncidentRecordsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListIncidentRecordsResponse] -> ShowS
$cshowList :: [ListIncidentRecordsResponse] -> ShowS
show :: ListIncidentRecordsResponse -> String
$cshow :: ListIncidentRecordsResponse -> String
showsPrec :: Int -> ListIncidentRecordsResponse -> ShowS
$cshowsPrec :: Int -> ListIncidentRecordsResponse -> ShowS
Prelude.Show, forall x.
Rep ListIncidentRecordsResponse x -> ListIncidentRecordsResponse
forall x.
ListIncidentRecordsResponse -> Rep ListIncidentRecordsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListIncidentRecordsResponse x -> ListIncidentRecordsResponse
$cfrom :: forall x.
ListIncidentRecordsResponse -> Rep ListIncidentRecordsResponse x
Prelude.Generic)
newListIncidentRecordsResponse ::
Prelude.Int ->
ListIncidentRecordsResponse
newListIncidentRecordsResponse :: Int -> ListIncidentRecordsResponse
newListIncidentRecordsResponse Int
pHttpStatus_ =
ListIncidentRecordsResponse'
{ $sel:nextToken:ListIncidentRecordsResponse' :: Maybe Text
nextToken =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListIncidentRecordsResponse' :: Int
httpStatus = Int
pHttpStatus_,
$sel:incidentRecordSummaries:ListIncidentRecordsResponse' :: [IncidentRecordSummary]
incidentRecordSummaries = forall a. Monoid a => a
Prelude.mempty
}
listIncidentRecordsResponse_nextToken :: Lens.Lens' ListIncidentRecordsResponse (Prelude.Maybe Prelude.Text)
listIncidentRecordsResponse_nextToken :: Lens' ListIncidentRecordsResponse (Maybe Text)
listIncidentRecordsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListIncidentRecordsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListIncidentRecordsResponse' :: ListIncidentRecordsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListIncidentRecordsResponse
s@ListIncidentRecordsResponse' {} Maybe Text
a -> ListIncidentRecordsResponse
s {$sel:nextToken:ListIncidentRecordsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListIncidentRecordsResponse)
listIncidentRecordsResponse_httpStatus :: Lens.Lens' ListIncidentRecordsResponse Prelude.Int
listIncidentRecordsResponse_httpStatus :: Lens' ListIncidentRecordsResponse Int
listIncidentRecordsResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListIncidentRecordsResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListIncidentRecordsResponse' :: ListIncidentRecordsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListIncidentRecordsResponse
s@ListIncidentRecordsResponse' {} Int
a -> ListIncidentRecordsResponse
s {$sel:httpStatus:ListIncidentRecordsResponse' :: Int
httpStatus = Int
a} :: ListIncidentRecordsResponse)
listIncidentRecordsResponse_incidentRecordSummaries :: Lens.Lens' ListIncidentRecordsResponse [IncidentRecordSummary]
listIncidentRecordsResponse_incidentRecordSummaries :: Lens' ListIncidentRecordsResponse [IncidentRecordSummary]
listIncidentRecordsResponse_incidentRecordSummaries = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListIncidentRecordsResponse' {[IncidentRecordSummary]
incidentRecordSummaries :: [IncidentRecordSummary]
$sel:incidentRecordSummaries:ListIncidentRecordsResponse' :: ListIncidentRecordsResponse -> [IncidentRecordSummary]
incidentRecordSummaries} -> [IncidentRecordSummary]
incidentRecordSummaries) (\s :: ListIncidentRecordsResponse
s@ListIncidentRecordsResponse' {} [IncidentRecordSummary]
a -> ListIncidentRecordsResponse
s {$sel:incidentRecordSummaries:ListIncidentRecordsResponse' :: [IncidentRecordSummary]
incidentRecordSummaries = [IncidentRecordSummary]
a} :: ListIncidentRecordsResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Prelude.NFData ListIncidentRecordsResponse where
rnf :: ListIncidentRecordsResponse -> ()
rnf ListIncidentRecordsResponse' {Int
[IncidentRecordSummary]
Maybe Text
incidentRecordSummaries :: [IncidentRecordSummary]
httpStatus :: Int
nextToken :: Maybe Text
$sel:incidentRecordSummaries:ListIncidentRecordsResponse' :: ListIncidentRecordsResponse -> [IncidentRecordSummary]
$sel:httpStatus:ListIncidentRecordsResponse' :: ListIncidentRecordsResponse -> Int
$sel:nextToken:ListIncidentRecordsResponse' :: ListIncidentRecordsResponse -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf [IncidentRecordSummary]
incidentRecordSummaries