{-# 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.CodeGuruProfiler.ListProfileTimes
-- 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 the start times of the available aggregated profiles of a
-- profiling group for an aggregation period within the specified time
-- range.
--
-- This operation returns paginated results.
module Amazonka.CodeGuruProfiler.ListProfileTimes
  ( -- * Creating a Request
    ListProfileTimes (..),
    newListProfileTimes,

    -- * Request Lenses
    listProfileTimes_maxResults,
    listProfileTimes_nextToken,
    listProfileTimes_orderBy,
    listProfileTimes_endTime,
    listProfileTimes_period,
    listProfileTimes_profilingGroupName,
    listProfileTimes_startTime,

    -- * Destructuring the Response
    ListProfileTimesResponse (..),
    newListProfileTimesResponse,

    -- * Response Lenses
    listProfileTimesResponse_nextToken,
    listProfileTimesResponse_httpStatus,
    listProfileTimesResponse_profileTimes,
  )
where

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

-- | The structure representing the listProfileTimesRequest.
--
-- /See:/ 'newListProfileTimes' smart constructor.
data ListProfileTimes = ListProfileTimes'
  { -- | The maximum number of profile time results returned by
    -- @ListProfileTimes@ in paginated output. When this parameter is used,
    -- @ListProfileTimes@ only returns @maxResults@ results in a single page
    -- with a @nextToken@ response element. The remaining results of the
    -- initial request can be seen by sending another @ListProfileTimes@
    -- request with the returned @nextToken@ value.
    ListProfileTimes -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The @nextToken@ value returned from a previous paginated
    -- @ListProfileTimes@ request where @maxResults@ was used and the results
    -- exceeded the value of that parameter. Pagination continues from the end
    -- of the previous results that returned the @nextToken@ value.
    --
    -- This token should be treated as an opaque identifier that is only used
    -- to retrieve the next items in a list and not for other programmatic
    -- purposes.
    ListProfileTimes -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The order (ascending or descending by start time of the profile) to use
    -- when listing profiles. Defaults to @TIMESTAMP_DESCENDING@.
    ListProfileTimes -> Maybe OrderBy
orderBy :: Prelude.Maybe OrderBy,
    -- | The end time of the time range from which to list the profiles.
    ListProfileTimes -> ISO8601
endTime :: Data.ISO8601,
    -- | The aggregation period. This specifies the period during which an
    -- aggregation profile collects posted agent profiles for a profiling
    -- group. There are 3 valid values.
    --
    -- -   @P1D@ — 1 day
    --
    -- -   @PT1H@ — 1 hour
    --
    -- -   @PT5M@ — 5 minutes
    ListProfileTimes -> AggregationPeriod
period :: AggregationPeriod,
    -- | The name of the profiling group.
    ListProfileTimes -> Text
profilingGroupName :: Prelude.Text,
    -- | The start time of the time range from which to list the profiles.
    ListProfileTimes -> ISO8601
startTime :: Data.ISO8601
  }
  deriving (ListProfileTimes -> ListProfileTimes -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListProfileTimes -> ListProfileTimes -> Bool
$c/= :: ListProfileTimes -> ListProfileTimes -> Bool
== :: ListProfileTimes -> ListProfileTimes -> Bool
$c== :: ListProfileTimes -> ListProfileTimes -> Bool
Prelude.Eq, ReadPrec [ListProfileTimes]
ReadPrec ListProfileTimes
Int -> ReadS ListProfileTimes
ReadS [ListProfileTimes]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListProfileTimes]
$creadListPrec :: ReadPrec [ListProfileTimes]
readPrec :: ReadPrec ListProfileTimes
$creadPrec :: ReadPrec ListProfileTimes
readList :: ReadS [ListProfileTimes]
$creadList :: ReadS [ListProfileTimes]
readsPrec :: Int -> ReadS ListProfileTimes
$creadsPrec :: Int -> ReadS ListProfileTimes
Prelude.Read, Int -> ListProfileTimes -> ShowS
[ListProfileTimes] -> ShowS
ListProfileTimes -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListProfileTimes] -> ShowS
$cshowList :: [ListProfileTimes] -> ShowS
show :: ListProfileTimes -> String
$cshow :: ListProfileTimes -> String
showsPrec :: Int -> ListProfileTimes -> ShowS
$cshowsPrec :: Int -> ListProfileTimes -> ShowS
Prelude.Show, forall x. Rep ListProfileTimes x -> ListProfileTimes
forall x. ListProfileTimes -> Rep ListProfileTimes x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListProfileTimes x -> ListProfileTimes
$cfrom :: forall x. ListProfileTimes -> Rep ListProfileTimes x
Prelude.Generic)

