{-# 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.ApplicationCostProfiler.ListReportDefinitions
-- 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)
--
-- Retrieves a list of all reports and their configurations for your AWS
-- account.
--
-- The maximum number of reports is one.
--
-- This operation returns paginated results.
module Amazonka.ApplicationCostProfiler.ListReportDefinitions
  ( -- * Creating a Request
    ListReportDefinitions (..),
    newListReportDefinitions,

    -- * Request Lenses
    listReportDefinitions_nextToken,
    listReportDefinitions_maxResults,

    -- * Destructuring the Response
    ListReportDefinitionsResponse (..),
    newListReportDefinitionsResponse,

    -- * Response Lenses
    listReportDefinitionsResponse_nextToken,
    listReportDefinitionsResponse_reportDefinitions,
    listReportDefinitionsResponse_httpStatus,
  )
where

import Amazonka.ApplicationCostProfiler.Types
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

-- | /See:/ 'newListReportDefinitions' smart constructor.
data ListReportDefinitions = ListReportDefinitions'
  { -- | The token value from a previous call to access the next page of results.
    ListReportDefinitions -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of results to return.
    ListReportDefinitions -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural
  }
  deriving (ListReportDefinitions -> ListReportDefinitions -> Bool
(ListReportDefinitions -> ListReportDefinitions -> Bool)
-> (ListReportDefinitions -> ListReportDefinitions -> Bool)
-> Eq ListReportDefinitions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListReportDefinitions -> ListReportDefinitions -> Bool
$c/= :: ListReportDefinitions -> ListReportDefinitions -> Bool
== :: ListReportDefinitions -> ListReportDefinitions -> Bool
$c== :: ListReportDefinitions -> ListReportDefinitions -> Bool
Prelude.Eq, ReadPrec [ListReportDefinitions]
ReadPrec ListReportDefinitions
Int -> ReadS ListReportDefinitions
ReadS [ListReportDefinitions]
(Int -> ReadS ListReportDefinitions)
-> ReadS [ListReportDefinitions]
-> ReadPrec ListReportDefinitions
-> ReadPrec [ListReportDefinitions]
-> Read ListReportDefinitions
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListReportDefinitions]
$creadListPrec :: ReadPrec [ListReportDefinitions]
readPrec :: ReadPrec ListReportDefinitions
$creadPrec :: ReadPrec ListReportDefinitions
readList :: ReadS [ListReportDefinitions]
$creadList :: ReadS [ListReportDefinitions]
readsPrec :: Int -> ReadS ListReportDefinitions
$creadsPrec :: Int -> ReadS ListReportDefinitions
Prelude.Read, Int -> ListReportDefinitions -> ShowS
[ListReportDefinitions] -> ShowS
ListReportDefinitions -> String
(Int -> ListReportDefinitions -> ShowS)
-> (ListReportDefinitions -> String)
-> ([ListReportDefinitions] -> ShowS)
-> Show ListReportDefinitions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListReportDefinitions] -> ShowS
$cshowList :: [ListReportDefinitions] -> ShowS
show :: ListReportDefinitions -> String
$cshow :: ListReportDefinitions -> String
showsPrec :: Int -> ListReportDefinitions -> ShowS
$cshowsPrec :: Int -> ListReportDefinitions -> ShowS
Prelude.Show, (forall x. ListReportDefinitions -> Rep ListReportDefinitions x)
-> (forall x. Rep ListReportDefinitions x -> ListReportDefinitions)
-> Generic ListReportDefinitions
forall x. Rep ListReportDefinitions x -> ListReportDefinitions
forall x. ListReportDefinitions -> Rep ListReportDefinitions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListReportDefinitions x -> ListReportDefinitions
$cfrom :: forall x. ListReportDefinitions -> Rep ListReportDefinitions x
Prelude.Generic)

-- |
-- Create a value of 'ListReportDefinitions' 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', 'listReportDefinitions_nextToken' - The token value from a previous call to access the next page of results.
--
-- 'maxResults', 'listReportDefinitions_maxResults' - The maximum number of results to return.
newListReportDefinitions ::
  ListReportDefinitions
