{-# 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.DeviceFarm.ListOfferingTransactions
-- 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 a list of all historical purchases, renewals, and system renewal
-- transactions for an AWS account. The list is paginated and ordered by a
-- descending timestamp (most recent transactions are first). The API
-- returns a @NotEligible@ error if the user is not permitted to invoke the
-- operation. If you must be able to invoke this operation, contact
-- <mailto:aws-devicefarm-support@amazon.com aws-devicefarm-support\@amazon.com>.
--
-- This operation returns paginated results.
module Amazonka.DeviceFarm.ListOfferingTransactions
  ( -- * Creating a Request
    ListOfferingTransactions (..),
    newListOfferingTransactions,

    -- * Request Lenses
    listOfferingTransactions_nextToken,

    -- * Destructuring the Response
    ListOfferingTransactionsResponse (..),
    newListOfferingTransactionsResponse,

    -- * Response Lenses
    listOfferingTransactionsResponse_offeringTransactions,
    listOfferingTransactionsResponse_nextToken,
    listOfferingTransactionsResponse_httpStatus,
  )
where

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

-- | Represents the request to list the offering transaction history.
--
-- /See:/ 'newListOfferingTransactions' smart constructor.
data ListOfferingTransactions = ListOfferingTransactions'
  { -- | An identifier that was returned from the previous call to this
    -- operation, which can be used to return the next set of items in the
    -- list.
    ListOfferingTransactions -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text
  }
  deriving (ListOfferingTransactions -> ListOfferingTransactions -> Bool
(ListOfferingTransactions -> ListOfferingTransactions -> Bool)
-> (ListOfferingTransactions -> ListOfferingTransactions -> Bool)
-> Eq ListOfferingTransactions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListOfferingTransactions -> ListOfferingTransactions -> Bool
$c/= :: ListOfferingTransactions -> ListOfferingTransactions -> Bool
== :: ListOfferingTransactions -> ListOfferingTransactions -> Bool
$c== :: ListOfferingTransactions -> ListOfferingTransactions -> Bool
Prelude.Eq, ReadPrec [ListOfferingTransactions]
ReadPrec ListOfferingTransactions
Int -> ReadS ListOfferingTransactions
ReadS [ListOfferingTransactions]
(Int -> ReadS ListOfferingTransactions)
-> ReadS [ListOfferingTransactions]
-> ReadPrec ListOfferingTransactions
-> ReadPrec [ListOfferingTransactions]
-> Read ListOfferingTransactions
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListOfferingTransactions]
$creadListPrec :: ReadPrec [ListOfferingTransactions]
readPrec :: ReadPrec ListOfferingTransactions
$creadPrec :: ReadPrec ListOfferingTransactions
readList :: ReadS [ListOfferingTransactions]
$creadList :: ReadS [ListOfferingTransactions]
readsPrec :: Int -> ReadS ListOfferingTransactions
$creadsPrec :: Int -> ReadS ListOfferingTransactions
Prelude.Read, Int -> ListOfferingTransactions -> ShowS
[ListOfferingTransactions] -> ShowS
ListOfferingTransactions -> String
(Int -> ListOfferingTransactions -> ShowS)
-> (ListOfferingTransactions -> String)
-> ([ListOfferingTransactions] -> ShowS)
-> Show ListOfferingTransactions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListOfferingTransactions] -> ShowS
$cshowList :: [ListOfferingTransactions] -> ShowS
show :: ListOfferingTransactions -> String
$cshow :: ListOfferingTransactions -> String
showsPrec :: Int -> ListOfferingTransactions -> ShowS
$cshowsPrec :: Int -> ListOfferingTransactions -> ShowS
Prelude.Show, (forall x.
 ListOfferingTransactions -> Rep ListOfferingTransactions x)
-> (forall x.
    Rep ListOfferingTransactions x -> ListOfferingTransactions)
-> Generic ListOfferingTransactions
forall x.
Rep ListOfferingTransactions x -> ListOfferingTransactions
forall x.
ListOfferingTransactions -> Rep ListOfferingTransactions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListOfferingTransactions x -> ListOfferingTransactions
$cfrom :: forall x.
ListOfferingTransactions -> Rep ListOfferingTransactions x
Prelude.Generic)

-- |
-- Create a value of 'ListOfferingTransactions' 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', 'listOfferingTransactions_nextToken' - An identifier that was returned from the previous call to this
-- operation, which can be used to return the next set of items in the
-- list.
newListOfferingTransactions ::
  ListOfferingTransactions
newListOfferingTransactions :: ListOfferingTransactions
newListOfferingTransactions =
  ListOfferingTransactions' :: Maybe Text -> ListOfferingTransactions
