{-# 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.ListConnectorDefinitionVersions
-- 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 connector definition, which are containers for
-- connectors. Connectors run on the Greengrass core and contain built-in
-- integration with local infrastructure, device protocols, AWS, and other
-- cloud services.
--
-- This operation returns paginated results.
module Amazonka.Greengrass.ListConnectorDefinitionVersions
  ( -- * Creating a Request
    ListConnectorDefinitionVersions (..),
    newListConnectorDefinitionVersions,

    -- * Request Lenses
    listConnectorDefinitionVersions_nextToken,
    listConnectorDefinitionVersions_maxResults,
    listConnectorDefinitionVersions_connectorDefinitionId,

    -- * Destructuring the Response
    ListConnectorDefinitionVersionsResponse (..),
    newListConnectorDefinitionVersionsResponse,

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

-- |
-- Create a value of 'ListConnectorDefinitionVersions' 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', 'listConnectorDefinitionVersions_nextToken' - The token for the next set of results, or \'\'null\'\' if there are no
-- additional results.
--
-- 'maxResults', 'listConnectorDefinitionVersions_maxResults' - The maximum number of results to be returned per request.
--
-- 'connectorDefinitionId', 'listConnectorDefinitionVersions_connectorDefinitionId' - The ID of the connector definition.
newListConnectorDefinitionVersions ::
  -- | 'connectorDefinitionId'
  Prelude.Text ->
  ListConnectorDefinitionVersions
newListConnectorDefinitionVersions :: Text -> ListConnectorDefinitionVersions
newListConnectorDefinitionVersions
  Text
pConnectorDefinitionId_ =
    ListConnectorDefinitionVersions' :: Maybe Text -> Maybe Text -> Text -> ListConnectorDefinitionVersions
ListConnectorDefinitionVersions'
      { $sel:nextToken:ListConnectorDefinitionVersions' :: Maybe Text
nextToken =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:maxResults:ListConnectorDefinitionVersions' :: Maybe Text
maxResults = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:connectorDefinitionId:ListConnectorDefinitionVersions' :: Text
connectorDefinitionId =
          Text
pConnectorDefinitionId_
      }

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

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

-- | The ID of the connector definition.
listConnectorDefinitionVersions_connectorDefinitionId :: Lens.Lens' ListConnectorDefinitionVersions Prelude.Text
listConnectorDefinitionVersions_connectorDefinitionId :: (Text -> f Text)
-> ListConnectorDefinitionVersions
-> f ListConnectorDefinitionVersions
listConnectorDefinitionVersions_connectorDefinitionId = (ListConnectorDefinitionVersions -> Text)
-> (ListConnectorDefinitionVersions
    -> Text -> ListConnectorDefinitionVersions)
-> Lens
     ListConnectorDefinitionVersions
     ListConnectorDefinitionVersions
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListConnectorDefinitionVersions' {Text
connectorDefinitionId :: Text
$sel:connectorDefinitionId:ListConnectorDefinitionVersions' :: ListConnectorDefinitionVersions -> Text
connectorDefinitionId} -> Text
connectorDefinitionId) (\s :: ListConnectorDefinitionVersions
s@ListConnectorDefinitionVersions' {} Text
a -> ListConnectorDefinitionVersions
s {$sel:connectorDefinitionId:ListConnectorDefinitionVersions' :: Text
connectorDefinitionId = Text
a} :: ListConnectorDefinitionVersions)

instance
  Core.AWSPager
    ListConnectorDefinitionVersions
  where
  page :: ListConnectorDefinitionVersions
-> AWSResponse ListConnectorDefinitionVersions
-> Maybe ListConnectorDefinitionVersions
page ListConnectorDefinitionVersions
rq AWSResponse ListConnectorDefinitionVersions
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListConnectorDefinitionVersions
ListConnectorDefinitionVersionsResponse
rs
            ListConnectorDefinitionVersionsResponse
-> Getting
     (First Text) ListConnectorDefinitionVersionsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListConnectorDefinitionVersionsResponse
-> Const (First Text) ListConnectorDefinitionVersionsResponse
Lens' ListConnectorDefinitionVersionsResponse (Maybe Text)
listConnectorDefinitionVersionsResponse_nextToken
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListConnectorDefinitionVersionsResponse
 -> Const (First Text) ListConnectorDefinitionVersionsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting
     (First Text) ListConnectorDefinitionVersionsResponse 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 ListConnectorDefinitionVersions
forall a. Maybe a
Prelude.Nothing
    | Maybe [VersionInformation] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListConnectorDefinitionVersions
ListConnectorDefinitionVersionsResponse
rs
            ListConnectorDefinitionVersionsResponse
-> Getting
     (First [VersionInformation])
     ListConnectorDefinitionVersionsResponse
     [VersionInformation]
-> Maybe [VersionInformation]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [VersionInformation]
 -> Const (First [VersionInformation]) (Maybe [VersionInformation]))
-> ListConnectorDefinitionVersionsResponse
-> Const
     (First [VersionInformation])
     ListConnectorDefinitionVersionsResponse
Lens'
  ListConnectorDefinitionVersionsResponse
  (Maybe [VersionInformation])
listConnectorDefinitionVersionsResponse_versions
              ((Maybe [VersionInformation]
  -> Const (First [VersionInformation]) (Maybe [VersionInformation]))
 -> ListConnectorDefinitionVersionsResponse
 -> Const
      (First [VersionInformation])
      ListConnectorDefinitionVersionsResponse)
-> (([VersionInformation]
     -> Const (First [VersionInformation]) [VersionInformation])
    -> Maybe [VersionInformation]
    -> Const (First [VersionInformation]) (Maybe [VersionInformation]))
-> Getting
     (First [VersionInformation])
     ListConnectorDefinitionVersionsResponse
     [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 ListConnectorDefinitionVersions
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      ListConnectorDefinitionVersions
-> Maybe ListConnectorDefinitionVersions
forall a. a -> Maybe a
Prelude.Just (ListConnectorDefinitionVersions
 -> Maybe ListConnectorDefinitionVersions)
-> ListConnectorDefinitionVersions
-> Maybe ListConnectorDefinitionVersions
forall a b. (a -> b) -> a -> b
Prelude.$
        ListConnectorDefinitionVersions
rq
          ListConnectorDefinitionVersions
-> (ListConnectorDefinitionVersions
    -> ListConnectorDefinitionVersions)
-> ListConnectorDefinitionVersions
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListConnectorDefinitionVersions
-> Identity ListConnectorDefinitionVersions
Lens
  ListConnectorDefinitionVersions
  ListConnectorDefinitionVersions
  (Maybe Text)
  (Maybe Text)
listConnectorDefinitionVersions_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> ListConnectorDefinitionVersions
 -> Identity ListConnectorDefinitionVersions)
-> Maybe Text
-> ListConnectorDefinitionVersions
-> ListConnectorDefinitionVersions
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListConnectorDefinitionVersions
ListConnectorDefinitionVersionsResponse
rs
          ListConnectorDefinitionVersionsResponse
-> Getting
     (First Text) ListConnectorDefinitionVersionsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListConnectorDefinitionVersionsResponse
-> Const (First Text) ListConnectorDefinitionVersionsResponse
Lens' ListConnectorDefinitionVersionsResponse (Maybe Text)
listConnectorDefinitionVersionsResponse_nextToken
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListConnectorDefinitionVersionsResponse
 -> Const (First Text) ListConnectorDefinitionVersionsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting
     (First Text) ListConnectorDefinitionVersionsResponse 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
    ListConnectorDefinitionVersions
  where
  type
    AWSResponse ListConnectorDefinitionVersions =
      ListConnectorDefinitionVersionsResponse
  request :: ListConnectorDefinitionVersions
-> Request ListConnectorDefinitionVersions
request = Service
-> ListConnectorDefinitionVersions
-> Request ListConnectorDefinitionVersions
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy ListConnectorDefinitionVersions
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse ListConnectorDefinitionVersions)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ListConnectorDefinitionVersions))
-> Logger
-> Service
-> Proxy ListConnectorDefinitionVersions
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse ListConnectorDefinitionVersions)))
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 -> ListConnectorDefinitionVersionsResponse
ListConnectorDefinitionVersionsResponse'
            (Maybe [VersionInformation]
 -> Maybe Text -> Int -> ListConnectorDefinitionVersionsResponse)
