{-# 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.IVS.ListPlaybackKeyPairs
-- 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)
--
-- Gets summary information about playback key pairs. For more information,
-- see
-- <https://docs.aws.amazon.com/ivs/latest/userguide/private-channels.html Setting Up Private Channels>
-- in the /Amazon IVS User Guide/.
--
-- This operation returns paginated results.
module Amazonka.IVS.ListPlaybackKeyPairs
  ( -- * Creating a Request
    ListPlaybackKeyPairs (..),
    newListPlaybackKeyPairs,

    -- * Request Lenses
    listPlaybackKeyPairs_nextToken,
    listPlaybackKeyPairs_maxResults,

    -- * Destructuring the Response
    ListPlaybackKeyPairsResponse (..),
    newListPlaybackKeyPairsResponse,

    -- * Response Lenses
    listPlaybackKeyPairsResponse_nextToken,
    listPlaybackKeyPairsResponse_httpStatus,
    listPlaybackKeyPairsResponse_keyPairs,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.IVS.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:/ 'newListPlaybackKeyPairs' smart constructor.
data ListPlaybackKeyPairs = ListPlaybackKeyPairs'
  { -- | Maximum number of key pairs to return.
    ListPlaybackKeyPairs -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The first key pair to retrieve. This is used for pagination; see the
    -- @nextToken@ response field. Default: 50.
    ListPlaybackKeyPairs -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural
  }
  deriving (ListPlaybackKeyPairs -> ListPlaybackKeyPairs -> Bool
(ListPlaybackKeyPairs -> ListPlaybackKeyPairs -> Bool)
-> (ListPlaybackKeyPairs -> ListPlaybackKeyPairs -> Bool)
-> Eq ListPlaybackKeyPairs
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListPlaybackKeyPairs -> ListPlaybackKeyPairs -> Bool
$c/= :: ListPlaybackKeyPairs -> ListPlaybackKeyPairs -> Bool
== :: ListPlaybackKeyPairs -> ListPlaybackKeyPairs -> Bool
$c== :: ListPlaybackKeyPairs -> ListPlaybackKeyPairs -> Bool
Prelude.Eq, ReadPrec [ListPlaybackKeyPairs]
ReadPrec ListPlaybackKeyPairs
Int -> ReadS ListPlaybackKeyPairs
ReadS [ListPlaybackKeyPairs]
(Int -> ReadS ListPlaybackKeyPairs)
-> ReadS [ListPlaybackKeyPairs]
-> ReadPrec ListPlaybackKeyPairs
-> ReadPrec [ListPlaybackKeyPairs]
-> Read ListPlaybackKeyPairs
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListPlaybackKeyPairs]
$creadListPrec :: ReadPrec [ListPlaybackKeyPairs]
readPrec :: ReadPrec ListPlaybackKeyPairs
$creadPrec :: ReadPrec ListPlaybackKeyPairs
readList :: ReadS [ListPlaybackKeyPairs]
$creadList :: ReadS [ListPlaybackKeyPairs]
readsPrec :: Int -> ReadS ListPlaybackKeyPairs
$creadsPrec :: Int -> ReadS ListPlaybackKeyPairs
Prelude.Read, Int -> ListPlaybackKeyPairs -> ShowS
[ListPlaybackKeyPairs] -> ShowS
ListPlaybackKeyPairs -> String
(Int -> ListPlaybackKeyPairs -> ShowS)
-> (ListPlaybackKeyPairs -> String)
-> ([ListPlaybackKeyPairs] -> ShowS)
-> Show ListPlaybackKeyPairs
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListPlaybackKeyPairs] -> ShowS
$cshowList :: [ListPlaybackKeyPairs] -> ShowS
show :: ListPlaybackKeyPairs -> String
$cshow :: ListPlaybackKeyPairs -> String
showsPrec :: Int -> ListPlaybackKeyPairs -> ShowS
$cshowsPrec :: Int -> ListPlaybackKeyPairs -> ShowS
Prelude.Show, (forall x. ListPlaybackKeyPairs -> Rep ListPlaybackKeyPairs x)
-> (forall x. Rep ListPlaybackKeyPairs x -> ListPlaybackKeyPairs)
-> Generic ListPlaybackKeyPairs
forall x. Rep ListPlaybackKeyPairs x -> ListPlaybackKeyPairs
forall x. ListPlaybackKeyPairs -> Rep ListPlaybackKeyPairs x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListPlaybackKeyPairs x -> ListPlaybackKeyPairs
$cfrom :: forall x. ListPlaybackKeyPairs -> Rep ListPlaybackKeyPairs x
Prelude.Generic)

