{-# 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.GreengrassV2.ListComponents
-- 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)
--
-- Retrieves a paginated list of component summaries. This list includes
-- components that you have permission to view.
--
-- This operation returns paginated results.
module Amazonka.GreengrassV2.ListComponents
  ( -- * Creating a Request
    ListComponents (..),
    newListComponents,

    -- * Request Lenses
    listComponents_nextToken,
    listComponents_scope,
    listComponents_maxResults,

    -- * Destructuring the Response
    ListComponentsResponse (..),
    newListComponentsResponse,

    -- * Response Lenses
    listComponentsResponse_components,
    listComponentsResponse_nextToken,
    listComponentsResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.GreengrassV2.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:/ 'newListComponents' smart constructor.
data ListComponents = ListComponents'
  { -- | The token to be used for the next set of paginated results.
    ListComponents -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The scope of the components to list.
    --
    -- Default: @PRIVATE@
    ListComponents -> Maybe ComponentVisibilityScope
scope :: Prelude.Maybe ComponentVisibilityScope,
    -- | The maximum number of results to be returned per paginated request.
    ListComponents -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural
  }
  deriving (ListComponents -> ListComponents -> Bool
(ListComponents -> ListComponents -> Bool)
-> (ListComponents -> ListComponents -> Bool) -> Eq ListComponents
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListComponents -> ListComponents -> Bool
$c/= :: ListComponents -> ListComponents -> Bool
== :: ListComponents -> ListComponents -> Bool
$c== :: ListComponents -> ListComponents -> Bool
Prelude.Eq, ReadPrec [ListComponents]
ReadPrec ListComponents
Int -> ReadS ListComponents
ReadS [ListComponents]
(Int -> ReadS ListComponents)
-> ReadS [ListComponents]
-> ReadPrec ListComponents
-> ReadPrec [ListComponents]
-> Read ListComponents
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListComponents]
$creadListPrec :: ReadPrec [ListComponents]
readPrec :: ReadPrec ListComponents
$creadPrec :: ReadPrec ListComponents
readList :: ReadS [ListComponents]
$creadList :: ReadS [ListComponents]
readsPrec :: Int -> ReadS ListComponents
$creadsPrec :: Int -> ReadS ListComponents
Prelude.Read, Int -> ListComponents -> ShowS
[ListComponents] -> ShowS
ListComponents -> String
(Int -> ListComponents -> ShowS)
-> (ListComponents -> String)
-> ([ListComponents] -> ShowS)
-> Show ListComponents
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListComponents] -> ShowS
$cshowList :: [ListComponents] -> ShowS
show :: ListComponents -> String
$cshow :: ListComponents -> String
showsPrec :: Int -> ListComponents -> ShowS
$cshowsPrec :: Int -> ListComponents -> ShowS
Prelude.Show, (forall x. ListComponents -> Rep ListComponents x)
-> (forall x. Rep ListComponents x -> ListComponents)
-> Generic ListComponents
forall x. Rep ListComponents x -> ListComponents
forall x. ListComponents -> Rep ListComponents x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListComponents x -> ListComponents
$cfrom :: forall x. ListComponents -> Rep ListComponents x
Prelude.Generic)

-- |
-- Create a value of 'ListComponents' 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', 'listComponents_nextToken' - The token to be used for the next set of paginated results.
--
-- 'scope', 'listComponents_scope' - The scope of the components to list.
--
-- Default: @PRIVATE@
--
-- 'maxResults', 'listComponents_maxResults' - The maximum number of results to be returned per paginated request.
newListComponents ::
  ListComponents
newListComponents :: ListComponents
newListComponents =
  ListComponents' :: Maybe Text
