{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.SSMIncidents.ListIncidentRecords
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Lists all incident records in your account. Use this command to retrieve
-- the Amazon Resource Name (ARN) of the incident record you want to
-- update.
--
-- This operation returns paginated results.
module Amazonka.SSMIncidents.ListIncidentRecords
  ( -- * Creating a Request
    ListIncidentRecords (..),
    newListIncidentRecords,

    -- * Request Lenses
    listIncidentRecords_filters,
    listIncidentRecords_nextToken,
    listIncidentRecords_maxResults,

    -- * Destructuring the Response
    ListIncidentRecordsResponse (..),
    newListIncidentRecordsResponse,

    -- * Response Lenses
    listIncidentRecordsResponse_nextToken,
    listIncidentRecordsResponse_httpStatus,
    listIncidentRecordsResponse_incidentRecordSummaries,
  )
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

-- | /See:/ 'newListIncidentRecords' smart constructor.
data ListIncidentRecords = ListIncidentRecords'
  { -- | Filter the list of incident records you are searching through. You can
    -- filter on the following keys:
    --
    -- -   @creationTime@
    --
    -- -   @impact@
    --
    -- -   @status@
    --
    -- -   @createdBy@
    ListIncidentRecords -> Maybe [Filter]
filters :: Prelude.Maybe [Filter],
    -- | The pagination token to continue to the next page of results.
    ListIncidentRecords -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of results per page.
    ListIncidentRecords -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural
  }
  deriving (ListIncidentRecords -> ListIncidentRecords -> Bool
(ListIncidentRecords -> ListIncidentRecords -> Bool)
-> (ListIncidentRecords -> ListIncidentRecords -> Bool)
-> Eq ListIncidentRecords
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]
(Int -> ReadS ListIncidentRecords)
-> ReadS [ListIncidentRecords]
-> ReadPrec ListIncidentRecords
-> ReadPrec [ListIncidentRecords]
-> Read 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
(Int -> ListIncidentRecords -> ShowS)
-> (ListIncidentRecords -> String)
-> ([ListIncidentRecords] -> ShowS)
-> Show ListIncidentRecords
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. ListIncidentRecords -> Rep ListIncidentRecords x)
-> (forall x. Rep ListIncidentRecords x -> ListIncidentRecords)
-> Generic ListIncidentRecords
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)

-- |
-- Create a value of 'ListIncidentRecords' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'filters', 'listIncidentRecords_filters' - Filter the list of incident records you are searching through. You can
-- filter on the following keys:
--
-- -   @creationTime@
--
-- -   @impact@
--
-- -   @status@
--
-- -   @createdBy@
--
-- 'nextToken', 'listIncidentRecords_nextToken' - The pagination token to continue to the next page of results.
--
-- 'maxResults', 'listIncidentRecords_maxResults' - The maximum number of results per page.
newListIncidentRecords ::
  ListIncidentRecords
newListIncidentRecords :: ListIncidentRecords
newListIncidentRecords =
  ListIncidentRecords' :: Maybe [Filter]
-> Maybe Text -> Maybe Natural -> ListIncidentRecords
ListIncidentRecords'
    { $sel:filters:ListIncidentRecords' :: Maybe [Filter]
filters = Maybe [Filter]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListIncidentRecords' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListIncidentRecords' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

-- | Filter the list of incident records you are searching through. You can
-- filter on the following keys:
--
-- -   @creationTime@
--
-- -   @impact@
--
-- -   @status@
--
-- -   @createdBy@
listIncidentRecords_filters :: Lens.Lens' ListIncidentRecords (Prelude.Maybe [Filter])
listIncidentRecords_filters :: (Maybe [Filter] -> f (Maybe [Filter]))
-> ListIncidentRecords -> f ListIncidentRecords
listIncidentRecords_filters = (ListIncidentRecords -> Maybe [Filter])
-> (ListIncidentRecords -> Maybe [Filter] -> ListIncidentRecords)
-> Lens
     ListIncidentRecords
     ListIncidentRecords
     (Maybe [Filter])
     (Maybe [Filter])
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) ((Maybe [Filter] -> f (Maybe [Filter]))
 -> ListIncidentRecords -> f ListIncidentRecords)