-- |
-- Create a value of 'ListProfileTimes' 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', 'listProfileTimes_maxResults' - The maximum number of profile time results returned by
-- @ListProfileTimes@ in paginated output. When this parameter is used,
-- @ListProfileTimes@ only returns @maxResults@ results in a single page
-- with a @nextToken@ response element. The remaining results of the
-- initial request can be seen by sending another @ListProfileTimes@
-- request with the returned @nextToken@ value.
--
-- 'nextToken', 'listProfileTimes_nextToken' - The @nextToken@ value returned from a previous paginated
-- @ListProfileTimes@ request where @maxResults@ was used and the results
-- exceeded the value of that parameter. Pagination continues from the end
-- of the previous results that returned the @nextToken@ value.
--
-- This token should be treated as an opaque identifier that is only used
-- to retrieve the next items in a list and not for other programmatic
-- purposes.
--
-- 'orderBy', 'listProfileTimes_orderBy' - The order (ascending or descending by start time of the profile) to use
-- when listing profiles. Defaults to @TIMESTAMP_DESCENDING@.
--
-- 'endTime', 'listProfileTimes_endTime' - The end time of the time range from which to list the profiles.
--
-- 'period', 'listProfileTimes_period' - The aggregation period. This specifies the period during which an
-- aggregation profile collects posted agent profiles for a profiling
-- group. There are 3 valid values.
--
-- -   @P1D@ — 1 day
--
-- -   @PT1H@ — 1 hour
--
-- -   @PT5M@ — 5 minutes
--
-- 'profilingGroupName', 'listProfileTimes_profilingGroupName' - The name of the profiling group.
--
-- 'startTime', 'listProfileTimes_startTime' - The start time of the time range from which to list the profiles.
newListProfileTimes ::
  -- | 'endTime'
  Prelude.UTCTime ->
  -- | 'period'
  AggregationPeriod ->
  -- | 'profilingGroupName'
  Prelude.Text ->
  -- | 'startTime'
  Prelude.UTCTime ->
  ListProfileTimes
newListProfileTimes :: UTCTime -> AggregationPeriod -> Text -> UTCTime -> ListProfileTimes
newListProfileTimes
  UTCTime
pEndTime_
  AggregationPeriod
pPeriod_
  Text
pProfilingGroupName_
  UTCTime
pStartTime_ =
    ListProfileTimes'
      { $sel:maxResults:ListProfileTimes' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
        $sel:nextToken:ListProfileTimes' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
        $sel:orderBy:ListProfileTimes' :: Maybe OrderBy
orderBy = forall a. Maybe a
Prelude.Nothing,
        $sel:endTime:ListProfileTimes' :: ISO8601
endTime = forall (a :: Format). Iso' (Time a) UTCTime
Data._Time forall t b. AReview t b -> b -> t
Lens.# UTCTime
pEndTime_,
        $sel:period:ListProfileTimes' :: AggregationPeriod
period = AggregationPeriod
pPeriod_,
        $sel:profilingGroupName:ListProfileTimes' :: Text
profilingGroupName = Text
pProfilingGroupName_,
        $sel:startTime:ListProfileTimes' :: ISO8601
startTime = forall (a :: Format). Iso' (Time a) UTCTime
Data._Time forall t b. AReview t b -> b -> t
Lens.# UTCTime
pStartTime_
      }

