{-# 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.CostAndUsageReport.DescribeReportDefinitions
-- 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 the AWS Cost and Usage reports available to this account.
--
-- This operation returns paginated results.
module Amazonka.CostAndUsageReport.DescribeReportDefinitions
  ( -- * Creating a Request
    DescribeReportDefinitions (..),
    newDescribeReportDefinitions,

    -- * Request Lenses
    describeReportDefinitions_nextToken,
    describeReportDefinitions_maxResults,

    -- * Destructuring the Response
    DescribeReportDefinitionsResponse (..),
    newDescribeReportDefinitionsResponse,

    -- * Response Lenses
    describeReportDefinitionsResponse_nextToken,
    describeReportDefinitionsResponse_reportDefinitions,
    describeReportDefinitionsResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.CostAndUsageReport.Types
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | Requests a list of AWS Cost and Usage reports owned by the account.
--
-- /See:/ 'newDescribeReportDefinitions' smart constructor.
data DescribeReportDefinitions = DescribeReportDefinitions'
  { DescribeReportDefinitions -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    DescribeReportDefinitions -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural
  }
  deriving (DescribeReportDefinitions -> DescribeReportDefinitions -> Bool
(DescribeReportDefinitions -> DescribeReportDefinitions -> Bool)
-> (DescribeReportDefinitions -> DescribeReportDefinitions -> Bool)
-> Eq DescribeReportDefinitions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeReportDefinitions -> DescribeReportDefinitions -> Bool
$c/= :: DescribeReportDefinitions -> DescribeReportDefinitions -> Bool
== :: DescribeReportDefinitions -> DescribeReportDefinitions -> Bool
$c== :: DescribeReportDefinitions -> DescribeReportDefinitions -> Bool
Prelude.Eq, ReadPrec [DescribeReportDefinitions]
ReadPrec DescribeReportDefinitions
Int -> ReadS DescribeReportDefinitions
ReadS [DescribeReportDefinitions]
(Int -> ReadS DescribeReportDefinitions)
-> ReadS [DescribeReportDefinitions]
-> ReadPrec DescribeReportDefinitions
-> ReadPrec [DescribeReportDefinitions]
-> Read DescribeReportDefinitions
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeReportDefinitions]
$creadListPrec :: ReadPrec [DescribeReportDefinitions]
readPrec :: ReadPrec DescribeReportDefinitions
$creadPrec :: ReadPrec DescribeReportDefinitions
readList :: ReadS [DescribeReportDefinitions]
$creadList :: ReadS [DescribeReportDefinitions]
readsPrec :: Int -> ReadS DescribeReportDefinitions
$creadsPrec :: Int -> ReadS DescribeReportDefinitions
Prelude.Read, Int -> DescribeReportDefinitions -> ShowS
[DescribeReportDefinitions] -> ShowS
DescribeReportDefinitions -> String
(Int -> DescribeReportDefinitions -> ShowS)
-> (DescribeReportDefinitions -> String)
-> ([DescribeReportDefinitions] -> ShowS)
-> Show DescribeReportDefinitions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeReportDefinitions] -> ShowS
$cshowList :: [DescribeReportDefinitions] -> ShowS
show :: DescribeReportDefinitions -> String
$cshow :: DescribeReportDefinitions -> String
showsPrec :: Int -> DescribeReportDefinitions -> ShowS
$cshowsPrec :: Int -> DescribeReportDefinitions -> ShowS
Prelude.Show, (forall x.
 DescribeReportDefinitions -> Rep DescribeReportDefinitions x)
-> (forall x.
    Rep DescribeReportDefinitions x -> DescribeReportDefinitions)
-> Generic DescribeReportDefinitions
forall x.
Rep DescribeReportDefinitions x -> DescribeReportDefinitions
forall x.
DescribeReportDefinitions -> Rep DescribeReportDefinitions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeReportDefinitions x -> DescribeReportDefinitions
$cfrom :: forall x.
DescribeReportDefinitions -> Rep DescribeReportDefinitions x
Prelude.Generic)

-- |
-- Create a value of 'DescribeReportDefinitions' 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', 'describeReportDefinitions_nextToken' - Undocumented member.
--
-- 'maxResults', 'describeReportDefinitions_maxResults' - Undocumented member.
newDescribeReportDefinitions ::
  DescribeReportDefinitions