-> Maybe ComponentVisibilityScope
-> Maybe Natural
-> ListComponents
ListComponents'
    { $sel:nextToken:ListComponents' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:scope:ListComponents' :: Maybe ComponentVisibilityScope
scope = Maybe ComponentVisibilityScope
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListComponents' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

-- | The token to be used for the next set of paginated results.
listComponents_nextToken :: Lens.Lens' ListComponents (Prelude.Maybe Prelude.Text)
listComponents_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListComponents -> f ListComponents
listComponents_nextToken = (ListComponents -> Maybe Text)
-> (ListComponents -> Maybe Text -> ListComponents)
-> Lens ListComponents ListComponents (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListComponents' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListComponents' :: ListComponents -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListComponents
s@ListComponents' {} Maybe Text
a -> ListComponents
s {$sel:nextToken:ListComponents' :: Maybe Text
nextToken = Maybe Text
a} :: ListComponents)

-- | The scope of the components to list.
--
-- Default: @PRIVATE@
listComponents_scope :: Lens.Lens' ListComponents (Prelude.Maybe ComponentVisibilityScope)
listComponents_scope :: (Maybe ComponentVisibilityScope
 -> f (Maybe ComponentVisibilityScope))
-> ListComponents -> f ListComponents
listComponents_scope = (ListComponents -> Maybe ComponentVisibilityScope)
-> (ListComponents
    -> Maybe ComponentVisibilityScope -> ListComponents)
-> Lens
     ListComponents
     ListComponents
     (Maybe ComponentVisibilityScope)
     (Maybe ComponentVisibilityScope)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListComponents' {Maybe ComponentVisibilityScope
scope :: Maybe ComponentVisibilityScope
$sel:scope:ListComponents' :: ListComponents -> Maybe ComponentVisibilityScope
scope} -> Maybe ComponentVisibilityScope
scope) (\s :: ListComponents
s@ListComponents' {} Maybe ComponentVisibilityScope
a -> ListComponents
s {$sel:scope:ListComponents' :: Maybe ComponentVisibilityScope
scope = Maybe ComponentVisibilityScope
a} :: ListComponents)

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

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

instance Prelude.NFData ListComponents

instance Core.ToHeaders ListComponents where
  toHeaders :: ListComponents -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListComponents -> 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 ListComponents where
  toPath :: ListComponents -> ByteString
toPath = ByteString -> ListComponents -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/greengrass/v2/components"

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

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

-- |
-- Create a value of 'ListComponentsResponse' 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:
--
-- 'components', 'listComponentsResponse_components' - A list that summarizes each component.
--
-- 'nextToken', 'listComponentsResponse_nextToken' - The token for the next set of results, or null if there are no
-- additional results.
--
-- 'httpStatus', 'listComponentsResponse_httpStatus' - The response's http status code.
newListComponentsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListComponentsResponse
newListComponentsResponse :: Int -> ListComponentsResponse
newListComponentsResponse Int
pHttpStatus_ =
  ListComponentsResponse' :: Maybe [Component] -> Maybe Text -> Int -> ListComponentsResponse
ListComponentsResponse'
    { $sel:components:ListComponentsResponse' :: Maybe [Component]
components =
        Maybe [Component]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListComponentsResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListComponentsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A list that summarizes each component.
listComponentsResponse_components :: Lens.Lens' ListComponentsResponse (Prelude.Maybe [Component])
listComponentsResponse_components :: (Maybe [Component] -> f (Maybe [Component]))
-> ListComponentsResponse -> f ListComponentsResponse
listComponentsResponse_components = (ListComponentsResponse -> Maybe [Component])
-> (ListComponentsResponse
    -> Maybe [Component] -> ListComponentsResponse)
-> Lens' ListComponentsResponse (Maybe [Component])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListComponentsResponse' {Maybe [Component]
components :: Maybe [Component]
$sel:components:ListComponentsResponse' :: ListComponentsResponse -> Maybe [Component]
components} -> Maybe [Component]
components) (\s :: ListComponentsResponse
s@ListComponentsResponse' {} Maybe [Component]
a -> ListComponentsResponse
s {$sel:components:ListComponentsResponse' :: Maybe [Component]
components = Maybe [Component]
a} :: ListComponentsResponse) ((Maybe [Component] -> f (Maybe [Component]))
 -> ListComponentsResponse -> f ListComponentsResponse)
-> ((Maybe [Component] -> f (Maybe [Component]))
    -> Maybe [Component] -> f (Maybe [Component]))
-> (Maybe [Component] -> f (Maybe [Component]))
-> ListComponentsResponse
-> f ListComponentsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Component] [Component] [Component] [Component]
-> Iso
     (Maybe [Component])
     (Maybe [Component])
     (Maybe [Component])
     (Maybe [Component])
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 [Component] [Component] [Component] [Component]
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.
listComponentsResponse_nextToken :: Lens.Lens' ListComponentsResponse (Prelude.Maybe Prelude.Text)
listComponentsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListComponentsResponse -> f ListComponentsResponse
listComponentsResponse_nextToken = (ListComponentsResponse -> Maybe Text)
-> (ListComponentsResponse -> Maybe Text -> ListComponentsResponse)
-> Lens' ListComponentsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListComponentsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListComponentsResponse' :: ListComponentsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListComponentsResponse
s@ListComponentsResponse' {} Maybe Text
a -> ListComponentsResponse
s {$sel:nextToken:ListComponentsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListComponentsResponse)

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

instance Prelude.NFData ListComponentsResponse