{-# 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.GuardDuty.GetUsageStatistics
-- 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 Amazon GuardDuty usage statistics over the last 30 days for the
-- specified detector ID. For newly enabled detectors or data sources, the
-- cost returned will include only the usage so far under 30 days. This may
-- differ from the cost metrics in the console, which project usage over 30
-- days to provide a monthly cost estimate. For more information, see
-- <https://docs.aws.amazon.com/guardduty/latest/ug/monitoring_costs.html#usage-calculations Understanding How Usage Costs are Calculated>.
module Amazonka.GuardDuty.GetUsageStatistics
  ( -- * Creating a Request
    GetUsageStatistics (..),
    newGetUsageStatistics,

    -- * Request Lenses
    getUsageStatistics_maxResults,
    getUsageStatistics_nextToken,
    getUsageStatistics_unit,
    getUsageStatistics_detectorId,
    getUsageStatistics_usageStatisticType,
    getUsageStatistics_usageCriteria,

    -- * Destructuring the Response
    GetUsageStatisticsResponse (..),
    newGetUsageStatisticsResponse,

    -- * Response Lenses
    getUsageStatisticsResponse_nextToken,
    getUsageStatisticsResponse_usageStatistics,
    getUsageStatisticsResponse_httpStatus,
  )
where

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

-- | /See:/ 'newGetUsageStatistics' smart constructor.
data GetUsageStatistics = GetUsageStatistics'
  { -- | The maximum number of results to return in the response.
    GetUsageStatistics -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | A token to use for paginating results that are returned in the response.
    -- Set the value of this parameter to null for the first request to a list
    -- action. For subsequent calls, use the NextToken value returned from the
    -- previous request to continue listing results after the first page.
    GetUsageStatistics -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The currency unit you would like to view your usage statistics in.
    -- Current valid values are USD.
    GetUsageStatistics -> Maybe Text
unit :: Prelude.Maybe Prelude.Text,
    -- | The ID of the detector that specifies the GuardDuty service whose usage
    -- statistics you want to retrieve.
    GetUsageStatistics -> Text
detectorId :: Prelude.Text,
    -- | The type of usage statistics to retrieve.
    GetUsageStatistics -> UsageStatisticType
usageStatisticType :: UsageStatisticType,
    -- | Represents the criteria used for querying usage.
    GetUsageStatistics -> UsageCriteria
usageCriteria :: UsageCriteria
  }
  deriving (GetUsageStatistics -> GetUsageStatistics -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetUsageStatistics -> GetUsageStatistics -> Bool
$c/= :: GetUsageStatistics -> GetUsageStatistics -> Bool
== :: GetUsageStatistics -> GetUsageStatistics -> Bool
$c== :: GetUsageStatistics -> GetUsageStatistics -> Bool
Prelude.Eq, ReadPrec [GetUsageStatistics]
ReadPrec GetUsageStatistics
Int -> ReadS GetUsageStatistics
ReadS [GetUsageStatistics]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetUsageStatistics]
$creadListPrec :: ReadPrec [GetUsageStatistics]
readPrec :: ReadPrec GetUsageStatistics
$creadPrec :: ReadPrec GetUsageStatistics
readList :: ReadS [GetUsageStatistics]
$creadList :: ReadS [GetUsageStatistics]
readsPrec :: Int -> ReadS GetUsageStatistics
$creadsPrec :: Int -> ReadS GetUsageStatistics
Prelude.Read, Int -> GetUsageStatistics -> ShowS
[GetUsageStatistics] -> ShowS
GetUsageStatistics -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetUsageStatistics] -> ShowS
$cshowList :: [GetUsageStatistics] -> ShowS
show :: GetUsageStatistics -> String
$cshow :: GetUsageStatistics -> String
showsPrec :: Int -> GetUsageStatistics -> ShowS
$cshowsPrec :: Int -> GetUsageStatistics -> ShowS
Prelude.Show, forall x. Rep GetUsageStatistics x -> GetUsageStatistics
forall x. GetUsageStatistics -> Rep GetUsageStatistics x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetUsageStatistics x -> GetUsageStatistics
$cfrom :: forall x. GetUsageStatistics -> Rep GetUsageStatistics x
Prelude.Generic)