newDescribeReportDefinitions :: DescribeReportDefinitions
newDescribeReportDefinitions =
  DescribeReportDefinitions' :: Maybe Text -> Maybe Natural -> DescribeReportDefinitions
DescribeReportDefinitions'
    { $sel:nextToken:DescribeReportDefinitions' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:DescribeReportDefinitions' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

-- | Undocumented member.
describeReportDefinitions_nextToken :: Lens.Lens' DescribeReportDefinitions (Prelude.Maybe Prelude.Text)
describeReportDefinitions_nextToken :: (Maybe Text -> f (Maybe Text))
-> DescribeReportDefinitions -> f DescribeReportDefinitions
describeReportDefinitions_nextToken = (DescribeReportDefinitions -> Maybe Text)
-> (DescribeReportDefinitions
    -> Maybe Text -> DescribeReportDefinitions)
-> Lens
     DescribeReportDefinitions
     DescribeReportDefinitions
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeReportDefinitions' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeReportDefinitions' :: DescribeReportDefinitions -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeReportDefinitions
s@DescribeReportDefinitions' {} Maybe Text
a -> DescribeReportDefinitions
s {$sel:nextToken:DescribeReportDefinitions' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeReportDefinitions)

-- | Undocumented member.
describeReportDefinitions_maxResults :: Lens.Lens' DescribeReportDefinitions (Prelude.Maybe Prelude.Natural)
describeReportDefinitions_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> DescribeReportDefinitions -> f DescribeReportDefinitions
describeReportDefinitions_maxResults = (DescribeReportDefinitions -> Maybe Natural)
-> (DescribeReportDefinitions
    -> Maybe Natural -> DescribeReportDefinitions)
-> Lens
     DescribeReportDefinitions
     DescribeReportDefinitions
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeReportDefinitions' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:DescribeReportDefinitions' :: DescribeReportDefinitions -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: DescribeReportDefinitions
s@DescribeReportDefinitions' {} Maybe Natural
a -> DescribeReportDefinitions
s {$sel:maxResults:DescribeReportDefinitions' :: Maybe Natural
maxResults = Maybe Natural
a} :: DescribeReportDefinitions)

instance Core.AWSPager DescribeReportDefinitions where
  page :: DescribeReportDefinitions
-> AWSResponse DescribeReportDefinitions
-> Maybe DescribeReportDefinitions
page DescribeReportDefinitions
rq AWSResponse DescribeReportDefinitions
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeReportDefinitions
DescribeReportDefinitionsResponse
rs
            DescribeReportDefinitionsResponse
-> Getting (First Text) DescribeReportDefinitionsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> DescribeReportDefinitionsResponse
-> Const (First Text) DescribeReportDefinitionsResponse
Lens' DescribeReportDefinitionsResponse (Maybe Text)
describeReportDefinitionsResponse_nextToken
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> DescribeReportDefinitionsResponse
 -> Const (First Text) DescribeReportDefinitionsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) DescribeReportDefinitionsResponse 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 DescribeReportDefinitions
forall a. Maybe a
Prelude.Nothing
    | Maybe [ReportDefinition] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeReportDefinitions
DescribeReportDefinitionsResponse
rs
            DescribeReportDefinitionsResponse
-> Getting
     (First [ReportDefinition])
     DescribeReportDefinitionsResponse
     [ReportDefinition]
-> Maybe [ReportDefinition]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [ReportDefinition]
 -> Const (First [ReportDefinition]) (Maybe [ReportDefinition]))
-> DescribeReportDefinitionsResponse
-> Const
     (First [ReportDefinition]) DescribeReportDefinitionsResponse
Lens' DescribeReportDefinitionsResponse (Maybe [ReportDefinition])
describeReportDefinitionsResponse_reportDefinitions
              ((Maybe [ReportDefinition]
  -> Const (First [ReportDefinition]) (Maybe [ReportDefinition]))
 -> DescribeReportDefinitionsResponse
 -> Const
      (First [ReportDefinition]) DescribeReportDefinitionsResponse)
-> (([ReportDefinition]
     -> Const (First [ReportDefinition]) [ReportDefinition])
    -> Maybe [ReportDefinition]
    -> Const (First [ReportDefinition]) (Maybe [ReportDefinition]))
