{-# 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.KafkaConnect.ListWorkerConfigurations
-- 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)
--
-- Returns a list of all of the worker configurations in this account and
-- Region.
--
-- This operation returns paginated results.
module Amazonka.KafkaConnect.ListWorkerConfigurations
  ( -- * Creating a Request
    ListWorkerConfigurations (..),
    newListWorkerConfigurations,

    -- * Request Lenses
    listWorkerConfigurations_nextToken,
    listWorkerConfigurations_maxResults,

    -- * Destructuring the Response
    ListWorkerConfigurationsResponse (..),
    newListWorkerConfigurationsResponse,

    -- * Response Lenses
    listWorkerConfigurationsResponse_workerConfigurations,
    listWorkerConfigurationsResponse_nextToken,
    listWorkerConfigurationsResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.KafkaConnect.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:/ 'newListWorkerConfigurations' smart constructor.
data ListWorkerConfigurations = ListWorkerConfigurations'
  { -- | If the response of a ListWorkerConfigurations operation is truncated, it
    -- will include a NextToken. Send this NextToken in a subsequent request to
    -- continue listing from where the previous operation left off.
    ListWorkerConfigurations -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of worker configurations to list in one response.
    ListWorkerConfigurations -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural
  }
  deriving (ListWorkerConfigurations -> ListWorkerConfigurations -> Bool
(ListWorkerConfigurations -> ListWorkerConfigurations -> Bool)
-> (ListWorkerConfigurations -> ListWorkerConfigurations -> Bool)
-> Eq ListWorkerConfigurations
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListWorkerConfigurations -> ListWorkerConfigurations -> Bool
$c/= :: ListWorkerConfigurations -> ListWorkerConfigurations -> Bool
== :: ListWorkerConfigurations -> ListWorkerConfigurations -> Bool
$c== :: ListWorkerConfigurations -> ListWorkerConfigurations -> Bool
Prelude.Eq, ReadPrec [ListWorkerConfigurations]
ReadPrec ListWorkerConfigurations
Int -> ReadS ListWorkerConfigurations
ReadS [ListWorkerConfigurations]
(Int -> ReadS ListWorkerConfigurations)
-> ReadS [ListWorkerConfigurations]
-> ReadPrec ListWorkerConfigurations
-> ReadPrec [ListWorkerConfigurations]
-> Read ListWorkerConfigurations
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListWorkerConfigurations]
$creadListPrec :: ReadPrec [ListWorkerConfigurations]
readPrec :: ReadPrec ListWorkerConfigurations
$creadPrec :: ReadPrec ListWorkerConfigurations
readList :: ReadS [ListWorkerConfigurations]
$creadList :: ReadS [ListWorkerConfigurations]
readsPrec :: Int -> ReadS ListWorkerConfigurations
$creadsPrec :: Int -> ReadS ListWorkerConfigurations
Prelude.Read, Int -> ListWorkerConfigurations -> ShowS
[ListWorkerConfigurations] -> ShowS
ListWorkerConfigurations -> String
(Int -> ListWorkerConfigurations -> ShowS)
-> (ListWorkerConfigurations -> String)
-> ([ListWorkerConfigurations] -> ShowS)
-> Show ListWorkerConfigurations
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListWorkerConfigurations] -> ShowS
$cshowList :: [ListWorkerConfigurations] -> ShowS
show :: ListWorkerConfigurations -> String
$cshow :: ListWorkerConfigurations -> String
showsPrec :: Int -> ListWorkerConfigurations -> ShowS
$cshowsPrec :: Int -> ListWorkerConfigurations -> ShowS
Prelude.Show, (forall x.
 ListWorkerConfigurations -> Rep ListWorkerConfigurations x)
-> (forall x.
    Rep ListWorkerConfigurations x -> ListWorkerConfigurations)
-> Generic ListWorkerConfigurations
forall x.
Rep ListWorkerConfigurations x -> ListWorkerConfigurations
forall x.
ListWorkerConfigurations -> Rep ListWorkerConfigurations x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListWorkerConfigurations x -> ListWorkerConfigurations
$cfrom :: forall x.
ListWorkerConfigurations -> Rep ListWorkerConfigurations x
Prelude.Generic)

