{-# 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.Synthetics.DescribeCanariesLastRun
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Use this operation to see information from the most recent run of each
-- canary that you have created.
--
-- This operation supports resource-level authorization using an IAM policy
-- and the @Names@ parameter. If you specify the @Names@ parameter, the
-- operation is successful only if you have authorization to view all the
-- canaries that you specify in your request. If you do not have permission
-- to view any of the canaries, the request fails with a 403 response.
--
-- You are required to use the @Names@ parameter if you are logged on to a
-- user or role that has an IAM policy that restricts which canaries that
-- you are allowed to view. For more information, see
-- <https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries_Restricted.html Limiting a user to viewing specific canaries>.
module Amazonka.Synthetics.DescribeCanariesLastRun
  ( -- * Creating a Request
    DescribeCanariesLastRun (..),
    newDescribeCanariesLastRun,

    -- * Request Lenses
    describeCanariesLastRun_maxResults,
    describeCanariesLastRun_names,
    describeCanariesLastRun_nextToken,

    -- * Destructuring the Response
    DescribeCanariesLastRunResponse (..),
    newDescribeCanariesLastRunResponse,

    -- * Response Lenses
    describeCanariesLastRunResponse_canariesLastRun,
    describeCanariesLastRunResponse_nextToken,
    describeCanariesLastRunResponse_httpStatus,
  )
where

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
import Amazonka.Synthetics.Types

-- | /See:/ 'newDescribeCanariesLastRun' smart constructor.
data DescribeCanariesLastRun = DescribeCanariesLastRun'
  { -- | Specify this parameter to limit how many runs are returned each time you
    -- use the @DescribeLastRun@ operation. If you omit this parameter, the
    -- default of 100 is used.
    DescribeCanariesLastRun -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | Use this parameter to return only canaries that match the names that you
    -- specify here. You can specify as many as five canary names.
    --
    -- If you specify this parameter, the operation is successful only if you
    -- have authorization to view all the canaries that you specify in your
    -- request. If you do not have permission to view any of the canaries, the
    -- request fails with a 403 response.
    --
    -- You are required to use the @Names@ parameter if you are logged on to a
    -- user or role that has an IAM policy that restricts which canaries that
    -- you are allowed to view. For more information, see
    -- <https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries_Restricted.html Limiting a user to viewing specific canaries>.
    DescribeCanariesLastRun -> Maybe (NonEmpty Text)
names :: Prelude.Maybe (Prelude.NonEmpty Prelude.Text),
    -- | A token that indicates that there is more data available. You can use
    -- this token in a subsequent @DescribeCanariesLastRun@ operation to
    -- retrieve the next set of results.
    DescribeCanariesLastRun -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text
  }
  deriving (DescribeCanariesLastRun -> DescribeCanariesLastRun -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeCanariesLastRun -> DescribeCanariesLastRun -> Bool
$c/= :: DescribeCanariesLastRun -> DescribeCanariesLastRun -> Bool
== :: DescribeCanariesLastRun -> DescribeCanariesLastRun -> Bool
$c== :: DescribeCanariesLastRun -> DescribeCanariesLastRun -> Bool
Prelude.Eq, ReadPrec [DescribeCanariesLastRun]
ReadPrec DescribeCanariesLastRun
Int -> ReadS DescribeCanariesLastRun
ReadS [DescribeCanariesLastRun]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeCanariesLastRun]
$creadListPrec :: ReadPrec [DescribeCanariesLastRun]
readPrec :: ReadPrec DescribeCanariesLastRun
$creadPrec :: ReadPrec DescribeCanariesLastRun
readList :: ReadS [DescribeCanariesLastRun]
$creadList :: ReadS [DescribeCanariesLastRun]
readsPrec :: Int -> ReadS DescribeCanariesLastRun
$creadsPrec :: Int -> ReadS DescribeCanariesLastRun
Prelude.Read, Int -> DescribeCanariesLastRun -> ShowS
[DescribeCanariesLastRun] -> ShowS
DescribeCanariesLastRun -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeCanariesLastRun] -> ShowS
$cshowList :: [DescribeCanariesLastRun] -> ShowS
show :: DescribeCanariesLastRun -> String
$cshow :: DescribeCanariesLastRun -> String
showsPrec :: Int -> DescribeCanariesLastRun -> ShowS
$cshowsPrec :: Int -> DescribeCanariesLastRun -> ShowS
Prelude.Show, forall x. Rep DescribeCanariesLastRun x -> DescribeCanariesLastRun
forall x. DescribeCanariesLastRun -> Rep DescribeCanariesLastRun x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeCanariesLastRun x -> DescribeCanariesLastRun
$cfrom :: forall x. DescribeCanariesLastRun -> Rep DescribeCanariesLastRun x
Prelude.Generic)