-- |
-- Create a value of 'ListPlaybackKeyPairs' 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', 'listPlaybackKeyPairs_nextToken' - Maximum number of key pairs to return.
--
-- 'maxResults', 'listPlaybackKeyPairs_maxResults' - The first key pair to retrieve. This is used for pagination; see the
-- @nextToken@ response field. Default: 50.
newListPlaybackKeyPairs ::
  ListPlaybackKeyPairs
newListPlaybackKeyPairs :: ListPlaybackKeyPairs
newListPlaybackKeyPairs =
  ListPlaybackKeyPairs' :: Maybe Text -> Maybe Natural -> ListPlaybackKeyPairs
ListPlaybackKeyPairs'
    { $sel:nextToken:ListPlaybackKeyPairs' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListPlaybackKeyPairs' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

-- | Maximum number of key pairs to return.
listPlaybackKeyPairs_nextToken :: Lens.Lens' ListPlaybackKeyPairs (Prelude.Maybe Prelude.Text)
listPlaybackKeyPairs_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListPlaybackKeyPairs -> f ListPlaybackKeyPairs
listPlaybackKeyPairs_nextToken = (ListPlaybackKeyPairs -> Maybe Text)
-> (ListPlaybackKeyPairs -> Maybe Text -> ListPlaybackKeyPairs)
-> Lens
     ListPlaybackKeyPairs ListPlaybackKeyPairs (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPlaybackKeyPairs' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListPlaybackKeyPairs' :: ListPlaybackKeyPairs -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListPlaybackKeyPairs
s@ListPlaybackKeyPairs' {} Maybe Text
a -> ListPlaybackKeyPairs
s {$sel:nextToken:ListPlaybackKeyPairs' :: Maybe Text
nextToken = Maybe Text
a} :: ListPlaybackKeyPairs)

-- | The first key pair to retrieve. This is used for pagination; see the
-- @nextToken@ response field. Default: 50.
listPlaybackKeyPairs_maxResults :: Lens.Lens' ListPlaybackKeyPairs (Prelude.Maybe Prelude.Natural)
listPlaybackKeyPairs_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListPlaybackKeyPairs -> f ListPlaybackKeyPairs
listPlaybackKeyPairs_maxResults = (ListPlaybackKeyPairs -> Maybe Natural)
-> (ListPlaybackKeyPairs -> Maybe Natural -> ListPlaybackKeyPairs)
-> Lens
     ListPlaybackKeyPairs
     ListPlaybackKeyPairs
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPlaybackKeyPairs' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListPlaybackKeyPairs' :: ListPlaybackKeyPairs -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListPlaybackKeyPairs
s@ListPlaybackKeyPairs' {} Maybe Natural
a -> ListPlaybackKeyPairs
s {$sel:maxResults:ListPlaybackKeyPairs' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListPlaybackKeyPairs)

instance Core.AWSPager ListPlaybackKeyPairs where
  page :: ListPlaybackKeyPairs
-> AWSResponse ListPlaybackKeyPairs -> Maybe ListPlaybackKeyPairs
page ListPlaybackKeyPairs
rq AWSResponse ListPlaybackKeyPairs
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListPlaybackKeyPairs
ListPlaybackKeyPairsResponse
rs
            ListPlaybackKeyPairsResponse
-> Getting (First Text) ListPlaybackKeyPairsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListPlaybackKeyPairsResponse
-> Const (First Text) ListPlaybackKeyPairsResponse
Lens' ListPlaybackKeyPairsResponse (Maybe Text)
listPlaybackKeyPairsResponse_nextToken
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListPlaybackKeyPairsResponse
 -> Const (First Text) ListPlaybackKeyPairsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListPlaybackKeyPairsResponse 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 ListPlaybackKeyPairs
forall a. Maybe a
Prelude.Nothing
    | [PlaybackKeyPairSummary] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        (AWSResponse ListPlaybackKeyPairs
ListPlaybackKeyPairsResponse
rs ListPlaybackKeyPairsResponse
-> Getting
     [PlaybackKeyPairSummary]
     ListPlaybackKeyPairsResponse
     [PlaybackKeyPairSummary]
-> [PlaybackKeyPairSummary]
forall s a. s -> Getting a s a -> a
Lens.^. Getting
  [PlaybackKeyPairSummary]
  ListPlaybackKeyPairsResponse
  [PlaybackKeyPairSummary]
Lens' ListPlaybackKeyPairsResponse [PlaybackKeyPairSummary]
listPlaybackKeyPairsResponse_keyPairs) =
      Maybe ListPlaybackKeyPairs
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      ListPlaybackKeyPairs -> Maybe ListPlaybackKeyPairs
forall a. a -> Maybe a
Prelude.Just (ListPlaybackKeyPairs -> Maybe ListPlaybackKeyPairs)
-> ListPlaybackKeyPairs -> Maybe ListPlaybackKeyPairs
forall a b. (a -> b) -> a -> b
Prelude.$
        ListPlaybackKeyPairs
rq
          ListPlaybackKeyPairs
-> (ListPlaybackKeyPairs -> ListPlaybackKeyPairs)
-> ListPlaybackKeyPairs
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListPlaybackKeyPairs -> Identity ListPlaybackKeyPairs
Lens
  ListPlaybackKeyPairs ListPlaybackKeyPairs (Maybe Text) (Maybe Text)
listPlaybackKeyPairs_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> ListPlaybackKeyPairs -> Identity ListPlaybackKeyPairs)
-> Maybe Text -> ListPlaybackKeyPairs -> ListPlaybackKeyPairs
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListPlaybackKeyPairs
ListPlaybackKeyPairsResponse
rs
          ListPlaybackKeyPairsResponse
-> Getting (First Text) ListPlaybackKeyPairsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListPlaybackKeyPairsResponse
-> Const (First Text) ListPlaybackKeyPairsResponse
Lens' ListPlaybackKeyPairsResponse (Maybe Text)
listPlaybackKeyPairsResponse_nextToken
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListPlaybackKeyPairsResponse
 -> Const (First Text) ListPlaybackKeyPairsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListPlaybackKeyPairsResponse 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 ListPlaybackKeyPairs where
  type
    AWSResponse ListPlaybackKeyPairs =
      ListPlaybackKeyPairsResponse
  request :: ListPlaybackKeyPairs -> Request ListPlaybackKeyPairs
request = Service -> ListPlaybackKeyPairs -> Request ListPlaybackKeyPairs
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy ListPlaybackKeyPairs
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListPlaybackKeyPairs)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ListPlaybackKeyPairs))
-> Logger
-> Service
-> Proxy ListPlaybackKeyPairs
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListPlaybackKeyPairs)))
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 -> [PlaybackKeyPairSummary] -> ListPlaybackKeyPairsResponse
ListPlaybackKeyPairsResponse'
            (Maybe Text
 -> Int -> [PlaybackKeyPairSummary] -> ListPlaybackKeyPairsResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Int -> [PlaybackKeyPairSummary] -> ListPlaybackKeyPairsResponse)
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 -> [PlaybackKeyPairSummary] -> ListPlaybackKeyPairsResponse)
-> Either String Int
-> Either
     String ([PlaybackKeyPairSummary] -> ListPlaybackKeyPairsResponse)
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 ([PlaybackKeyPairSummary] -> ListPlaybackKeyPairsResponse)
-> Either String [PlaybackKeyPairSummary]
-> Either String ListPlaybackKeyPairsResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe [PlaybackKeyPairSummary])
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"keyPairs" Either String (Maybe [PlaybackKeyPairSummary])
-> [PlaybackKeyPairSummary]
-> Either String [PlaybackKeyPairSummary]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [PlaybackKeyPairSummary]
forall a. Monoid a => a
Prelude.mempty)
      )