-> ((Maybe [Filter] -> f (Maybe [Filter]))
    -> Maybe [Filter] -> f (Maybe [Filter]))
-> (Maybe [Filter] -> f (Maybe [Filter]))
-> ListIncidentRecords
-> f ListIncidentRecords
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Filter] [Filter] [Filter] [Filter]
-> Iso
     (Maybe [Filter]) (Maybe [Filter]) (Maybe [Filter]) (Maybe [Filter])
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 [Filter] [Filter] [Filter] [Filter]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The pagination token to continue to the next page of results.
listIncidentRecords_nextToken :: Lens.Lens' ListIncidentRecords (Prelude.Maybe Prelude.Text)
listIncidentRecords_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListIncidentRecords -> f ListIncidentRecords
listIncidentRecords_nextToken = (ListIncidentRecords -> Maybe Text)
-> (ListIncidentRecords -> Maybe Text -> ListIncidentRecords)
-> Lens
     ListIncidentRecords ListIncidentRecords (Maybe Text) (Maybe Text)
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)

-- | The maximum number of results per page.
listIncidentRecords_maxResults :: Lens.Lens' ListIncidentRecords (Prelude.Maybe Prelude.Natural)
listIncidentRecords_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListIncidentRecords -> f ListIncidentRecords
listIncidentRecords_maxResults = (ListIncidentRecords -> Maybe Natural)
-> (ListIncidentRecords -> Maybe Natural -> ListIncidentRecords)
-> Lens
     ListIncidentRecords
     ListIncidentRecords
     (Maybe Natural)
     (Maybe Natural)
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)

instance Core.AWSPager ListIncidentRecords where
  page :: ListIncidentRecords
-> AWSResponse ListIncidentRecords -> Maybe ListIncidentRecords
page ListIncidentRecords
rq AWSResponse ListIncidentRecords
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListIncidentRecords
ListIncidentRecordsResponse
rs
            ListIncidentRecordsResponse
-> Getting (First Text) ListIncidentRecordsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListIncidentRecordsResponse
-> Const (First Text) ListIncidentRecordsResponse
Lens' ListIncidentRecordsResponse (Maybe Text)
listIncidentRecordsResponse_nextToken
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListIncidentRecordsResponse
 -> Const (First Text) ListIncidentRecordsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListIncidentRecordsResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe ListIncidentRecords
forall a. Maybe a
Prelude.Nothing
    | [IncidentRecordSummary] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListIncidentRecords
ListIncidentRecordsResponse
rs
            ListIncidentRecordsResponse
-> Getting
     [IncidentRecordSummary]
     ListIncidentRecordsResponse
     [IncidentRecordSummary]
-> [IncidentRecordSummary]
forall s a. s -> Getting a s a -> a
Lens.^. Getting
  [IncidentRecordSummary]
  ListIncidentRecordsResponse
  [IncidentRecordSummary]
Lens' ListIncidentRecordsResponse [IncidentRecordSummary]
listIncidentRecordsResponse_incidentRecordSummaries
        ) =
      Maybe ListIncidentRecords
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      ListIncidentRecords -> Maybe ListIncidentRecords
forall a. a -> Maybe a
Prelude.Just (ListIncidentRecords -> Maybe ListIncidentRecords)
-> ListIncidentRecords -> Maybe ListIncidentRecords
forall a b. (a -> b) -> a -> b
Prelude.$
        ListIncidentRecords
rq
          ListIncidentRecords
-> (ListIncidentRecords -> ListIncidentRecords)
-> ListIncidentRecords
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListIncidentRecords -> Identity ListIncidentRecords
Lens
  ListIncidentRecords ListIncidentRecords (Maybe Text) (Maybe Text)
listIncidentRecords_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> ListIncidentRecords -> Identity ListIncidentRecords)
-> Maybe Text -> ListIncidentRecords -> ListIncidentRecords
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListIncidentRecords
ListIncidentRecordsResponse
rs
          ListIncidentRecordsResponse
-> Getting (First Text) ListIncidentRecordsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListIncidentRecordsResponse
-> Const (First Text) ListIncidentRecordsResponse
Lens' ListIncidentRecordsResponse (Maybe Text)
listIncidentRecordsResponse_nextToken
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListIncidentRecordsResponse
 -> Const (First Text) ListIncidentRecordsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListIncidentRecordsResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