-> Getting
     (First [ReportDefinition])
     DescribeReportDefinitionsResponse
     [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 DescribeReportDefinitions
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      DescribeReportDefinitions -> Maybe DescribeReportDefinitions
forall a. a -> Maybe a
Prelude.Just (DescribeReportDefinitions -> Maybe DescribeReportDefinitions)
-> DescribeReportDefinitions -> Maybe DescribeReportDefinitions
forall a b. (a -> b) -> a -> b
Prelude.$
        DescribeReportDefinitions
rq
          DescribeReportDefinitions
-> (DescribeReportDefinitions -> DescribeReportDefinitions)
-> DescribeReportDefinitions
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> DescribeReportDefinitions -> Identity DescribeReportDefinitions
Lens
  DescribeReportDefinitions
  DescribeReportDefinitions
  (Maybe Text)
  (Maybe Text)
describeReportDefinitions_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> DescribeReportDefinitions -> Identity DescribeReportDefinitions)
-> Maybe Text
-> DescribeReportDefinitions
-> DescribeReportDefinitions
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse DescribeReportDefinitions
DescribeReportDefinitionsResponse
rs
          DescribeReportDefinitionsResponse
-> Getting (First Text) DescribeReportDefinitionsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> DescribeReportDefinitionsResponse
-> Const (First Text) DescribeReportDefinitionsResponse
Lens' DescribeReportDefinitionsResponse (Maybe Text)
describeReportDefinitionsResponse_nextToken
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> DescribeReportDefinitionsResponse
 -> Const (First Text) DescribeReportDefinitionsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) DescribeReportDefinitionsResponse 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 DescribeReportDefinitions where
  type
    AWSResponse DescribeReportDefinitions =
      DescribeReportDefinitionsResponse
  request :: DescribeReportDefinitions -> Request DescribeReportDefinitions
request = Service
-> DescribeReportDefinitions -> Request DescribeReportDefinitions
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy DescribeReportDefinitions
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeReportDefinitions)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse DescribeReportDefinitions))
-> Logger
-> Service
-> Proxy DescribeReportDefinitions
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeReportDefinitions)))
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
-> DescribeReportDefinitionsResponse
DescribeReportDefinitionsResponse'
            (Maybe Text
 -> Maybe [ReportDefinition]
 -> Int
 -> DescribeReportDefinitionsResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe [ReportDefinition]
      -> Int -> DescribeReportDefinitionsResponse)
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 -> DescribeReportDefinitionsResponse)
-> Either String (Maybe [ReportDefinition])
-> Either String (Int -> DescribeReportDefinitionsResponse)
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 -> DescribeReportDefinitionsResponse)
-> Either String Int
-> Either String DescribeReportDefinitionsResponse
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 DescribeReportDefinitions

instance Prelude.NFData DescribeReportDefinitions

instance Core.ToHeaders DescribeReportDefinitions where
  toHeaders :: DescribeReportDefinitions -> ResponseHeaders
toHeaders =
    ResponseHeaders -> DescribeReportDefinitions -> 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
"AWSOrigamiServiceGatewayService.DescribeReportDefinitions" ::
                          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 DescribeReportDefinitions where
  toJSON :: DescribeReportDefinitions -> Value
toJSON DescribeReportDefinitions' {Maybe Natural
Maybe Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:maxResults:DescribeReportDefinitions' :: DescribeReportDefinitions -> Maybe Natural
$sel:nextToken:DescribeReportDefinitions' :: DescribeReportDefinitions -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (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 DescribeReportDefinitions where
  toPath :: DescribeReportDefinitions -> ByteString
toPath = ByteString -> DescribeReportDefinitions -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

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