-- |
-- Create a value of 'DescribeCanariesLastRun' 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', 'describeCanariesLastRun_maxResults' - Specify this parameter to limit how many runs are returned each time you
-- use the @DescribeLastRun@ operation. If you omit this parameter, the
-- default of 100 is used.
--
-- 'names', 'describeCanariesLastRun_names' - Use this parameter to return only canaries that match the names that you
-- specify here. You can specify as many as five canary names.
--
-- If you specify this parameter, the operation is successful only if you
-- have authorization to view all the canaries that you specify in your
-- request. If you do not have permission to view any of the canaries, the
-- request fails with a 403 response.
--
-- You are required to use the @Names@ parameter if you are logged on to a
-- user or role that has an IAM policy that restricts which canaries that
-- you are allowed to view. For more information, see
-- <https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries_Restricted.html Limiting a user to viewing specific canaries>.
--
-- 'nextToken', 'describeCanariesLastRun_nextToken' - A token that indicates that there is more data available. You can use
-- this token in a subsequent @DescribeCanariesLastRun@ operation to
-- retrieve the next set of results.
newDescribeCanariesLastRun ::
  DescribeCanariesLastRun
newDescribeCanariesLastRun :: DescribeCanariesLastRun
newDescribeCanariesLastRun =
  DescribeCanariesLastRun'
    { $sel:maxResults:DescribeCanariesLastRun' :: Maybe Natural
maxResults =
        forall a. Maybe a
Prelude.Nothing,
      $sel:names:DescribeCanariesLastRun' :: Maybe (NonEmpty Text)
names = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:DescribeCanariesLastRun' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing
    }

-- | Specify this parameter to limit how many runs are returned each time you
-- use the @DescribeLastRun@ operation. If you omit this parameter, the
-- default of 100 is used.
describeCanariesLastRun_maxResults :: Lens.Lens' DescribeCanariesLastRun (Prelude.Maybe Prelude.Natural)
describeCanariesLastRun_maxResults :: Lens' DescribeCanariesLastRun (Maybe Natural)
describeCanariesLastRun_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeCanariesLastRun' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:DescribeCanariesLastRun' :: DescribeCanariesLastRun -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: DescribeCanariesLastRun
s@DescribeCanariesLastRun' {} Maybe Natural
a -> DescribeCanariesLastRun
s {$sel:maxResults:DescribeCanariesLastRun' :: Maybe Natural
maxResults = Maybe Natural
a} :: DescribeCanariesLastRun)

-- | Use this parameter to return only canaries that match the names that you
-- specify here. You can specify as many as five canary names.
--
-- If you specify this parameter, the operation is successful only if you
-- have authorization to view all the canaries that you specify in your
-- request. If you do not have permission to view any of the canaries, the
-- request fails with a 403 response.
--
-- You are required to use the @Names@ parameter if you are logged on to a
-- user or role that has an IAM policy that restricts which canaries that
-- you are allowed to view. For more information, see
-- <https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries_Restricted.html Limiting a user to viewing specific canaries>.
describeCanariesLastRun_names :: Lens.Lens' DescribeCanariesLastRun (Prelude.Maybe (Prelude.NonEmpty Prelude.Text))
describeCanariesLastRun_names :: Lens' DescribeCanariesLastRun (Maybe (NonEmpty Text))
describeCanariesLastRun_names = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeCanariesLastRun' {Maybe (NonEmpty Text)
names :: Maybe (NonEmpty Text)
$sel:names:DescribeCanariesLastRun' :: DescribeCanariesLastRun -> Maybe (NonEmpty Text)
names} -> Maybe (NonEmpty Text)
names) (\s :: DescribeCanariesLastRun
s@DescribeCanariesLastRun' {} Maybe (NonEmpty Text)
a -> DescribeCanariesLastRun
s {$sel:names:DescribeCanariesLastRun' :: Maybe (NonEmpty Text)
names = Maybe (NonEmpty Text)
a} :: DescribeCanariesLastRun) 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

