{-# 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.BillingConductor.ListBillingGroupCostReports
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- A paginated call to retrieve a summary report of actual Amazon Web
-- Services charges and the calculated Amazon Web Services charges based on
-- the associated pricing plan of a billing group.
--
-- This operation returns paginated results.
module Amazonka.BillingConductor.ListBillingGroupCostReports
  ( -- * Creating a Request
    ListBillingGroupCostReports (..),
    newListBillingGroupCostReports,

    -- * Request Lenses
    listBillingGroupCostReports_billingPeriod,
    listBillingGroupCostReports_filters,
    listBillingGroupCostReports_maxResults,
    listBillingGroupCostReports_nextToken,

    -- * Destructuring the Response
    ListBillingGroupCostReportsResponse (..),
    newListBillingGroupCostReportsResponse,

    -- * Response Lenses
    listBillingGroupCostReportsResponse_billingGroupCostReports,
    listBillingGroupCostReportsResponse_nextToken,
    listBillingGroupCostReportsResponse_httpStatus,
  )
where

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

-- | /See:/ 'newListBillingGroupCostReports' smart constructor.
data ListBillingGroupCostReports = ListBillingGroupCostReports'
  { -- | The preferred billing period for your report.
    ListBillingGroupCostReports -> Maybe Text
billingPeriod :: Prelude.Maybe Prelude.Text,
    -- | A @ListBillingGroupCostReportsFilter@ to specify billing groups to
    -- retrieve reports from.
    ListBillingGroupCostReports
-> Maybe ListBillingGroupCostReportsFilter
filters :: Prelude.Maybe ListBillingGroupCostReportsFilter,
    -- | The maximum number of reports to retrieve.
    ListBillingGroupCostReports -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The pagination token that\'s used on subsequent calls to get reports.
    ListBillingGroupCostReports -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text
  }
  deriving (ListBillingGroupCostReports -> ListBillingGroupCostReports -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListBillingGroupCostReports -> ListBillingGroupCostReports -> Bool
$c/= :: ListBillingGroupCostReports -> ListBillingGroupCostReports -> Bool
== :: ListBillingGroupCostReports -> ListBillingGroupCostReports -> Bool
$c== :: ListBillingGroupCostReports -> ListBillingGroupCostReports -> Bool
Prelude.Eq, ReadPrec [ListBillingGroupCostReports]
ReadPrec ListBillingGroupCostReports
Int -> ReadS ListBillingGroupCostReports
ReadS [ListBillingGroupCostReports]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListBillingGroupCostReports]
$creadListPrec :: ReadPrec [ListBillingGroupCostReports]
readPrec :: ReadPrec ListBillingGroupCostReports
$creadPrec :: ReadPrec ListBillingGroupCostReports
readList :: ReadS [ListBillingGroupCostReports]
$creadList :: ReadS [ListBillingGroupCostReports]
readsPrec :: Int -> ReadS ListBillingGroupCostReports
$creadsPrec :: Int -> ReadS ListBillingGroupCostReports
Prelude.Read, Int -> ListBillingGroupCostReports -> ShowS
[ListBillingGroupCostReports] -> ShowS
ListBillingGroupCostReports -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListBillingGroupCostReports] -> ShowS
$cshowList :: [ListBillingGroupCostReports] -> ShowS
show :: ListBillingGroupCostReports -> String
$cshow :: ListBillingGroupCostReports -> String
showsPrec :: Int -> ListBillingGroupCostReports -> ShowS
$cshowsPrec :: Int -> ListBillingGroupCostReports -> ShowS
Prelude.Show, forall x.
Rep ListBillingGroupCostReports x -> ListBillingGroupCostReports
forall x.
ListBillingGroupCostReports -> Rep ListBillingGroupCostReports x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListBillingGroupCostReports x -> ListBillingGroupCostReports
$cfrom :: forall x.
ListBillingGroupCostReports -> Rep ListBillingGroupCostReports x
Prelude.Generic)

