{-# 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.LicenseManager.ListUsageForLicenseConfiguration
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Lists all license usage records for a license configuration, displaying
-- license consumption details by resource at a selected point in time. Use
-- this action to audit the current license consumption for any license
-- inventory and configuration.
--
-- This operation returns paginated results.
module Amazonka.LicenseManager.ListUsageForLicenseConfiguration
  ( -- * Creating a Request
    ListUsageForLicenseConfiguration (..),
    newListUsageForLicenseConfiguration,

    -- * Request Lenses
    listUsageForLicenseConfiguration_filters,
    listUsageForLicenseConfiguration_maxResults,
    listUsageForLicenseConfiguration_nextToken,
    listUsageForLicenseConfiguration_licenseConfigurationArn,

    -- * Destructuring the Response
    ListUsageForLicenseConfigurationResponse (..),
    newListUsageForLicenseConfigurationResponse,

    -- * Response Lenses
    listUsageForLicenseConfigurationResponse_licenseConfigurationUsageList,
    listUsageForLicenseConfigurationResponse_nextToken,
    listUsageForLicenseConfigurationResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.LicenseManager.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newListUsageForLicenseConfiguration' smart constructor.
data ListUsageForLicenseConfiguration = ListUsageForLicenseConfiguration'
  { -- | Filters to scope the results. The following filters and logical
    -- operators are supported:
    --
    -- -   @resourceArn@ - The ARN of the license configuration resource.
    --     Logical operators are @EQUALS@ | @NOT_EQUALS@.
    --
    -- -   @resourceType@ - The resource type (@EC2_INSTANCE@ | @EC2_HOST@ |
    --     @EC2_AMI@ | @SYSTEMS_MANAGER_MANAGED_INSTANCE@). Logical operators
    --     are @EQUALS@ | @NOT_EQUALS@.
    --
    -- -   @resourceAccount@ - The ID of the account that owns the resource.
    --     Logical operators are @EQUALS@ | @NOT_EQUALS@.
    ListUsageForLicenseConfiguration -> Maybe [Filter]
filters :: Prelude.Maybe [Filter],
    -- | Maximum number of results to return in a single call.
    ListUsageForLicenseConfiguration -> Maybe Int
maxResults :: Prelude.Maybe Prelude.Int,
    -- | Token for the next set of results.
    ListUsageForLicenseConfiguration -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | Amazon Resource Name (ARN) of the license configuration.
    ListUsageForLicenseConfiguration -> Text
licenseConfigurationArn :: Prelude.Text
  }
  deriving (ListUsageForLicenseConfiguration
-> ListUsageForLicenseConfiguration -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListUsageForLicenseConfiguration
-> ListUsageForLicenseConfiguration -> Bool
$c/= :: ListUsageForLicenseConfiguration
-> ListUsageForLicenseConfiguration -> Bool
== :: ListUsageForLicenseConfiguration
-> ListUsageForLicenseConfiguration -> Bool
$c== :: ListUsageForLicenseConfiguration
-> ListUsageForLicenseConfiguration -> Bool
Prelude.Eq, ReadPrec [ListUsageForLicenseConfiguration]
ReadPrec ListUsageForLicenseConfiguration
Int -> ReadS ListUsageForLicenseConfiguration
ReadS [ListUsageForLicenseConfiguration]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListUsageForLicenseConfiguration]
$creadListPrec :: ReadPrec [ListUsageForLicenseConfiguration]
readPrec :: ReadPrec ListUsageForLicenseConfiguration
$creadPrec :: ReadPrec ListUsageForLicenseConfiguration
readList :: ReadS [ListUsageForLicenseConfiguration]
$creadList :: ReadS [ListUsageForLicenseConfiguration]
readsPrec :: Int -> ReadS ListUsageForLicenseConfiguration
$creadsPrec :: Int -> ReadS ListUsageForLicenseConfiguration
Prelude.Read, Int -> ListUsageForLicenseConfiguration -> ShowS
[ListUsageForLicenseConfiguration] -> ShowS
ListUsageForLicenseConfiguration -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListUsageForLicenseConfiguration] -> ShowS
$cshowList :: [ListUsageForLicenseConfiguration] -> ShowS
show :: ListUsageForLicenseConfiguration -> String
$cshow :: ListUsageForLicenseConfiguration -> String
showsPrec :: Int -> ListUsageForLicenseConfiguration -> ShowS
$cshowsPrec :: Int -> ListUsageForLicenseConfiguration -> ShowS
Prelude.Show, forall x.
Rep ListUsageForLicenseConfiguration x
-> ListUsageForLicenseConfiguration
forall x.
ListUsageForLicenseConfiguration
-> Rep ListUsageForLicenseConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListUsageForLicenseConfiguration x
-> ListUsageForLicenseConfiguration
$cfrom :: forall x.
ListUsageForLicenseConfiguration
-> Rep ListUsageForLicenseConfiguration x
Prelude.Generic)

