{-# 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.IoT.ListOTAUpdates
-- 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 OTA updates.
--
-- Requires permission to access the
-- <https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsiot.html#awsiot-actions-as-permissions ListOTAUpdates>
-- action.
--
-- This operation returns paginated results.
module Amazonka.IoT.ListOTAUpdates
  ( -- * Creating a Request
    ListOTAUpdates (..),
    newListOTAUpdates,

    -- * Request Lenses
    listOTAUpdates_nextToken,
    listOTAUpdates_otaUpdateStatus,
    listOTAUpdates_maxResults,

    -- * Destructuring the Response
    ListOTAUpdatesResponse (..),
    newListOTAUpdatesResponse,

    -- * Response Lenses
    listOTAUpdatesResponse_nextToken,
    listOTAUpdatesResponse_otaUpdates,
    listOTAUpdatesResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.IoT.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:/ 'newListOTAUpdates' smart constructor.
data ListOTAUpdates = ListOTAUpdates'
  { -- | A token used to retrieve the next set of results.
    ListOTAUpdates -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The OTA update job status.
    ListOTAUpdates -> Maybe OTAUpdateStatus
otaUpdateStatus :: Prelude.Maybe OTAUpdateStatus,
    -- | The maximum number of results to return at one time.
    ListOTAUpdates -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural
  }
  deriving (ListOTAUpdates -> ListOTAUpdates -> Bool
(ListOTAUpdates -> ListOTAUpdates -> Bool)
-> (ListOTAUpdates -> ListOTAUpdates -> Bool) -> Eq ListOTAUpdates
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListOTAUpdates -> ListOTAUpdates -> Bool
$c/= :: ListOTAUpdates -> ListOTAUpdates -> Bool
== :: ListOTAUpdates -> ListOTAUpdates -> Bool
$c== :: ListOTAUpdates -> ListOTAUpdates -> Bool
Prelude.Eq, ReadPrec [ListOTAUpdates]
ReadPrec ListOTAUpdates
Int -> ReadS ListOTAUpdates
ReadS [ListOTAUpdates]
(Int -> ReadS ListOTAUpdates)
-> ReadS [ListOTAUpdates]
-> ReadPrec ListOTAUpdates
-> ReadPrec [ListOTAUpdates]
-> Read ListOTAUpdates
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListOTAUpdates]
$creadListPrec :: ReadPrec [ListOTAUpdates]
readPrec :: ReadPrec ListOTAUpdates
$creadPrec :: ReadPrec ListOTAUpdates
readList :: ReadS [ListOTAUpdates]
$creadList :: ReadS [ListOTAUpdates]
readsPrec :: Int -> ReadS ListOTAUpdates
$creadsPrec :: Int -> ReadS ListOTAUpdates
Prelude.Read, Int -> ListOTAUpdates -> ShowS
[ListOTAUpdates] -> ShowS
ListOTAUpdates -> String
(Int -> ListOTAUpdates -> ShowS)
-> (ListOTAUpdates -> String)
-> ([ListOTAUpdates] -> ShowS)
-> Show ListOTAUpdates
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListOTAUpdates] -> ShowS
$cshowList :: [ListOTAUpdates] -> ShowS
show :: ListOTAUpdates -> String
$cshow :: ListOTAUpdates -> String
showsPrec :: Int -> ListOTAUpdates -> ShowS
$cshowsPrec :: Int -> ListOTAUpdates -> ShowS
Prelude.Show, (forall x. ListOTAUpdates -> Rep ListOTAUpdates x)
-> (forall x. Rep ListOTAUpdates x -> ListOTAUpdates)
-> Generic ListOTAUpdates
forall x. Rep ListOTAUpdates x -> ListOTAUpdates
forall x. ListOTAUpdates -> Rep ListOTAUpdates x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListOTAUpdates x -> ListOTAUpdates
$cfrom :: forall x. ListOTAUpdates -> Rep ListOTAUpdates x
Prelude.Generic)

-- |
-- Create a value of 'ListOTAUpdates' 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', 'listOTAUpdates_nextToken' - A token used to retrieve the next set of results.
--
-- 'otaUpdateStatus', 'listOTAUpdates_otaUpdateStatus' - The OTA update job status.
--
-- 'maxResults', 'listOTAUpdates_maxResults' - The maximum number of results to return at one time.
newListOTAUpdates ::
  ListOTAUpdates
newListOTAUpdates :: ListOTAUpdates
newListOTAUpdates =
  ListOTAUpdates' :: Maybe Text