instance Prelude.Hashable ListPlaybackKeyPairs

instance Prelude.NFData ListPlaybackKeyPairs

instance Core.ToHeaders ListPlaybackKeyPairs where
  toHeaders :: ListPlaybackKeyPairs -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListPlaybackKeyPairs -> 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.ToJSON ListPlaybackKeyPairs where
  toJSON :: ListPlaybackKeyPairs -> Value
toJSON ListPlaybackKeyPairs' {Maybe Natural
Maybe Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:maxResults:ListPlaybackKeyPairs' :: ListPlaybackKeyPairs -> Maybe Natural
$sel:nextToken:ListPlaybackKeyPairs' :: ListPlaybackKeyPairs -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"nextToken" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextToken,
            (Text
"maxResults" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxResults
          ]
      )

instance Core.ToPath ListPlaybackKeyPairs where
  toPath :: ListPlaybackKeyPairs -> ByteString
toPath = ByteString -> ListPlaybackKeyPairs -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/ListPlaybackKeyPairs"

instance Core.ToQuery ListPlaybackKeyPairs where
  toQuery :: ListPlaybackKeyPairs -> QueryString
toQuery = QueryString -> ListPlaybackKeyPairs -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newListPlaybackKeyPairsResponse' smart constructor.
data ListPlaybackKeyPairsResponse = ListPlaybackKeyPairsResponse'
  { -- | If there are more key pairs than @maxResults@, use @nextToken@ in the
    -- request to get the next set.
    ListPlaybackKeyPairsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListPlaybackKeyPairsResponse -> Int
httpStatus :: Prelude.Int,
    -- | List of key pairs.
    ListPlaybackKeyPairsResponse -> [PlaybackKeyPairSummary]
keyPairs :: [PlaybackKeyPairSummary]
  }
  deriving (ListPlaybackKeyPairsResponse
-> ListPlaybackKeyPairsResponse -> Bool
(ListPlaybackKeyPairsResponse
 -> ListPlaybackKeyPairsResponse -> Bool)
-> (ListPlaybackKeyPairsResponse
    -> ListPlaybackKeyPairsResponse -> Bool)
-> Eq ListPlaybackKeyPairsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListPlaybackKeyPairsResponse
-> ListPlaybackKeyPairsResponse -> Bool
$c/= :: ListPlaybackKeyPairsResponse
-> ListPlaybackKeyPairsResponse -> Bool
== :: ListPlaybackKeyPairsResponse
-> ListPlaybackKeyPairsResponse -> Bool
$c== :: ListPlaybackKeyPairsResponse
-> ListPlaybackKeyPairsResponse -> Bool
Prelude.Eq, ReadPrec [ListPlaybackKeyPairsResponse]
ReadPrec ListPlaybackKeyPairsResponse
Int -> ReadS ListPlaybackKeyPairsResponse
ReadS [ListPlaybackKeyPairsResponse]
(Int -> ReadS ListPlaybackKeyPairsResponse)
-> ReadS [ListPlaybackKeyPairsResponse]
-> ReadPrec ListPlaybackKeyPairsResponse
-> ReadPrec [ListPlaybackKeyPairsResponse]
-> Read ListPlaybackKeyPairsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListPlaybackKeyPairsResponse]
$creadListPrec :: ReadPrec [ListPlaybackKeyPairsResponse]
readPrec :: ReadPrec ListPlaybackKeyPairsResponse
$creadPrec :: ReadPrec ListPlaybackKeyPairsResponse
readList :: ReadS [ListPlaybackKeyPairsResponse]
$creadList :: ReadS [ListPlaybackKeyPairsResponse]
readsPrec :: Int -> ReadS ListPlaybackKeyPairsResponse
$creadsPrec :: Int -> ReadS ListPlaybackKeyPairsResponse
Prelude.Read, Int -> ListPlaybackKeyPairsResponse -> ShowS
[ListPlaybackKeyPairsResponse] -> ShowS
ListPlaybackKeyPairsResponse -> String
(Int -> ListPlaybackKeyPairsResponse -> ShowS)
-> (ListPlaybackKeyPairsResponse -> String)
-> ([ListPlaybackKeyPairsResponse] -> ShowS)
-> Show ListPlaybackKeyPairsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListPlaybackKeyPairsResponse] -> ShowS
$cshowList :: [ListPlaybackKeyPairsResponse] -> ShowS
show :: ListPlaybackKeyPairsResponse -> String
$cshow :: ListPlaybackKeyPairsResponse -> String
showsPrec :: Int -> ListPlaybackKeyPairsResponse -> ShowS
$cshowsPrec :: Int -> ListPlaybackKeyPairsResponse -> ShowS
Prelude.Show, (forall x.
 ListPlaybackKeyPairsResponse -> Rep ListPlaybackKeyPairsResponse x)