newListReportDefinitions :: ListReportDefinitions
newListReportDefinitions =
  ListReportDefinitions' :: Maybe Text -> Maybe Natural -> ListReportDefinitions
ListReportDefinitions'
    { $sel:nextToken:ListReportDefinitions' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListReportDefinitions' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

-- | The token value from a previous call to access the next page of results.
listReportDefinitions_nextToken :: Lens.Lens' ListReportDefinitions (Prelude.Maybe Prelude.Text)
listReportDefinitions_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListReportDefinitions -> f ListReportDefinitions
listReportDefinitions_nextToken = (ListReportDefinitions -> Maybe Text)
-> (ListReportDefinitions -> Maybe Text -> ListReportDefinitions)
-> Lens
     ListReportDefinitions
     ListReportDefinitions
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListReportDefinitions' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListReportDefinitions' :: ListReportDefinitions -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListReportDefinitions
s@ListReportDefinitions' {} Maybe Text
a -> ListReportDefinitions
s {$sel:nextToken:ListReportDefinitions' :: Maybe Text
nextToken = Maybe Text
a} :: ListReportDefinitions)

-- | The maximum number of results to return.
listReportDefinitions_maxResults :: Lens.Lens' ListReportDefinitions (Prelude.Maybe Prelude.Natural)
listReportDefinitions_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListReportDefinitions -> f ListReportDefinitions
listReportDefinitions_maxResults = (ListReportDefinitions -> Maybe Natural)
-> (ListReportDefinitions
    -> Maybe Natural -> ListReportDefinitions)
-> Lens
     ListReportDefinitions
     ListReportDefinitions
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListReportDefinitions' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListReportDefinitions' :: ListReportDefinitions -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListReportDefinitions
s@ListReportDefinitions' {} Maybe Natural
a -> ListReportDefinitions
s {$sel:maxResults:ListReportDefinitions' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListReportDefinitions)

instance Core.AWSPager ListReportDefinitions where
  page :: ListReportDefinitions
-> AWSResponse ListReportDefinitions -> Maybe ListReportDefinitions
page ListReportDefinitions
rq AWSResponse ListReportDefinitions
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListReportDefinitions
ListReportDefinitionsResponse
rs
            ListReportDefinitionsResponse
-> Getting (First Text) ListReportDefinitionsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListReportDefinitionsResponse
-> Const (First Text) ListReportDefinitionsResponse
Lens' ListReportDefinitionsResponse (Maybe Text)
listReportDefinitionsResponse_nextToken
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListReportDefinitionsResponse
 -> Const (First Text) ListReportDefinitionsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListReportDefinitionsResponse 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 ListReportDefinitions
forall a. Maybe a
Prelude.Nothing
    | Maybe [ReportDefinition] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListReportDefinitions
ListReportDefinitionsResponse
rs
            ListReportDefinitionsResponse
-> Getting
     (First [ReportDefinition])
     ListReportDefinitionsResponse
     [ReportDefinition]
-> Maybe [ReportDefinition]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [ReportDefinition]
 -> Const (First [ReportDefinition]) (Maybe [ReportDefinition]))
-> ListReportDefinitionsResponse
-> Const (First [ReportDefinition]) ListReportDefinitionsResponse
Lens' ListReportDefinitionsResponse (Maybe [ReportDefinition])
listReportDefinitionsResponse_reportDefinitions
              ((Maybe [ReportDefinition]
  -> Const (First [ReportDefinition]) (Maybe [ReportDefinition]))
 -> ListReportDefinitionsResponse
 -> Const (First [ReportDefinition]) ListReportDefinitionsResponse)
-> (([ReportDefinition]
     -> Const (First [ReportDefinition]) [ReportDefinition])
    -> Maybe [ReportDefinition]
    -> Const (First [ReportDefinition]) (Maybe [ReportDefinition]))
-> Getting
     (First [ReportDefinition])
     ListReportDefinitionsResponse
     [ReportDefinition]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([ReportDefinition]
 -> Const (First [ReportDefinition]) [ReportDefinition])
