{-# 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.ListCustomLineItemVersions
-- 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 get a list of all custom line item versions.
--
-- This operation returns paginated results.
module Amazonka.BillingConductor.ListCustomLineItemVersions
  ( -- * Creating a Request
    ListCustomLineItemVersions (..),
    newListCustomLineItemVersions,

    -- * Request Lenses
    listCustomLineItemVersions_filters,
    listCustomLineItemVersions_maxResults,
    listCustomLineItemVersions_nextToken,
    listCustomLineItemVersions_arn,

    -- * Destructuring the Response
    ListCustomLineItemVersionsResponse (..),
    newListCustomLineItemVersionsResponse,

    -- * Response Lenses
    listCustomLineItemVersionsResponse_customLineItemVersions,
    listCustomLineItemVersionsResponse_nextToken,
    listCustomLineItemVersionsResponse_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:/ 'newListCustomLineItemVersions' smart constructor.
data ListCustomLineItemVersions = ListCustomLineItemVersions'
  { -- | A @ListCustomLineItemVersionsFilter@ that specifies the billing period
    -- range in which the custom line item versions are applied.
    ListCustomLineItemVersions
-> Maybe ListCustomLineItemVersionsFilter
filters :: Prelude.Maybe ListCustomLineItemVersionsFilter,
    -- | The maximum number of custom line item versions to retrieve.
    ListCustomLineItemVersions -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The pagination token that\'s used on subsequent calls to retrieve custom
    -- line item versions.
    ListCustomLineItemVersions -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) for the custom line item.
    ListCustomLineItemVersions -> Text
arn :: Prelude.Text
  }
  deriving (ListCustomLineItemVersions -> ListCustomLineItemVersions -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListCustomLineItemVersions -> ListCustomLineItemVersions -> Bool
$c/= :: ListCustomLineItemVersions -> ListCustomLineItemVersions -> Bool
== :: ListCustomLineItemVersions -> ListCustomLineItemVersions -> Bool
$c== :: ListCustomLineItemVersions -> ListCustomLineItemVersions -> Bool
Prelude.Eq, ReadPrec [ListCustomLineItemVersions]
ReadPrec ListCustomLineItemVersions
Int -> ReadS ListCustomLineItemVersions
ReadS [ListCustomLineItemVersions]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListCustomLineItemVersions]
$creadListPrec :: ReadPrec [ListCustomLineItemVersions]
readPrec :: ReadPrec ListCustomLineItemVersions
$creadPrec :: ReadPrec ListCustomLineItemVersions
readList :: ReadS [ListCustomLineItemVersions]
$creadList :: ReadS [ListCustomLineItemVersions]
readsPrec :: Int -> ReadS ListCustomLineItemVersions
$creadsPrec :: Int -> ReadS ListCustomLineItemVersions
Prelude.Read, Int -> ListCustomLineItemVersions -> ShowS
[ListCustomLineItemVersions] -> ShowS
ListCustomLineItemVersions -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListCustomLineItemVersions] -> ShowS
$cshowList :: [ListCustomLineItemVersions] -> ShowS
show :: ListCustomLineItemVersions -> String
$cshow :: ListCustomLineItemVersions -> String
showsPrec :: Int -> ListCustomLineItemVersions -> ShowS
$cshowsPrec :: Int -> ListCustomLineItemVersions -> ShowS
Prelude.Show, forall x.
Rep ListCustomLineItemVersions x -> ListCustomLineItemVersions
forall x.
ListCustomLineItemVersions -> Rep ListCustomLineItemVersions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListCustomLineItemVersions x -> ListCustomLineItemVersions
$cfrom :: forall x.
ListCustomLineItemVersions -> Rep ListCustomLineItemVersions x
Prelude.Generic)

-- |
-- Create a value of 'ListCustomLineItemVersions' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'filters', 'listCustomLineItemVersions_filters' - A @ListCustomLineItemVersionsFilter@ that specifies the billing period
-- range in which the custom line item versions are applied.
--
-- 'maxResults', 'listCustomLineItemVersions_maxResults' - The maximum number of custom line item versions to retrieve.
--
-- 'nextToken', 'listCustomLineItemVersions_nextToken' - The pagination token that\'s used on subsequent calls to retrieve custom
-- line item versions.
--
-- 'arn', 'listCustomLineItemVersions_arn' - The Amazon Resource Name (ARN) for the custom line item.
newListCustomLineItemVersions ::
  -- | 'arn'
  Prelude.Text ->
  ListCustomLineItemVersions
newListCustomLineItemVersions :: Text -> ListCustomLineItemVersions
newListCustomLineItemVersions Text
pArn_ =
  ListCustomLineItemVersions'
    { $sel:filters:ListCustomLineItemVersions' :: Maybe ListCustomLineItemVersionsFilter
filters =
        forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListCustomLineItemVersions' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListCustomLineItemVersions' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:arn:ListCustomLineItemVersions' :: Text
arn = Text
pArn_
    }