-> Maybe OTAUpdateStatus -> Maybe Natural -> ListOTAUpdates
ListOTAUpdates'
    { $sel:nextToken:ListOTAUpdates' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:otaUpdateStatus:ListOTAUpdates' :: Maybe OTAUpdateStatus
otaUpdateStatus = Maybe OTAUpdateStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListOTAUpdates' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

-- | A token used to retrieve the next set of results.
listOTAUpdates_nextToken :: Lens.Lens' ListOTAUpdates (Prelude.Maybe Prelude.Text)
listOTAUpdates_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListOTAUpdates -> f ListOTAUpdates
listOTAUpdates_nextToken = (ListOTAUpdates -> Maybe Text)
-> (ListOTAUpdates -> Maybe Text -> ListOTAUpdates)
-> Lens ListOTAUpdates ListOTAUpdates (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListOTAUpdates' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListOTAUpdates' :: ListOTAUpdates -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListOTAUpdates
s@ListOTAUpdates' {} Maybe Text
a -> ListOTAUpdates
s {$sel:nextToken:ListOTAUpdates' :: Maybe Text
nextToken = Maybe Text
a} :: ListOTAUpdates)

-- | The OTA update job status.
listOTAUpdates_otaUpdateStatus :: Lens.Lens' ListOTAUpdates (Prelude.Maybe OTAUpdateStatus)
listOTAUpdates_otaUpdateStatus :: (Maybe OTAUpdateStatus -> f (Maybe OTAUpdateStatus))
-> ListOTAUpdates -> f ListOTAUpdates
listOTAUpdates_otaUpdateStatus = (ListOTAUpdates -> Maybe OTAUpdateStatus)
-> (ListOTAUpdates -> Maybe OTAUpdateStatus -> ListOTAUpdates)
-> Lens
     ListOTAUpdates
     ListOTAUpdates
     (Maybe OTAUpdateStatus)
     (Maybe OTAUpdateStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListOTAUpdates' {Maybe OTAUpdateStatus
otaUpdateStatus :: Maybe OTAUpdateStatus
$sel:otaUpdateStatus:ListOTAUpdates' :: ListOTAUpdates -> Maybe OTAUpdateStatus
otaUpdateStatus} -> Maybe OTAUpdateStatus
otaUpdateStatus) (\s :: ListOTAUpdates
s@ListOTAUpdates' {} Maybe OTAUpdateStatus
a -> ListOTAUpdates
s {$sel:otaUpdateStatus:ListOTAUpdates' :: Maybe OTAUpdateStatus
otaUpdateStatus = Maybe OTAUpdateStatus
a} :: ListOTAUpdates)