-> Maybe [ReportDefinition]
-> Const (First [ReportDefinition]) (Maybe [ReportDefinition])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe ListReportDefinitions
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      ListReportDefinitions -> Maybe ListReportDefinitions
forall a. a -> Maybe a
Prelude.Just (ListReportDefinitions -> Maybe ListReportDefinitions)
-> ListReportDefinitions -> Maybe ListReportDefinitions
forall a b. (a -> b) -> a -> b
Prelude.$
        ListReportDefinitions
rq
          ListReportDefinitions
-> (ListReportDefinitions -> ListReportDefinitions)
-> ListReportDefinitions
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListReportDefinitions -> Identity ListReportDefinitions
Lens
  ListReportDefinitions
  ListReportDefinitions
  (Maybe Text)
  (Maybe Text)
listReportDefinitions_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> ListReportDefinitions -> Identity ListReportDefinitions)
-> Maybe Text -> ListReportDefinitions -> ListReportDefinitions
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListReportDefinitions
ListReportDefinitionsResponse
rs
          ListReportDefinitionsResponse
-> Getting (First Text) ListReportDefinitionsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListReportDefinitionsResponse
-> Const (First Text) ListReportDefinitionsResponse
Lens' ListReportDefinitionsResponse (Maybe Text)
listReportDefinitionsResponse_nextToken
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListReportDefinitionsResponse
 -> Const (First Text) ListReportDefinitionsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListReportDefinitionsResponse 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 ListReportDefinitions where
  type
    AWSResponse ListReportDefinitions =
      ListReportDefinitionsResponse
  request :: ListReportDefinitions -> Request ListReportDefinitions
request = Service -> ListReportDefinitions -> Request ListReportDefinitions
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy ListReportDefinitions
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListReportDefinitions)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ListReportDefinitions))
-> Logger
-> Service
-> Proxy ListReportDefinitions
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListReportDefinitions)))
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
-> Maybe [ReportDefinition] -> Int -> ListReportDefinitionsResponse
ListReportDefinitionsResponse'
            (Maybe Text
 -> Maybe [ReportDefinition]
 -> Int
 -> ListReportDefinitionsResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe [ReportDefinition] -> Int -> ListReportDefinitionsResponse)
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
  (Maybe [ReportDefinition] -> Int -> ListReportDefinitionsResponse)
