{-# 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.CostExplorer.ListCostCategoryDefinitions
-- 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)
--
-- Returns the name, ARN, @NumberOfRules@ and effective dates of all Cost
-- Categories defined in the account. You have the option to use
-- @EffectiveOn@ to return a list of Cost Categories that were active on a
-- specific date. If there is no @EffectiveOn@ specified, you’ll see Cost
-- Categories that are effective on the current date. If Cost Category is
-- still effective, @EffectiveEnd@ is omitted in the response.
-- @ListCostCategoryDefinitions@ supports pagination. The request can have
-- a @MaxResults@ range up to 100.
module Amazonka.CostExplorer.ListCostCategoryDefinitions
  ( -- * Creating a Request
    ListCostCategoryDefinitions (..),
    newListCostCategoryDefinitions,

    -- * Request Lenses
    listCostCategoryDefinitions_effectiveOn,
    listCostCategoryDefinitions_nextToken,
    listCostCategoryDefinitions_maxResults,

    -- * Destructuring the Response
    ListCostCategoryDefinitionsResponse (..),
    newListCostCategoryDefinitionsResponse,

    -- * Response Lenses
    listCostCategoryDefinitionsResponse_costCategoryReferences,
    listCostCategoryDefinitionsResponse_nextToken,
    listCostCategoryDefinitionsResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.CostExplorer.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

-- | /See:/ 'newListCostCategoryDefinitions' smart constructor.
data ListCostCategoryDefinitions = ListCostCategoryDefinitions'
  { -- | The date when the Cost Category was effective.
    ListCostCategoryDefinitions -> Maybe Text
effectiveOn :: Prelude.Maybe Prelude.Text,
    -- | The token to retrieve the next set of results. Amazon Web Services
    -- provides the token when the response from a previous call has more
    -- results than the maximum page size.
    ListCostCategoryDefinitions -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The number of entries a paginated response contains.
    ListCostCategoryDefinitions -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural
  }
  deriving (ListCostCategoryDefinitions -> ListCostCategoryDefinitions -> Bool
(ListCostCategoryDefinitions
 -> ListCostCategoryDefinitions -> Bool)
-> (ListCostCategoryDefinitions
    -> ListCostCategoryDefinitions -> Bool)
-> Eq ListCostCategoryDefinitions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListCostCategoryDefinitions -> ListCostCategoryDefinitions -> Bool
$c/= :: ListCostCategoryDefinitions -> ListCostCategoryDefinitions -> Bool
== :: ListCostCategoryDefinitions -> ListCostCategoryDefinitions -> Bool
$c== :: ListCostCategoryDefinitions -> ListCostCategoryDefinitions -> Bool
Prelude.Eq, ReadPrec [ListCostCategoryDefinitions]
ReadPrec ListCostCategoryDefinitions
Int -> ReadS ListCostCategoryDefinitions
ReadS [ListCostCategoryDefinitions]
(Int -> ReadS ListCostCategoryDefinitions)
-> ReadS [ListCostCategoryDefinitions]
-> ReadPrec ListCostCategoryDefinitions
-> ReadPrec [ListCostCategoryDefinitions]
-> Read ListCostCategoryDefinitions
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListCostCategoryDefinitions]
$creadListPrec :: ReadPrec [ListCostCategoryDefinitions]
readPrec :: ReadPrec ListCostCategoryDefinitions
$creadPrec :: ReadPrec ListCostCategoryDefinitions
readList :: ReadS [ListCostCategoryDefinitions]
$creadList :: ReadS [ListCostCategoryDefinitions]
readsPrec :: Int -> ReadS ListCostCategoryDefinitions
$creadsPrec :: Int -> ReadS ListCostCategoryDefinitions
Prelude.Read, Int -> ListCostCategoryDefinitions -> ShowS
[ListCostCategoryDefinitions] -> ShowS
ListCostCategoryDefinitions -> String
(Int -> ListCostCategoryDefinitions -> ShowS)
-> (ListCostCategoryDefinitions -> String)
-> ([ListCostCategoryDefinitions] -> ShowS)
-> Show ListCostCategoryDefinitions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListCostCategoryDefinitions] -> ShowS
$cshowList :: [ListCostCategoryDefinitions] -> ShowS
show :: ListCostCategoryDefinitions -> String
$cshow :: ListCostCategoryDefinitions -> String
showsPrec :: Int -> ListCostCategoryDefinitions -> ShowS
$cshowsPrec :: Int -> ListCostCategoryDefinitions -> ShowS
Prelude.Show, (forall x.
 ListCostCategoryDefinitions -> Rep ListCostCategoryDefinitions x)