-- | A @ListCustomLineItemVersionsFilter@ that specifies the billing period
-- range in which the custom line item versions are applied.
listCustomLineItemVersions_filters :: Lens.Lens' ListCustomLineItemVersions (Prelude.Maybe ListCustomLineItemVersionsFilter)
listCustomLineItemVersions_filters :: Lens'
  ListCustomLineItemVersions (Maybe ListCustomLineItemVersionsFilter)
listCustomLineItemVersions_filters = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListCustomLineItemVersions' {Maybe ListCustomLineItemVersionsFilter
filters :: Maybe ListCustomLineItemVersionsFilter
$sel:filters:ListCustomLineItemVersions' :: ListCustomLineItemVersions
-> Maybe ListCustomLineItemVersionsFilter
filters} -> Maybe ListCustomLineItemVersionsFilter
filters) (\s :: ListCustomLineItemVersions
s@ListCustomLineItemVersions' {} Maybe ListCustomLineItemVersionsFilter
a -> ListCustomLineItemVersions
s {$sel:filters:ListCustomLineItemVersions' :: Maybe ListCustomLineItemVersionsFilter
filters = Maybe ListCustomLineItemVersionsFilter
a} :: ListCustomLineItemVersions)

-- | The maximum number of custom line item versions to retrieve.
listCustomLineItemVersions_maxResults :: Lens.Lens' ListCustomLineItemVersions (Prelude.Maybe Prelude.Natural)
listCustomLineItemVersions_maxResults :: Lens' ListCustomLineItemVersions (Maybe Natural)
listCustomLineItemVersions_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListCustomLineItemVersions' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListCustomLineItemVersions' :: ListCustomLineItemVersions -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListCustomLineItemVersions
s@ListCustomLineItemVersions' {} Maybe Natural
a -> ListCustomLineItemVersions
s {$sel:maxResults:ListCustomLineItemVersions' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListCustomLineItemVersions)

-- | The pagination token that\'s used on subsequent calls to retrieve custom
-- line item versions.
listCustomLineItemVersions_nextToken :: Lens.Lens' ListCustomLineItemVersions (Prelude.Maybe Prelude.Text)
listCustomLineItemVersions_nextToken :: Lens' ListCustomLineItemVersions (Maybe Text)
listCustomLineItemVersions_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListCustomLineItemVersions' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListCustomLineItemVersions' :: ListCustomLineItemVersions -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListCustomLineItemVersions
s@ListCustomLineItemVersions' {} Maybe Text
a -> ListCustomLineItemVersions
s {$sel:nextToken:ListCustomLineItemVersions' :: Maybe Text
nextToken = Maybe Text
a} :: ListCustomLineItemVersions)

-- | The Amazon Resource Name (ARN) for the custom line item.
listCustomLineItemVersions_arn :: Lens.Lens' ListCustomLineItemVersions Prelude.Text
listCustomLineItemVersions_arn :: Lens' ListCustomLineItemVersions Text
listCustomLineItemVersions_arn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListCustomLineItemVersions' {Text
arn :: Text
$sel:arn:ListCustomLineItemVersions' :: ListCustomLineItemVersions -> Text
arn} -> Text
arn) (\s :: ListCustomLineItemVersions
s@ListCustomLineItemVersions' {} Text
a -> ListCustomLineItemVersions
s {$sel:arn:ListCustomLineItemVersions' :: Text
arn = Text
a} :: ListCustomLineItemVersions)

instance Core.AWSPager ListCustomLineItemVersions where
  page :: ListCustomLineItemVersions
-> AWSResponse ListCustomLineItemVersions
-> Maybe ListCustomLineItemVersions
page ListCustomLineItemVersions
rq AWSResponse ListCustomLineItemVersions
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListCustomLineItemVersions
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListCustomLineItemVersionsResponse (Maybe Text)
listCustomLineItemVersionsResponse_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 ListCustomLineItemVersions
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens'
  ListCustomLineItemVersionsResponse
  (Maybe [CustomLineItemVersionListElement])
listCustomLineItemVersionsResponse_customLineItemVersions
            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.$ ListCustomLineItemVersions
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListCustomLineItemVersions (Maybe Text)
listCustomLineItemVersions_nextToken
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListCustomLineItemVersions
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListCustomLineItemVersionsResponse (Maybe Text)
listCustomLineItemVersionsResponse_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 ListCustomLineItemVersions where
  type
    AWSResponse ListCustomLineItemVersions =
      ListCustomLineItemVersionsResponse
  request :: (Service -> Service)