-- |
-- Create a value of 'ListWorkerConfigurations' 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', 'listWorkerConfigurations_nextToken' - If the response of a ListWorkerConfigurations operation is truncated, it
-- will include a NextToken. Send this NextToken in a subsequent request to
-- continue listing from where the previous operation left off.
--
-- 'maxResults', 'listWorkerConfigurations_maxResults' - The maximum number of worker configurations to list in one response.
newListWorkerConfigurations ::
  ListWorkerConfigurations
newListWorkerConfigurations :: ListWorkerConfigurations
newListWorkerConfigurations =
  ListWorkerConfigurations' :: Maybe Text -> Maybe Natural -> ListWorkerConfigurations
ListWorkerConfigurations'
    { $sel:nextToken:ListWorkerConfigurations' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListWorkerConfigurations' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

-- | If the response of a ListWorkerConfigurations operation is truncated, it
-- will include a NextToken. Send this NextToken in a subsequent request to
-- continue listing from where the previous operation left off.
listWorkerConfigurations_nextToken :: Lens.Lens' ListWorkerConfigurations (Prelude.Maybe Prelude.Text)
listWorkerConfigurations_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListWorkerConfigurations -> f ListWorkerConfigurations
listWorkerConfigurations_nextToken = (ListWorkerConfigurations -> Maybe Text)
-> (ListWorkerConfigurations
    -> Maybe Text -> ListWorkerConfigurations)
-> Lens
     ListWorkerConfigurations
     ListWorkerConfigurations
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListWorkerConfigurations' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListWorkerConfigurations' :: ListWorkerConfigurations -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListWorkerConfigurations
s@ListWorkerConfigurations' {} Maybe Text
a -> ListWorkerConfigurations
s {$sel:nextToken:ListWorkerConfigurations' :: Maybe Text
nextToken = Maybe Text
a} :: ListWorkerConfigurations)

-- | The maximum number of worker configurations to list in one response.
listWorkerConfigurations_maxResults :: Lens.Lens' ListWorkerConfigurations (Prelude.Maybe Prelude.Natural)
listWorkerConfigurations_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListWorkerConfigurations -> f ListWorkerConfigurations
listWorkerConfigurations_maxResults = (ListWorkerConfigurations -> Maybe Natural)
-> (ListWorkerConfigurations
    -> Maybe Natural -> ListWorkerConfigurations)
