{-# 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-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)
--
-- 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 projects 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_nextToken,
    getUsageStatistics_unit,
    getUsageStatistics_maxResults,
    getUsageStatistics_detectorId,
    getUsageStatistics_usageStatisticType,
    getUsageStatistics_usageCriteria,

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

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

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

-- | /See:/ 'newGetUsageStatistics' smart constructor.
data GetUsageStatistics = 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 -> 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 maximum number of results to return in the response.
    GetUsageStatistics -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | 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
(GetUsageStatistics -> GetUsageStatistics -> Bool)
-> (GetUsageStatistics -> GetUsageStatistics -> Bool)
-> Eq GetUsageStatistics
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]
(Int -> ReadS GetUsageStatistics)
-> ReadS [GetUsageStatistics]
-> ReadPrec GetUsageStatistics
-> ReadPrec [GetUsageStatistics]
-> Read 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
(Int -> GetUsageStatistics -> ShowS)
-> (GetUsageStatistics -> String)
-> ([GetUsageStatistics] -> ShowS)
-> Show GetUsageStatistics
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. GetUsageStatistics -> Rep GetUsageStatistics x)
-> (forall x. Rep GetUsageStatistics x -> GetUsageStatistics)
-> Generic GetUsageStatistics
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:
--
-- '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.
--
-- 'maxResults', 'getUsageStatistics_maxResults' - The maximum number of results to return in the response.
--
-- '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' :: Maybe Text
-> Maybe Text
-> Maybe Natural
-> Text
-> UsageStatisticType
-> UsageCriteria
-> GetUsageStatistics
GetUsageStatistics'
      { $sel:nextToken:GetUsageStatistics' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:unit:GetUsageStatistics' :: Maybe Text
unit = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:maxResults:GetUsageStatistics' :: Maybe Natural
maxResults = Maybe Natural
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_
      }

-- | 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 :: (Maybe Text -> f (Maybe Text))
-> GetUsageStatistics -> f GetUsageStatistics
getUsageStatistics_nextToken = (GetUsageStatistics -> Maybe Text)
-> (GetUsageStatistics -> Maybe Text -> GetUsageStatistics)
-> Lens
     GetUsageStatistics GetUsageStatistics (Maybe Text) (Maybe Text)
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 :: (Maybe Text -> f (Maybe Text))
-> GetUsageStatistics -> f GetUsageStatistics
getUsageStatistics_unit = (GetUsageStatistics -> Maybe Text)
-> (GetUsageStatistics -> Maybe Text -> GetUsageStatistics)
-> Lens
     GetUsageStatistics GetUsageStatistics (Maybe Text) (Maybe Text)
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 maximum number of results to return in the response.
getUsageStatistics_maxResults :: Lens.Lens' GetUsageStatistics (Prelude.Maybe Prelude.Natural)
getUsageStatistics_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> GetUsageStatistics -> f GetUsageStatistics
getUsageStatistics_maxResults = (GetUsageStatistics -> Maybe Natural)
-> (GetUsageStatistics -> Maybe Natural -> GetUsageStatistics)
-> Lens
     GetUsageStatistics
     GetUsageStatistics
     (Maybe Natural)
     (Maybe Natural)
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)

-- | 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 :: (Text -> f Text) -> GetUsageStatistics -> f GetUsageStatistics
getUsageStatistics_detectorId = (GetUsageStatistics -> Text)
-> (GetUsageStatistics -> Text -> GetUsageStatistics)
-> Lens GetUsageStatistics GetUsageStatistics Text Text
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 :: (UsageStatisticType -> f UsageStatisticType)
-> GetUsageStatistics -> f GetUsageStatistics
getUsageStatistics_usageStatisticType = (GetUsageStatistics -> UsageStatisticType)
-> (GetUsageStatistics -> UsageStatisticType -> GetUsageStatistics)
-> Lens
     GetUsageStatistics
     GetUsageStatistics
     UsageStatisticType
     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 :: (UsageCriteria -> f UsageCriteria)
-> GetUsageStatistics -> f GetUsageStatistics
getUsageStatistics_usageCriteria = (GetUsageStatistics -> UsageCriteria)
-> (GetUsageStatistics -> UsageCriteria -> GetUsageStatistics)
-> Lens
     GetUsageStatistics GetUsageStatistics UsageCriteria 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 :: GetUsageStatistics -> Request GetUsageStatistics
request = Service -> GetUsageStatistics -> Request GetUsageStatistics
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy GetUsageStatistics
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse GetUsageStatistics)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse GetUsageStatistics))
-> Logger
-> Service
-> Proxy GetUsageStatistics
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse GetUsageStatistics)))
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 UsageStatistics
-> Maybe Text -> Int -> GetUsageStatisticsResponse
GetUsageStatisticsResponse'
            (Maybe UsageStatistics
 -> Maybe Text -> Int -> GetUsageStatisticsResponse)
-> Either String (Maybe UsageStatistics)
-> Either String (Maybe Text -> Int -> GetUsageStatisticsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe UsageStatistics)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"usageStatistics")
            Either String (Maybe Text -> Int -> GetUsageStatisticsResponse)
-> Either String (Maybe Text)
-> Either String (Int -> GetUsageStatisticsResponse)
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 -> GetUsageStatisticsResponse)
-> Either String Int -> Either String GetUsageStatisticsResponse
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 GetUsageStatistics

instance Prelude.NFData GetUsageStatistics

instance Core.ToHeaders GetUsageStatistics where
  toHeaders :: GetUsageStatistics -> ResponseHeaders