-- |
-- Create a value of 'GetUsageStatistics' 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:
--
-- 'maxResults', 'getUsageStatistics_maxResults' - The maximum number of results to return in the response.
--
-- 'nextToken', 'getUsageStatistics_nextToken' - A token to use for paginating results that are returned in the response.
-- Set the value of this parameter to null for the first request to a list
-- action. For subsequent calls, use the NextToken value returned from the
-- previous request to continue listing results after the first page.
--
-- 'unit', 'getUsageStatistics_unit' - The currency unit you would like to view your usage statistics in.
-- Current valid values are USD.
--
-- 'detectorId', 'getUsageStatistics_detectorId' - The ID of the detector that specifies the GuardDuty service whose usage
-- statistics you want to retrieve.
--
-- 'usageStatisticType', 'getUsageStatistics_usageStatisticType' - The type of usage statistics to retrieve.
--
-- 'usageCriteria', 'getUsageStatistics_usageCriteria' - Represents the criteria used for querying usage.
newGetUsageStatistics ::
  -- | 'detectorId'
  Prelude.Text ->
  -- | 'usageStatisticType'
  UsageStatisticType ->
  -- | 'usageCriteria'
  UsageCriteria ->
  GetUsageStatistics
newGetUsageStatistics :: Text -> UsageStatisticType -> UsageCriteria -> GetUsageStatistics
newGetUsageStatistics
  Text
pDetectorId_
  UsageStatisticType
pUsageStatisticType_
  UsageCriteria
pUsageCriteria_ =
    GetUsageStatistics'
      { $sel:maxResults:GetUsageStatistics' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
        $sel:nextToken:GetUsageStatistics' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
        $sel:unit:GetUsageStatistics' :: Maybe Text
unit = forall a. Maybe a
Prelude.Nothing,
        $sel:detectorId:GetUsageStatistics' :: Text
detectorId = Text
pDetectorId_,
        $sel:usageStatisticType:GetUsageStatistics' :: UsageStatisticType
usageStatisticType = UsageStatisticType
pUsageStatisticType_,
        $sel:usageCriteria:GetUsageStatistics' :: UsageCriteria
usageCriteria = UsageCriteria
pUsageCriteria_
      }

-- | The maximum number of results to return in the response.
getUsageStatistics_maxResults :: Lens.Lens' GetUsageStatistics (Prelude.Maybe Prelude.Natural)
getUsageStatistics_maxResults :: Lens' GetUsageStatistics (Maybe Natural)
getUsageStatistics_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetUsageStatistics' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:GetUsageStatistics' :: GetUsageStatistics -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: GetUsageStatistics
s@GetUsageStatistics' {} Maybe Natural
a -> GetUsageStatistics
s {$sel:maxResults:GetUsageStatistics' :: Maybe Natural
maxResults = Maybe Natural
a} :: GetUsageStatistics)

-- | A token to use for paginating results that are returned in the response.
-- Set the value of this parameter to null for the first request to a list
-- action. For subsequent calls, use the NextToken value returned from the
-- previous request to continue listing results after the first page.
getUsageStatistics_nextToken :: Lens.Lens' GetUsageStatistics (Prelude.Maybe Prelude.Text)
getUsageStatistics_nextToken :: Lens' GetUsageStatistics (Maybe Text)
getUsageStatistics_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetUsageStatistics' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetUsageStatistics' :: GetUsageStatistics -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: GetUsageStatistics
s@GetUsageStatistics' {} Maybe Text
a -> GetUsageStatistics
s {$sel:nextToken:GetUsageStatistics' :: Maybe Text
nextToken = Maybe Text
a} :: GetUsageStatistics)

-- | The currency unit you would like to view your usage statistics in.
-- Current valid values are USD.
getUsageStatistics_unit :: Lens.Lens' GetUsageStatistics (Prelude.Maybe Prelude.Text)
getUsageStatistics_unit :: Lens' GetUsageStatistics (Maybe Text)
getUsageStatistics_unit = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetUsageStatistics' {Maybe Text
unit :: Maybe Text
$sel:unit:GetUsageStatistics' :: GetUsageStatistics -> Maybe Text
unit} -> Maybe Text
unit) (\s :: GetUsageStatistics
s@GetUsageStatistics' {} Maybe Text
a -> GetUsageStatistics
s {$sel:unit:GetUsageStatistics' :: Maybe Text
unit = Maybe Text
a} :: GetUsageStatistics)