-> Lens
     ListWorkerConfigurations
     ListWorkerConfigurations
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListWorkerConfigurations' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListWorkerConfigurations' :: ListWorkerConfigurations -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListWorkerConfigurations
s@ListWorkerConfigurations' {} Maybe Natural
a -> ListWorkerConfigurations
s {$sel:maxResults:ListWorkerConfigurations' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListWorkerConfigurations)

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

instance Prelude.NFData ListWorkerConfigurations

instance Core.ToHeaders ListWorkerConfigurations where
  toHeaders :: ListWorkerConfigurations -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListWorkerConfigurations -> 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 ListWorkerConfigurations where
  toPath :: ListWorkerConfigurations -> ByteString
toPath = ByteString -> ListWorkerConfigurations -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/v1/worker-configurations"

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

-- | /See:/ 'newListWorkerConfigurationsResponse' smart constructor.
data ListWorkerConfigurationsResponse = ListWorkerConfigurationsResponse'
  { -- | An array of worker configuration descriptions.
    ListWorkerConfigurationsResponse
-> Maybe [WorkerConfigurationSummary]
workerConfigurations :: Prelude.Maybe [WorkerConfigurationSummary],
    -- | If the response of a ListWorkerConfigurations operation is truncated, it
    -- will include a NextToken. Send this NextToken in a subsequent request to
    -- continue listing from where the previous operation left off.
    ListWorkerConfigurationsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListWorkerConfigurationsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListWorkerConfigurationsResponse
-> ListWorkerConfigurationsResponse -> Bool
(ListWorkerConfigurationsResponse
 -> ListWorkerConfigurationsResponse -> Bool)
-> (ListWorkerConfigurationsResponse
    -> ListWorkerConfigurationsResponse -> Bool)
-> Eq ListWorkerConfigurationsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListWorkerConfigurationsResponse
-> ListWorkerConfigurationsResponse -> Bool
$c/= :: ListWorkerConfigurationsResponse
-> ListWorkerConfigurationsResponse -> Bool
== :: ListWorkerConfigurationsResponse
-> ListWorkerConfigurationsResponse -> Bool
$c== :: ListWorkerConfigurationsResponse
-> ListWorkerConfigurationsResponse -> Bool
Prelude.Eq, ReadPrec [ListWorkerConfigurationsResponse]
ReadPrec ListWorkerConfigurationsResponse
Int -> ReadS ListWorkerConfigurationsResponse
ReadS [ListWorkerConfigurationsResponse]
(Int -> ReadS ListWorkerConfigurationsResponse)
-> ReadS [ListWorkerConfigurationsResponse]
-> ReadPrec ListWorkerConfigurationsResponse
-> ReadPrec [ListWorkerConfigurationsResponse]
-> Read ListWorkerConfigurationsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListWorkerConfigurationsResponse]
$creadListPrec :: ReadPrec [ListWorkerConfigurationsResponse]
readPrec :: ReadPrec ListWorkerConfigurationsResponse
$creadPrec :: ReadPrec ListWorkerConfigurationsResponse
readList :: ReadS [ListWorkerConfigurationsResponse]
$creadList :: ReadS [ListWorkerConfigurationsResponse]
readsPrec :: Int -> ReadS ListWorkerConfigurationsResponse
$creadsPrec :: Int -> ReadS ListWorkerConfigurationsResponse
Prelude.Read, Int -> ListWorkerConfigurationsResponse -> ShowS
[ListWorkerConfigurationsResponse] -> ShowS
ListWorkerConfigurationsResponse -> String
(Int -> ListWorkerConfigurationsResponse -> ShowS)
-> (ListWorkerConfigurationsResponse -> String)
-> ([ListWorkerConfigurationsResponse] -> ShowS)
-> Show ListWorkerConfigurationsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListWorkerConfigurationsResponse] -> ShowS
$cshowList :: [ListWorkerConfigurationsResponse] -> ShowS
show :: ListWorkerConfigurationsResponse -> String
$cshow :: ListWorkerConfigurationsResponse -> String
showsPrec :: Int -> ListWorkerConfigurationsResponse -> ShowS
$cshowsPrec :: Int -> ListWorkerConfigurationsResponse -> ShowS
Prelude.Show, (forall x.
 ListWorkerConfigurationsResponse
 -> Rep ListWorkerConfigurationsResponse x)
-> (forall x.
    Rep ListWorkerConfigurationsResponse x
    -> ListWorkerConfigurationsResponse)
-> Generic ListWorkerConfigurationsResponse
forall x.
Rep ListWorkerConfigurationsResponse x
-> ListWorkerConfigurationsResponse
forall x.
ListWorkerConfigurationsResponse
-> Rep ListWorkerConfigurationsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListWorkerConfigurationsResponse x
-> ListWorkerConfigurationsResponse
$cfrom :: forall x.
ListWorkerConfigurationsResponse
-> Rep ListWorkerConfigurationsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListWorkerConfigurationsResponse' 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:
--
-- 'workerConfigurations', 'listWorkerConfigurationsResponse_workerConfigurations' - An array of worker configuration descriptions.
--
-- 'nextToken', 'listWorkerConfigurationsResponse_nextToken' - If the response of a ListWorkerConfigurations operation is truncated, it
-- will include a NextToken. Send this NextToken in a subsequent request to
-- continue listing from where the previous operation left off.
--
-- 'httpStatus', 'listWorkerConfigurationsResponse_httpStatus' - The response's http status code.
newListWorkerConfigurationsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListWorkerConfigurationsResponse
newListWorkerConfigurationsResponse :: Int -> ListWorkerConfigurationsResponse
newListWorkerConfigurationsResponse Int
pHttpStatus_ =
  ListWorkerConfigurationsResponse' :: Maybe [WorkerConfigurationSummary]