instance Core.AWSRequest ListIncidentRecords where
  type
    AWSResponse ListIncidentRecords =
      ListIncidentRecordsResponse
  request :: ListIncidentRecords -> Request ListIncidentRecords
request = Service -> ListIncidentRecords -> Request ListIncidentRecords
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy ListIncidentRecords
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListIncidentRecords)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ListIncidentRecords))
-> Logger
-> Service
-> Proxy ListIncidentRecords
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListIncidentRecords)))
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 Text
-> Int -> [IncidentRecordSummary] -> ListIncidentRecordsResponse
ListIncidentRecordsResponse'
            (Maybe Text
 -> Int -> [IncidentRecordSummary] -> ListIncidentRecordsResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Int -> [IncidentRecordSummary] -> ListIncidentRecordsResponse)
forall (f :: * -> *) a b. Functor 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
"nextToken")
            Either
  String
  (Int -> [IncidentRecordSummary] -> ListIncidentRecordsResponse)
-> Either String Int
-> Either
     String ([IncidentRecordSummary] -> ListIncidentRecordsResponse)
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))
            Either
  String ([IncidentRecordSummary] -> ListIncidentRecordsResponse)
-> Either String [IncidentRecordSummary]
-> Either String ListIncidentRecordsResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Either String (Maybe [IncidentRecordSummary])
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"incidentRecordSummaries"
                            Either String (Maybe [IncidentRecordSummary])
-> [IncidentRecordSummary] -> Either String [IncidentRecordSummary]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [IncidentRecordSummary]
forall a. Monoid a => a
Prelude.mempty
                        )
      )

instance Prelude.Hashable ListIncidentRecords

instance Prelude.NFData ListIncidentRecords

instance Core.ToHeaders ListIncidentRecords where
  toHeaders :: ListIncidentRecords -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListIncidentRecords -> 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.ToJSON ListIncidentRecords where
  toJSON :: ListIncidentRecords -> Value
toJSON ListIncidentRecords' {Maybe Natural
Maybe [Filter]
Maybe Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
filters :: Maybe [Filter]
$sel:maxResults:ListIncidentRecords' :: ListIncidentRecords -> Maybe Natural
$sel:nextToken:ListIncidentRecords' :: ListIncidentRecords -> Maybe Text
$sel:filters:ListIncidentRecords' :: ListIncidentRecords -> Maybe [Filter]
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"filters" Text -> [Filter] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Filter] -> Pair) -> Maybe [Filter] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Filter]
filters,
            (Text
"nextToken" 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
nextToken,
            (Text
"maxResults" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxResults
          ]
      )

instance Core.ToPath ListIncidentRecords where
  toPath :: ListIncidentRecords -> ByteString
toPath = ByteString -> ListIncidentRecords -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/listIncidentRecords"

instance Core.ToQuery ListIncidentRecords where
  toQuery :: ListIncidentRecords -> QueryString
toQuery = QueryString -> ListIncidentRecords -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newListIncidentRecordsResponse' smart constructor.
data ListIncidentRecordsResponse = ListIncidentRecordsResponse'
  { -- | The pagination token to continue to the next page of results.
    ListIncidentRecordsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListIncidentRecordsResponse -> Int
httpStatus :: Prelude.Int,
    -- | The details of each listed incident record.
    ListIncidentRecordsResponse -> [IncidentRecordSummary]
incidentRecordSummaries :: [IncidentRecordSummary]
  }
  deriving (ListIncidentRecordsResponse -> ListIncidentRecordsResponse -> Bool
(ListIncidentRecordsResponse
 -> ListIncidentRecordsResponse -> Bool)
-> (ListIncidentRecordsResponse
    -> ListIncidentRecordsResponse -> Bool)
-> Eq ListIncidentRecordsResponse
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]
(Int -> ReadS ListIncidentRecordsResponse)
-> ReadS [ListIncidentRecordsResponse]
-> ReadPrec ListIncidentRecordsResponse
-> ReadPrec [ListIncidentRecordsResponse]
-> Read 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
(Int -> ListIncidentRecordsResponse -> ShowS)
-> (ListIncidentRecordsResponse -> String)
-> ([ListIncidentRecordsResponse] -> ShowS)
-> Show ListIncidentRecordsResponse
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.
 ListIncidentRecordsResponse -> Rep ListIncidentRecordsResponse x)