-- | A token that indicates that there is more data available. You can use
-- this token in a subsequent @DescribeCanariesLastRun@ operation to
-- retrieve the next set of results.
describeCanariesLastRun_nextToken :: Lens.Lens' DescribeCanariesLastRun (Prelude.Maybe Prelude.Text)
describeCanariesLastRun_nextToken :: Lens' DescribeCanariesLastRun (Maybe Text)
describeCanariesLastRun_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeCanariesLastRun' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeCanariesLastRun' :: DescribeCanariesLastRun -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeCanariesLastRun
s@DescribeCanariesLastRun' {} Maybe Text
a -> DescribeCanariesLastRun
s {$sel:nextToken:DescribeCanariesLastRun' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeCanariesLastRun)

instance Core.AWSRequest DescribeCanariesLastRun where
  type
    AWSResponse DescribeCanariesLastRun =
      DescribeCanariesLastRunResponse
  request :: (Service -> Service)
-> DescribeCanariesLastRun -> Request DescribeCanariesLastRun
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 DescribeCanariesLastRun
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeCanariesLastRun)))
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 [CanaryLastRun]
-> Maybe Text -> Int -> DescribeCanariesLastRunResponse
DescribeCanariesLastRunResponse'
            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
"CanariesLastRun"
                            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 DescribeCanariesLastRun where
  hashWithSalt :: Int -> DescribeCanariesLastRun -> Int
hashWithSalt Int
_salt DescribeCanariesLastRun' {Maybe Natural
Maybe (NonEmpty Text)
Maybe Text
nextToken :: Maybe Text
names :: Maybe (NonEmpty Text)
maxResults :: Maybe Natural
$sel:nextToken:DescribeCanariesLastRun' :: DescribeCanariesLastRun -> Maybe Text
$sel:names:DescribeCanariesLastRun' :: DescribeCanariesLastRun -> Maybe (NonEmpty Text)
$sel:maxResults:DescribeCanariesLastRun' :: DescribeCanariesLastRun -> 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 (NonEmpty Text)
names
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken

instance Prelude.NFData DescribeCanariesLastRun where
  rnf :: DescribeCanariesLastRun -> ()
rnf DescribeCanariesLastRun' {Maybe Natural
Maybe (NonEmpty Text)
Maybe Text
nextToken :: Maybe Text
names :: Maybe (NonEmpty Text)
maxResults :: Maybe Natural
$sel:nextToken:DescribeCanariesLastRun' :: DescribeCanariesLastRun -> Maybe Text
$sel:names:DescribeCanariesLastRun' :: DescribeCanariesLastRun -> Maybe (NonEmpty Text)
$sel:maxResults:DescribeCanariesLastRun' :: DescribeCanariesLastRun -> 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 (NonEmpty Text)
names
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken

instance Data.ToHeaders DescribeCanariesLastRun where
  toHeaders :: DescribeCanariesLastRun -> 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 DescribeCanariesLastRun where
  toJSON :: DescribeCanariesLastRun -> Value
toJSON DescribeCanariesLastRun' {Maybe Natural
Maybe (NonEmpty Text)
Maybe Text
nextToken :: Maybe Text
names :: Maybe (NonEmpty Text)
maxResults :: Maybe Natural
$sel:nextToken:DescribeCanariesLastRun' :: DescribeCanariesLastRun -> Maybe Text
$sel:names:DescribeCanariesLastRun' :: DescribeCanariesLastRun -> Maybe (NonEmpty Text)
$sel:maxResults:DescribeCanariesLastRun' :: DescribeCanariesLastRun -> 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
"Names" 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 (NonEmpty Text)
names,
            (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
          ]
      )

instance Data.ToPath DescribeCanariesLastRun where
  toPath :: DescribeCanariesLastRun -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/canaries/last-run"

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