-- |
-- Create a value of 'ListBillingGroupCostReports' 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:
--
-- 'billingPeriod', 'listBillingGroupCostReports_billingPeriod' - The preferred billing period for your report.
--
-- 'filters', 'listBillingGroupCostReports_filters' - A @ListBillingGroupCostReportsFilter@ to specify billing groups to
-- retrieve reports from.
--
-- 'maxResults', 'listBillingGroupCostReports_maxResults' - The maximum number of reports to retrieve.
--
-- 'nextToken', 'listBillingGroupCostReports_nextToken' - The pagination token that\'s used on subsequent calls to get reports.
newListBillingGroupCostReports ::
  ListBillingGroupCostReports
newListBillingGroupCostReports :: ListBillingGroupCostReports
newListBillingGroupCostReports =
  ListBillingGroupCostReports'
    { $sel:billingPeriod:ListBillingGroupCostReports' :: Maybe Text
billingPeriod =
        forall a. Maybe a
Prelude.Nothing,
      $sel:filters:ListBillingGroupCostReports' :: Maybe ListBillingGroupCostReportsFilter
filters = forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListBillingGroupCostReports' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListBillingGroupCostReports' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing
    }

-- | The preferred billing period for your report.
listBillingGroupCostReports_billingPeriod :: Lens.Lens' ListBillingGroupCostReports (Prelude.Maybe Prelude.Text)
listBillingGroupCostReports_billingPeriod :: Lens' ListBillingGroupCostReports (Maybe Text)
listBillingGroupCostReports_billingPeriod = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListBillingGroupCostReports' {Maybe Text
billingPeriod :: Maybe Text
$sel:billingPeriod:ListBillingGroupCostReports' :: ListBillingGroupCostReports -> Maybe Text
billingPeriod} -> Maybe Text
billingPeriod) (\s :: ListBillingGroupCostReports
s@ListBillingGroupCostReports' {} Maybe Text
a -> ListBillingGroupCostReports
s {$sel:billingPeriod:ListBillingGroupCostReports' :: Maybe Text
billingPeriod = Maybe Text
a} :: ListBillingGroupCostReports)

-- | A @ListBillingGroupCostReportsFilter@ to specify billing groups to
-- retrieve reports from.
listBillingGroupCostReports_filters :: Lens.Lens' ListBillingGroupCostReports (Prelude.Maybe ListBillingGroupCostReportsFilter)
listBillingGroupCostReports_filters :: Lens'
  ListBillingGroupCostReports
  (Maybe ListBillingGroupCostReportsFilter)
listBillingGroupCostReports_filters = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListBillingGroupCostReports' {Maybe ListBillingGroupCostReportsFilter
filters :: Maybe ListBillingGroupCostReportsFilter
$sel:filters:ListBillingGroupCostReports' :: ListBillingGroupCostReports
-> Maybe ListBillingGroupCostReportsFilter
filters} -> Maybe ListBillingGroupCostReportsFilter
filters) (\s :: ListBillingGroupCostReports
s@ListBillingGroupCostReports' {} Maybe ListBillingGroupCostReportsFilter
a -> ListBillingGroupCostReports
s {$sel:filters:ListBillingGroupCostReports' :: Maybe ListBillingGroupCostReportsFilter
filters = Maybe ListBillingGroupCostReportsFilter
a} :: ListBillingGroupCostReports)

-- | The maximum number of reports to retrieve.
listBillingGroupCostReports_maxResults :: Lens.Lens' ListBillingGroupCostReports (Prelude.Maybe Prelude.Natural)
listBillingGroupCostReports_maxResults :: Lens' ListBillingGroupCostReports (Maybe Natural)
listBillingGroupCostReports_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListBillingGroupCostReports' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListBillingGroupCostReports' :: ListBillingGroupCostReports -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListBillingGroupCostReports
s@ListBillingGroupCostReports' {} Maybe Natural
a -> ListBillingGroupCostReports
s {$sel:maxResults:ListBillingGroupCostReports' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListBillingGroupCostReports)

-- | The pagination token that\'s used on subsequent calls to get reports.
listBillingGroupCostReports_nextToken :: Lens.Lens' ListBillingGroupCostReports (Prelude.Maybe Prelude.Text)
listBillingGroupCostReports_nextToken :: Lens' ListBillingGroupCostReports (Maybe Text)
listBillingGroupCostReports_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListBillingGroupCostReports' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListBillingGroupCostReports' :: ListBillingGroupCostReports -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListBillingGroupCostReports
s@ListBillingGroupCostReports' {} Maybe Text
a -> ListBillingGroupCostReports
s {$sel:nextToken:ListBillingGroupCostReports' :: Maybe Text
nextToken = Maybe Text
a} :: ListBillingGroupCostReports)