ListOfferingTransactions'
    { $sel:nextToken:ListOfferingTransactions' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | An identifier that was returned from the previous call to this
-- operation, which can be used to return the next set of items in the
-- list.
listOfferingTransactions_nextToken :: Lens.Lens' ListOfferingTransactions (Prelude.Maybe Prelude.Text)
listOfferingTransactions_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListOfferingTransactions -> f ListOfferingTransactions
listOfferingTransactions_nextToken = (ListOfferingTransactions -> Maybe Text)
-> (ListOfferingTransactions
    -> Maybe Text -> ListOfferingTransactions)
-> Lens
     ListOfferingTransactions
     ListOfferingTransactions
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListOfferingTransactions' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListOfferingTransactions' :: ListOfferingTransactions -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListOfferingTransactions
s@ListOfferingTransactions' {} Maybe Text
a -> ListOfferingTransactions
s {$sel:nextToken:ListOfferingTransactions' :: Maybe Text
nextToken = Maybe Text
a} :: ListOfferingTransactions)

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

instance Prelude.NFData ListOfferingTransactions

instance Core.ToHeaders ListOfferingTransactions where
  toHeaders :: ListOfferingTransactions -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListOfferingTransactions -> 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
"DeviceFarm_20150623.ListOfferingTransactions" ::
                          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 ListOfferingTransactions where
  toJSON :: ListOfferingTransactions -> Value
toJSON ListOfferingTransactions' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListOfferingTransactions' :: ListOfferingTransactions -> 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]
      )

instance Core.ToPath ListOfferingTransactions where
  toPath :: ListOfferingTransactions -> ByteString
toPath = ByteString -> ListOfferingTransactions -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

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

-- | Returns the transaction log of the specified offerings.
--
-- /See:/ 'newListOfferingTransactionsResponse' smart constructor.
data ListOfferingTransactionsResponse = ListOfferingTransactionsResponse'
  { -- | The audit log of subscriptions you have purchased and modified through
    -- AWS Device Farm.
    ListOfferingTransactionsResponse -> Maybe [OfferingTransaction]
offeringTransactions :: Prelude.Maybe [OfferingTransaction],
    -- | An identifier that was returned from the previous call to this
    -- operation, which can be used to return the next set of items in the
    -- list.
    ListOfferingTransactionsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListOfferingTransactionsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListOfferingTransactionsResponse
-> ListOfferingTransactionsResponse -> Bool
(ListOfferingTransactionsResponse
 -> ListOfferingTransactionsResponse -> Bool)
-> (ListOfferingTransactionsResponse
    -> ListOfferingTransactionsResponse -> Bool)
-> Eq ListOfferingTransactionsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListOfferingTransactionsResponse
-> ListOfferingTransactionsResponse -> Bool
$c/= :: ListOfferingTransactionsResponse
-> ListOfferingTransactionsResponse -> Bool
== :: ListOfferingTransactionsResponse
-> ListOfferingTransactionsResponse -> Bool
$c== :: ListOfferingTransactionsResponse
-> ListOfferingTransactionsResponse -> Bool
Prelude.Eq, ReadPrec [ListOfferingTransactionsResponse]
ReadPrec ListOfferingTransactionsResponse
Int -> ReadS ListOfferingTransactionsResponse
ReadS [ListOfferingTransactionsResponse]
(Int -> ReadS ListOfferingTransactionsResponse)
-> ReadS [ListOfferingTransactionsResponse]
-> ReadPrec ListOfferingTransactionsResponse
-> ReadPrec [ListOfferingTransactionsResponse]
-> Read ListOfferingTransactionsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListOfferingTransactionsResponse]
$creadListPrec :: ReadPrec [ListOfferingTransactionsResponse]
readPrec :: ReadPrec ListOfferingTransactionsResponse
$creadPrec :: ReadPrec ListOfferingTransactionsResponse
readList :: ReadS [ListOfferingTransactionsResponse]
$creadList :: ReadS [ListOfferingTransactionsResponse]
readsPrec :: Int -> ReadS ListOfferingTransactionsResponse
$creadsPrec :: Int -> ReadS ListOfferingTransactionsResponse
Prelude.Read, Int -> ListOfferingTransactionsResponse -> ShowS
[ListOfferingTransactionsResponse] -> ShowS
ListOfferingTransactionsResponse -> String
(Int -> ListOfferingTransactionsResponse -> ShowS)
-> (ListOfferingTransactionsResponse -> String)
-> ([ListOfferingTransactionsResponse] -> ShowS)
-> Show ListOfferingTransactionsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListOfferingTransactionsResponse] -> ShowS
$cshowList :: [ListOfferingTransactionsResponse] -> ShowS
show :: ListOfferingTransactionsResponse -> String
$cshow :: ListOfferingTransactionsResponse -> String
showsPrec :: Int -> ListOfferingTransactionsResponse -> ShowS
$cshowsPrec :: Int -> ListOfferingTransactionsResponse -> ShowS
Prelude.Show, (forall x.
 ListOfferingTransactionsResponse
 -> Rep ListOfferingTransactionsResponse x)
-> (forall x.
    Rep ListOfferingTransactionsResponse x
    -> ListOfferingTransactionsResponse)
