{-# 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.Greengrass.ListDeviceDefinitionVersions
-- 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 the versions of a device definition.
--
-- This operation returns paginated results.
module Amazonka.Greengrass.ListDeviceDefinitionVersions
  ( -- * Creating a Request
    ListDeviceDefinitionVersions (..),
    newListDeviceDefinitionVersions,

    -- * Request Lenses
    listDeviceDefinitionVersions_nextToken,
    listDeviceDefinitionVersions_maxResults,
    listDeviceDefinitionVersions_deviceDefinitionId,

    -- * Destructuring the Response
    ListDeviceDefinitionVersionsResponse (..),
    newListDeviceDefinitionVersionsResponse,

    -- * Response Lenses
    listDeviceDefinitionVersionsResponse_versions,
    listDeviceDefinitionVersionsResponse_nextToken,
    listDeviceDefinitionVersionsResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.Greengrass.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:/ 'newListDeviceDefinitionVersions' smart constructor.
data ListDeviceDefinitionVersions = ListDeviceDefinitionVersions'
  { -- | The token for the next set of results, or \'\'null\'\' if there are no
    -- additional results.
    ListDeviceDefinitionVersions -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of results to be returned per request.
    ListDeviceDefinitionVersions -> Maybe Text
maxResults :: Prelude.Maybe Prelude.Text,
    -- | The ID of the device definition.
    ListDeviceDefinitionVersions -> Text
deviceDefinitionId :: Prelude.Text
  }
  deriving (ListDeviceDefinitionVersions
-> ListDeviceDefinitionVersions -> Bool
(ListDeviceDefinitionVersions
 -> ListDeviceDefinitionVersions -> Bool)
-> (ListDeviceDefinitionVersions
    -> ListDeviceDefinitionVersions -> Bool)
-> Eq ListDeviceDefinitionVersions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListDeviceDefinitionVersions
-> ListDeviceDefinitionVersions -> Bool
$c/= :: ListDeviceDefinitionVersions
-> ListDeviceDefinitionVersions -> Bool
== :: ListDeviceDefinitionVersions
-> ListDeviceDefinitionVersions -> Bool
$c== :: ListDeviceDefinitionVersions
-> ListDeviceDefinitionVersions -> Bool
Prelude.Eq, ReadPrec [ListDeviceDefinitionVersions]
ReadPrec ListDeviceDefinitionVersions
Int -> ReadS ListDeviceDefinitionVersions
ReadS [ListDeviceDefinitionVersions]
(Int -> ReadS ListDeviceDefinitionVersions)
-> ReadS [ListDeviceDefinitionVersions]
-> ReadPrec ListDeviceDefinitionVersions
-> ReadPrec [ListDeviceDefinitionVersions]
-> Read ListDeviceDefinitionVersions
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListDeviceDefinitionVersions]
$creadListPrec :: ReadPrec [ListDeviceDefinitionVersions]
readPrec :: ReadPrec ListDeviceDefinitionVersions
$creadPrec :: ReadPrec ListDeviceDefinitionVersions
readList :: ReadS [ListDeviceDefinitionVersions]
$creadList :: ReadS [ListDeviceDefinitionVersions]
readsPrec :: Int -> ReadS ListDeviceDefinitionVersions
$creadsPrec :: Int -> ReadS ListDeviceDefinitionVersions
Prelude.Read, Int -> ListDeviceDefinitionVersions -> ShowS
[ListDeviceDefinitionVersions] -> ShowS
ListDeviceDefinitionVersions -> String
(Int -> ListDeviceDefinitionVersions -> ShowS)
-> (ListDeviceDefinitionVersions -> String)
-> ([ListDeviceDefinitionVersions] -> ShowS)
-> Show ListDeviceDefinitionVersions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListDeviceDefinitionVersions] -> ShowS
$cshowList :: [ListDeviceDefinitionVersions] -> ShowS
show :: ListDeviceDefinitionVersions -> String
$cshow :: ListDeviceDefinitionVersions -> String
showsPrec :: Int -> ListDeviceDefinitionVersions -> ShowS
$cshowsPrec :: Int -> ListDeviceDefinitionVersions -> ShowS
Prelude.Show, (forall x.
 ListDeviceDefinitionVersions -> Rep ListDeviceDefinitionVersions x)
-> (forall x.
    Rep ListDeviceDefinitionVersions x -> ListDeviceDefinitionVersions)
-> Generic ListDeviceDefinitionVersions
forall x.
Rep ListDeviceDefinitionVersions x -> ListDeviceDefinitionVersions
forall x.
ListDeviceDefinitionVersions -> Rep ListDeviceDefinitionVersions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListDeviceDefinitionVersions x -> ListDeviceDefinitionVersions
$cfrom :: forall x.
ListDeviceDefinitionVersions -> Rep ListDeviceDefinitionVersions x
Prelude.Generic)