-- | The maximum number of profile time results returned by
-- @ListProfileTimes@ in paginated output. When this parameter is used,
-- @ListProfileTimes@ only returns @maxResults@ results in a single page
-- with a @nextToken@ response element. The remaining results of the
-- initial request can be seen by sending another @ListProfileTimes@
-- request with the returned @nextToken@ value.
listProfileTimes_maxResults :: Lens.Lens' ListProfileTimes (Prelude.Maybe Prelude.Natural)
listProfileTimes_maxResults :: Lens' ListProfileTimes (Maybe Natural)
listProfileTimes_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListProfileTimes' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListProfileTimes' :: ListProfileTimes -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListProfileTimes
s@ListProfileTimes' {} Maybe Natural
a -> ListProfileTimes
s {$sel:maxResults:ListProfileTimes' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListProfileTimes)

-- | The @nextToken@ value returned from a previous paginated
-- @ListProfileTimes@ request where @maxResults@ was used and the results
-- exceeded the value of that parameter. Pagination continues from the end
-- of the previous results that returned the @nextToken@ value.
--
-- This token should be treated as an opaque identifier that is only used
-- to retrieve the next items in a list and not for other programmatic
-- purposes.
listProfileTimes_nextToken :: Lens.Lens' ListProfileTimes (Prelude.Maybe Prelude.Text)
listProfileTimes_nextToken :: Lens' ListProfileTimes (Maybe Text)
listProfileTimes_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListProfileTimes' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListProfileTimes' :: ListProfileTimes -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListProfileTimes
s@ListProfileTimes' {} Maybe Text
a -> ListProfileTimes
s {$sel:nextToken:ListProfileTimes' :: Maybe Text
nextToken = Maybe Text
a} :: ListProfileTimes)

-- | The order (ascending or descending by start time of the profile) to use
-- when listing profiles. Defaults to @TIMESTAMP_DESCENDING@.
listProfileTimes_orderBy :: Lens.Lens' ListProfileTimes (Prelude.Maybe OrderBy)
listProfileTimes_orderBy :: Lens' ListProfileTimes (Maybe OrderBy)
listProfileTimes_orderBy = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListProfileTimes' {Maybe OrderBy
orderBy :: Maybe OrderBy
$sel:orderBy:ListProfileTimes' :: ListProfileTimes -> Maybe OrderBy
orderBy} -> Maybe OrderBy
orderBy) (\s :: ListProfileTimes
s@ListProfileTimes' {} Maybe OrderBy
a -> ListProfileTimes
s {$sel:orderBy:ListProfileTimes' :: Maybe OrderBy
orderBy = Maybe OrderBy
a} :: ListProfileTimes)

-- | The end time of the time range from which to list the profiles.
listProfileTimes_endTime :: Lens.Lens' ListProfileTimes Prelude.UTCTime
listProfileTimes_endTime :: Lens' ListProfileTimes UTCTime
listProfileTimes_endTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListProfileTimes' {ISO8601
endTime :: ISO8601
$sel:endTime:ListProfileTimes' :: ListProfileTimes -> ISO8601
endTime} -> ISO8601
endTime) (\s :: ListProfileTimes
s@ListProfileTimes' {} ISO8601
a -> ListProfileTimes
s {$sel:endTime:ListProfileTimes' :: ISO8601
endTime = ISO8601
a} :: ListProfileTimes) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The aggregation period. This specifies the period during which an
-- aggregation profile collects posted agent profiles for a profiling
-- group. There are 3 valid values.
--
-- -   @P1D@ — 1 day
--
-- -   @PT1H@ — 1 hour
--
-- -   @PT5M@ — 5 minutes
listProfileTimes_period :: Lens.Lens' ListProfileTimes AggregationPeriod
listProfileTimes_period :: Lens' ListProfileTimes AggregationPeriod
listProfileTimes_period = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListProfileTimes' {AggregationPeriod
period :: AggregationPeriod
$sel:period:ListProfileTimes' :: ListProfileTimes -> AggregationPeriod
period} -> AggregationPeriod
period) (\s :: ListProfileTimes
s@ListProfileTimes' {} AggregationPeriod
a -> ListProfileTimes
s {$sel:period:ListProfileTimes' :: AggregationPeriod
period = AggregationPeriod
a} :: ListProfileTimes)

-- | The name of the profiling group.
listProfileTimes_profilingGroupName :: Lens.Lens' ListProfileTimes Prelude.Text
listProfileTimes_profilingGroupName :: Lens' ListProfileTimes Text
listProfileTimes_profilingGroupName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListProfileTimes' {Text
profilingGroupName :: Text
$sel:profilingGroupName:ListProfileTimes' :: ListProfileTimes -> Text
profilingGroupName} -> Text
profilingGroupName) (\s :: ListProfileTimes
s@ListProfileTimes' {} Text
a -> ListProfileTimes
s {$sel:profilingGroupName:ListProfileTimes' :: Text
profilingGroupName = Text
a} :: ListProfileTimes)