-> (forall x.
    Rep ListPlaybackKeyPairsResponse x -> ListPlaybackKeyPairsResponse)
-> Generic ListPlaybackKeyPairsResponse
forall x.
Rep ListPlaybackKeyPairsResponse x -> ListPlaybackKeyPairsResponse
forall x.
ListPlaybackKeyPairsResponse -> Rep ListPlaybackKeyPairsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListPlaybackKeyPairsResponse x -> ListPlaybackKeyPairsResponse
$cfrom :: forall x.
ListPlaybackKeyPairsResponse -> Rep ListPlaybackKeyPairsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListPlaybackKeyPairsResponse' 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', 'listPlaybackKeyPairsResponse_nextToken' - If there are more key pairs than @maxResults@, use @nextToken@ in the
-- request to get the next set.
--
-- 'httpStatus', 'listPlaybackKeyPairsResponse_httpStatus' - The response's http status code.
--
-- 'keyPairs', 'listPlaybackKeyPairsResponse_keyPairs' - List of key pairs.
newListPlaybackKeyPairsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListPlaybackKeyPairsResponse
newListPlaybackKeyPairsResponse :: Int -> ListPlaybackKeyPairsResponse
newListPlaybackKeyPairsResponse Int
pHttpStatus_ =
  ListPlaybackKeyPairsResponse' :: Maybe Text