-- |
-- Create a value of 'ListUsageForLicenseConfiguration' 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', 'listUsageForLicenseConfiguration_filters' - Filters to scope the results. The following filters and logical
-- operators are supported:
--
-- -   @resourceArn@ - The ARN of the license configuration resource.
--     Logical operators are @EQUALS@ | @NOT_EQUALS@.
--
-- -   @resourceType@ - The resource type (@EC2_INSTANCE@ | @EC2_HOST@ |
--     @EC2_AMI@ | @SYSTEMS_MANAGER_MANAGED_INSTANCE@). Logical operators
--     are @EQUALS@ | @NOT_EQUALS@.
--
-- -   @resourceAccount@ - The ID of the account that owns the resource.
--     Logical operators are @EQUALS@ | @NOT_EQUALS@.
--
-- 'maxResults', 'listUsageForLicenseConfiguration_maxResults' - Maximum number of results to return in a single call.
--
-- 'nextToken', 'listUsageForLicenseConfiguration_nextToken' - Token for the next set of results.
--
-- 'licenseConfigurationArn', 'listUsageForLicenseConfiguration_licenseConfigurationArn' - Amazon Resource Name (ARN) of the license configuration.
newListUsageForLicenseConfiguration ::
  -- | 'licenseConfigurationArn'
  Prelude.Text ->
  ListUsageForLicenseConfiguration
newListUsageForLicenseConfiguration :: Text -> ListUsageForLicenseConfiguration
newListUsageForLicenseConfiguration
  Text
pLicenseConfigurationArn_ =
    ListUsageForLicenseConfiguration'
      { $sel:filters:ListUsageForLicenseConfiguration' :: Maybe [Filter]
filters =
          forall a. Maybe a
Prelude.Nothing,
        $sel:maxResults:ListUsageForLicenseConfiguration' :: Maybe Int
maxResults = forall a. Maybe a
Prelude.Nothing,
        $sel:nextToken:ListUsageForLicenseConfiguration' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
        $sel:licenseConfigurationArn:ListUsageForLicenseConfiguration' :: Text
licenseConfigurationArn =
          Text
pLicenseConfigurationArn_
      }