-- | The start time of the time range from which to list the profiles.
listProfileTimes_startTime :: Lens.Lens' ListProfileTimes Prelude.UTCTime
listProfileTimes_startTime :: Lens' ListProfileTimes UTCTime
listProfileTimes_startTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListProfileTimes' {ISO8601
startTime :: ISO8601
$sel:startTime:ListProfileTimes' :: ListProfileTimes -> ISO8601
startTime} -> ISO8601
startTime) (\s :: ListProfileTimes
s@ListProfileTimes' {} ISO8601
a -> ListProfileTimes
s {$sel:startTime:ListProfileTimes' :: ISO8601
startTime = ISO8601
a} :: ListProfileTimes) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

instance Core.AWSPager ListProfileTimes where
  page :: ListProfileTimes
-> AWSResponse ListProfileTimes -> Maybe ListProfileTimes
page ListProfileTimes
rq AWSResponse ListProfileTimes
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListProfileTimes
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListProfileTimesResponse (Maybe Text)
listProfileTimesResponse_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 ListProfileTimes
rs forall s a. s -> Getting a s a -> a
Lens.^. Lens' ListProfileTimesResponse [ProfileTime]
listProfileTimesResponse_profileTimes) =
        forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
        forall a. a -> Maybe a
Prelude.Just
          forall a b. (a -> b) -> a -> b
Prelude.$ ListProfileTimes
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListProfileTimes (Maybe Text)
listProfileTimes_nextToken
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListProfileTimes
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListProfileTimesResponse (Maybe Text)
listProfileTimesResponse_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 ListProfileTimes where
  type
    AWSResponse ListProfileTimes =
      ListProfileTimesResponse
  request :: (Service -> Service)
-> ListProfileTimes -> Request ListProfileTimes
request Service -> Service
overrides =
    forall a. ToRequest a => Service -> a -> Request a
Request.get (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy ListProfileTimes
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListProfileTimes)))
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 -> Int -> [ProfileTime] -> ListProfileTimesResponse
ListProfileTimesResponse'
            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.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
            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
"profileTimes" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
      )

instance Prelude.Hashable ListProfileTimes where
  hashWithSalt :: Int -> ListProfileTimes -> Int