-> (forall x.
    Rep ListCostCategoryDefinitions x -> ListCostCategoryDefinitions)
-> Generic ListCostCategoryDefinitions
forall x.
Rep ListCostCategoryDefinitions x -> ListCostCategoryDefinitions
forall x.
ListCostCategoryDefinitions -> Rep ListCostCategoryDefinitions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListCostCategoryDefinitions x -> ListCostCategoryDefinitions
$cfrom :: forall x.
ListCostCategoryDefinitions -> Rep ListCostCategoryDefinitions x
Prelude.Generic)

-- |
-- Create a value of 'ListCostCategoryDefinitions' 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:
--
-- 'effectiveOn', 'listCostCategoryDefinitions_effectiveOn' - The date when the Cost Category was effective.
--
-- 'nextToken', 'listCostCategoryDefinitions_nextToken' - The token to retrieve the next set of results. Amazon Web Services
-- provides the token when the response from a previous call has more
-- results than the maximum page size.
--
-- 'maxResults', 'listCostCategoryDefinitions_maxResults' - The number of entries a paginated response contains.
newListCostCategoryDefinitions ::
  ListCostCategoryDefinitions
newListCostCategoryDefinitions :: ListCostCategoryDefinitions
newListCostCategoryDefinitions =
  ListCostCategoryDefinitions' :: Maybe Text
-> Maybe Text -> Maybe Natural -> ListCostCategoryDefinitions
ListCostCategoryDefinitions'
    { $sel:effectiveOn:ListCostCategoryDefinitions' :: Maybe Text
effectiveOn =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListCostCategoryDefinitions' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListCostCategoryDefinitions' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

-- | The date when the Cost Category was effective.
listCostCategoryDefinitions_effectiveOn :: Lens.Lens' ListCostCategoryDefinitions (Prelude.Maybe Prelude.Text)
listCostCategoryDefinitions_effectiveOn :: (Maybe Text -> f (Maybe Text))
-> ListCostCategoryDefinitions -> f ListCostCategoryDefinitions
listCostCategoryDefinitions_effectiveOn = (ListCostCategoryDefinitions -> Maybe Text)
-> (ListCostCategoryDefinitions
    -> Maybe Text -> ListCostCategoryDefinitions)
-> Lens
     ListCostCategoryDefinitions
     ListCostCategoryDefinitions
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListCostCategoryDefinitions' {Maybe Text
effectiveOn :: Maybe Text
$sel:effectiveOn:ListCostCategoryDefinitions' :: ListCostCategoryDefinitions -> Maybe Text
effectiveOn} -> Maybe Text
effectiveOn) (\s :: ListCostCategoryDefinitions
s@ListCostCategoryDefinitions' {} Maybe Text
a -> ListCostCategoryDefinitions
s {$sel:effectiveOn:ListCostCategoryDefinitions' :: Maybe Text
effectiveOn = Maybe Text
a} :: ListCostCategoryDefinitions)

