{-# 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.IoT1ClickProjects.ListPlacements
-- 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 placement(s) of a project.
--
-- This operation returns paginated results.
module Amazonka.IoT1ClickProjects.ListPlacements
  ( -- * Creating a Request
    ListPlacements (..),
    newListPlacements,

    -- * Request Lenses
    listPlacements_nextToken,
    listPlacements_maxResults,
    listPlacements_projectName,

    -- * Destructuring the Response
    ListPlacementsResponse (..),
    newListPlacementsResponse,

    -- * Response Lenses
    listPlacementsResponse_nextToken,
    listPlacementsResponse_httpStatus,
    listPlacementsResponse_placements,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.IoT1ClickProjects.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:/ 'newListPlacements' smart constructor.
data ListPlacements = ListPlacements'
  { -- | The token to retrieve the next set of results.
    ListPlacements -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of results to return per request. If not set, a
    -- default value of 100 is used.
    ListPlacements -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The project containing the placements to be listed.
    ListPlacements -> Text
projectName :: Prelude.Text
  }
  deriving (ListPlacements -> ListPlacements -> Bool
(ListPlacements -> ListPlacements -> Bool)
-> (ListPlacements -> ListPlacements -> Bool) -> Eq ListPlacements
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListPlacements -> ListPlacements -> Bool
$c/= :: ListPlacements -> ListPlacements -> Bool
== :: ListPlacements -> ListPlacements -> Bool
$c== :: ListPlacements -> ListPlacements -> Bool
Prelude.Eq, ReadPrec [ListPlacements]
ReadPrec ListPlacements
Int -> ReadS ListPlacements
ReadS [ListPlacements]
(Int -> ReadS ListPlacements)
-> ReadS [ListPlacements]
-> ReadPrec ListPlacements
-> ReadPrec [ListPlacements]
-> Read ListPlacements
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListPlacements]
$creadListPrec :: ReadPrec [ListPlacements]
readPrec :: ReadPrec ListPlacements
$creadPrec :: ReadPrec ListPlacements
readList :: ReadS [ListPlacements]
$creadList :: ReadS [ListPlacements]
readsPrec :: Int -> ReadS ListPlacements
$creadsPrec :: Int -> ReadS ListPlacements
Prelude.Read, Int -> ListPlacements -> ShowS
[ListPlacements] -> ShowS
ListPlacements -> String
(Int -> ListPlacements -> ShowS)
-> (ListPlacements -> String)
-> ([ListPlacements] -> ShowS)
-> Show ListPlacements
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListPlacements] -> ShowS
$cshowList :: [ListPlacements] -> ShowS
show :: ListPlacements -> String
$cshow :: ListPlacements -> String
showsPrec :: Int -> ListPlacements -> ShowS
$cshowsPrec :: Int -> ListPlacements -> ShowS
Prelude.Show, (forall x. ListPlacements -> Rep ListPlacements x)
-> (forall x. Rep ListPlacements x -> ListPlacements)
-> Generic ListPlacements
forall x. Rep ListPlacements x -> ListPlacements
forall x. ListPlacements -> Rep ListPlacements x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListPlacements x -> ListPlacements
$cfrom :: forall x. ListPlacements -> Rep ListPlacements x
Prelude.Generic)

-- |
-- Create a value of 'ListPlacements' 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', 'listPlacements_nextToken' - The token to retrieve the next set of results.
--
-- 'maxResults', 'listPlacements_maxResults' - The maximum number of results to return per request. If not set, a
-- default value of 100 is used.
--
-- 'projectName', 'listPlacements_projectName' - The project containing the placements to be listed.
newListPlacements ::
  -- | 'projectName'
  Prelude.Text ->
  ListPlacements
newListPlacements :: Text -> ListPlacements
newListPlacements Text
pProjectName_ =
  ListPlacements' :: Maybe Text -> Maybe Natural -> Text -> ListPlacements
ListPlacements'
    { $sel:nextToken:ListPlacements' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListPlacements' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:projectName:ListPlacements' :: Text
projectName = Text
pProjectName_
    }

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