-- | Filters to scope the results. The following filters and logical
-- operators are supported:
--
-- -   @resourceArn@ - The ARN of the license configuration resource.
--     Logical operators are @EQUALS@ | @NOT_EQUALS@.
--
-- -   @resourceType@ - The resource type (@EC2_INSTANCE@ | @EC2_HOST@ |
--     @EC2_AMI@ | @SYSTEMS_MANAGER_MANAGED_INSTANCE@). Logical operators
--     are @EQUALS@ | @NOT_EQUALS@.
--
-- -   @resourceAccount@ - The ID of the account that owns the resource.
--     Logical operators are @EQUALS@ | @NOT_EQUALS@.
listUsageForLicenseConfiguration_filters :: Lens.Lens' ListUsageForLicenseConfiguration (Prelude.Maybe [Filter])
listUsageForLicenseConfiguration_filters :: Lens' ListUsageForLicenseConfiguration (Maybe [Filter])
listUsageForLicenseConfiguration_filters = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListUsageForLicenseConfiguration' {Maybe [Filter]
filters :: Maybe [Filter]
$sel:filters:ListUsageForLicenseConfiguration' :: ListUsageForLicenseConfiguration -> Maybe [Filter]
filters} -> Maybe [Filter]
filters) (\s :: ListUsageForLicenseConfiguration
s@ListUsageForLicenseConfiguration' {} Maybe [Filter]
a -> ListUsageForLicenseConfiguration
s {$sel:filters:ListUsageForLicenseConfiguration' :: Maybe [Filter]
filters = Maybe [Filter]
a} :: ListUsageForLicenseConfiguration) 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

-- | Maximum number of results to return in a single call.
listUsageForLicenseConfiguration_maxResults :: Lens.Lens' ListUsageForLicenseConfiguration (Prelude.Maybe Prelude.Int)
listUsageForLicenseConfiguration_maxResults :: Lens' ListUsageForLicenseConfiguration (Maybe Int)
listUsageForLicenseConfiguration_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListUsageForLicenseConfiguration' {Maybe Int
maxResults :: Maybe Int
$sel:maxResults:ListUsageForLicenseConfiguration' :: ListUsageForLicenseConfiguration -> Maybe Int
maxResults} -> Maybe Int
maxResults) (\s :: ListUsageForLicenseConfiguration
s@ListUsageForLicenseConfiguration' {} Maybe Int
a -> ListUsageForLicenseConfiguration
s {$sel:maxResults:ListUsageForLicenseConfiguration' :: Maybe Int
maxResults = Maybe Int
a} :: ListUsageForLicenseConfiguration)

-- | Token for the next set of results.
listUsageForLicenseConfiguration_nextToken :: Lens.Lens' ListUsageForLicenseConfiguration (Prelude.Maybe Prelude.Text)
listUsageForLicenseConfiguration_nextToken :: Lens' ListUsageForLicenseConfiguration (Maybe Text)
listUsageForLicenseConfiguration_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListUsageForLicenseConfiguration' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListUsageForLicenseConfiguration' :: ListUsageForLicenseConfiguration -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListUsageForLicenseConfiguration
s@ListUsageForLicenseConfiguration' {} Maybe Text
a -> ListUsageForLicenseConfiguration
s {$sel:nextToken:ListUsageForLicenseConfiguration' :: Maybe Text
nextToken = Maybe Text
a} :: ListUsageForLicenseConfiguration)

-- | Amazon Resource Name (ARN) of the license configuration.
listUsageForLicenseConfiguration_licenseConfigurationArn :: Lens.Lens' ListUsageForLicenseConfiguration Prelude.Text
listUsageForLicenseConfiguration_licenseConfigurationArn :: Lens' ListUsageForLicenseConfiguration Text
listUsageForLicenseConfiguration_licenseConfigurationArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListUsageForLicenseConfiguration' {Text
licenseConfigurationArn :: Text
$sel:licenseConfigurationArn:ListUsageForLicenseConfiguration' :: ListUsageForLicenseConfiguration -> Text
licenseConfigurationArn} -> Text
licenseConfigurationArn) (\s :: ListUsageForLicenseConfiguration
s@ListUsageForLicenseConfiguration' {} Text
a -> ListUsageForLicenseConfiguration
s {$sel:licenseConfigurationArn:ListUsageForLicenseConfiguration' :: Text
licenseConfigurationArn = Text
a} :: ListUsageForLicenseConfiguration)

instance
  Core.AWSPager
    ListUsageForLicenseConfiguration
  where
  page :: ListUsageForLicenseConfiguration