-- | /See:/ 'newDescribeCanariesLastRunResponse' smart constructor.
data DescribeCanariesLastRunResponse = DescribeCanariesLastRunResponse'
  { -- | An array that contains the information from the most recent run of each
    -- canary.
    DescribeCanariesLastRunResponse -> Maybe [CanaryLastRun]
canariesLastRun :: Prelude.Maybe [CanaryLastRun],
    -- | A token that indicates that there is more data available. You can use
    -- this token in a subsequent @DescribeCanariesLastRun@ operation to
    -- retrieve the next set of results.
    DescribeCanariesLastRunResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    DescribeCanariesLastRunResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeCanariesLastRunResponse
-> DescribeCanariesLastRunResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeCanariesLastRunResponse
-> DescribeCanariesLastRunResponse -> Bool
$c/= :: DescribeCanariesLastRunResponse
-> DescribeCanariesLastRunResponse -> Bool
== :: DescribeCanariesLastRunResponse
-> DescribeCanariesLastRunResponse -> Bool
$c== :: DescribeCanariesLastRunResponse
-> DescribeCanariesLastRunResponse -> Bool
Prelude.Eq, ReadPrec [DescribeCanariesLastRunResponse]
ReadPrec DescribeCanariesLastRunResponse
Int -> ReadS DescribeCanariesLastRunResponse
ReadS [DescribeCanariesLastRunResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeCanariesLastRunResponse]
$creadListPrec :: ReadPrec [DescribeCanariesLastRunResponse]
readPrec :: ReadPrec DescribeCanariesLastRunResponse
$creadPrec :: ReadPrec DescribeCanariesLastRunResponse
readList :: ReadS [DescribeCanariesLastRunResponse]
$creadList :: ReadS [DescribeCanariesLastRunResponse]
readsPrec :: Int -> ReadS DescribeCanariesLastRunResponse
$creadsPrec :: Int -> ReadS DescribeCanariesLastRunResponse
Prelude.Read, Int -> DescribeCanariesLastRunResponse -> ShowS
[DescribeCanariesLastRunResponse] -> ShowS
DescribeCanariesLastRunResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeCanariesLastRunResponse] -> ShowS
$cshowList :: [DescribeCanariesLastRunResponse] -> ShowS
show :: DescribeCanariesLastRunResponse -> String
$cshow :: DescribeCanariesLastRunResponse -> String
showsPrec :: Int -> DescribeCanariesLastRunResponse -> ShowS
$cshowsPrec :: Int -> DescribeCanariesLastRunResponse -> ShowS
Prelude.Show, forall x.
Rep DescribeCanariesLastRunResponse x
-> DescribeCanariesLastRunResponse
forall x.
DescribeCanariesLastRunResponse
-> Rep DescribeCanariesLastRunResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeCanariesLastRunResponse x
-> DescribeCanariesLastRunResponse
$cfrom :: forall x.
DescribeCanariesLastRunResponse
-> Rep DescribeCanariesLastRunResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeCanariesLastRunResponse' 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:
--
-- 'canariesLastRun', 'describeCanariesLastRunResponse_canariesLastRun' - An array that contains the information from the most recent run of each
-- canary.
--
-- 'nextToken', 'describeCanariesLastRunResponse_nextToken' - A token that indicates that there is more data available. You can use
-- this token in a subsequent @DescribeCanariesLastRun@ operation to
-- retrieve the next set of results.
--
-- 'httpStatus', 'describeCanariesLastRunResponse_httpStatus' - The response's http status code.
newDescribeCanariesLastRunResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeCanariesLastRunResponse
newDescribeCanariesLastRunResponse :: Int -> DescribeCanariesLastRunResponse
newDescribeCanariesLastRunResponse Int
pHttpStatus_ =
  DescribeCanariesLastRunResponse'
    { $sel:canariesLastRun:DescribeCanariesLastRunResponse' :: Maybe [CanaryLastRun]
canariesLastRun =
        forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:DescribeCanariesLastRunResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeCanariesLastRunResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | An array that contains the information from the most recent run of each
-- canary.
describeCanariesLastRunResponse_canariesLastRun :: Lens.Lens' DescribeCanariesLastRunResponse (Prelude.Maybe [CanaryLastRun])
describeCanariesLastRunResponse_canariesLastRun :: Lens' DescribeCanariesLastRunResponse (Maybe [CanaryLastRun])
describeCanariesLastRunResponse_canariesLastRun = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeCanariesLastRunResponse' {Maybe [CanaryLastRun]
canariesLastRun :: Maybe [CanaryLastRun]
$sel:canariesLastRun:DescribeCanariesLastRunResponse' :: DescribeCanariesLastRunResponse -> Maybe [CanaryLastRun]
canariesLastRun} -> Maybe [CanaryLastRun]
canariesLastRun) (\s :: DescribeCanariesLastRunResponse
s@DescribeCanariesLastRunResponse' {} Maybe [CanaryLastRun]
a -> DescribeCanariesLastRunResponse
s {$sel:canariesLastRun:DescribeCanariesLastRunResponse' :: Maybe [CanaryLastRun]
canariesLastRun = Maybe [CanaryLastRun]
a} :: DescribeCanariesLastRunResponse) 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

-- | A token that indicates that there is more data available. You can use
-- this token in a subsequent @DescribeCanariesLastRun@ operation to
-- retrieve the next set of results.
describeCanariesLastRunResponse_nextToken :: Lens.Lens' DescribeCanariesLastRunResponse (Prelude.Maybe Prelude.Text)
describeCanariesLastRunResponse_nextToken :: Lens' DescribeCanariesLastRunResponse (Maybe Text)
describeCanariesLastRunResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeCanariesLastRunResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeCanariesLastRunResponse' :: DescribeCanariesLastRunResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeCanariesLastRunResponse
s@DescribeCanariesLastRunResponse' {} Maybe Text
a -> DescribeCanariesLastRunResponse
s {$sel:nextToken:DescribeCanariesLastRunResponse' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeCanariesLastRunResponse)

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

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