-- | The maximum number of results to return per request. If not set, a
-- default value of 100 is used.
listPlacements_maxResults :: Lens.Lens' ListPlacements (Prelude.Maybe Prelude.Natural)
listPlacements_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListPlacements -> f ListPlacements
listPlacements_maxResults = (ListPlacements -> Maybe Natural)
-> (ListPlacements -> Maybe Natural -> ListPlacements)
-> Lens
     ListPlacements ListPlacements (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPlacements' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListPlacements' :: ListPlacements -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListPlacements
s@ListPlacements' {} Maybe Natural
a -> ListPlacements
s {$sel:maxResults:ListPlacements' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListPlacements)

-- | The project containing the placements to be listed.
listPlacements_projectName :: Lens.Lens' ListPlacements Prelude.Text
listPlacements_projectName :: (Text -> f Text) -> ListPlacements -> f ListPlacements
listPlacements_projectName = (ListPlacements -> Text)
-> (ListPlacements -> Text -> ListPlacements)
-> Lens ListPlacements ListPlacements Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPlacements' {Text
projectName :: Text
$sel:projectName:ListPlacements' :: ListPlacements -> Text
projectName} -> Text
projectName) (\s :: ListPlacements
s@ListPlacements' {} Text
a -> ListPlacements
s {$sel:projectName:ListPlacements' :: Text
projectName = Text
a} :: ListPlacements)

instance Core.AWSPager ListPlacements where
  page :: ListPlacements
-> AWSResponse ListPlacements -> Maybe ListPlacements
page ListPlacements
rq AWSResponse ListPlacements
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListPlacements
ListPlacementsResponse
rs
            ListPlacementsResponse
-> Getting (First Text) ListPlacementsResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListPlacementsResponse
-> Const (First Text) ListPlacementsResponse
Lens' ListPlacementsResponse (Maybe Text)
listPlacementsResponse_nextToken
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListPlacementsResponse
 -> Const (First Text) ListPlacementsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListPlacementsResponse 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 ListPlacements
forall a. Maybe a
Prelude.Nothing
    | [PlacementSummary] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        (AWSResponse ListPlacements
ListPlacementsResponse
rs ListPlacementsResponse
-> Getting
     [PlacementSummary] ListPlacementsResponse [PlacementSummary]
-> [PlacementSummary]
forall s a. s -> Getting a s a -> a
Lens.^. Getting
  [PlacementSummary] ListPlacementsResponse [PlacementSummary]
Lens' ListPlacementsResponse [PlacementSummary]
listPlacementsResponse_placements) =
      Maybe ListPlacements
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      ListPlacements -> Maybe ListPlacements
forall a. a -> Maybe a
Prelude.Just (ListPlacements -> Maybe ListPlacements)
-> ListPlacements -> Maybe ListPlacements
forall a b. (a -> b) -> a -> b
Prelude.$
        ListPlacements
rq
          ListPlacements
-> (ListPlacements -> ListPlacements) -> ListPlacements
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListPlacements -> Identity ListPlacements
Lens ListPlacements ListPlacements (Maybe Text) (Maybe Text)
listPlacements_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> ListPlacements -> Identity ListPlacements)
-> Maybe Text -> ListPlacements -> ListPlacements
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListPlacements
ListPlacementsResponse
rs
          ListPlacementsResponse
-> Getting (First Text) ListPlacementsResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListPlacementsResponse
-> Const (First Text) ListPlacementsResponse
Lens' ListPlacementsResponse (Maybe Text)
listPlacementsResponse_nextToken ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListPlacementsResponse
 -> Const (First Text) ListPlacementsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListPlacementsResponse 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 ListPlacements where
  type
    AWSResponse ListPlacements =
      ListPlacementsResponse
  request :: ListPlacements -> Request ListPlacements
request = Service -> ListPlacements -> Request ListPlacements
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy ListPlacements
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListPlacements)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ListPlacements))
-> Logger
-> Service
-> Proxy ListPlacements
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListPlacements)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text -> Int -> [PlacementSummary] -> ListPlacementsResponse
ListPlacementsResponse'
            (Maybe Text -> Int -> [PlacementSummary] -> ListPlacementsResponse)