-- | If the action is successful, the service sends back an HTTP 200
-- response.
--
-- /See:/ 'newDescribeReportDefinitionsResponse' smart constructor.
data DescribeReportDefinitionsResponse = DescribeReportDefinitionsResponse'
  { DescribeReportDefinitionsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | A list of AWS Cost and Usage reports owned by the account.
    DescribeReportDefinitionsResponse -> Maybe [ReportDefinition]
reportDefinitions :: Prelude.Maybe [ReportDefinition],
    -- | The response's http status code.
    DescribeReportDefinitionsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeReportDefinitionsResponse
-> DescribeReportDefinitionsResponse -> Bool
(DescribeReportDefinitionsResponse
 -> DescribeReportDefinitionsResponse -> Bool)
-> (DescribeReportDefinitionsResponse
    -> DescribeReportDefinitionsResponse -> Bool)
-> Eq DescribeReportDefinitionsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeReportDefinitionsResponse
-> DescribeReportDefinitionsResponse -> Bool
$c/= :: DescribeReportDefinitionsResponse
-> DescribeReportDefinitionsResponse -> Bool
== :: DescribeReportDefinitionsResponse
-> DescribeReportDefinitionsResponse -> Bool
$c== :: DescribeReportDefinitionsResponse
-> DescribeReportDefinitionsResponse -> Bool
Prelude.Eq, ReadPrec [DescribeReportDefinitionsResponse]
ReadPrec DescribeReportDefinitionsResponse
Int -> ReadS DescribeReportDefinitionsResponse
ReadS [DescribeReportDefinitionsResponse]
(Int -> ReadS DescribeReportDefinitionsResponse)
-> ReadS [DescribeReportDefinitionsResponse]
-> ReadPrec DescribeReportDefinitionsResponse
-> ReadPrec [DescribeReportDefinitionsResponse]
-> Read DescribeReportDefinitionsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeReportDefinitionsResponse]
$creadListPrec :: ReadPrec [DescribeReportDefinitionsResponse]
readPrec :: ReadPrec DescribeReportDefinitionsResponse
$creadPrec :: ReadPrec DescribeReportDefinitionsResponse
readList :: ReadS [DescribeReportDefinitionsResponse]
$creadList :: ReadS [DescribeReportDefinitionsResponse]
readsPrec :: Int -> ReadS DescribeReportDefinitionsResponse
$creadsPrec :: Int -> ReadS DescribeReportDefinitionsResponse
Prelude.Read, Int -> DescribeReportDefinitionsResponse -> ShowS
[DescribeReportDefinitionsResponse] -> ShowS
DescribeReportDefinitionsResponse -> String
(Int -> DescribeReportDefinitionsResponse -> ShowS)
-> (DescribeReportDefinitionsResponse -> String)
-> ([DescribeReportDefinitionsResponse] -> ShowS)
-> Show DescribeReportDefinitionsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeReportDefinitionsResponse] -> ShowS
$cshowList :: [DescribeReportDefinitionsResponse] -> ShowS
show :: DescribeReportDefinitionsResponse -> String
$cshow :: DescribeReportDefinitionsResponse -> String
showsPrec :: Int -> DescribeReportDefinitionsResponse -> ShowS
$cshowsPrec :: Int -> DescribeReportDefinitionsResponse -> ShowS
Prelude.Show, (forall x.
 DescribeReportDefinitionsResponse
 -> Rep DescribeReportDefinitionsResponse x)
-> (forall x.
    Rep DescribeReportDefinitionsResponse x
    -> DescribeReportDefinitionsResponse)
-> Generic DescribeReportDefinitionsResponse
forall x.
Rep DescribeReportDefinitionsResponse x
-> DescribeReportDefinitionsResponse
forall x.
DescribeReportDefinitionsResponse
-> Rep DescribeReportDefinitionsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeReportDefinitionsResponse x
-> DescribeReportDefinitionsResponse
$cfrom :: forall x.
DescribeReportDefinitionsResponse
-> Rep DescribeReportDefinitionsResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeReportDefinitionsResponse' 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', 'describeReportDefinitionsResponse_nextToken' - Undocumented member.
--
-- 'reportDefinitions', 'describeReportDefinitionsResponse_reportDefinitions' - A list of AWS Cost and Usage reports owned by the account.
--
-- 'httpStatus', 'describeReportDefinitionsResponse_httpStatus' - The response's http status code.
newDescribeReportDefinitionsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeReportDefinitionsResponse
newDescribeReportDefinitionsResponse :: Int -> DescribeReportDefinitionsResponse
newDescribeReportDefinitionsResponse Int
pHttpStatus_ =
  DescribeReportDefinitionsResponse' :: Maybe Text