-- |
-- Create a value of 'ListDeviceDefinitionVersions' 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', 'listDeviceDefinitionVersions_nextToken' - The token for the next set of results, or \'\'null\'\' if there are no
-- additional results.
--
-- 'maxResults', 'listDeviceDefinitionVersions_maxResults' - The maximum number of results to be returned per request.
--
-- 'deviceDefinitionId', 'listDeviceDefinitionVersions_deviceDefinitionId' - The ID of the device definition.
newListDeviceDefinitionVersions ::
  -- | 'deviceDefinitionId'
  Prelude.Text ->
  ListDeviceDefinitionVersions
newListDeviceDefinitionVersions :: Text -> ListDeviceDefinitionVersions
newListDeviceDefinitionVersions Text
pDeviceDefinitionId_ =
  ListDeviceDefinitionVersions' :: Maybe Text -> Maybe Text -> Text -> ListDeviceDefinitionVersions
ListDeviceDefinitionVersions'
    { $sel:nextToken:ListDeviceDefinitionVersions' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListDeviceDefinitionVersions' :: Maybe Text
maxResults = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:deviceDefinitionId:ListDeviceDefinitionVersions' :: Text
deviceDefinitionId = Text
pDeviceDefinitionId_
    }

-- | The token for the next set of results, or \'\'null\'\' if there are no
-- additional results.
listDeviceDefinitionVersions_nextToken :: Lens.Lens' ListDeviceDefinitionVersions (Prelude.Maybe Prelude.Text)
listDeviceDefinitionVersions_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListDeviceDefinitionVersions -> f ListDeviceDefinitionVersions
listDeviceDefinitionVersions_nextToken = (ListDeviceDefinitionVersions -> Maybe Text)
-> (ListDeviceDefinitionVersions
    -> Maybe Text -> ListDeviceDefinitionVersions)
-> Lens
     ListDeviceDefinitionVersions
     ListDeviceDefinitionVersions
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDeviceDefinitionVersions' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListDeviceDefinitionVersions' :: ListDeviceDefinitionVersions -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListDeviceDefinitionVersions
s@ListDeviceDefinitionVersions' {} Maybe Text
a -> ListDeviceDefinitionVersions
s {$sel:nextToken:ListDeviceDefinitionVersions' :: Maybe Text
nextToken = Maybe Text
a} :: ListDeviceDefinitionVersions)

-- | The maximum number of results to be returned per request.
listDeviceDefinitionVersions_maxResults :: Lens.Lens' ListDeviceDefinitionVersions (Prelude.Maybe Prelude.Text)
listDeviceDefinitionVersions_maxResults :: (Maybe Text -> f (Maybe Text))
-> ListDeviceDefinitionVersions -> f ListDeviceDefinitionVersions
listDeviceDefinitionVersions_maxResults = (ListDeviceDefinitionVersions -> Maybe Text)
-> (ListDeviceDefinitionVersions
    -> Maybe Text -> ListDeviceDefinitionVersions)
-> Lens
     ListDeviceDefinitionVersions
     ListDeviceDefinitionVersions
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDeviceDefinitionVersions' {Maybe Text
maxResults :: Maybe Text
$sel:maxResults:ListDeviceDefinitionVersions' :: ListDeviceDefinitionVersions -> Maybe Text
maxResults} -> Maybe Text
maxResults) (\s :: ListDeviceDefinitionVersions
s@ListDeviceDefinitionVersions' {} Maybe Text
a -> ListDeviceDefinitionVersions
s {$sel:maxResults:ListDeviceDefinitionVersions' :: Maybe Text
maxResults = Maybe Text
a} :: ListDeviceDefinitionVersions)

-- | The ID of the device definition.
listDeviceDefinitionVersions_deviceDefinitionId :: Lens.Lens' ListDeviceDefinitionVersions Prelude.Text
listDeviceDefinitionVersions_deviceDefinitionId :: (Text -> f Text)
-> ListDeviceDefinitionVersions -> f ListDeviceDefinitionVersions
listDeviceDefinitionVersions_deviceDefinitionId = (ListDeviceDefinitionVersions -> Text)
-> (ListDeviceDefinitionVersions
    -> Text -> ListDeviceDefinitionVersions)