instance Core.AWSPager ListBillingGroupCostReports where
  page :: ListBillingGroupCostReports
-> AWSResponse ListBillingGroupCostReports
-> Maybe ListBillingGroupCostReports
page ListBillingGroupCostReports
rq AWSResponse ListBillingGroupCostReports
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListBillingGroupCostReports
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListBillingGroupCostReportsResponse (Maybe Text)
listBillingGroupCostReportsResponse_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 ListBillingGroupCostReports
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens'
  ListBillingGroupCostReportsResponse
  (Maybe [BillingGroupCostReportElement])
listBillingGroupCostReportsResponse_billingGroupCostReports
            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
    | Bool
Prelude.otherwise =
        forall a. a -> Maybe a
Prelude.Just
          forall a b. (a -> b) -> a -> b
Prelude.$ ListBillingGroupCostReports
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListBillingGroupCostReports (Maybe Text)
listBillingGroupCostReports_nextToken
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListBillingGroupCostReports
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListBillingGroupCostReportsResponse (Maybe Text)
listBillingGroupCostReportsResponse_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 ListBillingGroupCostReports where
  type
    AWSResponse ListBillingGroupCostReports =
      ListBillingGroupCostReportsResponse
  request :: (Service -> Service)
-> ListBillingGroupCostReports
-> Request ListBillingGroupCostReports
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 ListBillingGroupCostReports
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListBillingGroupCostReports)))
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 [BillingGroupCostReportElement]
-> Maybe Text -> Int -> ListBillingGroupCostReportsResponse
ListBillingGroupCostReportsResponse'
            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
"BillingGroupCostReports"
                            forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
                        )
            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
"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))
      )

instance Prelude.Hashable ListBillingGroupCostReports where
  hashWithSalt :: Int -> ListBillingGroupCostReports -> Int
hashWithSalt Int
_salt ListBillingGroupCostReports' {Maybe Natural
Maybe Text
Maybe ListBillingGroupCostReportsFilter
nextToken :: Maybe Text
maxResults :: Maybe Natural
filters :: Maybe ListBillingGroupCostReportsFilter
billingPeriod :: Maybe Text
$sel:nextToken:ListBillingGroupCostReports' :: ListBillingGroupCostReports -> Maybe Text
$sel:maxResults:ListBillingGroupCostReports' :: ListBillingGroupCostReports -> Maybe Natural
$sel:filters:ListBillingGroupCostReports' :: ListBillingGroupCostReports
-> Maybe ListBillingGroupCostReportsFilter
$sel:billingPeriod:ListBillingGroupCostReports' :: ListBillingGroupCostReports -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
billingPeriod
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ListBillingGroupCostReportsFilter
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 ListBillingGroupCostReports where
  rnf :: ListBillingGroupCostReports -> ()
rnf ListBillingGroupCostReports' {Maybe Natural
Maybe Text
Maybe ListBillingGroupCostReportsFilter
nextToken :: Maybe Text
maxResults :: Maybe Natural
filters :: Maybe ListBillingGroupCostReportsFilter
billingPeriod :: Maybe Text
$sel:nextToken:ListBillingGroupCostReports' :: ListBillingGroupCostReports -> Maybe Text
$sel:maxResults:ListBillingGroupCostReports' :: ListBillingGroupCostReports -> Maybe Natural
$sel:filters:ListBillingGroupCostReports' :: ListBillingGroupCostReports
-> Maybe ListBillingGroupCostReportsFilter
$sel:billingPeriod:ListBillingGroupCostReports' :: ListBillingGroupCostReports -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
billingPeriod
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ListBillingGroupCostReportsFilter
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 ListBillingGroupCostReports where
  toHeaders :: ListBillingGroupCostReports -> 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 ListBillingGroupCostReports where
  toJSON :: ListBillingGroupCostReports -> Value