-> Either String (Maybe Text)
-> Either
     String (Int -> [PlacementSummary] -> ListPlacementsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"nextToken")
            Either String (Int -> [PlacementSummary] -> ListPlacementsResponse)
-> Either String Int
-> Either String ([PlacementSummary] -> ListPlacementsResponse)
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))
            Either String ([PlacementSummary] -> ListPlacementsResponse)
-> Either String [PlacementSummary]
-> Either String ListPlacementsResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe [PlacementSummary])
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"placements" Either String (Maybe [PlacementSummary])
-> [PlacementSummary] -> Either String [PlacementSummary]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [PlacementSummary]
forall a. Monoid a => a
Prelude.mempty)
      )

instance Prelude.Hashable ListPlacements

instance Prelude.NFData ListPlacements

instance Core.ToHeaders ListPlacements where
  toHeaders :: ListPlacements -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListPlacements -> 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 ListPlacements where
  toPath :: ListPlacements -> ByteString
toPath ListPlacements' {Maybe Natural
Maybe Text
Text
projectName :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:projectName:ListPlacements' :: ListPlacements -> Text
$sel:maxResults:ListPlacements' :: ListPlacements -> Maybe Natural
$sel:nextToken:ListPlacements' :: ListPlacements -> Maybe Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/projects/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
projectName, ByteString
"/placements"]

instance Core.ToQuery ListPlacements where
  toQuery :: ListPlacements -> QueryString
toQuery ListPlacements' {Maybe Natural
Maybe Text
Text
projectName :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:projectName:ListPlacements' :: ListPlacements -> Text
$sel:maxResults:ListPlacements' :: ListPlacements -> Maybe Natural
$sel:nextToken:ListPlacements' :: ListPlacements -> 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:/ 'newListPlacementsResponse' smart constructor.
data ListPlacementsResponse = ListPlacementsResponse'
  { -- | The token used to retrieve the next set of results - will be effectively
    -- empty if there are no further results.
    ListPlacementsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListPlacementsResponse -> Int
httpStatus :: Prelude.Int,
    -- | An object listing the requested placements.
    ListPlacementsResponse -> [PlacementSummary]
placements :: [PlacementSummary]
  }
  deriving (ListPlacementsResponse -> ListPlacementsResponse -> Bool
(ListPlacementsResponse -> ListPlacementsResponse -> Bool)
-> (ListPlacementsResponse -> ListPlacementsResponse -> Bool)
-> Eq ListPlacementsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListPlacementsResponse -> ListPlacementsResponse -> Bool
$c/= :: ListPlacementsResponse -> ListPlacementsResponse -> Bool
== :: ListPlacementsResponse -> ListPlacementsResponse -> Bool
$c== :: ListPlacementsResponse -> ListPlacementsResponse -> Bool
Prelude.Eq, ReadPrec [ListPlacementsResponse]
ReadPrec ListPlacementsResponse
Int -> ReadS ListPlacementsResponse
ReadS [ListPlacementsResponse]
(Int -> ReadS ListPlacementsResponse)
-> ReadS [ListPlacementsResponse]
-> ReadPrec ListPlacementsResponse
-> ReadPrec [ListPlacementsResponse]
-> Read ListPlacementsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListPlacementsResponse]
$creadListPrec :: ReadPrec [ListPlacementsResponse]
readPrec :: ReadPrec ListPlacementsResponse
$creadPrec :: ReadPrec ListPlacementsResponse
readList :: ReadS [ListPlacementsResponse]
$creadList :: ReadS [ListPlacementsResponse]
readsPrec :: Int -> ReadS ListPlacementsResponse
$creadsPrec :: Int -> ReadS ListPlacementsResponse
Prelude.Read, Int -> ListPlacementsResponse -> ShowS
[ListPlacementsResponse] -> ShowS
ListPlacementsResponse -> String
(Int -> ListPlacementsResponse -> ShowS)
-> (ListPlacementsResponse -> String)
-> ([ListPlacementsResponse] -> ShowS)
-> Show ListPlacementsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListPlacementsResponse] -> ShowS
$cshowList :: [ListPlacementsResponse] -> ShowS
show :: ListPlacementsResponse -> String
$cshow :: ListPlacementsResponse -> String
showsPrec :: Int -> ListPlacementsResponse -> ShowS
$cshowsPrec :: Int -> ListPlacementsResponse -> ShowS
Prelude.Show, (forall x. ListPlacementsResponse -> Rep ListPlacementsResponse x)
-> (forall x.
    Rep ListPlacementsResponse x -> ListPlacementsResponse)