-> AWSResponse ListUsageForLicenseConfiguration
-> Maybe ListUsageForLicenseConfiguration
page ListUsageForLicenseConfiguration
rq AWSResponse ListUsageForLicenseConfiguration
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListUsageForLicenseConfiguration
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListUsageForLicenseConfigurationResponse (Maybe Text)
listUsageForLicenseConfigurationResponse_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 ListUsageForLicenseConfiguration
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens'
  ListUsageForLicenseConfigurationResponse
  (Maybe [LicenseConfigurationUsage])
listUsageForLicenseConfigurationResponse_licenseConfigurationUsageList
            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.$ ListUsageForLicenseConfiguration
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListUsageForLicenseConfiguration (Maybe Text)
listUsageForLicenseConfiguration_nextToken
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListUsageForLicenseConfiguration
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListUsageForLicenseConfigurationResponse (Maybe Text)
listUsageForLicenseConfigurationResponse_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
    ListUsageForLicenseConfiguration
  where
  type
    AWSResponse ListUsageForLicenseConfiguration =
      ListUsageForLicenseConfigurationResponse
  request :: (Service -> Service)
-> ListUsageForLicenseConfiguration
-> Request ListUsageForLicenseConfiguration
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 ListUsageForLicenseConfiguration
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse ListUsageForLicenseConfiguration)))
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 [LicenseConfigurationUsage]
-> Maybe Text -> Int -> ListUsageForLicenseConfigurationResponse
ListUsageForLicenseConfigurationResponse'
            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
"LicenseConfigurationUsageList"
                            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
    ListUsageForLicenseConfiguration
  where
  hashWithSalt :: Int -> ListUsageForLicenseConfiguration -> Int
hashWithSalt
    Int
_salt
    ListUsageForLicenseConfiguration' {Maybe Int
Maybe [Filter]
Maybe Text
Text
licenseConfigurationArn :: Text
nextToken :: Maybe Text
maxResults :: Maybe Int
filters :: Maybe [Filter]
$sel:licenseConfigurationArn:ListUsageForLicenseConfiguration' :: ListUsageForLicenseConfiguration -> Text
$sel:nextToken:ListUsageForLicenseConfiguration' :: ListUsageForLicenseConfiguration -> Maybe Text
$sel:maxResults:ListUsageForLicenseConfiguration' :: ListUsageForLicenseConfiguration -> Maybe Int
$sel:filters:ListUsageForLicenseConfiguration' :: ListUsageForLicenseConfiguration -> Maybe [Filter]
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Filter]
filters
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
maxResults
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
licenseConfigurationArn

instance
  Prelude.NFData
    ListUsageForLicenseConfiguration
  where
  rnf :: ListUsageForLicenseConfiguration -> ()
rnf ListUsageForLicenseConfiguration' {Maybe Int
Maybe [Filter]
Maybe Text
Text
licenseConfigurationArn :: Text
nextToken :: Maybe Text
maxResults :: Maybe Int
filters :: Maybe [Filter]
$sel:licenseConfigurationArn:ListUsageForLicenseConfiguration' :: ListUsageForLicenseConfiguration -> Text
$sel:nextToken:ListUsageForLicenseConfiguration' :: ListUsageForLicenseConfiguration -> Maybe Text
$sel:maxResults:ListUsageForLicenseConfiguration' :: ListUsageForLicenseConfiguration -> Maybe Int
$sel:filters:ListUsageForLicenseConfiguration' :: ListUsageForLicenseConfiguration -> Maybe [Filter]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [Filter]
filters
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
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
licenseConfigurationArn

instance
  Data.ToHeaders
    ListUsageForLicenseConfiguration
  where
  toHeaders :: ListUsageForLicenseConfiguration -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"AWSLicenseManager.ListUsageForLicenseConfiguration" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToJSON ListUsageForLicenseConfiguration where
  toJSON :: ListUsageForLicenseConfiguration -> Value