-- | The maximum number of results to return at one time.
listOTAUpdates_maxResults :: Lens.Lens' ListOTAUpdates (Prelude.Maybe Prelude.Natural)
listOTAUpdates_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListOTAUpdates -> f ListOTAUpdates
listOTAUpdates_maxResults = (ListOTAUpdates -> Maybe Natural)
-> (ListOTAUpdates -> Maybe Natural -> ListOTAUpdates)
-> Lens
     ListOTAUpdates ListOTAUpdates (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListOTAUpdates' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListOTAUpdates' :: ListOTAUpdates -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListOTAUpdates
s@ListOTAUpdates' {} Maybe Natural
a -> ListOTAUpdates
s {$sel:maxResults:ListOTAUpdates' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListOTAUpdates)

instance Core.AWSPager ListOTAUpdates where
  page :: ListOTAUpdates
-> AWSResponse ListOTAUpdates -> Maybe ListOTAUpdates
page ListOTAUpdates
rq AWSResponse ListOTAUpdates
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListOTAUpdates
ListOTAUpdatesResponse
rs
            ListOTAUpdatesResponse
-> Getting (First Text) ListOTAUpdatesResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListOTAUpdatesResponse
-> Const (First Text) ListOTAUpdatesResponse
Lens' ListOTAUpdatesResponse (Maybe Text)
listOTAUpdatesResponse_nextToken
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListOTAUpdatesResponse
 -> Const (First Text) ListOTAUpdatesResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListOTAUpdatesResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe ListOTAUpdates
forall a. Maybe a
Prelude.Nothing
    | Maybe [OTAUpdateSummary] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListOTAUpdates
ListOTAUpdatesResponse
rs
            ListOTAUpdatesResponse
-> Getting
     (First [OTAUpdateSummary])
     ListOTAUpdatesResponse
     [OTAUpdateSummary]
-> Maybe [OTAUpdateSummary]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [OTAUpdateSummary]
 -> Const (First [OTAUpdateSummary]) (Maybe [OTAUpdateSummary]))
-> ListOTAUpdatesResponse
-> Const (First [OTAUpdateSummary]) ListOTAUpdatesResponse
Lens' ListOTAUpdatesResponse (Maybe [OTAUpdateSummary])
listOTAUpdatesResponse_otaUpdates
              ((Maybe [OTAUpdateSummary]
  -> Const (First [OTAUpdateSummary]) (Maybe [OTAUpdateSummary]))
 -> ListOTAUpdatesResponse
 -> Const (First [OTAUpdateSummary]) ListOTAUpdatesResponse)
-> (([OTAUpdateSummary]
     -> Const (First [OTAUpdateSummary]) [OTAUpdateSummary])
    -> Maybe [OTAUpdateSummary]
    -> Const (First [OTAUpdateSummary]) (Maybe [OTAUpdateSummary]))
-> Getting
     (First [OTAUpdateSummary])
     ListOTAUpdatesResponse
     [OTAUpdateSummary]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([OTAUpdateSummary]
 -> Const (First [OTAUpdateSummary]) [OTAUpdateSummary])
-> Maybe [OTAUpdateSummary]
-> Const (First [OTAUpdateSummary]) (Maybe [OTAUpdateSummary])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe ListOTAUpdates
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      ListOTAUpdates -> Maybe ListOTAUpdates
forall a. a -> Maybe a
Prelude.Just (ListOTAUpdates -> Maybe ListOTAUpdates)
-> ListOTAUpdates -> Maybe ListOTAUpdates
forall a b. (a -> b) -> a -> b
Prelude.$
        ListOTAUpdates
rq
          ListOTAUpdates
-> (ListOTAUpdates -> ListOTAUpdates) -> ListOTAUpdates
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListOTAUpdates -> Identity ListOTAUpdates
Lens ListOTAUpdates ListOTAUpdates (Maybe Text) (Maybe Text)
listOTAUpdates_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> ListOTAUpdates -> Identity ListOTAUpdates)
-> Maybe Text -> ListOTAUpdates -> ListOTAUpdates
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListOTAUpdates
ListOTAUpdatesResponse
rs
          ListOTAUpdatesResponse
-> Getting (First Text) ListOTAUpdatesResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListOTAUpdatesResponse
-> Const (First Text) ListOTAUpdatesResponse
Lens' ListOTAUpdatesResponse (Maybe Text)
listOTAUpdatesResponse_nextToken ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListOTAUpdatesResponse
 -> Const (First Text) ListOTAUpdatesResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListOTAUpdatesResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

instance Core.AWSRequest ListOTAUpdates where
  type
    AWSResponse ListOTAUpdates =
      ListOTAUpdatesResponse
  request :: ListOTAUpdates -> Request ListOTAUpdates
request = Service -> ListOTAUpdates -> Request ListOTAUpdates
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy ListOTAUpdates
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListOTAUpdates)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ListOTAUpdates))
-> Logger
-> Service
-> Proxy ListOTAUpdates
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListOTAUpdates)))
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 Text
-> Maybe [OTAUpdateSummary] -> Int -> ListOTAUpdatesResponse
ListOTAUpdatesResponse'
            (Maybe Text
 -> Maybe [OTAUpdateSummary] -> Int -> ListOTAUpdatesResponse)
-> Either String (Maybe Text)
-> Either
     String (Maybe [OTAUpdateSummary] -> Int -> ListOTAUpdatesResponse)
forall (f :: * -> *) a b. Functor 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 (Maybe [OTAUpdateSummary] -> Int -> ListOTAUpdatesResponse)
-> Either String (Maybe [OTAUpdateSummary])
-> Either String (Int -> ListOTAUpdatesResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (Maybe [OTAUpdateSummary]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"otaUpdates" Either String (Maybe (Maybe [OTAUpdateSummary]))
-> Maybe [OTAUpdateSummary]
-> Either String (Maybe [OTAUpdateSummary])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [OTAUpdateSummary]
forall a. Monoid a => a
Prelude.mempty)
            Either String (Int -> ListOTAUpdatesResponse)
-> Either String Int -> Either String ListOTAUpdatesResponse
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 ListOTAUpdates

instance Prelude.NFData ListOTAUpdates

instance Core.ToHeaders ListOTAUpdates where
  toHeaders :: ListOTAUpdates -> ResponseHeaders
toHeaders = ResponseHeaders -> ListOTAUpdates -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty

instance Core.ToPath ListOTAUpdates where
  toPath :: ListOTAUpdates -> ByteString
toPath = ByteString -> ListOTAUpdates -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/otaUpdates"

instance Core.ToQuery ListOTAUpdates where
  toQuery :: ListOTAUpdates -> QueryString
toQuery ListOTAUpdates' {Maybe Natural
Maybe Text
Maybe OTAUpdateStatus
maxResults :: Maybe Natural
otaUpdateStatus :: Maybe OTAUpdateStatus
nextToken :: Maybe Text
$sel:maxResults:ListOTAUpdates' :: ListOTAUpdates -> Maybe Natural
$sel:otaUpdateStatus:ListOTAUpdates' :: ListOTAUpdates -> Maybe OTAUpdateStatus
$sel:nextToken:ListOTAUpdates' :: ListOTAUpdates -> Maybe Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"nextToken" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
nextToken,
        ByteString
"otaUpdateStatus" ByteString -> Maybe OTAUpdateStatus -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe OTAUpdateStatus
otaUpdateStatus,
        ByteString
"maxResults" ByteString -> Maybe Natural -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Natural
maxResults
      ]