-> Maybe Text -> Int -> ListWorkerConfigurationsResponse
ListWorkerConfigurationsResponse'
    { $sel:workerConfigurations:ListWorkerConfigurationsResponse' :: Maybe [WorkerConfigurationSummary]
workerConfigurations =
        Maybe [WorkerConfigurationSummary]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListWorkerConfigurationsResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListWorkerConfigurationsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | An array of worker configuration descriptions.
listWorkerConfigurationsResponse_workerConfigurations :: Lens.Lens' ListWorkerConfigurationsResponse (Prelude.Maybe [WorkerConfigurationSummary])
listWorkerConfigurationsResponse_workerConfigurations :: (Maybe [WorkerConfigurationSummary]
 -> f (Maybe [WorkerConfigurationSummary]))
-> ListWorkerConfigurationsResponse
-> f ListWorkerConfigurationsResponse
listWorkerConfigurationsResponse_workerConfigurations = (ListWorkerConfigurationsResponse
 -> Maybe [WorkerConfigurationSummary])
-> (ListWorkerConfigurationsResponse
    -> Maybe [WorkerConfigurationSummary]
    -> ListWorkerConfigurationsResponse)
-> Lens'
     ListWorkerConfigurationsResponse
     (Maybe [WorkerConfigurationSummary])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListWorkerConfigurationsResponse' {Maybe [WorkerConfigurationSummary]
workerConfigurations :: Maybe [WorkerConfigurationSummary]
$sel:workerConfigurations:ListWorkerConfigurationsResponse' :: ListWorkerConfigurationsResponse
-> Maybe [WorkerConfigurationSummary]
workerConfigurations} -> Maybe [WorkerConfigurationSummary]
workerConfigurations) (\s :: ListWorkerConfigurationsResponse
s@ListWorkerConfigurationsResponse' {} Maybe [WorkerConfigurationSummary]
a -> ListWorkerConfigurationsResponse
s {$sel:workerConfigurations:ListWorkerConfigurationsResponse' :: Maybe [WorkerConfigurationSummary]
workerConfigurations = Maybe [WorkerConfigurationSummary]
a} :: ListWorkerConfigurationsResponse) ((Maybe [WorkerConfigurationSummary]
  -> f (Maybe [WorkerConfigurationSummary]))
 -> ListWorkerConfigurationsResponse
 -> f ListWorkerConfigurationsResponse)
-> ((Maybe [WorkerConfigurationSummary]
     -> f (Maybe [WorkerConfigurationSummary]))
    -> Maybe [WorkerConfigurationSummary]
    -> f (Maybe [WorkerConfigurationSummary]))
-> (Maybe [WorkerConfigurationSummary]
    -> f (Maybe [WorkerConfigurationSummary]))
-> ListWorkerConfigurationsResponse
-> f ListWorkerConfigurationsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [WorkerConfigurationSummary]
  [WorkerConfigurationSummary]
  [WorkerConfigurationSummary]
  [WorkerConfigurationSummary]
-> Iso
     (Maybe [WorkerConfigurationSummary])
     (Maybe [WorkerConfigurationSummary])
     (Maybe [WorkerConfigurationSummary])
     (Maybe [WorkerConfigurationSummary])
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
  [WorkerConfigurationSummary]
  [WorkerConfigurationSummary]
  [WorkerConfigurationSummary]
  [WorkerConfigurationSummary]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | If the response of a ListWorkerConfigurations operation is truncated, it
-- will include a NextToken. Send this NextToken in a subsequent request to
-- continue listing from where the previous operation left off.
listWorkerConfigurationsResponse_nextToken :: Lens.Lens' ListWorkerConfigurationsResponse (Prelude.Maybe Prelude.Text)
listWorkerConfigurationsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListWorkerConfigurationsResponse
-> f ListWorkerConfigurationsResponse
listWorkerConfigurationsResponse_nextToken = (ListWorkerConfigurationsResponse -> Maybe Text)
-> (ListWorkerConfigurationsResponse
    -> Maybe Text -> ListWorkerConfigurationsResponse)
-> Lens' ListWorkerConfigurationsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListWorkerConfigurationsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListWorkerConfigurationsResponse' :: ListWorkerConfigurationsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListWorkerConfigurationsResponse
s@ListWorkerConfigurationsResponse' {} Maybe Text
a -> ListWorkerConfigurationsResponse
s {$sel:nextToken:ListWorkerConfigurationsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListWorkerConfigurationsResponse)

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

instance
  Prelude.NFData
    ListWorkerConfigurationsResponse