-- | The ID of the detector that specifies the GuardDuty service whose usage
-- statistics you want to retrieve.
getUsageStatistics_detectorId :: Lens.Lens' GetUsageStatistics Prelude.Text
getUsageStatistics_detectorId :: Lens' GetUsageStatistics Text
getUsageStatistics_detectorId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetUsageStatistics' {Text
detectorId :: Text
$sel:detectorId:GetUsageStatistics' :: GetUsageStatistics -> Text
detectorId} -> Text
detectorId) (\s :: GetUsageStatistics
s@GetUsageStatistics' {} Text
a -> GetUsageStatistics
s {$sel:detectorId:GetUsageStatistics' :: Text
detectorId = Text
a} :: GetUsageStatistics)

-- | The type of usage statistics to retrieve.
getUsageStatistics_usageStatisticType :: Lens.Lens' GetUsageStatistics UsageStatisticType
getUsageStatistics_usageStatisticType :: Lens' GetUsageStatistics UsageStatisticType
getUsageStatistics_usageStatisticType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetUsageStatistics' {UsageStatisticType
usageStatisticType :: UsageStatisticType
$sel:usageStatisticType:GetUsageStatistics' :: GetUsageStatistics -> UsageStatisticType
usageStatisticType} -> UsageStatisticType
usageStatisticType) (\s :: GetUsageStatistics
s@GetUsageStatistics' {} UsageStatisticType
a -> GetUsageStatistics
s {$sel:usageStatisticType:GetUsageStatistics' :: UsageStatisticType
usageStatisticType = UsageStatisticType
a} :: GetUsageStatistics)

-- | Represents the criteria used for querying usage.
getUsageStatistics_usageCriteria :: Lens.Lens' GetUsageStatistics UsageCriteria
getUsageStatistics_usageCriteria :: Lens' GetUsageStatistics UsageCriteria
getUsageStatistics_usageCriteria = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetUsageStatistics' {UsageCriteria
usageCriteria :: UsageCriteria
$sel:usageCriteria:GetUsageStatistics' :: GetUsageStatistics -> UsageCriteria
usageCriteria} -> UsageCriteria
usageCriteria) (\s :: GetUsageStatistics
s@GetUsageStatistics' {} UsageCriteria
a -> GetUsageStatistics
s {$sel:usageCriteria:GetUsageStatistics' :: UsageCriteria
usageCriteria = UsageCriteria
a} :: GetUsageStatistics)

instance Core.AWSRequest GetUsageStatistics where
  type
    AWSResponse GetUsageStatistics =
      GetUsageStatisticsResponse
  request :: (Service -> Service)
-> GetUsageStatistics -> Request GetUsageStatistics
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 GetUsageStatistics
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse GetUsageStatistics)))
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 Text
-> Maybe UsageStatistics -> Int -> GetUsageStatisticsResponse
GetUsageStatisticsResponse'
            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
"nextToken")
            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
"usageStatistics")
            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 GetUsageStatistics where
  hashWithSalt :: Int -> GetUsageStatistics -> Int
hashWithSalt Int
_salt GetUsageStatistics' {Maybe Natural
Maybe Text
Text
UsageCriteria
UsageStatisticType
usageCriteria :: UsageCriteria
usageStatisticType :: UsageStatisticType
detectorId :: Text
unit :: Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:usageCriteria:GetUsageStatistics' :: GetUsageStatistics -> UsageCriteria
$sel:usageStatisticType:GetUsageStatistics' :: GetUsageStatistics -> UsageStatisticType
$sel:detectorId:GetUsageStatistics' :: GetUsageStatistics -> Text
$sel:unit:GetUsageStatistics' :: GetUsageStatistics -> Maybe Text
$sel:nextToken:GetUsageStatistics' :: GetUsageStatistics -> Maybe Text
$sel:maxResults:GetUsageStatistics' :: GetUsageStatistics -> Maybe Natural
..} =
    Int