toHeaders =
    ResponseHeaders -> GetUsageStatistics -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ 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 GetUsageStatistics where
  toJSON :: GetUsageStatistics -> Value
toJSON GetUsageStatistics' {Maybe Natural
Maybe Text
Text
UsageCriteria
UsageStatisticType
usageCriteria :: UsageCriteria
usageStatisticType :: UsageStatisticType
detectorId :: Text
maxResults :: Maybe Natural
unit :: Maybe Text
nextToken :: Maybe Text
$sel:usageCriteria:GetUsageStatistics' :: GetUsageStatistics -> UsageCriteria
$sel:usageStatisticType:GetUsageStatistics' :: GetUsageStatistics -> UsageStatisticType
$sel:detectorId:GetUsageStatistics' :: GetUsageStatistics -> Text
$sel:maxResults:GetUsageStatistics' :: GetUsageStatistics -> Maybe Natural
$sel:unit:GetUsageStatistics' :: GetUsageStatistics -> Maybe Text
$sel:nextToken:GetUsageStatistics' :: GetUsageStatistics -> 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,
            (Text
"unit" 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
unit,
            (Text
"maxResults" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxResults,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"usageStatisticsType" Text -> UsageStatisticType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= UsageStatisticType
usageStatisticType),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"usageCriteria" Text -> UsageCriteria -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= UsageCriteria
usageCriteria)
          ]
      )

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

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

-- | /See:/ 'newGetUsageStatisticsResponse' smart constructor.
data GetUsageStatisticsResponse = GetUsageStatisticsResponse'
  { -- | 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 pagination parameter to be used on the next list operation to
    -- retrieve more items.
    GetUsageStatisticsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    GetUsageStatisticsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetUsageStatisticsResponse -> GetUsageStatisticsResponse -> Bool
(GetUsageStatisticsResponse -> GetUsageStatisticsResponse -> Bool)
-> (GetUsageStatisticsResponse
    -> GetUsageStatisticsResponse -> Bool)
-> Eq GetUsageStatisticsResponse
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]
(Int -> ReadS GetUsageStatisticsResponse)
-> ReadS [GetUsageStatisticsResponse]
-> ReadPrec GetUsageStatisticsResponse
-> ReadPrec [GetUsageStatisticsResponse]
-> Read 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
(Int -> GetUsageStatisticsResponse -> ShowS)
-> (GetUsageStatisticsResponse -> String)
-> ([GetUsageStatisticsResponse] -> ShowS)
-> Show GetUsageStatisticsResponse
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.
 GetUsageStatisticsResponse -> Rep GetUsageStatisticsResponse x)
-> (forall x.
    Rep GetUsageStatisticsResponse x -> GetUsageStatisticsResponse)
-> Generic GetUsageStatisticsResponse
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:
--
-- 'usageStatistics', 'getUsageStatisticsResponse_usageStatistics' - The usage statistics object. If a UsageStatisticType was provided, the
-- objects representing other types will be null.
--
-- 'nextToken', 'getUsageStatisticsResponse_nextToken' - The pagination parameter to be used on the next list operation to
-- retrieve more items.
--
-- 'httpStatus', 'getUsageStatisticsResponse_httpStatus' - The response's http status code.
newGetUsageStatisticsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetUsageStatisticsResponse
newGetUsageStatisticsResponse :: Int -> GetUsageStatisticsResponse
newGetUsageStatisticsResponse Int
pHttpStatus_ =
  GetUsageStatisticsResponse' :: Maybe UsageStatistics
-> Maybe Text -> Int -> GetUsageStatisticsResponse
GetUsageStatisticsResponse'
    { $sel:usageStatistics:GetUsageStatisticsResponse' :: Maybe UsageStatistics
usageStatistics =
        Maybe UsageStatistics
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:GetUsageStatisticsResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetUsageStatisticsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | 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 :: (Maybe UsageStatistics -> f (Maybe UsageStatistics))
-> GetUsageStatisticsResponse -> f GetUsageStatisticsResponse
getUsageStatisticsResponse_usageStatistics = (GetUsageStatisticsResponse -> Maybe UsageStatistics)
-> (GetUsageStatisticsResponse
    -> Maybe UsageStatistics -> GetUsageStatisticsResponse)
-> Lens
     GetUsageStatisticsResponse
     GetUsageStatisticsResponse
     (Maybe UsageStatistics)
     (Maybe 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 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 :: (Maybe Text -> f (Maybe Text))
-> GetUsageStatisticsResponse -> f GetUsageStatisticsResponse
getUsageStatisticsResponse_nextToken = (GetUsageStatisticsResponse -> Maybe Text)
-> (GetUsageStatisticsResponse
    -> Maybe Text -> GetUsageStatisticsResponse)
-> Lens
     GetUsageStatisticsResponse
     GetUsageStatisticsResponse
     (Maybe Text)
     (Maybe Text)
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 response's http status code.
getUsageStatisticsResponse_httpStatus :: Lens.Lens' GetUsageStatisticsResponse Prelude.Int
getUsageStatisticsResponse_httpStatus :: (Int -> f Int)
-> GetUsageStatisticsResponse -> f GetUsageStatisticsResponse
getUsageStatisticsResponse_httpStatus = (GetUsageStatisticsResponse -> Int)
-> (GetUsageStatisticsResponse
    -> Int -> GetUsageStatisticsResponse)
-> Lens
     GetUsageStatisticsResponse GetUsageStatisticsResponse Int Int
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