-- | The token to retrieve the next set of results. Amazon Web Services
-- provides the token when the response from a previous call has more
-- results than the maximum page size.
listCostCategoryDefinitions_nextToken :: Lens.Lens' ListCostCategoryDefinitions (Prelude.Maybe Prelude.Text)
listCostCategoryDefinitions_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListCostCategoryDefinitions -> f ListCostCategoryDefinitions
listCostCategoryDefinitions_nextToken = (ListCostCategoryDefinitions -> Maybe Text)
-> (ListCostCategoryDefinitions
    -> Maybe Text -> ListCostCategoryDefinitions)
-> Lens
     ListCostCategoryDefinitions
     ListCostCategoryDefinitions
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListCostCategoryDefinitions' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListCostCategoryDefinitions' :: ListCostCategoryDefinitions -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListCostCategoryDefinitions
s@ListCostCategoryDefinitions' {} Maybe Text
a -> ListCostCategoryDefinitions
s {$sel:nextToken:ListCostCategoryDefinitions' :: Maybe Text
nextToken = Maybe Text
a} :: ListCostCategoryDefinitions)

-- | The number of entries a paginated response contains.
listCostCategoryDefinitions_maxResults :: Lens.Lens' ListCostCategoryDefinitions (Prelude.Maybe Prelude.Natural)
listCostCategoryDefinitions_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListCostCategoryDefinitions -> f ListCostCategoryDefinitions
listCostCategoryDefinitions_maxResults = (ListCostCategoryDefinitions -> Maybe Natural)
-> (ListCostCategoryDefinitions
    -> Maybe Natural -> ListCostCategoryDefinitions)
-> Lens
     ListCostCategoryDefinitions
     ListCostCategoryDefinitions
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListCostCategoryDefinitions' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListCostCategoryDefinitions' :: ListCostCategoryDefinitions -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListCostCategoryDefinitions
s@ListCostCategoryDefinitions' {} Maybe Natural
a -> ListCostCategoryDefinitions
s {$sel:maxResults:ListCostCategoryDefinitions' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListCostCategoryDefinitions)

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

instance Prelude.NFData ListCostCategoryDefinitions

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

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

-- | /See:/ 'newListCostCategoryDefinitionsResponse' smart constructor.
data ListCostCategoryDefinitionsResponse = ListCostCategoryDefinitionsResponse'
  { -- | A reference to a Cost Category containing enough information to identify
    -- the Cost Category.
    ListCostCategoryDefinitionsResponse
-> Maybe [CostCategoryReference]
costCategoryReferences :: Prelude.Maybe [CostCategoryReference],
    -- | The token to retrieve the next set of results. Amazon Web Services
    -- provides the token when the response from a previous call has more
    -- results than the maximum page size.
    ListCostCategoryDefinitionsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListCostCategoryDefinitionsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListCostCategoryDefinitionsResponse
-> ListCostCategoryDefinitionsResponse -> Bool
(ListCostCategoryDefinitionsResponse
 -> ListCostCategoryDefinitionsResponse -> Bool)
-> (ListCostCategoryDefinitionsResponse
    -> ListCostCategoryDefinitionsResponse -> Bool)
-> Eq ListCostCategoryDefinitionsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListCostCategoryDefinitionsResponse
-> ListCostCategoryDefinitionsResponse -> Bool
$c/= :: ListCostCategoryDefinitionsResponse
-> ListCostCategoryDefinitionsResponse -> Bool
== :: ListCostCategoryDefinitionsResponse
-> ListCostCategoryDefinitionsResponse -> Bool
$c== :: ListCostCategoryDefinitionsResponse
-> ListCostCategoryDefinitionsResponse -> Bool
Prelude.Eq, ReadPrec [ListCostCategoryDefinitionsResponse]
ReadPrec ListCostCategoryDefinitionsResponse
Int -> ReadS ListCostCategoryDefinitionsResponse
ReadS [ListCostCategoryDefinitionsResponse]
(Int -> ReadS ListCostCategoryDefinitionsResponse)
-> ReadS [ListCostCategoryDefinitionsResponse]
-> ReadPrec ListCostCategoryDefinitionsResponse
-> ReadPrec [ListCostCategoryDefinitionsResponse]
-> Read ListCostCategoryDefinitionsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListCostCategoryDefinitionsResponse]
$creadListPrec :: ReadPrec [ListCostCategoryDefinitionsResponse]
readPrec :: ReadPrec ListCostCategoryDefinitionsResponse
$creadPrec :: ReadPrec ListCostCategoryDefinitionsResponse
readList :: ReadS [ListCostCategoryDefinitionsResponse]
$creadList :: ReadS [ListCostCategoryDefinitionsResponse]
readsPrec :: Int -> ReadS ListCostCategoryDefinitionsResponse
$creadsPrec :: Int -> ReadS ListCostCategoryDefinitionsResponse
Prelude.Read, Int -> ListCostCategoryDefinitionsResponse -> ShowS
[ListCostCategoryDefinitionsResponse] -> ShowS
ListCostCategoryDefinitionsResponse -> String
(Int -> ListCostCategoryDefinitionsResponse -> ShowS)
-> (ListCostCategoryDefinitionsResponse -> String)
-> ([ListCostCategoryDefinitionsResponse] -> ShowS)
-> Show ListCostCategoryDefinitionsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListCostCategoryDefinitionsResponse] -> ShowS
$cshowList :: [ListCostCategoryDefinitionsResponse] -> ShowS
show :: ListCostCategoryDefinitionsResponse -> String
$cshow :: ListCostCategoryDefinitionsResponse -> String
showsPrec :: Int -> ListCostCategoryDefinitionsResponse -> ShowS
$cshowsPrec :: Int -> ListCostCategoryDefinitionsResponse -> ShowS
Prelude.Show, (forall x.
 ListCostCategoryDefinitionsResponse
 -> Rep ListCostCategoryDefinitionsResponse x)