_salt
      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` Maybe Text
unit
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
detectorId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` UsageStatisticType
usageStatisticType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` UsageCriteria
usageCriteria

instance Prelude.NFData GetUsageStatistics where
  rnf :: GetUsageStatistics -> ()
rnf GetUsageStatistics' {Maybe Natural
Maybe Text
Text
UsageCriteria
UsageStatisticType
usageCriteria :: UsageCriteria
usageStatisticType :: UsageStatisticType
detectorId :: Text
unit :: Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:usageCriteria:GetUsageStatistics' :: GetUsageStatistics -> UsageCriteria
$sel:usageStatisticType:GetUsageStatistics' :: GetUsageStatistics -> UsageStatisticType
$sel:detectorId:GetUsageStatistics' :: GetUsageStatistics -> Text
$sel:unit:GetUsageStatistics' :: GetUsageStatistics -> Maybe Text
$sel:nextToken:GetUsageStatistics' :: GetUsageStatistics -> Maybe Text
$sel:maxResults:GetUsageStatistics' :: GetUsageStatistics -> Maybe Natural
..} =
    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 Maybe Text
unit
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
detectorId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf UsageStatisticType
usageStatisticType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf UsageCriteria
usageCriteria

instance Data.ToHeaders GetUsageStatistics where
  toHeaders :: GetUsageStatistics -> 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 GetUsageStatistics where
  toJSON :: GetUsageStatistics -> Value
toJSON GetUsageStatistics' {Maybe Natural
Maybe Text
Text
UsageCriteria
UsageStatisticType
usageCriteria :: UsageCriteria
usageStatisticType :: UsageStatisticType
detectorId :: Text
unit :: Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:usageCriteria:GetUsageStatistics' :: GetUsageStatistics -> UsageCriteria
$sel:usageStatisticType:GetUsageStatistics' :: GetUsageStatistics -> UsageStatisticType
$sel:detectorId:GetUsageStatistics' :: GetUsageStatistics -> Text
$sel:unit:GetUsageStatistics' :: GetUsageStatistics -> Maybe Text
$sel:nextToken:GetUsageStatistics' :: GetUsageStatistics -> Maybe Text
$sel:maxResults:GetUsageStatistics' :: GetUsageStatistics -> Maybe Natural
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (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,
            (Key
"unit" 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
unit,
            forall a. a -> Maybe a
Prelude.Just
              (Key
"usageStatisticsType" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= UsageStatisticType
usageStatisticType),
            forall a. a -> Maybe a
Prelude.Just
              (Key
"usageCriteria" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= UsageCriteria
usageCriteria)
          ]
      )

instance Data.ToPath GetUsageStatistics where
  toPath :: GetUsageStatistics -> ByteString
toPath GetUsageStatistics' {Maybe Natural
Maybe Text
Text
UsageCriteria
UsageStatisticType
usageCriteria :: UsageCriteria
usageStatisticType :: UsageStatisticType
detectorId :: Text
unit :: Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:usageCriteria:GetUsageStatistics' :: GetUsageStatistics -> UsageCriteria
$sel:usageStatisticType:GetUsageStatistics' :: GetUsageStatistics -> UsageStatisticType
$sel:detectorId:GetUsageStatistics' :: GetUsageStatistics -> Text
$sel:unit:GetUsageStatistics' :: GetUsageStatistics -> Maybe Text
$sel:nextToken:GetUsageStatistics' :: GetUsageStatistics -> Maybe Text
$sel:maxResults:GetUsageStatistics' :: GetUsageStatistics -> Maybe Natural
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/detector/",
        forall a. ToByteString a => a -> ByteString
Data.toBS Text
detectorId,
        ByteString
"/usage/statistics"
      ]

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

-- | /See:/ 'newGetUsageStatisticsResponse' smart constructor.
data GetUsageStatisticsResponse = GetUsageStatisticsResponse'
  { -- | The pagination parameter to be used on the next list operation to
    -- retrieve more items.
    GetUsageStatisticsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The usage statistics object. If a UsageStatisticType was provided, the
    -- objects representing other types will be null.
    GetUsageStatisticsResponse -> Maybe UsageStatistics
usageStatistics :: Prelude.Maybe UsageStatistics,
    -- | The response's http status code.
    GetUsageStatisticsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetUsageStatisticsResponse -> GetUsageStatisticsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetUsageStatisticsResponse -> GetUsageStatisticsResponse -> Bool
$c/= :: GetUsageStatisticsResponse -> GetUsageStatisticsResponse -> Bool
== :: GetUsageStatisticsResponse -> GetUsageStatisticsResponse -> Bool
$c== :: GetUsageStatisticsResponse -> GetUsageStatisticsResponse -> Bool
Prelude.Eq, ReadPrec [GetUsageStatisticsResponse]
ReadPrec GetUsageStatisticsResponse
Int -> ReadS GetUsageStatisticsResponse
ReadS [GetUsageStatisticsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetUsageStatisticsResponse]
$creadListPrec :: ReadPrec [GetUsageStatisticsResponse]
readPrec :: ReadPrec GetUsageStatisticsResponse
$creadPrec :: ReadPrec GetUsageStatisticsResponse
readList :: ReadS [GetUsageStatisticsResponse]
$creadList :: ReadS [GetUsageStatisticsResponse]
readsPrec :: Int -> ReadS GetUsageStatisticsResponse
$creadsPrec :: Int -> ReadS GetUsageStatisticsResponse
Prelude.Read, Int -> GetUsageStatisticsResponse -> ShowS
[GetUsageStatisticsResponse] -> ShowS
GetUsageStatisticsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetUsageStatisticsResponse] -> ShowS
$cshowList :: [GetUsageStatisticsResponse] -> ShowS
show :: GetUsageStatisticsResponse -> String
$cshow :: GetUsageStatisticsResponse -> String
showsPrec :: Int -> GetUsageStatisticsResponse -> ShowS
$cshowsPrec :: Int -> GetUsageStatisticsResponse -> ShowS
Prelude.Show, forall x.
Rep GetUsageStatisticsResponse x -> GetUsageStatisticsResponse
forall x.
GetUsageStatisticsResponse -> Rep GetUsageStatisticsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetUsageStatisticsResponse x -> GetUsageStatisticsResponse
$cfrom :: forall x.
GetUsageStatisticsResponse -> Rep GetUsageStatisticsResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetUsageStatisticsResponse' 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', 'getUsageStatisticsResponse_nextToken' - The pagination parameter to be used on the next list operation to
-- retrieve more items.
--
-- 'usageStatistics', 'getUsageStatisticsResponse_usageStatistics' - The usage statistics object. If a UsageStatisticType was provided, the
-- objects representing other types will be null.
--
-- 'httpStatus', 'getUsageStatisticsResponse_httpStatus' - The response's http status code.
newGetUsageStatisticsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetUsageStatisticsResponse
newGetUsageStatisticsResponse :: Int -> GetUsageStatisticsResponse
newGetUsageStatisticsResponse Int
pHttpStatus_ =
  GetUsageStatisticsResponse'
    { $sel:nextToken:GetUsageStatisticsResponse' :: Maybe Text
nextToken =
        forall a. Maybe a
Prelude.Nothing,
      $sel:usageStatistics:GetUsageStatisticsResponse' :: Maybe UsageStatistics
usageStatistics = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetUsageStatisticsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The pagination parameter to be used on the next list operation to
-- retrieve more items.
getUsageStatisticsResponse_nextToken :: Lens.Lens' GetUsageStatisticsResponse (Prelude.Maybe Prelude.Text)
getUsageStatisticsResponse_nextToken :: Lens' GetUsageStatisticsResponse (Maybe Text)
getUsageStatisticsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetUsageStatisticsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetUsageStatisticsResponse' :: GetUsageStatisticsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: GetUsageStatisticsResponse
s@GetUsageStatisticsResponse' {} Maybe Text
a -> GetUsageStatisticsResponse
s {$sel:nextToken:GetUsageStatisticsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: GetUsageStatisticsResponse)

-- | The usage statistics object. If a UsageStatisticType was provided, the
-- objects representing other types will be null.
getUsageStatisticsResponse_usageStatistics :: Lens.Lens' GetUsageStatisticsResponse (Prelude.Maybe UsageStatistics)
getUsageStatisticsResponse_usageStatistics :: Lens' GetUsageStatisticsResponse (Maybe UsageStatistics)
getUsageStatisticsResponse_usageStatistics = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetUsageStatisticsResponse' {Maybe UsageStatistics
usageStatistics :: Maybe UsageStatistics
$sel:usageStatistics:GetUsageStatisticsResponse' :: GetUsageStatisticsResponse -> Maybe UsageStatistics
usageStatistics} -> Maybe UsageStatistics
usageStatistics) (\s :: GetUsageStatisticsResponse
s@GetUsageStatisticsResponse' {} Maybe UsageStatistics
a -> GetUsageStatisticsResponse
s {$sel:usageStatistics:GetUsageStatisticsResponse' :: Maybe UsageStatistics
usageStatistics = Maybe UsageStatistics
a} :: GetUsageStatisticsResponse)

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

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