-> Generic ListPlacementsResponse
forall x. Rep ListPlacementsResponse x -> ListPlacementsResponse
forall x. ListPlacementsResponse -> Rep ListPlacementsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListPlacementsResponse x -> ListPlacementsResponse
$cfrom :: forall x. ListPlacementsResponse -> Rep ListPlacementsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListPlacementsResponse' 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', 'listPlacementsResponse_nextToken' - The token used to retrieve the next set of results - will be effectively
-- empty if there are no further results.
--
-- 'httpStatus', 'listPlacementsResponse_httpStatus' - The response's http status code.
--
-- 'placements', 'listPlacementsResponse_placements' - An object listing the requested placements.
newListPlacementsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListPlacementsResponse
newListPlacementsResponse :: Int -> ListPlacementsResponse
newListPlacementsResponse Int
pHttpStatus_ =
  ListPlacementsResponse' :: Maybe Text -> Int -> [PlacementSummary] -> ListPlacementsResponse
ListPlacementsResponse'
    { $sel:nextToken:ListPlacementsResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListPlacementsResponse' :: Int
httpStatus = Int
pHttpStatus_,
      $sel:placements:ListPlacementsResponse' :: [PlacementSummary]
placements = [PlacementSummary]
forall a. Monoid a => a
Prelude.mempty
    }

-- | The token used to retrieve the next set of results - will be effectively
-- empty if there are no further results.
listPlacementsResponse_nextToken :: Lens.Lens' ListPlacementsResponse (Prelude.Maybe Prelude.Text)
listPlacementsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListPlacementsResponse -> f ListPlacementsResponse
listPlacementsResponse_nextToken = (ListPlacementsResponse -> Maybe Text)
-> (ListPlacementsResponse -> Maybe Text -> ListPlacementsResponse)
-> Lens' ListPlacementsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPlacementsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListPlacementsResponse' :: ListPlacementsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListPlacementsResponse
s@ListPlacementsResponse' {} Maybe Text
a -> ListPlacementsResponse
s {$sel:nextToken:ListPlacementsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListPlacementsResponse)

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

-- | An object listing the requested placements.
listPlacementsResponse_placements :: Lens.Lens' ListPlacementsResponse [PlacementSummary]
listPlacementsResponse_placements :: ([PlacementSummary] -> f [PlacementSummary])
-> ListPlacementsResponse -> f ListPlacementsResponse
listPlacementsResponse_placements = (ListPlacementsResponse -> [PlacementSummary])
-> (ListPlacementsResponse
    -> [PlacementSummary] -> ListPlacementsResponse)
-> Lens' ListPlacementsResponse [PlacementSummary]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPlacementsResponse' {[PlacementSummary]
placements :: [PlacementSummary]
$sel:placements:ListPlacementsResponse' :: ListPlacementsResponse -> [PlacementSummary]
placements} -> [PlacementSummary]
placements) (\s :: ListPlacementsResponse
s@ListPlacementsResponse' {} [PlacementSummary]
a -> ListPlacementsResponse
s {$sel:placements:ListPlacementsResponse' :: [PlacementSummary]
placements = [PlacementSummary]
a} :: ListPlacementsResponse) (([PlacementSummary] -> f [PlacementSummary])
 -> ListPlacementsResponse -> f ListPlacementsResponse)
-> (([PlacementSummary] -> f [PlacementSummary])
    -> [PlacementSummary] -> f [PlacementSummary])
-> ([PlacementSummary] -> f [PlacementSummary])
-> ListPlacementsResponse
-> f ListPlacementsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([PlacementSummary] -> f [PlacementSummary])
-> [PlacementSummary] -> f [PlacementSummary]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Prelude.NFData ListPlacementsResponse