toJSON ListBillingGroupCostReports' {Maybe Natural
Maybe Text
Maybe ListBillingGroupCostReportsFilter
nextToken :: Maybe Text
maxResults :: Maybe Natural
filters :: Maybe ListBillingGroupCostReportsFilter
billingPeriod :: Maybe Text
$sel:nextToken:ListBillingGroupCostReports' :: ListBillingGroupCostReports -> Maybe Text
$sel:maxResults:ListBillingGroupCostReports' :: ListBillingGroupCostReports -> Maybe Natural
$sel:filters:ListBillingGroupCostReports' :: ListBillingGroupCostReports
-> Maybe ListBillingGroupCostReportsFilter
$sel:billingPeriod:ListBillingGroupCostReports' :: ListBillingGroupCostReports -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"BillingPeriod" 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
billingPeriod,
            (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 ListBillingGroupCostReportsFilter
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 ListBillingGroupCostReports where
  toPath :: ListBillingGroupCostReports -> ByteString
toPath =
    forall a b. a -> b -> a
Prelude.const ByteString
"/list-billing-group-cost-reports"

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

-- | /See:/ 'newListBillingGroupCostReportsResponse' smart constructor.
data ListBillingGroupCostReportsResponse = ListBillingGroupCostReportsResponse'
  { -- | A list of @BillingGroupCostReportElement@ retrieved.
    ListBillingGroupCostReportsResponse
-> Maybe [BillingGroupCostReportElement]
billingGroupCostReports :: Prelude.Maybe [BillingGroupCostReportElement],
    -- | The pagination token that\'s used on subsequent calls to get reports.
    ListBillingGroupCostReportsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListBillingGroupCostReportsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListBillingGroupCostReportsResponse
-> ListBillingGroupCostReportsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListBillingGroupCostReportsResponse
-> ListBillingGroupCostReportsResponse -> Bool
$c/= :: ListBillingGroupCostReportsResponse
-> ListBillingGroupCostReportsResponse -> Bool
== :: ListBillingGroupCostReportsResponse
-> ListBillingGroupCostReportsResponse -> Bool
$c== :: ListBillingGroupCostReportsResponse
-> ListBillingGroupCostReportsResponse -> Bool
Prelude.Eq, ReadPrec [ListBillingGroupCostReportsResponse]
ReadPrec ListBillingGroupCostReportsResponse
Int -> ReadS ListBillingGroupCostReportsResponse
ReadS [ListBillingGroupCostReportsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListBillingGroupCostReportsResponse]
$creadListPrec :: ReadPrec [ListBillingGroupCostReportsResponse]
readPrec :: ReadPrec ListBillingGroupCostReportsResponse
$creadPrec :: ReadPrec ListBillingGroupCostReportsResponse
readList :: ReadS [ListBillingGroupCostReportsResponse]
$creadList :: ReadS [ListBillingGroupCostReportsResponse]
readsPrec :: Int -> ReadS ListBillingGroupCostReportsResponse
$creadsPrec :: Int -> ReadS ListBillingGroupCostReportsResponse
Prelude.Read, Int -> ListBillingGroupCostReportsResponse -> ShowS
[ListBillingGroupCostReportsResponse] -> ShowS
ListBillingGroupCostReportsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListBillingGroupCostReportsResponse] -> ShowS
$cshowList :: [ListBillingGroupCostReportsResponse] -> ShowS
show :: ListBillingGroupCostReportsResponse -> String
$cshow :: ListBillingGroupCostReportsResponse -> String
showsPrec :: Int -> ListBillingGroupCostReportsResponse -> ShowS
$cshowsPrec :: Int -> ListBillingGroupCostReportsResponse -> ShowS
Prelude.Show, forall x.
Rep ListBillingGroupCostReportsResponse x
-> ListBillingGroupCostReportsResponse
forall x.
ListBillingGroupCostReportsResponse
-> Rep ListBillingGroupCostReportsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListBillingGroupCostReportsResponse x
-> ListBillingGroupCostReportsResponse
$cfrom :: forall x.
ListBillingGroupCostReportsResponse
-> Rep ListBillingGroupCostReportsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListBillingGroupCostReportsResponse' 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:
--
-- 'billingGroupCostReports', 'listBillingGroupCostReportsResponse_billingGroupCostReports' - A list of @BillingGroupCostReportElement@ retrieved.
--
-- 'nextToken', 'listBillingGroupCostReportsResponse_nextToken' - The pagination token that\'s used on subsequent calls to get reports.
--
-- 'httpStatus', 'listBillingGroupCostReportsResponse_httpStatus' - The response's http status code.
newListBillingGroupCostReportsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListBillingGroupCostReportsResponse
newListBillingGroupCostReportsResponse :: Int -> ListBillingGroupCostReportsResponse
newListBillingGroupCostReportsResponse Int
pHttpStatus_ =
  ListBillingGroupCostReportsResponse'
    { $sel:billingGroupCostReports:ListBillingGroupCostReportsResponse' :: Maybe [BillingGroupCostReportElement]
billingGroupCostReports =
        forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListBillingGroupCostReportsResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListBillingGroupCostReportsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A list of @BillingGroupCostReportElement@ retrieved.
listBillingGroupCostReportsResponse_billingGroupCostReports :: Lens.Lens' ListBillingGroupCostReportsResponse (Prelude.Maybe [BillingGroupCostReportElement])
listBillingGroupCostReportsResponse_billingGroupCostReports :: Lens'
  ListBillingGroupCostReportsResponse
  (Maybe [BillingGroupCostReportElement])
listBillingGroupCostReportsResponse_billingGroupCostReports = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListBillingGroupCostReportsResponse' {Maybe [BillingGroupCostReportElement]
billingGroupCostReports :: Maybe [BillingGroupCostReportElement]
$sel:billingGroupCostReports:ListBillingGroupCostReportsResponse' :: ListBillingGroupCostReportsResponse
-> Maybe [BillingGroupCostReportElement]
billingGroupCostReports} -> Maybe [BillingGroupCostReportElement]
billingGroupCostReports) (\s :: ListBillingGroupCostReportsResponse
s@ListBillingGroupCostReportsResponse' {} Maybe [BillingGroupCostReportElement]
a -> ListBillingGroupCostReportsResponse
s {$sel:billingGroupCostReports:ListBillingGroupCostReportsResponse' :: Maybe [BillingGroupCostReportElement]
billingGroupCostReports = Maybe [BillingGroupCostReportElement]
a} :: ListBillingGroupCostReportsResponse) 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