-> (forall x.
    Rep ListCostCategoryDefinitionsResponse x
    -> ListCostCategoryDefinitionsResponse)
-> Generic ListCostCategoryDefinitionsResponse
forall x.
Rep ListCostCategoryDefinitionsResponse x
-> ListCostCategoryDefinitionsResponse
forall x.
ListCostCategoryDefinitionsResponse
-> Rep ListCostCategoryDefinitionsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListCostCategoryDefinitionsResponse x
-> ListCostCategoryDefinitionsResponse
$cfrom :: forall x.
ListCostCategoryDefinitionsResponse
-> Rep ListCostCategoryDefinitionsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListCostCategoryDefinitionsResponse' 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:
--
-- 'costCategoryReferences', 'listCostCategoryDefinitionsResponse_costCategoryReferences' - A reference to a Cost Category containing enough information to identify
-- the Cost Category.
--
-- 'nextToken', 'listCostCategoryDefinitionsResponse_nextToken' - The token to retrieve the next set of results. Amazon Web Services
-- provides the token when the response from a previous call has more
-- results than the maximum page size.
--
-- 'httpStatus', 'listCostCategoryDefinitionsResponse_httpStatus' - The response's http status code.
newListCostCategoryDefinitionsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListCostCategoryDefinitionsResponse
newListCostCategoryDefinitionsResponse :: Int -> ListCostCategoryDefinitionsResponse
newListCostCategoryDefinitionsResponse Int
pHttpStatus_ =
  ListCostCategoryDefinitionsResponse' :: Maybe [CostCategoryReference]