-> Int -> [PlaybackKeyPairSummary] -> ListPlaybackKeyPairsResponse
ListPlaybackKeyPairsResponse'
    { $sel:nextToken:ListPlaybackKeyPairsResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListPlaybackKeyPairsResponse' :: Int
httpStatus = Int
pHttpStatus_,
      $sel:keyPairs:ListPlaybackKeyPairsResponse' :: [PlaybackKeyPairSummary]
keyPairs = [PlaybackKeyPairSummary]
forall a. Monoid a => a
Prelude.mempty
    }

-- | If there are more key pairs than @maxResults@, use @nextToken@ in the
-- request to get the next set.
listPlaybackKeyPairsResponse_nextToken :: Lens.Lens' ListPlaybackKeyPairsResponse (Prelude.Maybe Prelude.Text)
listPlaybackKeyPairsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListPlaybackKeyPairsResponse -> f ListPlaybackKeyPairsResponse
listPlaybackKeyPairsResponse_nextToken = (ListPlaybackKeyPairsResponse -> Maybe Text)
-> (ListPlaybackKeyPairsResponse
    -> Maybe Text -> ListPlaybackKeyPairsResponse)
-> Lens' ListPlaybackKeyPairsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPlaybackKeyPairsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListPlaybackKeyPairsResponse' :: ListPlaybackKeyPairsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListPlaybackKeyPairsResponse
s@ListPlaybackKeyPairsResponse' {} Maybe Text
a -> ListPlaybackKeyPairsResponse
s {$sel:nextToken:ListPlaybackKeyPairsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListPlaybackKeyPairsResponse)

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

-- | List of key pairs.
listPlaybackKeyPairsResponse_keyPairs :: Lens.Lens' ListPlaybackKeyPairsResponse [PlaybackKeyPairSummary]
listPlaybackKeyPairsResponse_keyPairs :: ([PlaybackKeyPairSummary] -> f [PlaybackKeyPairSummary])
-> ListPlaybackKeyPairsResponse -> f ListPlaybackKeyPairsResponse
listPlaybackKeyPairsResponse_keyPairs = (ListPlaybackKeyPairsResponse -> [PlaybackKeyPairSummary])
-> (ListPlaybackKeyPairsResponse
    -> [PlaybackKeyPairSummary] -> ListPlaybackKeyPairsResponse)
-> Lens' ListPlaybackKeyPairsResponse [PlaybackKeyPairSummary]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPlaybackKeyPairsResponse' {[PlaybackKeyPairSummary]
keyPairs :: [PlaybackKeyPairSummary]
$sel:keyPairs:ListPlaybackKeyPairsResponse' :: ListPlaybackKeyPairsResponse -> [PlaybackKeyPairSummary]
keyPairs} -> [PlaybackKeyPairSummary]
keyPairs) (\s :: ListPlaybackKeyPairsResponse
s@ListPlaybackKeyPairsResponse' {} [PlaybackKeyPairSummary]
a -> ListPlaybackKeyPairsResponse
s {$sel:keyPairs:ListPlaybackKeyPairsResponse' :: [PlaybackKeyPairSummary]
keyPairs = [PlaybackKeyPairSummary]
a} :: ListPlaybackKeyPairsResponse) (([PlaybackKeyPairSummary] -> f [PlaybackKeyPairSummary])
 -> ListPlaybackKeyPairsResponse -> f ListPlaybackKeyPairsResponse)
-> (([PlaybackKeyPairSummary] -> f [PlaybackKeyPairSummary])
    -> [PlaybackKeyPairSummary] -> f [PlaybackKeyPairSummary])
-> ([PlaybackKeyPairSummary] -> f [PlaybackKeyPairSummary])
-> ListPlaybackKeyPairsResponse
-> f ListPlaybackKeyPairsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([PlaybackKeyPairSummary] -> f [PlaybackKeyPairSummary])
-> [PlaybackKeyPairSummary] -> f [PlaybackKeyPairSummary]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Prelude.NFData ListPlaybackKeyPairsResponse