-> Maybe [ReportDefinition]
-> Int
-> DescribeReportDefinitionsResponse
DescribeReportDefinitionsResponse'
    { $sel:nextToken:DescribeReportDefinitionsResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:reportDefinitions:DescribeReportDefinitionsResponse' :: Maybe [ReportDefinition]
reportDefinitions = Maybe [ReportDefinition]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeReportDefinitionsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Undocumented member.
describeReportDefinitionsResponse_nextToken :: Lens.Lens' DescribeReportDefinitionsResponse (Prelude.Maybe Prelude.Text)
describeReportDefinitionsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> DescribeReportDefinitionsResponse
-> f DescribeReportDefinitionsResponse
describeReportDefinitionsResponse_nextToken = (DescribeReportDefinitionsResponse -> Maybe Text)
-> (DescribeReportDefinitionsResponse
    -> Maybe Text -> DescribeReportDefinitionsResponse)
-> Lens' DescribeReportDefinitionsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeReportDefinitionsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeReportDefinitionsResponse' :: DescribeReportDefinitionsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeReportDefinitionsResponse
s@DescribeReportDefinitionsResponse' {} Maybe Text
a -> DescribeReportDefinitionsResponse
s {$sel:nextToken:DescribeReportDefinitionsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeReportDefinitionsResponse)

-- | A list of AWS Cost and Usage reports owned by the account.
describeReportDefinitionsResponse_reportDefinitions :: Lens.Lens' DescribeReportDefinitionsResponse (Prelude.Maybe [ReportDefinition])
describeReportDefinitionsResponse_reportDefinitions :: (Maybe [ReportDefinition] -> f (Maybe [ReportDefinition]))
-> DescribeReportDefinitionsResponse
-> f DescribeReportDefinitionsResponse
describeReportDefinitionsResponse_reportDefinitions = (DescribeReportDefinitionsResponse -> Maybe [ReportDefinition])
-> (DescribeReportDefinitionsResponse
    -> Maybe [ReportDefinition] -> DescribeReportDefinitionsResponse)
-> Lens'
     DescribeReportDefinitionsResponse (Maybe [ReportDefinition])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeReportDefinitionsResponse' {Maybe [ReportDefinition]
reportDefinitions :: Maybe [ReportDefinition]
$sel:reportDefinitions:DescribeReportDefinitionsResponse' :: DescribeReportDefinitionsResponse -> Maybe [ReportDefinition]
reportDefinitions} -> Maybe [ReportDefinition]
reportDefinitions) (\s :: DescribeReportDefinitionsResponse
s@DescribeReportDefinitionsResponse' {} Maybe [ReportDefinition]
a -> DescribeReportDefinitionsResponse
s {$sel:reportDefinitions:DescribeReportDefinitionsResponse' :: Maybe [ReportDefinition]
reportDefinitions = Maybe [ReportDefinition]
a} :: DescribeReportDefinitionsResponse) ((Maybe [ReportDefinition] -> f (Maybe [ReportDefinition]))
 -> DescribeReportDefinitionsResponse
 -> f DescribeReportDefinitionsResponse)
-> ((Maybe [ReportDefinition] -> f (Maybe [ReportDefinition]))
    -> Maybe [ReportDefinition] -> f (Maybe [ReportDefinition]))
-> (Maybe [ReportDefinition] -> f (Maybe [ReportDefinition]))
-> DescribeReportDefinitionsResponse
-> f DescribeReportDefinitionsResponse
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.
describeReportDefinitionsResponse_httpStatus :: Lens.Lens' DescribeReportDefinitionsResponse Prelude.Int
describeReportDefinitionsResponse_httpStatus :: (Int -> f Int)
-> DescribeReportDefinitionsResponse
-> f DescribeReportDefinitionsResponse
describeReportDefinitionsResponse_httpStatus = (DescribeReportDefinitionsResponse -> Int)
-> (DescribeReportDefinitionsResponse
    -> Int -> DescribeReportDefinitionsResponse)
-> Lens
     DescribeReportDefinitionsResponse
     DescribeReportDefinitionsResponse
     Int
     Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeReportDefinitionsResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeReportDefinitionsResponse' :: DescribeReportDefinitionsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeReportDefinitionsResponse
s@DescribeReportDefinitionsResponse' {} Int
a -> DescribeReportDefinitionsResponse
s {$sel:httpStatus:DescribeReportDefinitionsResponse' :: Int
httpStatus = Int
a} :: DescribeReportDefinitionsResponse)

instance
  Prelude.NFData
    DescribeReportDefinitionsResponse