-> Maybe Text -> Int -> ListCostCategoryDefinitionsResponse
ListCostCategoryDefinitionsResponse'
    { $sel:costCategoryReferences:ListCostCategoryDefinitionsResponse' :: Maybe [CostCategoryReference]
costCategoryReferences =
        Maybe [CostCategoryReference]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListCostCategoryDefinitionsResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListCostCategoryDefinitionsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A reference to a Cost Category containing enough information to identify
-- the Cost Category.
listCostCategoryDefinitionsResponse_costCategoryReferences :: Lens.Lens' ListCostCategoryDefinitionsResponse (Prelude.Maybe [CostCategoryReference])
listCostCategoryDefinitionsResponse_costCategoryReferences :: (Maybe [CostCategoryReference]
 -> f (Maybe [CostCategoryReference]))
-> ListCostCategoryDefinitionsResponse
-> f ListCostCategoryDefinitionsResponse
listCostCategoryDefinitionsResponse_costCategoryReferences = (ListCostCategoryDefinitionsResponse
 -> Maybe [CostCategoryReference])
-> (ListCostCategoryDefinitionsResponse
    -> Maybe [CostCategoryReference]
    -> ListCostCategoryDefinitionsResponse)
-> Lens
     ListCostCategoryDefinitionsResponse
     ListCostCategoryDefinitionsResponse
     (Maybe [CostCategoryReference])
     (Maybe [CostCategoryReference])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListCostCategoryDefinitionsResponse' {Maybe [CostCategoryReference]
costCategoryReferences :: Maybe [CostCategoryReference]
$sel:costCategoryReferences:ListCostCategoryDefinitionsResponse' :: ListCostCategoryDefinitionsResponse
-> Maybe [CostCategoryReference]
costCategoryReferences} -> Maybe [CostCategoryReference]
costCategoryReferences) (\s :: ListCostCategoryDefinitionsResponse
s@ListCostCategoryDefinitionsResponse' {} Maybe [CostCategoryReference]
a -> ListCostCategoryDefinitionsResponse
s {$sel:costCategoryReferences:ListCostCategoryDefinitionsResponse' :: Maybe [CostCategoryReference]
costCategoryReferences = Maybe [CostCategoryReference]
a} :: ListCostCategoryDefinitionsResponse) ((Maybe [CostCategoryReference]
  -> f (Maybe [CostCategoryReference]))
 -> ListCostCategoryDefinitionsResponse
 -> f ListCostCategoryDefinitionsResponse)
-> ((Maybe [CostCategoryReference]
     -> f (Maybe [CostCategoryReference]))
    -> Maybe [CostCategoryReference]
    -> f (Maybe [CostCategoryReference]))
-> (Maybe [CostCategoryReference]
    -> f (Maybe [CostCategoryReference]))
-> ListCostCategoryDefinitionsResponse
-> f ListCostCategoryDefinitionsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [CostCategoryReference]
  [CostCategoryReference]
  [CostCategoryReference]
  [CostCategoryReference]
-> Iso
     (Maybe [CostCategoryReference])
     (Maybe [CostCategoryReference])
     (Maybe [CostCategoryReference])
     (Maybe [CostCategoryReference])
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
  [CostCategoryReference]
  [CostCategoryReference]
  [CostCategoryReference]
  [CostCategoryReference]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The token to retrieve the next set of results. Amazon Web Services
-- provides the token when the response from a previous call has more
-- results than the maximum page size.
listCostCategoryDefinitionsResponse_nextToken :: Lens.Lens' ListCostCategoryDefinitionsResponse (Prelude.Maybe Prelude.Text)
listCostCategoryDefinitionsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListCostCategoryDefinitionsResponse
-> f ListCostCategoryDefinitionsResponse
listCostCategoryDefinitionsResponse_nextToken = (ListCostCategoryDefinitionsResponse -> Maybe Text)
-> (ListCostCategoryDefinitionsResponse
    -> Maybe Text -> ListCostCategoryDefinitionsResponse)
-> Lens
     ListCostCategoryDefinitionsResponse
     ListCostCategoryDefinitionsResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListCostCategoryDefinitionsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListCostCategoryDefinitionsResponse' :: ListCostCategoryDefinitionsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListCostCategoryDefinitionsResponse
s@ListCostCategoryDefinitionsResponse' {} Maybe Text
a -> ListCostCategoryDefinitionsResponse
s {$sel:nextToken:ListCostCategoryDefinitionsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListCostCategoryDefinitionsResponse)

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

instance
  Prelude.NFData
    ListCostCategoryDefinitionsResponse