-> Either String (Maybe [VersionInformation])
-> Either
     String
     (Maybe Text -> Int -> ListConnectorDefinitionVersionsResponse)
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 -> ListConnectorDefinitionVersionsResponse)
-> Either String (Maybe Text)
-> Either String (Int -> ListConnectorDefinitionVersionsResponse)
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 -> ListConnectorDefinitionVersionsResponse)
-> Either String Int
-> Either String ListConnectorDefinitionVersionsResponse
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
    ListConnectorDefinitionVersions

instance
  Prelude.NFData
    ListConnectorDefinitionVersions

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

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

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

-- | Information about a version.
listConnectorDefinitionVersionsResponse_versions :: Lens.Lens' ListConnectorDefinitionVersionsResponse (Prelude.Maybe [VersionInformation])
listConnectorDefinitionVersionsResponse_versions :: (Maybe [VersionInformation] -> f (Maybe [VersionInformation]))
-> ListConnectorDefinitionVersionsResponse
-> f ListConnectorDefinitionVersionsResponse
listConnectorDefinitionVersionsResponse_versions = (ListConnectorDefinitionVersionsResponse
 -> Maybe [VersionInformation])
-> (ListConnectorDefinitionVersionsResponse
    -> Maybe [VersionInformation]
    -> ListConnectorDefinitionVersionsResponse)
-> Lens'
     ListConnectorDefinitionVersionsResponse
     (Maybe [VersionInformation])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListConnectorDefinitionVersionsResponse' {Maybe [VersionInformation]
versions :: Maybe [VersionInformation]
$sel:versions:ListConnectorDefinitionVersionsResponse' :: ListConnectorDefinitionVersionsResponse
-> Maybe [VersionInformation]
versions} -> Maybe [VersionInformation]
versions) (\s :: ListConnectorDefinitionVersionsResponse
s@ListConnectorDefinitionVersionsResponse' {} Maybe [VersionInformation]
a -> ListConnectorDefinitionVersionsResponse
s {$sel:versions:ListConnectorDefinitionVersionsResponse' :: Maybe [VersionInformation]
versions = Maybe [VersionInformation]
a} :: ListConnectorDefinitionVersionsResponse) ((Maybe [VersionInformation] -> f (Maybe [VersionInformation]))
 -> ListConnectorDefinitionVersionsResponse
 -> f ListConnectorDefinitionVersionsResponse)
-> ((Maybe [VersionInformation] -> f (Maybe [VersionInformation]))
    -> Maybe [VersionInformation] -> f (Maybe [VersionInformation]))
-> (Maybe [VersionInformation] -> f (Maybe [VersionInformation]))
-> ListConnectorDefinitionVersionsResponse
-> f ListConnectorDefinitionVersionsResponse
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.
listConnectorDefinitionVersionsResponse_nextToken :: Lens.Lens' ListConnectorDefinitionVersionsResponse (Prelude.Maybe Prelude.Text)
listConnectorDefinitionVersionsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListConnectorDefinitionVersionsResponse
-> f ListConnectorDefinitionVersionsResponse
listConnectorDefinitionVersionsResponse_nextToken = (ListConnectorDefinitionVersionsResponse -> Maybe Text)
-> (ListConnectorDefinitionVersionsResponse
    -> Maybe Text -> ListConnectorDefinitionVersionsResponse)
-> Lens' ListConnectorDefinitionVersionsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListConnectorDefinitionVersionsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListConnectorDefinitionVersionsResponse' :: ListConnectorDefinitionVersionsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListConnectorDefinitionVersionsResponse
s@ListConnectorDefinitionVersionsResponse' {} Maybe Text
a -> ListConnectorDefinitionVersionsResponse
s {$sel:nextToken:ListConnectorDefinitionVersionsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListConnectorDefinitionVersionsResponse)

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

instance
  Prelude.NFData
    ListConnectorDefinitionVersionsResponse