-> Lens
     ListDeviceDefinitionVersions ListDeviceDefinitionVersions Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDeviceDefinitionVersions' {Text
deviceDefinitionId :: Text
$sel:deviceDefinitionId:ListDeviceDefinitionVersions' :: ListDeviceDefinitionVersions -> Text
deviceDefinitionId} -> Text
deviceDefinitionId) (\s :: ListDeviceDefinitionVersions
s@ListDeviceDefinitionVersions' {} Text
a -> ListDeviceDefinitionVersions
s {$sel:deviceDefinitionId:ListDeviceDefinitionVersions' :: Text
deviceDefinitionId = Text
a} :: ListDeviceDefinitionVersions)

instance Core.AWSPager ListDeviceDefinitionVersions where
  page :: ListDeviceDefinitionVersions
-> AWSResponse ListDeviceDefinitionVersions
-> Maybe ListDeviceDefinitionVersions
page ListDeviceDefinitionVersions
rq AWSResponse ListDeviceDefinitionVersions
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListDeviceDefinitionVersions
ListDeviceDefinitionVersionsResponse
rs
            ListDeviceDefinitionVersionsResponse
-> Getting (First Text) ListDeviceDefinitionVersionsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListDeviceDefinitionVersionsResponse
-> Const (First Text) ListDeviceDefinitionVersionsResponse
Lens' ListDeviceDefinitionVersionsResponse (Maybe Text)
listDeviceDefinitionVersionsResponse_nextToken
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListDeviceDefinitionVersionsResponse
 -> Const (First Text) ListDeviceDefinitionVersionsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListDeviceDefinitionVersionsResponse 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 ListDeviceDefinitionVersions
forall a. Maybe a
Prelude.Nothing
    | Maybe [VersionInformation] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListDeviceDefinitionVersions
ListDeviceDefinitionVersionsResponse
rs
            ListDeviceDefinitionVersionsResponse
-> Getting
     (First [VersionInformation])
     ListDeviceDefinitionVersionsResponse
     [VersionInformation]
-> Maybe [VersionInformation]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [VersionInformation]
 -> Const (First [VersionInformation]) (Maybe [VersionInformation]))
-> ListDeviceDefinitionVersionsResponse
-> Const
     (First [VersionInformation]) ListDeviceDefinitionVersionsResponse
Lens'
  ListDeviceDefinitionVersionsResponse (Maybe [VersionInformation])
listDeviceDefinitionVersionsResponse_versions
              ((Maybe [VersionInformation]
  -> Const (First [VersionInformation]) (Maybe [VersionInformation]))
 -> ListDeviceDefinitionVersionsResponse
 -> Const
      (First [VersionInformation]) ListDeviceDefinitionVersionsResponse)
-> (([VersionInformation]
     -> Const (First [VersionInformation]) [VersionInformation])
    -> Maybe [VersionInformation]
    -> Const (First [VersionInformation]) (Maybe [VersionInformation]))
-> Getting
     (First [VersionInformation])
     ListDeviceDefinitionVersionsResponse
     [VersionInformation]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([VersionInformation]
 -> Const (First [VersionInformation]) [VersionInformation])
-> Maybe [VersionInformation]
-> Const (First [VersionInformation]) (Maybe [VersionInformation])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe ListDeviceDefinitionVersions
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      ListDeviceDefinitionVersions -> Maybe ListDeviceDefinitionVersions
forall a. a -> Maybe a
Prelude.Just (ListDeviceDefinitionVersions
 -> Maybe ListDeviceDefinitionVersions)
-> ListDeviceDefinitionVersions
-> Maybe ListDeviceDefinitionVersions
forall a b. (a -> b) -> a -> b
Prelude.$
        ListDeviceDefinitionVersions
rq
          ListDeviceDefinitionVersions
-> (ListDeviceDefinitionVersions -> ListDeviceDefinitionVersions)
-> ListDeviceDefinitionVersions
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListDeviceDefinitionVersions
-> Identity ListDeviceDefinitionVersions
Lens
  ListDeviceDefinitionVersions
  ListDeviceDefinitionVersions
  (Maybe Text)
  (Maybe Text)
listDeviceDefinitionVersions_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> ListDeviceDefinitionVersions
 -> Identity ListDeviceDefinitionVersions)