-> (forall x.
    Rep ListIncidentRecordsResponse x -> ListIncidentRecordsResponse)
-> Generic ListIncidentRecordsResponse
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)

-- |
-- Create a value of 'ListIncidentRecordsResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'nextToken', 'listIncidentRecordsResponse_nextToken' - The pagination token to continue to the next page of results.
--
-- 'httpStatus', 'listIncidentRecordsResponse_httpStatus' - The response's http status code.
--
-- 'incidentRecordSummaries', 'listIncidentRecordsResponse_incidentRecordSummaries' - The details of each listed incident record.
newListIncidentRecordsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListIncidentRecordsResponse
newListIncidentRecordsResponse :: Int -> ListIncidentRecordsResponse
newListIncidentRecordsResponse Int
pHttpStatus_ =
  ListIncidentRecordsResponse' :: Maybe Text
-> Int -> [IncidentRecordSummary] -> ListIncidentRecordsResponse
ListIncidentRecordsResponse'
    { $sel:nextToken:ListIncidentRecordsResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListIncidentRecordsResponse' :: Int
httpStatus = Int
pHttpStatus_,
      $sel:incidentRecordSummaries:ListIncidentRecordsResponse' :: [IncidentRecordSummary]
incidentRecordSummaries = [IncidentRecordSummary]
forall a. Monoid a => a
Prelude.mempty
    }

-- | The pagination token to continue to the next page of results.
listIncidentRecordsResponse_nextToken :: Lens.Lens' ListIncidentRecordsResponse (Prelude.Maybe Prelude.Text)
listIncidentRecordsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListIncidentRecordsResponse -> f ListIncidentRecordsResponse
listIncidentRecordsResponse_nextToken = (ListIncidentRecordsResponse -> Maybe Text)
-> (ListIncidentRecordsResponse
    -> Maybe Text -> ListIncidentRecordsResponse)
-> Lens' ListIncidentRecordsResponse (Maybe Text)
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)

-- | The response's http status code.
listIncidentRecordsResponse_httpStatus :: Lens.Lens' ListIncidentRecordsResponse Prelude.Int
listIncidentRecordsResponse_httpStatus :: (Int -> f Int)
-> ListIncidentRecordsResponse -> f ListIncidentRecordsResponse
listIncidentRecordsResponse_httpStatus = (ListIncidentRecordsResponse -> Int)
-> (ListIncidentRecordsResponse
    -> Int -> ListIncidentRecordsResponse)
-> Lens
     ListIncidentRecordsResponse ListIncidentRecordsResponse Int Int
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)

-- | The details of each listed incident record.
listIncidentRecordsResponse_incidentRecordSummaries :: Lens.Lens' ListIncidentRecordsResponse [IncidentRecordSummary]
listIncidentRecordsResponse_incidentRecordSummaries :: ([IncidentRecordSummary] -> f [IncidentRecordSummary])
-> ListIncidentRecordsResponse -> f ListIncidentRecordsResponse
listIncidentRecordsResponse_incidentRecordSummaries = (ListIncidentRecordsResponse -> [IncidentRecordSummary])
-> (ListIncidentRecordsResponse
    -> [IncidentRecordSummary] -> ListIncidentRecordsResponse)
-> Lens' ListIncidentRecordsResponse [IncidentRecordSummary]
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) (([IncidentRecordSummary] -> f [IncidentRecordSummary])
 -> ListIncidentRecordsResponse -> f ListIncidentRecordsResponse)
-> (([IncidentRecordSummary] -> f [IncidentRecordSummary])
    -> [IncidentRecordSummary] -> f [IncidentRecordSummary])
-> ([IncidentRecordSummary] -> f [IncidentRecordSummary])
-> ListIncidentRecordsResponse
-> f ListIncidentRecordsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([IncidentRecordSummary] -> f [IncidentRecordSummary])
-> [IncidentRecordSummary] -> f [IncidentRecordSummary]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Prelude.NFData ListIncidentRecordsResponse