-- | /See:/ 'newListOTAUpdatesResponse' smart constructor.
data ListOTAUpdatesResponse = ListOTAUpdatesResponse'
  { -- | A token to use to get the next set of results.
    ListOTAUpdatesResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | A list of OTA update jobs.
    ListOTAUpdatesResponse -> Maybe [OTAUpdateSummary]
otaUpdates :: Prelude.Maybe [OTAUpdateSummary],
    -- | The response's http status code.
    ListOTAUpdatesResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListOTAUpdatesResponse -> ListOTAUpdatesResponse -> Bool
(ListOTAUpdatesResponse -> ListOTAUpdatesResponse -> Bool)
-> (ListOTAUpdatesResponse -> ListOTAUpdatesResponse -> Bool)
-> Eq ListOTAUpdatesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListOTAUpdatesResponse -> ListOTAUpdatesResponse -> Bool
$c/= :: ListOTAUpdatesResponse -> ListOTAUpdatesResponse -> Bool
== :: ListOTAUpdatesResponse -> ListOTAUpdatesResponse -> Bool
$c== :: ListOTAUpdatesResponse -> ListOTAUpdatesResponse -> Bool
Prelude.Eq, ReadPrec [ListOTAUpdatesResponse]
ReadPrec ListOTAUpdatesResponse
Int -> ReadS ListOTAUpdatesResponse
ReadS [ListOTAUpdatesResponse]
(Int -> ReadS ListOTAUpdatesResponse)
-> ReadS [ListOTAUpdatesResponse]
-> ReadPrec ListOTAUpdatesResponse
-> ReadPrec [ListOTAUpdatesResponse]
-> Read ListOTAUpdatesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListOTAUpdatesResponse]
$creadListPrec :: ReadPrec [ListOTAUpdatesResponse]
readPrec :: ReadPrec ListOTAUpdatesResponse
$creadPrec :: ReadPrec ListOTAUpdatesResponse
readList :: ReadS [ListOTAUpdatesResponse]
$creadList :: ReadS [ListOTAUpdatesResponse]
readsPrec :: Int -> ReadS ListOTAUpdatesResponse
$creadsPrec :: Int -> ReadS ListOTAUpdatesResponse
Prelude.Read, Int -> ListOTAUpdatesResponse -> ShowS
[ListOTAUpdatesResponse] -> ShowS
ListOTAUpdatesResponse -> String
(Int -> ListOTAUpdatesResponse -> ShowS)
-> (ListOTAUpdatesResponse -> String)
-> ([ListOTAUpdatesResponse] -> ShowS)
-> Show ListOTAUpdatesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListOTAUpdatesResponse] -> ShowS
$cshowList :: [ListOTAUpdatesResponse] -> ShowS
show :: ListOTAUpdatesResponse -> String
$cshow :: ListOTAUpdatesResponse -> String
showsPrec :: Int -> ListOTAUpdatesResponse -> ShowS
$cshowsPrec :: Int -> ListOTAUpdatesResponse -> ShowS
Prelude.Show, (forall x. ListOTAUpdatesResponse -> Rep ListOTAUpdatesResponse x)
-> (forall x.
    Rep ListOTAUpdatesResponse x -> ListOTAUpdatesResponse)