-> Maybe Text
-> ListDeviceDefinitionVersions
-> ListDeviceDefinitionVersions
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListDeviceDefinitionVersions
ListDeviceDefinitionVersionsResponse
rs
          ListDeviceDefinitionVersionsResponse
-> Getting (First Text) ListDeviceDefinitionVersionsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListDeviceDefinitionVersionsResponse
-> Const (First Text) ListDeviceDefinitionVersionsResponse
Lens' ListDeviceDefinitionVersionsResponse (Maybe Text)
listDeviceDefinitionVersionsResponse_nextToken
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListDeviceDefinitionVersionsResponse
 -> Const (First Text) ListDeviceDefinitionVersionsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListDeviceDefinitionVersionsResponse 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 ListDeviceDefinitionVersions where
  type
    AWSResponse ListDeviceDefinitionVersions =
      ListDeviceDefinitionVersionsResponse
  request :: ListDeviceDefinitionVersions
-> Request ListDeviceDefinitionVersions
request = Service
-> ListDeviceDefinitionVersions
-> Request ListDeviceDefinitionVersions
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy ListDeviceDefinitionVersions
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListDeviceDefinitionVersions)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ListDeviceDefinitionVersions))
-> Logger
-> Service
-> Proxy ListDeviceDefinitionVersions
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListDeviceDefinitionVersions)))
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 [VersionInformation]
-> Maybe Text -> Int -> ListDeviceDefinitionVersionsResponse
ListDeviceDefinitionVersionsResponse'
            (Maybe [VersionInformation]
 -> Maybe Text -> Int -> ListDeviceDefinitionVersionsResponse)
-> Either String (Maybe [VersionInformation])
-> Either
     String (Maybe Text -> Int -> ListDeviceDefinitionVersionsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object
-> Text -> Either String (Maybe (Maybe [VersionInformation]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Versions" Either String (Maybe (Maybe [VersionInformation]))
-> Maybe [VersionInformation]
-> Either String (Maybe [VersionInformation])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [VersionInformation]
forall a. Monoid a => a
Prelude.mempty)
            Either
  String (Maybe Text -> Int -> ListDeviceDefinitionVersionsResponse)
-> Either String (Maybe Text)
-> Either String (Int -> ListDeviceDefinitionVersionsResponse)
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 -> ListDeviceDefinitionVersionsResponse)
-> Either String Int
-> Either String ListDeviceDefinitionVersionsResponse
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
    ListDeviceDefinitionVersions

instance Prelude.NFData ListDeviceDefinitionVersions

instance Core.ToHeaders ListDeviceDefinitionVersions where
  toHeaders :: ListDeviceDefinitionVersions -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListDeviceDefinitionVersions -> 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.ToPath ListDeviceDefinitionVersions where
  toPath :: ListDeviceDefinitionVersions -> ByteString
toPath ListDeviceDefinitionVersions' {Maybe Text
Text
deviceDefinitionId :: Text
maxResults :: Maybe Text
nextToken :: Maybe Text
$sel:deviceDefinitionId:ListDeviceDefinitionVersions' :: ListDeviceDefinitionVersions -> Text
$sel:maxResults:ListDeviceDefinitionVersions' :: ListDeviceDefinitionVersions -> Maybe Text
$sel:nextToken:ListDeviceDefinitionVersions' :: ListDeviceDefinitionVersions -> Maybe Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/greengrass/definition/devices/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
deviceDefinitionId,
        ByteString
"/versions"
      ]

instance Core.ToQuery ListDeviceDefinitionVersions where
  toQuery :: ListDeviceDefinitionVersions -> QueryString
toQuery ListDeviceDefinitionVersions' {Maybe Text
Text
deviceDefinitionId :: Text
maxResults :: Maybe Text
nextToken :: Maybe Text
$sel:deviceDefinitionId:ListDeviceDefinitionVersions' :: ListDeviceDefinitionVersions -> Text
$sel:maxResults:ListDeviceDefinitionVersions' :: ListDeviceDefinitionVersions -> Maybe Text
$sel:nextToken:ListDeviceDefinitionVersions' :: ListDeviceDefinitionVersions -> 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
"MaxResults" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
maxResults
      ]