-> Generic ListOfferingTransactionsResponse
forall x.
Rep ListOfferingTransactionsResponse x
-> ListOfferingTransactionsResponse
forall x.
ListOfferingTransactionsResponse
-> Rep ListOfferingTransactionsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListOfferingTransactionsResponse x
-> ListOfferingTransactionsResponse
$cfrom :: forall x.
ListOfferingTransactionsResponse
-> Rep ListOfferingTransactionsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListOfferingTransactionsResponse' 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:
--
-- 'offeringTransactions', 'listOfferingTransactionsResponse_offeringTransactions' - The audit log of subscriptions you have purchased and modified through
-- AWS Device Farm.
--
-- 'nextToken', 'listOfferingTransactionsResponse_nextToken' - An identifier that was returned from the previous call to this
-- operation, which can be used to return the next set of items in the
-- list.
--
-- 'httpStatus', 'listOfferingTransactionsResponse_httpStatus' - The response's http status code.
newListOfferingTransactionsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListOfferingTransactionsResponse
newListOfferingTransactionsResponse :: Int -> ListOfferingTransactionsResponse
newListOfferingTransactionsResponse Int
pHttpStatus_ =
  ListOfferingTransactionsResponse' :: Maybe [OfferingTransaction]
-> Maybe Text -> Int -> ListOfferingTransactionsResponse
ListOfferingTransactionsResponse'
    { $sel:offeringTransactions:ListOfferingTransactionsResponse' :: Maybe [OfferingTransaction]
offeringTransactions =
        Maybe [OfferingTransaction]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListOfferingTransactionsResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListOfferingTransactionsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The audit log of subscriptions you have purchased and modified through
-- AWS Device Farm.
listOfferingTransactionsResponse_offeringTransactions :: Lens.Lens' ListOfferingTransactionsResponse (Prelude.Maybe [OfferingTransaction])
listOfferingTransactionsResponse_offeringTransactions :: (Maybe [OfferingTransaction] -> f (Maybe [OfferingTransaction]))
-> ListOfferingTransactionsResponse
-> f ListOfferingTransactionsResponse
listOfferingTransactionsResponse_offeringTransactions = (ListOfferingTransactionsResponse -> Maybe [OfferingTransaction])
-> (ListOfferingTransactionsResponse
    -> Maybe [OfferingTransaction] -> ListOfferingTransactionsResponse)
-> Lens'
     ListOfferingTransactionsResponse (Maybe [OfferingTransaction])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListOfferingTransactionsResponse' {Maybe [OfferingTransaction]
offeringTransactions :: Maybe [OfferingTransaction]
$sel:offeringTransactions:ListOfferingTransactionsResponse' :: ListOfferingTransactionsResponse -> Maybe [OfferingTransaction]
offeringTransactions} -> Maybe [OfferingTransaction]
offeringTransactions) (\s :: ListOfferingTransactionsResponse
s@ListOfferingTransactionsResponse' {} Maybe [OfferingTransaction]
a -> ListOfferingTransactionsResponse
s {$sel:offeringTransactions:ListOfferingTransactionsResponse' :: Maybe [OfferingTransaction]
offeringTransactions = Maybe [OfferingTransaction]
a} :: ListOfferingTransactionsResponse) ((Maybe [OfferingTransaction] -> f (Maybe [OfferingTransaction]))
 -> ListOfferingTransactionsResponse
 -> f ListOfferingTransactionsResponse)
-> ((Maybe [OfferingTransaction]
     -> f (Maybe [OfferingTransaction]))
    -> Maybe [OfferingTransaction] -> f (Maybe [OfferingTransaction]))
-> (Maybe [OfferingTransaction] -> f (Maybe [OfferingTransaction]))
-> ListOfferingTransactionsResponse
-> f ListOfferingTransactionsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [OfferingTransaction]
  [OfferingTransaction]
  [OfferingTransaction]
  [OfferingTransaction]
-> Iso
     (Maybe [OfferingTransaction])
     (Maybe [OfferingTransaction])
     (Maybe [OfferingTransaction])
     (Maybe [OfferingTransaction])
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
  [OfferingTransaction]
  [OfferingTransaction]
  [OfferingTransaction]
  [OfferingTransaction]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | An identifier that was returned from the previous call to this
-- operation, which can be used to return the next set of items in the
-- list.
listOfferingTransactionsResponse_nextToken :: Lens.Lens' ListOfferingTransactionsResponse (Prelude.Maybe Prelude.Text)
listOfferingTransactionsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListOfferingTransactionsResponse
-> f ListOfferingTransactionsResponse
listOfferingTransactionsResponse_nextToken = (ListOfferingTransactionsResponse -> Maybe Text)
-> (ListOfferingTransactionsResponse
    -> Maybe Text -> ListOfferingTransactionsResponse)
-> Lens' ListOfferingTransactionsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListOfferingTransactionsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListOfferingTransactionsResponse' :: ListOfferingTransactionsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListOfferingTransactionsResponse
s@ListOfferingTransactionsResponse' {} Maybe Text
a -> ListOfferingTransactionsResponse
s {$sel:nextToken:ListOfferingTransactionsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListOfferingTransactionsResponse)

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

instance
  Prelude.NFData
    ListOfferingTransactionsResponse