-> Either String (Maybe [ReportDefinition])
-> Either String (Int -> ListReportDefinitionsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Either String (Maybe (Maybe [ReportDefinition]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"reportDefinitions"
                            Either String (Maybe (Maybe [ReportDefinition]))
-> Maybe [ReportDefinition]
-> Either String (Maybe [ReportDefinition])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [ReportDefinition]
forall a. Monoid a => a
Prelude.mempty
                        )
            Either String (Int -> ListReportDefinitionsResponse)
-> Either String Int -> Either String ListReportDefinitionsResponse
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 ListReportDefinitions

instance Prelude.NFData ListReportDefinitions

instance Core.ToHeaders ListReportDefinitions where
  toHeaders :: ListReportDefinitions -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListReportDefinitions -> 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 ListReportDefinitions where
  toPath :: ListReportDefinitions -> ByteString
toPath = ByteString -> ListReportDefinitions -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/reportDefinition"

instance Core.ToQuery ListReportDefinitions where
  toQuery :: ListReportDefinitions -> QueryString
toQuery ListReportDefinitions' {Maybe Natural
Maybe Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:maxResults:ListReportDefinitions' :: ListReportDefinitions -> Maybe Natural
$sel:nextToken:ListReportDefinitions' :: ListReportDefinitions -> Maybe Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"nextToken" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
nextToken,
        ByteString
"maxResults" ByteString -> Maybe Natural -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Natural
maxResults
      ]

-- | /See:/ 'newListReportDefinitionsResponse' smart constructor.
data ListReportDefinitionsResponse = ListReportDefinitionsResponse'
  { -- | The value of the next token, if it exists. Null if there are no more
    -- results.
    ListReportDefinitionsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The retrieved reports.
    ListReportDefinitionsResponse -> Maybe [ReportDefinition]
reportDefinitions :: Prelude.Maybe [ReportDefinition],
    -- | The response's http status code.
    ListReportDefinitionsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListReportDefinitionsResponse
-> ListReportDefinitionsResponse -> Bool
(ListReportDefinitionsResponse
 -> ListReportDefinitionsResponse -> Bool)
-> (ListReportDefinitionsResponse
    -> ListReportDefinitionsResponse -> Bool)
-> Eq ListReportDefinitionsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListReportDefinitionsResponse
-> ListReportDefinitionsResponse -> Bool
$c/= :: ListReportDefinitionsResponse
-> ListReportDefinitionsResponse -> Bool
== :: ListReportDefinitionsResponse
-> ListReportDefinitionsResponse -> Bool
$c== :: ListReportDefinitionsResponse
-> ListReportDefinitionsResponse -> Bool
Prelude.Eq, ReadPrec [ListReportDefinitionsResponse]
ReadPrec ListReportDefinitionsResponse
Int -> ReadS ListReportDefinitionsResponse
ReadS [ListReportDefinitionsResponse]
(Int -> ReadS ListReportDefinitionsResponse)
-> ReadS [ListReportDefinitionsResponse]
-> ReadPrec ListReportDefinitionsResponse
-> ReadPrec [ListReportDefinitionsResponse]
-> Read ListReportDefinitionsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListReportDefinitionsResponse]
$creadListPrec :: ReadPrec [ListReportDefinitionsResponse]
readPrec :: ReadPrec ListReportDefinitionsResponse
$creadPrec :: ReadPrec ListReportDefinitionsResponse
readList :: ReadS [ListReportDefinitionsResponse]
$creadList :: ReadS [ListReportDefinitionsResponse]
readsPrec :: Int -> ReadS ListReportDefinitionsResponse
$creadsPrec :: Int -> ReadS ListReportDefinitionsResponse
Prelude.Read, Int -> ListReportDefinitionsResponse -> ShowS
[ListReportDefinitionsResponse] -> ShowS
ListReportDefinitionsResponse -> String
(Int -> ListReportDefinitionsResponse -> ShowS)
-> (ListReportDefinitionsResponse -> String)
-> ([ListReportDefinitionsResponse] -> ShowS)
-> Show ListReportDefinitionsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListReportDefinitionsResponse] -> ShowS
$cshowList :: [ListReportDefinitionsResponse] -> ShowS
show :: ListReportDefinitionsResponse -> String
$cshow :: ListReportDefinitionsResponse -> String
showsPrec :: Int -> ListReportDefinitionsResponse -> ShowS
$cshowsPrec :: Int -> ListReportDefinitionsResponse -> ShowS
Prelude.Show, (forall x.
 ListReportDefinitionsResponse
 -> Rep ListReportDefinitionsResponse x)
-> (forall x.
    Rep ListReportDefinitionsResponse x
    -> ListReportDefinitionsResponse)
-> Generic ListReportDefinitionsResponse
forall x.
Rep ListReportDefinitionsResponse x
-> ListReportDefinitionsResponse
forall x.
ListReportDefinitionsResponse
-> Rep ListReportDefinitionsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListReportDefinitionsResponse x
-> ListReportDefinitionsResponse
$cfrom :: forall x.
ListReportDefinitionsResponse
-> Rep ListReportDefinitionsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListReportDefinitionsResponse' 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', 'listReportDefinitionsResponse_nextToken' - The value of the next token, if it exists. Null if there are no more
-- results.
--
-- 'reportDefinitions', 'listReportDefinitionsResponse_reportDefinitions' - The retrieved reports.
--
-- 'httpStatus', 'listReportDefinitionsResponse_httpStatus' - The response's http status code.
newListReportDefinitionsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListReportDefinitionsResponse
newListReportDefinitionsResponse :: Int -> ListReportDefinitionsResponse
newListReportDefinitionsResponse Int
pHttpStatus_ =
  ListReportDefinitionsResponse' :: Maybe Text