-- | The pagination token that\'s used on subsequent calls to get reports.
listBillingGroupCostReportsResponse_nextToken :: Lens.Lens' ListBillingGroupCostReportsResponse (Prelude.Maybe Prelude.Text)
listBillingGroupCostReportsResponse_nextToken :: Lens' ListBillingGroupCostReportsResponse (Maybe Text)
listBillingGroupCostReportsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListBillingGroupCostReportsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListBillingGroupCostReportsResponse' :: ListBillingGroupCostReportsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListBillingGroupCostReportsResponse
s@ListBillingGroupCostReportsResponse' {} Maybe Text
a -> ListBillingGroupCostReportsResponse
s {$sel:nextToken:ListBillingGroupCostReportsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListBillingGroupCostReportsResponse)

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

instance
  Prelude.NFData
    ListBillingGroupCostReportsResponse
  where
  rnf :: ListBillingGroupCostReportsResponse -> ()
rnf ListBillingGroupCostReportsResponse' {Int
Maybe [BillingGroupCostReportElement]
Maybe Text
httpStatus :: Int
nextToken :: Maybe Text
billingGroupCostReports :: Maybe [BillingGroupCostReportElement]
$sel:httpStatus:ListBillingGroupCostReportsResponse' :: ListBillingGroupCostReportsResponse -> Int
$sel:nextToken:ListBillingGroupCostReportsResponse' :: ListBillingGroupCostReportsResponse -> Maybe Text
$sel:billingGroupCostReports:ListBillingGroupCostReportsResponse' :: ListBillingGroupCostReportsResponse
-> Maybe [BillingGroupCostReportElement]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [BillingGroupCostReportElement]
billingGroupCostReports
      seq :: forall a b. a -> b -> b
`Prelude.seq` 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