toJSON ListUsageForLicenseConfiguration' {Maybe Int
Maybe [Filter]
Maybe Text
Text
licenseConfigurationArn :: Text
nextToken :: Maybe Text
maxResults :: Maybe Int
filters :: Maybe [Filter]
$sel:licenseConfigurationArn:ListUsageForLicenseConfiguration' :: ListUsageForLicenseConfiguration -> Text
$sel:nextToken:ListUsageForLicenseConfiguration' :: ListUsageForLicenseConfiguration -> Maybe Text
$sel:maxResults:ListUsageForLicenseConfiguration' :: ListUsageForLicenseConfiguration -> Maybe Int
$sel:filters:ListUsageForLicenseConfiguration' :: ListUsageForLicenseConfiguration -> Maybe [Filter]
..} =
    [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 [Filter]
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 Int
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
"LicenseConfigurationArn"
                  forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
licenseConfigurationArn
              )
          ]
      )

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

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

-- | /See:/ 'newListUsageForLicenseConfigurationResponse' smart constructor.
data ListUsageForLicenseConfigurationResponse = ListUsageForLicenseConfigurationResponse'
  { -- | Information about the license configurations.
    ListUsageForLicenseConfigurationResponse
-> Maybe [LicenseConfigurationUsage]
licenseConfigurationUsageList :: Prelude.Maybe [LicenseConfigurationUsage],
    -- | Token for the next set of results.
    ListUsageForLicenseConfigurationResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListUsageForLicenseConfigurationResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListUsageForLicenseConfigurationResponse
-> ListUsageForLicenseConfigurationResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListUsageForLicenseConfigurationResponse
-> ListUsageForLicenseConfigurationResponse -> Bool
$c/= :: ListUsageForLicenseConfigurationResponse
-> ListUsageForLicenseConfigurationResponse -> Bool
== :: ListUsageForLicenseConfigurationResponse
-> ListUsageForLicenseConfigurationResponse -> Bool
$c== :: ListUsageForLicenseConfigurationResponse
-> ListUsageForLicenseConfigurationResponse -> Bool
Prelude.Eq, ReadPrec [ListUsageForLicenseConfigurationResponse]
ReadPrec ListUsageForLicenseConfigurationResponse
Int -> ReadS ListUsageForLicenseConfigurationResponse
ReadS [ListUsageForLicenseConfigurationResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListUsageForLicenseConfigurationResponse]
$creadListPrec :: ReadPrec [ListUsageForLicenseConfigurationResponse]
readPrec :: ReadPrec ListUsageForLicenseConfigurationResponse
$creadPrec :: ReadPrec ListUsageForLicenseConfigurationResponse
readList :: ReadS [ListUsageForLicenseConfigurationResponse]
$creadList :: ReadS [ListUsageForLicenseConfigurationResponse]
readsPrec :: Int -> ReadS ListUsageForLicenseConfigurationResponse
$creadsPrec :: Int -> ReadS ListUsageForLicenseConfigurationResponse
Prelude.Read, Int -> ListUsageForLicenseConfigurationResponse -> ShowS
[ListUsageForLicenseConfigurationResponse] -> ShowS
ListUsageForLicenseConfigurationResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListUsageForLicenseConfigurationResponse] -> ShowS
$cshowList :: [ListUsageForLicenseConfigurationResponse] -> ShowS
show :: ListUsageForLicenseConfigurationResponse -> String
$cshow :: ListUsageForLicenseConfigurationResponse -> String
showsPrec :: Int -> ListUsageForLicenseConfigurationResponse -> ShowS
$cshowsPrec :: Int -> ListUsageForLicenseConfigurationResponse -> ShowS
Prelude.Show, forall x.
Rep ListUsageForLicenseConfigurationResponse x
-> ListUsageForLicenseConfigurationResponse
forall x.
ListUsageForLicenseConfigurationResponse
-> Rep ListUsageForLicenseConfigurationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListUsageForLicenseConfigurationResponse x
-> ListUsageForLicenseConfigurationResponse
$cfrom :: forall x.
ListUsageForLicenseConfigurationResponse
-> Rep ListUsageForLicenseConfigurationResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListUsageForLicenseConfigurationResponse' 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:
--
-- 'licenseConfigurationUsageList', 'listUsageForLicenseConfigurationResponse_licenseConfigurationUsageList' - Information about the license configurations.
--
-- 'nextToken', 'listUsageForLicenseConfigurationResponse_nextToken' - Token for the next set of results.
--
-- 'httpStatus', 'listUsageForLicenseConfigurationResponse_httpStatus' - The response's http status code.
newListUsageForLicenseConfigurationResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListUsageForLicenseConfigurationResponse
newListUsageForLicenseConfigurationResponse :: Int -> ListUsageForLicenseConfigurationResponse
newListUsageForLicenseConfigurationResponse
  Int