-- | /See:/ 'newListDeviceDefinitionVersionsResponse' smart constructor.
data ListDeviceDefinitionVersionsResponse = ListDeviceDefinitionVersionsResponse'
  { -- | Information about a version.
    ListDeviceDefinitionVersionsResponse -> Maybe [VersionInformation]
versions :: Prelude.Maybe [VersionInformation],
    -- | The token for the next set of results, or \'\'null\'\' if there are no
    -- additional results.
    ListDeviceDefinitionVersionsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListDeviceDefinitionVersionsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListDeviceDefinitionVersionsResponse
-> ListDeviceDefinitionVersionsResponse -> Bool
(ListDeviceDefinitionVersionsResponse
 -> ListDeviceDefinitionVersionsResponse -> Bool)
-> (ListDeviceDefinitionVersionsResponse
    -> ListDeviceDefinitionVersionsResponse -> Bool)
-> Eq ListDeviceDefinitionVersionsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListDeviceDefinitionVersionsResponse
-> ListDeviceDefinitionVersionsResponse -> Bool
$c/= :: ListDeviceDefinitionVersionsResponse
-> ListDeviceDefinitionVersionsResponse -> Bool
== :: ListDeviceDefinitionVersionsResponse
-> ListDeviceDefinitionVersionsResponse -> Bool
$c== :: ListDeviceDefinitionVersionsResponse
-> ListDeviceDefinitionVersionsResponse -> Bool
Prelude.Eq, ReadPrec [ListDeviceDefinitionVersionsResponse]
ReadPrec ListDeviceDefinitionVersionsResponse
Int -> ReadS ListDeviceDefinitionVersionsResponse
ReadS [ListDeviceDefinitionVersionsResponse]
(Int -> ReadS ListDeviceDefinitionVersionsResponse)
-> ReadS [ListDeviceDefinitionVersionsResponse]
-> ReadPrec ListDeviceDefinitionVersionsResponse
-> ReadPrec [ListDeviceDefinitionVersionsResponse]
-> Read ListDeviceDefinitionVersionsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListDeviceDefinitionVersionsResponse]
$creadListPrec :: ReadPrec [ListDeviceDefinitionVersionsResponse]
readPrec :: ReadPrec ListDeviceDefinitionVersionsResponse
$creadPrec :: ReadPrec ListDeviceDefinitionVersionsResponse
readList :: ReadS [ListDeviceDefinitionVersionsResponse]
$creadList :: ReadS [ListDeviceDefinitionVersionsResponse]
readsPrec :: Int -> ReadS ListDeviceDefinitionVersionsResponse
$creadsPrec :: Int -> ReadS ListDeviceDefinitionVersionsResponse
Prelude.Read, Int -> ListDeviceDefinitionVersionsResponse -> ShowS
[ListDeviceDefinitionVersionsResponse] -> ShowS
ListDeviceDefinitionVersionsResponse -> String
(Int -> ListDeviceDefinitionVersionsResponse -> ShowS)
-> (ListDeviceDefinitionVersionsResponse -> String)
-> ([ListDeviceDefinitionVersionsResponse] -> ShowS)
-> Show ListDeviceDefinitionVersionsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListDeviceDefinitionVersionsResponse] -> ShowS
$cshowList :: [ListDeviceDefinitionVersionsResponse] -> ShowS
show :: ListDeviceDefinitionVersionsResponse -> String
$cshow :: ListDeviceDefinitionVersionsResponse -> String
showsPrec :: Int -> ListDeviceDefinitionVersionsResponse -> ShowS
$cshowsPrec :: Int -> ListDeviceDefinitionVersionsResponse -> ShowS
Prelude.Show, (forall x.
 ListDeviceDefinitionVersionsResponse
 -> Rep ListDeviceDefinitionVersionsResponse x)
-> (forall x.
    Rep ListDeviceDefinitionVersionsResponse x
    -> ListDeviceDefinitionVersionsResponse)
-> Generic ListDeviceDefinitionVersionsResponse
forall x.
Rep ListDeviceDefinitionVersionsResponse x
-> ListDeviceDefinitionVersionsResponse
forall x.
ListDeviceDefinitionVersionsResponse
-> Rep ListDeviceDefinitionVersionsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListDeviceDefinitionVersionsResponse x
-> ListDeviceDefinitionVersionsResponse
$cfrom :: forall x.
ListDeviceDefinitionVersionsResponse
-> Rep ListDeviceDefinitionVersionsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListDeviceDefinitionVersionsResponse' 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:
--
-- 'versions', 'listDeviceDefinitionVersionsResponse_versions' - Information about a version.
--
-- 'nextToken', 'listDeviceDefinitionVersionsResponse_nextToken' - The token for the next set of results, or \'\'null\'\' if there are no
-- additional results.
--
-- 'httpStatus', 'listDeviceDefinitionVersionsResponse_httpStatus' - The response's http status code.
newListDeviceDefinitionVersionsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListDeviceDefinitionVersionsResponse
newListDeviceDefinitionVersionsResponse :: Int -> ListDeviceDefinitionVersionsResponse
newListDeviceDefinitionVersionsResponse Int
pHttpStatus_ =
  ListDeviceDefinitionVersionsResponse' :: Maybe [VersionInformation]