-> ListCustomLineItemVersions -> Request ListCustomLineItemVersions
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 ListCustomLineItemVersions
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListCustomLineItemVersions)))
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 [CustomLineItemVersionListElement]
-> Maybe Text -> Int -> ListCustomLineItemVersionsResponse
ListCustomLineItemVersionsResponse'
            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
"CustomLineItemVersions"
                            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 ListCustomLineItemVersions where
  hashWithSalt :: Int -> ListCustomLineItemVersions -> Int
hashWithSalt Int
_salt ListCustomLineItemVersions' {Maybe Natural
Maybe Text
Maybe ListCustomLineItemVersionsFilter
Text
arn :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
filters :: Maybe ListCustomLineItemVersionsFilter
$sel:arn:ListCustomLineItemVersions' :: ListCustomLineItemVersions -> Text
$sel:nextToken:ListCustomLineItemVersions' :: ListCustomLineItemVersions -> Maybe Text
$sel:maxResults:ListCustomLineItemVersions' :: ListCustomLineItemVersions -> Maybe Natural
$sel:filters:ListCustomLineItemVersions' :: ListCustomLineItemVersions
-> Maybe ListCustomLineItemVersionsFilter
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ListCustomLineItemVersionsFilter
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
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
arn

instance Prelude.NFData ListCustomLineItemVersions where
  rnf :: ListCustomLineItemVersions -> ()
rnf ListCustomLineItemVersions' {Maybe Natural
Maybe Text
Maybe ListCustomLineItemVersionsFilter
Text
arn :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
filters :: Maybe ListCustomLineItemVersionsFilter
$sel:arn:ListCustomLineItemVersions' :: ListCustomLineItemVersions -> Text
$sel:nextToken:ListCustomLineItemVersions' :: ListCustomLineItemVersions -> Maybe Text
$sel:maxResults:ListCustomLineItemVersions' :: ListCustomLineItemVersions -> Maybe Natural
$sel:filters:ListCustomLineItemVersions' :: ListCustomLineItemVersions
-> Maybe ListCustomLineItemVersionsFilter
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe ListCustomLineItemVersionsFilter
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
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
arn

instance Data.ToHeaders ListCustomLineItemVersions where
  toHeaders :: ListCustomLineItemVersions -> 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 ListCustomLineItemVersions where
  toJSON :: ListCustomLineItemVersions -> Value
toJSON ListCustomLineItemVersions' {Maybe Natural
Maybe Text
Maybe ListCustomLineItemVersionsFilter
Text
arn :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
filters :: Maybe ListCustomLineItemVersionsFilter
$sel:arn:ListCustomLineItemVersions' :: ListCustomLineItemVersions -> Text
$sel:nextToken:ListCustomLineItemVersions' :: ListCustomLineItemVersions -> Maybe Text
$sel:maxResults:ListCustomLineItemVersions' :: ListCustomLineItemVersions -> Maybe Natural
$sel:filters:ListCustomLineItemVersions' :: ListCustomLineItemVersions
-> Maybe ListCustomLineItemVersionsFilter
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (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 ListCustomLineItemVersionsFilter
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,
            forall a. a -> Maybe a
Prelude.Just (Key
"Arn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
arn)
          ]
      )

instance Data.ToPath ListCustomLineItemVersions where
  toPath :: ListCustomLineItemVersions -> ByteString
toPath =
    forall a b. a -> b -> a
Prelude.const ByteString
"/list-custom-line-item-versions"

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