pHttpStatus_ =
    ListUsageForLicenseConfigurationResponse'
      { $sel:licenseConfigurationUsageList:ListUsageForLicenseConfigurationResponse' :: Maybe [LicenseConfigurationUsage]
licenseConfigurationUsageList =
          forall a. Maybe a
Prelude.Nothing,
        $sel:nextToken:ListUsageForLicenseConfigurationResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:ListUsageForLicenseConfigurationResponse' :: Int
httpStatus = Int
pHttpStatus_
      }

-- | Information about the license configurations.
listUsageForLicenseConfigurationResponse_licenseConfigurationUsageList :: Lens.Lens' ListUsageForLicenseConfigurationResponse (Prelude.Maybe [LicenseConfigurationUsage])
listUsageForLicenseConfigurationResponse_licenseConfigurationUsageList :: Lens'
  ListUsageForLicenseConfigurationResponse
  (Maybe [LicenseConfigurationUsage])
listUsageForLicenseConfigurationResponse_licenseConfigurationUsageList = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListUsageForLicenseConfigurationResponse' {Maybe [LicenseConfigurationUsage]
licenseConfigurationUsageList :: Maybe [LicenseConfigurationUsage]
$sel:licenseConfigurationUsageList:ListUsageForLicenseConfigurationResponse' :: ListUsageForLicenseConfigurationResponse
-> Maybe [LicenseConfigurationUsage]
licenseConfigurationUsageList} -> Maybe [LicenseConfigurationUsage]
licenseConfigurationUsageList) (\s :: ListUsageForLicenseConfigurationResponse
s@ListUsageForLicenseConfigurationResponse' {} Maybe [LicenseConfigurationUsage]
a -> ListUsageForLicenseConfigurationResponse
s {$sel:licenseConfigurationUsageList:ListUsageForLicenseConfigurationResponse' :: Maybe [LicenseConfigurationUsage]
licenseConfigurationUsageList = Maybe [LicenseConfigurationUsage]
a} :: ListUsageForLicenseConfigurationResponse) 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

-- | Token for the next set of results.
listUsageForLicenseConfigurationResponse_nextToken :: Lens.Lens' ListUsageForLicenseConfigurationResponse (Prelude.Maybe Prelude.Text)
listUsageForLicenseConfigurationResponse_nextToken :: Lens' ListUsageForLicenseConfigurationResponse (Maybe Text)
listUsageForLicenseConfigurationResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListUsageForLicenseConfigurationResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListUsageForLicenseConfigurationResponse' :: ListUsageForLicenseConfigurationResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListUsageForLicenseConfigurationResponse
s@ListUsageForLicenseConfigurationResponse' {} Maybe Text
a -> ListUsageForLicenseConfigurationResponse
s {$sel:nextToken:ListUsageForLicenseConfigurationResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListUsageForLicenseConfigurationResponse)

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

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