-> Maybe [ReportDefinition] -> Int -> ListReportDefinitionsResponse
ListReportDefinitionsResponse'
    { $sel:nextToken:ListReportDefinitionsResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:reportDefinitions:ListReportDefinitionsResponse' :: Maybe [ReportDefinition]
reportDefinitions = Maybe [ReportDefinition]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListReportDefinitionsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The value of the next token, if it exists. Null if there are no more
-- results.
listReportDefinitionsResponse_nextToken :: Lens.Lens' ListReportDefinitionsResponse (Prelude.Maybe Prelude.Text)
listReportDefinitionsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListReportDefinitionsResponse -> f ListReportDefinitionsResponse
listReportDefinitionsResponse_nextToken = (ListReportDefinitionsResponse -> Maybe Text)
-> (ListReportDefinitionsResponse
    -> Maybe Text -> ListReportDefinitionsResponse)
-> Lens' ListReportDefinitionsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListReportDefinitionsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListReportDefinitionsResponse' :: ListReportDefinitionsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListReportDefinitionsResponse
s@ListReportDefinitionsResponse' {} Maybe Text
a -> ListReportDefinitionsResponse
s {$sel:nextToken:ListReportDefinitionsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListReportDefinitionsResponse)

-- | The retrieved reports.
listReportDefinitionsResponse_reportDefinitions :: Lens.Lens' ListReportDefinitionsResponse (Prelude.Maybe [ReportDefinition])
listReportDefinitionsResponse_reportDefinitions :: (Maybe [ReportDefinition] -> f (Maybe [ReportDefinition]))
-> ListReportDefinitionsResponse -> f ListReportDefinitionsResponse
listReportDefinitionsResponse_reportDefinitions = (ListReportDefinitionsResponse -> Maybe [ReportDefinition])
-> (ListReportDefinitionsResponse
    -> Maybe [ReportDefinition] -> ListReportDefinitionsResponse)
-> Lens' ListReportDefinitionsResponse (Maybe [ReportDefinition])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListReportDefinitionsResponse' {Maybe [ReportDefinition]
reportDefinitions :: Maybe [ReportDefinition]
$sel:reportDefinitions:ListReportDefinitionsResponse' :: ListReportDefinitionsResponse -> Maybe [ReportDefinition]
reportDefinitions} -> Maybe [ReportDefinition]
reportDefinitions) (\s :: ListReportDefinitionsResponse
s@ListReportDefinitionsResponse' {} Maybe [ReportDefinition]
a -> ListReportDefinitionsResponse
s {$sel:reportDefinitions:ListReportDefinitionsResponse' :: Maybe [ReportDefinition]
reportDefinitions = Maybe [ReportDefinition]
a} :: ListReportDefinitionsResponse) ((Maybe [ReportDefinition] -> f (Maybe [ReportDefinition]))
 -> ListReportDefinitionsResponse
 -> f ListReportDefinitionsResponse)
-> ((Maybe [ReportDefinition] -> f (Maybe [ReportDefinition]))
    -> Maybe [ReportDefinition] -> f (Maybe [ReportDefinition]))
-> (Maybe [ReportDefinition] -> f (Maybe [ReportDefinition]))
-> ListReportDefinitionsResponse
-> f ListReportDefinitionsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [ReportDefinition]
  [ReportDefinition]
  [ReportDefinition]
  [ReportDefinition]
-> Iso
     (Maybe [ReportDefinition])
     (Maybe [ReportDefinition])
     (Maybe [ReportDefinition])
     (Maybe [ReportDefinition])
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
  [ReportDefinition]
  [ReportDefinition]
  [ReportDefinition]
  [ReportDefinition]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The response's http status code.
listReportDefinitionsResponse_httpStatus :: Lens.Lens' ListReportDefinitionsResponse Prelude.Int
listReportDefinitionsResponse_httpStatus :: (Int -> f Int)
-> ListReportDefinitionsResponse -> f ListReportDefinitionsResponse
listReportDefinitionsResponse_httpStatus = (ListReportDefinitionsResponse -> Int)
-> (ListReportDefinitionsResponse
    -> Int -> ListReportDefinitionsResponse)
-> Lens
     ListReportDefinitionsResponse ListReportDefinitionsResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListReportDefinitionsResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListReportDefinitionsResponse' :: ListReportDefinitionsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListReportDefinitionsResponse
s@ListReportDefinitionsResponse' {} Int
a -> ListReportDefinitionsResponse
s {$sel:httpStatus:ListReportDefinitionsResponse' :: Int
httpStatus = Int
a} :: ListReportDefinitionsResponse)

instance Prelude.NFData ListReportDefinitionsResponse