-> Maybe Text -> Int -> ListDeviceDefinitionVersionsResponse
ListDeviceDefinitionVersionsResponse'
    { $sel:versions:ListDeviceDefinitionVersionsResponse' :: Maybe [VersionInformation]
versions =
        Maybe [VersionInformation]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListDeviceDefinitionVersionsResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListDeviceDefinitionVersionsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Information about a version.
listDeviceDefinitionVersionsResponse_versions :: Lens.Lens' ListDeviceDefinitionVersionsResponse (Prelude.Maybe [VersionInformation])
listDeviceDefinitionVersionsResponse_versions :: (Maybe [VersionInformation] -> f (Maybe [VersionInformation]))
-> ListDeviceDefinitionVersionsResponse
-> f ListDeviceDefinitionVersionsResponse
listDeviceDefinitionVersionsResponse_versions = (ListDeviceDefinitionVersionsResponse
 -> Maybe [VersionInformation])
-> (ListDeviceDefinitionVersionsResponse
    -> Maybe [VersionInformation]
    -> ListDeviceDefinitionVersionsResponse)
-> Lens'
     ListDeviceDefinitionVersionsResponse (Maybe [VersionInformation])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDeviceDefinitionVersionsResponse' {Maybe [VersionInformation]
versions :: Maybe [VersionInformation]
$sel:versions:ListDeviceDefinitionVersionsResponse' :: ListDeviceDefinitionVersionsResponse -> Maybe [VersionInformation]
versions} -> Maybe [VersionInformation]
versions) (\s :: ListDeviceDefinitionVersionsResponse
s@ListDeviceDefinitionVersionsResponse' {} Maybe [VersionInformation]
a -> ListDeviceDefinitionVersionsResponse
s {$sel:versions:ListDeviceDefinitionVersionsResponse' :: Maybe [VersionInformation]
versions = Maybe [VersionInformation]
a} :: ListDeviceDefinitionVersionsResponse) ((Maybe [VersionInformation] -> f (Maybe [VersionInformation]))
 -> ListDeviceDefinitionVersionsResponse
 -> f ListDeviceDefinitionVersionsResponse)
-> ((Maybe [VersionInformation] -> f (Maybe [VersionInformation]))
    -> Maybe [VersionInformation] -> f (Maybe [VersionInformation]))
-> (Maybe [VersionInformation] -> f (Maybe [VersionInformation]))
-> ListDeviceDefinitionVersionsResponse
-> f ListDeviceDefinitionVersionsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [VersionInformation]
  [VersionInformation]
  [VersionInformation]
  [VersionInformation]
-> Iso
     (Maybe [VersionInformation])
     (Maybe [VersionInformation])
     (Maybe [VersionInformation])
     (Maybe [VersionInformation])
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
  [VersionInformation]
  [VersionInformation]
  [VersionInformation]
  [VersionInformation]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The token for the next set of results, or \'\'null\'\' if there are no
-- additional results.
listDeviceDefinitionVersionsResponse_nextToken :: Lens.Lens' ListDeviceDefinitionVersionsResponse (Prelude.Maybe Prelude.Text)
listDeviceDefinitionVersionsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListDeviceDefinitionVersionsResponse
-> f ListDeviceDefinitionVersionsResponse
listDeviceDefinitionVersionsResponse_nextToken = (ListDeviceDefinitionVersionsResponse -> Maybe Text)
-> (ListDeviceDefinitionVersionsResponse
    -> Maybe Text -> ListDeviceDefinitionVersionsResponse)
-> Lens' ListDeviceDefinitionVersionsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDeviceDefinitionVersionsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListDeviceDefinitionVersionsResponse' :: ListDeviceDefinitionVersionsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListDeviceDefinitionVersionsResponse
s@ListDeviceDefinitionVersionsResponse' {} Maybe Text
a -> ListDeviceDefinitionVersionsResponse
s {$sel:nextToken:ListDeviceDefinitionVersionsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListDeviceDefinitionVersionsResponse)

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

instance
  Prelude.NFData
    ListDeviceDefinitionVersionsResponse