-> Generic ListOTAUpdatesResponse
forall x. Rep ListOTAUpdatesResponse x -> ListOTAUpdatesResponse
forall x. ListOTAUpdatesResponse -> Rep ListOTAUpdatesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListOTAUpdatesResponse x -> ListOTAUpdatesResponse
$cfrom :: forall x. ListOTAUpdatesResponse -> Rep ListOTAUpdatesResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListOTAUpdatesResponse' 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', 'listOTAUpdatesResponse_nextToken' - A token to use to get the next set of results.
--
-- 'otaUpdates', 'listOTAUpdatesResponse_otaUpdates' - A list of OTA update jobs.
--
-- 'httpStatus', 'listOTAUpdatesResponse_httpStatus' - The response's http status code.
newListOTAUpdatesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListOTAUpdatesResponse
newListOTAUpdatesResponse :: Int -> ListOTAUpdatesResponse
newListOTAUpdatesResponse Int
pHttpStatus_ =
  ListOTAUpdatesResponse' :: Maybe Text
-> Maybe [OTAUpdateSummary] -> Int -> ListOTAUpdatesResponse
ListOTAUpdatesResponse'
    { $sel:nextToken:ListOTAUpdatesResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:otaUpdates:ListOTAUpdatesResponse' :: Maybe [OTAUpdateSummary]
otaUpdates = Maybe [OTAUpdateSummary]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListOTAUpdatesResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A token to use to get the next set of results.
listOTAUpdatesResponse_nextToken :: Lens.Lens' ListOTAUpdatesResponse (Prelude.Maybe Prelude.Text)
listOTAUpdatesResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListOTAUpdatesResponse -> f ListOTAUpdatesResponse
listOTAUpdatesResponse_nextToken = (ListOTAUpdatesResponse -> Maybe Text)
-> (ListOTAUpdatesResponse -> Maybe Text -> ListOTAUpdatesResponse)
-> Lens' ListOTAUpdatesResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListOTAUpdatesResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListOTAUpdatesResponse' :: ListOTAUpdatesResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListOTAUpdatesResponse
s@ListOTAUpdatesResponse' {} Maybe Text
a -> ListOTAUpdatesResponse
s {$sel:nextToken:ListOTAUpdatesResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListOTAUpdatesResponse)

-- | A list of OTA update jobs.
listOTAUpdatesResponse_otaUpdates :: Lens.Lens' ListOTAUpdatesResponse (Prelude.Maybe [OTAUpdateSummary])
listOTAUpdatesResponse_otaUpdates :: (Maybe [OTAUpdateSummary] -> f (Maybe [OTAUpdateSummary]))
-> ListOTAUpdatesResponse -> f ListOTAUpdatesResponse
listOTAUpdatesResponse_otaUpdates = (ListOTAUpdatesResponse -> Maybe [OTAUpdateSummary])
-> (ListOTAUpdatesResponse
    -> Maybe [OTAUpdateSummary] -> ListOTAUpdatesResponse)
-> Lens' ListOTAUpdatesResponse (Maybe [OTAUpdateSummary])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListOTAUpdatesResponse' {Maybe [OTAUpdateSummary]
otaUpdates :: Maybe [OTAUpdateSummary]
$sel:otaUpdates:ListOTAUpdatesResponse' :: ListOTAUpdatesResponse -> Maybe [OTAUpdateSummary]
otaUpdates} -> Maybe [OTAUpdateSummary]
otaUpdates) (\s :: ListOTAUpdatesResponse
s@ListOTAUpdatesResponse' {} Maybe [OTAUpdateSummary]
a -> ListOTAUpdatesResponse
s {$sel:otaUpdates:ListOTAUpdatesResponse' :: Maybe [OTAUpdateSummary]
otaUpdates = Maybe [OTAUpdateSummary]
a} :: ListOTAUpdatesResponse) ((Maybe [OTAUpdateSummary] -> f (Maybe [OTAUpdateSummary]))
 -> ListOTAUpdatesResponse -> f ListOTAUpdatesResponse)
-> ((Maybe [OTAUpdateSummary] -> f (Maybe [OTAUpdateSummary]))
    -> Maybe [OTAUpdateSummary] -> f (Maybe [OTAUpdateSummary]))
-> (Maybe [OTAUpdateSummary] -> f (Maybe [OTAUpdateSummary]))
-> ListOTAUpdatesResponse
-> f ListOTAUpdatesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [OTAUpdateSummary]
  [OTAUpdateSummary]
  [OTAUpdateSummary]
  [OTAUpdateSummary]
-> Iso
     (Maybe [OTAUpdateSummary])
     (Maybe [OTAUpdateSummary])
     (Maybe [OTAUpdateSummary])
     (Maybe [OTAUpdateSummary])
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 AnIso
  [OTAUpdateSummary]
  [OTAUpdateSummary]
  [OTAUpdateSummary]
  [OTAUpdateSummary]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.NFData ListOTAUpdatesResponse