-- | /See:/ 'newListCustomLineItemVersionsResponse' smart constructor.
data ListCustomLineItemVersionsResponse = ListCustomLineItemVersionsResponse'
  { -- | A list of @CustomLineItemVersionListElements@ that are received.
    ListCustomLineItemVersionsResponse
-> Maybe [CustomLineItemVersionListElement]
customLineItemVersions :: Prelude.Maybe [CustomLineItemVersionListElement],
    -- | The pagination token that\'s used on subsequent calls to retrieve custom
    -- line item versions.
    ListCustomLineItemVersionsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListCustomLineItemVersionsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListCustomLineItemVersionsResponse
-> ListCustomLineItemVersionsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListCustomLineItemVersionsResponse
-> ListCustomLineItemVersionsResponse -> Bool
$c/= :: ListCustomLineItemVersionsResponse
-> ListCustomLineItemVersionsResponse -> Bool
== :: ListCustomLineItemVersionsResponse
-> ListCustomLineItemVersionsResponse -> Bool
$c== :: ListCustomLineItemVersionsResponse
-> ListCustomLineItemVersionsResponse -> Bool
Prelude.Eq, Int -> ListCustomLineItemVersionsResponse -> ShowS
[ListCustomLineItemVersionsResponse] -> ShowS
ListCustomLineItemVersionsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListCustomLineItemVersionsResponse] -> ShowS
$cshowList :: [ListCustomLineItemVersionsResponse] -> ShowS
show :: ListCustomLineItemVersionsResponse -> String
$cshow :: ListCustomLineItemVersionsResponse -> String
showsPrec :: Int -> ListCustomLineItemVersionsResponse -> ShowS
$cshowsPrec :: Int -> ListCustomLineItemVersionsResponse -> ShowS
Prelude.Show, forall x.
Rep ListCustomLineItemVersionsResponse x
-> ListCustomLineItemVersionsResponse
forall x.
ListCustomLineItemVersionsResponse
-> Rep ListCustomLineItemVersionsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListCustomLineItemVersionsResponse x
-> ListCustomLineItemVersionsResponse
$cfrom :: forall x.
ListCustomLineItemVersionsResponse
-> Rep ListCustomLineItemVersionsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListCustomLineItemVersionsResponse' 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:
--
-- 'customLineItemVersions', 'listCustomLineItemVersionsResponse_customLineItemVersions' - A list of @CustomLineItemVersionListElements@ that are received.
--
-- 'nextToken', 'listCustomLineItemVersionsResponse_nextToken' - The pagination token that\'s used on subsequent calls to retrieve custom
-- line item versions.
--
-- 'httpStatus', 'listCustomLineItemVersionsResponse_httpStatus' - The response's http status code.
newListCustomLineItemVersionsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListCustomLineItemVersionsResponse
newListCustomLineItemVersionsResponse :: Int -> ListCustomLineItemVersionsResponse
newListCustomLineItemVersionsResponse Int
pHttpStatus_ =
  ListCustomLineItemVersionsResponse'
    { $sel:customLineItemVersions:ListCustomLineItemVersionsResponse' :: Maybe [CustomLineItemVersionListElement]
customLineItemVersions =
        forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListCustomLineItemVersionsResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListCustomLineItemVersionsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A list of @CustomLineItemVersionListElements@ that are received.
listCustomLineItemVersionsResponse_customLineItemVersions :: Lens.Lens' ListCustomLineItemVersionsResponse (Prelude.Maybe [CustomLineItemVersionListElement])
listCustomLineItemVersionsResponse_customLineItemVersions :: Lens'
  ListCustomLineItemVersionsResponse
  (Maybe [CustomLineItemVersionListElement])
listCustomLineItemVersionsResponse_customLineItemVersions = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListCustomLineItemVersionsResponse' {Maybe [CustomLineItemVersionListElement]
customLineItemVersions :: Maybe [CustomLineItemVersionListElement]
$sel:customLineItemVersions:ListCustomLineItemVersionsResponse' :: ListCustomLineItemVersionsResponse
-> Maybe [CustomLineItemVersionListElement]
customLineItemVersions} -> Maybe [CustomLineItemVersionListElement]
customLineItemVersions) (\s :: ListCustomLineItemVersionsResponse
s@ListCustomLineItemVersionsResponse' {} Maybe [CustomLineItemVersionListElement]
a -> ListCustomLineItemVersionsResponse
s {$sel:customLineItemVersions:ListCustomLineItemVersionsResponse' :: Maybe [CustomLineItemVersionListElement]
customLineItemVersions = Maybe [CustomLineItemVersionListElement]
a} :: ListCustomLineItemVersionsResponse) 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 retrieve custom
-- line item versions.
listCustomLineItemVersionsResponse_nextToken :: Lens.Lens' ListCustomLineItemVersionsResponse (Prelude.Maybe Prelude.Text)
listCustomLineItemVersionsResponse_nextToken :: Lens' ListCustomLineItemVersionsResponse (Maybe Text)
listCustomLineItemVersionsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListCustomLineItemVersionsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListCustomLineItemVersionsResponse' :: ListCustomLineItemVersionsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListCustomLineItemVersionsResponse
s@ListCustomLineItemVersionsResponse' {} Maybe Text
a -> ListCustomLineItemVersionsResponse
s {$sel:nextToken:ListCustomLineItemVersionsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListCustomLineItemVersionsResponse)

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

instance
  Prelude.NFData
    ListCustomLineItemVersionsResponse
  where
  rnf :: ListCustomLineItemVersionsResponse -> ()
rnf ListCustomLineItemVersionsResponse' {Int
Maybe [CustomLineItemVersionListElement]
Maybe Text
httpStatus :: Int
nextToken :: Maybe Text
customLineItemVersions :: Maybe [CustomLineItemVersionListElement]
$sel:httpStatus:ListCustomLineItemVersionsResponse' :: ListCustomLineItemVersionsResponse -> Int
$sel:nextToken:ListCustomLineItemVersionsResponse' :: ListCustomLineItemVersionsResponse -> Maybe Text
$sel:customLineItemVersions:ListCustomLineItemVersionsResponse' :: ListCustomLineItemVersionsResponse
-> Maybe [CustomLineItemVersionListElement]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [CustomLineItemVersionListElement]
customLineItemVersions
      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