hashWithSalt Int
_salt ListProfileTimes' {Maybe Natural
Maybe Text
Maybe OrderBy
Text
ISO8601
AggregationPeriod
startTime :: ISO8601
profilingGroupName :: Text
period :: AggregationPeriod
endTime :: ISO8601
orderBy :: Maybe OrderBy
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:startTime:ListProfileTimes' :: ListProfileTimes -> ISO8601
$sel:profilingGroupName:ListProfileTimes' :: ListProfileTimes -> Text
$sel:period:ListProfileTimes' :: ListProfileTimes -> AggregationPeriod
$sel:endTime:ListProfileTimes' :: ListProfileTimes -> ISO8601
$sel:orderBy:ListProfileTimes' :: ListProfileTimes -> Maybe OrderBy
$sel:nextToken:ListProfileTimes' :: ListProfileTimes -> Maybe Text
$sel:maxResults:ListProfileTimes' :: ListProfileTimes -> 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 OrderBy
orderBy
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ISO8601
endTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` AggregationPeriod
period
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
profilingGroupName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ISO8601
startTime

instance Prelude.NFData ListProfileTimes where
  rnf :: ListProfileTimes -> ()
rnf ListProfileTimes' {Maybe Natural
Maybe Text
Maybe OrderBy
Text
ISO8601
AggregationPeriod
startTime :: ISO8601
profilingGroupName :: Text
period :: AggregationPeriod
endTime :: ISO8601
orderBy :: Maybe OrderBy
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:startTime:ListProfileTimes' :: ListProfileTimes -> ISO8601
$sel:profilingGroupName:ListProfileTimes' :: ListProfileTimes -> Text
$sel:period:ListProfileTimes' :: ListProfileTimes -> AggregationPeriod
$sel:endTime:ListProfileTimes' :: ListProfileTimes -> ISO8601
$sel:orderBy:ListProfileTimes' :: ListProfileTimes -> Maybe OrderBy
$sel:nextToken:ListProfileTimes' :: ListProfileTimes -> Maybe Text
$sel:maxResults:ListProfileTimes' :: ListProfileTimes -> 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 OrderBy
orderBy
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf ISO8601
endTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf AggregationPeriod
period
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
profilingGroupName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf ISO8601
startTime

instance Data.ToHeaders ListProfileTimes where
  toHeaders :: ListProfileTimes -> 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.ToPath ListProfileTimes where
  toPath :: ListProfileTimes -> ByteString
toPath ListProfileTimes' {Maybe Natural
Maybe Text
Maybe OrderBy
Text
ISO8601
AggregationPeriod
startTime :: ISO8601
profilingGroupName :: Text
period :: AggregationPeriod
endTime :: ISO8601
orderBy :: Maybe OrderBy
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:startTime:ListProfileTimes' :: ListProfileTimes -> ISO8601
$sel:profilingGroupName:ListProfileTimes' :: ListProfileTimes -> Text
$sel:period:ListProfileTimes' :: ListProfileTimes -> AggregationPeriod
$sel:endTime:ListProfileTimes' :: ListProfileTimes -> ISO8601
$sel:orderBy:ListProfileTimes' :: ListProfileTimes -> Maybe OrderBy
$sel:nextToken:ListProfileTimes' :: ListProfileTimes -> Maybe Text
$sel:maxResults:ListProfileTimes' :: ListProfileTimes -> Maybe Natural
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/profilingGroups/",
        forall a. ToByteString a => a -> ByteString
Data.toBS Text
profilingGroupName,
        ByteString
"/profileTimes"
      ]

instance Data.ToQuery ListProfileTimes where
  toQuery :: ListProfileTimes -> QueryString
toQuery ListProfileTimes' {Maybe Natural
Maybe Text
Maybe OrderBy
Text
ISO8601
AggregationPeriod
startTime :: ISO8601
profilingGroupName :: Text
period :: AggregationPeriod
endTime :: ISO8601
orderBy :: Maybe OrderBy
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:startTime:ListProfileTimes' :: ListProfileTimes -> ISO8601
$sel:profilingGroupName:ListProfileTimes' :: ListProfileTimes -> Text
$sel:period:ListProfileTimes' :: ListProfileTimes -> AggregationPeriod
$sel:endTime:ListProfileTimes' :: ListProfileTimes -> ISO8601
$sel:orderBy:ListProfileTimes' :: ListProfileTimes -> Maybe OrderBy
$sel:nextToken:ListProfileTimes' :: ListProfileTimes -> Maybe Text
$sel:maxResults:ListProfileTimes' :: ListProfileTimes -> Maybe Natural
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"maxResults" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Natural
maxResults,
        ByteString
"nextToken" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
nextToken,
        ByteString
"orderBy" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe OrderBy
orderBy,
        ByteString
"endTime" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: ISO8601
endTime,
        ByteString
"period" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: AggregationPeriod
period,
        ByteString
"startTime" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: ISO8601
startTime
      ]

-- | The structure representing the listProfileTimesResponse.
--
-- /See:/ 'newListProfileTimesResponse' smart constructor.
data ListProfileTimesResponse = ListProfileTimesResponse'
  { -- | The @nextToken@ value to include in a future @ListProfileTimes@ request.
    -- When the results of a @ListProfileTimes@ request exceed @maxResults@,
    -- this value can be used to retrieve the next page of results. This value
    -- is @null@ when there are no more results to return.
    ListProfileTimesResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListProfileTimesResponse -> Int
httpStatus :: Prelude.Int,
    -- | The list of start times of the available profiles for the aggregation
    -- period in the specified time range.
    ListProfileTimesResponse -> [ProfileTime]
profileTimes :: [ProfileTime]
  }
  deriving (ListProfileTimesResponse -> ListProfileTimesResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListProfileTimesResponse -> ListProfileTimesResponse -> Bool
$c/= :: ListProfileTimesResponse -> ListProfileTimesResponse -> Bool
== :: ListProfileTimesResponse -> ListProfileTimesResponse -> Bool
$c== :: ListProfileTimesResponse -> ListProfileTimesResponse -> Bool
Prelude.Eq, ReadPrec [ListProfileTimesResponse]
ReadPrec ListProfileTimesResponse
Int -> ReadS ListProfileTimesResponse
ReadS [ListProfileTimesResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListProfileTimesResponse]
$creadListPrec :: ReadPrec [ListProfileTimesResponse]
readPrec :: ReadPrec ListProfileTimesResponse
$creadPrec :: ReadPrec ListProfileTimesResponse
readList :: ReadS [ListProfileTimesResponse]
$creadList :: ReadS [ListProfileTimesResponse]
readsPrec :: Int -> ReadS ListProfileTimesResponse
$creadsPrec :: Int -> ReadS ListProfileTimesResponse
Prelude.Read, Int -> ListProfileTimesResponse -> ShowS
[ListProfileTimesResponse] -> ShowS
ListProfileTimesResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListProfileTimesResponse] -> ShowS
$cshowList :: [ListProfileTimesResponse] -> ShowS
show :: ListProfileTimesResponse -> String
$cshow :: ListProfileTimesResponse -> String
showsPrec :: Int -> ListProfileTimesResponse -> ShowS
$cshowsPrec :: Int -> ListProfileTimesResponse -> ShowS
Prelude.Show, forall x.
Rep ListProfileTimesResponse x -> ListProfileTimesResponse
forall x.
ListProfileTimesResponse -> Rep ListProfileTimesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListProfileTimesResponse x -> ListProfileTimesResponse
$cfrom :: forall x.
ListProfileTimesResponse -> Rep ListProfileTimesResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListProfileTimesResponse' 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', 'listProfileTimesResponse_nextToken' - The @nextToken@ value to include in a future @ListProfileTimes@ request.
-- When the results of a @ListProfileTimes@ request exceed @maxResults@,
-- this value can be used to retrieve the next page of results. This value
-- is @null@ when there are no more results to return.
--
-- 'httpStatus', 'listProfileTimesResponse_httpStatus' - The response's http status code.
--
-- 'profileTimes', 'listProfileTimesResponse_profileTimes' - The list of start times of the available profiles for the aggregation
-- period in the specified time range.
newListProfileTimesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListProfileTimesResponse
newListProfileTimesResponse :: Int -> ListProfileTimesResponse
newListProfileTimesResponse Int
pHttpStatus_ =
  ListProfileTimesResponse'
    { $sel:nextToken:ListProfileTimesResponse' :: Maybe Text
nextToken =
        forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListProfileTimesResponse' :: Int
httpStatus = Int
pHttpStatus_,
      $sel:profileTimes:ListProfileTimesResponse' :: [ProfileTime]
profileTimes = forall a. Monoid a => a
Prelude.mempty
    }

-- | The @nextToken@ value to include in a future @ListProfileTimes@ request.
-- When the results of a @ListProfileTimes@ request exceed @maxResults@,
-- this value can be used to retrieve the next page of results. This value
-- is @null@ when there are no more results to return.
listProfileTimesResponse_nextToken :: Lens.Lens' ListProfileTimesResponse (Prelude.Maybe Prelude.Text)
listProfileTimesResponse_nextToken :: Lens' ListProfileTimesResponse (Maybe Text)
listProfileTimesResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListProfileTimesResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListProfileTimesResponse' :: ListProfileTimesResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListProfileTimesResponse
s@ListProfileTimesResponse' {} Maybe Text
a -> ListProfileTimesResponse
s {$sel:nextToken:ListProfileTimesResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListProfileTimesResponse)

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

-- | The list of start times of the available profiles for the aggregation
-- period in the specified time range.
listProfileTimesResponse_profileTimes :: Lens.Lens' ListProfileTimesResponse [ProfileTime]
listProfileTimesResponse_profileTimes :: Lens' ListProfileTimesResponse [ProfileTime]
listProfileTimesResponse_profileTimes = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListProfileTimesResponse' {[ProfileTime]
profileTimes :: [ProfileTime]
$sel:profileTimes:ListProfileTimesResponse' :: ListProfileTimesResponse -> [ProfileTime]
profileTimes} -> [ProfileTime]
profileTimes) (\s :: ListProfileTimesResponse
s@ListProfileTimesResponse' {} [ProfileTime]
a -> ListProfileTimesResponse
s {$sel:profileTimes:ListProfileTimesResponse' :: [ProfileTime]
profileTimes = [ProfileTime]
a} :: ListProfileTimesResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Prelude.NFData ListProfileTimesResponse where
  rnf :: ListProfileTimesResponse -> ()
rnf ListProfileTimesResponse' {Int
[ProfileTime]
Maybe Text
profileTimes :: [ProfileTime]
httpStatus :: Int
nextToken :: Maybe Text
$sel:profileTimes:ListProfileTimesResponse' :: ListProfileTimesResponse -> [ProfileTime]
$sel:httpStatus:ListProfileTimesResponse' :: ListProfileTimesResponse -> Int
$sel:nextToken:ListProfileTimesResponse' :: ListProfileTimesResponse -> 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 Int
httpStatus
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf [ProfileTime]
profileTimes