{-# 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.Connect.ListSecurityKeys
-- 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)
--
-- This API is in preview release for Amazon Connect and is subject to
-- change.
--
-- Returns a paginated list of all security keys associated with the
-- instance.
--
-- This operation returns paginated results.
module Amazonka.Connect.ListSecurityKeys
  ( -- * Creating a Request
    ListSecurityKeys (..),
    newListSecurityKeys,

    -- * Request Lenses
    listSecurityKeys_nextToken,
    listSecurityKeys_maxResults,
    listSecurityKeys_instanceId,

    -- * Destructuring the Response
    ListSecurityKeysResponse (..),
    newListSecurityKeysResponse,

    -- * Response Lenses
    listSecurityKeysResponse_nextToken,
    listSecurityKeysResponse_securityKeys,
    listSecurityKeysResponse_httpStatus,
  )
where

import Amazonka.Connect.Types
import qualified Amazonka.Core as Core
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:/ 'newListSecurityKeys' smart constructor.
data ListSecurityKeys = ListSecurityKeys'
  { -- | The token for the next set of results. Use the value returned in the
    -- previous response in the next request to retrieve the next set of
    -- results.
    ListSecurityKeys -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of results to return per page.
    ListSecurityKeys -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The identifier of the Amazon Connect instance. You can find the
    -- instanceId in the ARN of the instance.
    ListSecurityKeys -> Text
instanceId :: Prelude.Text
  }
  deriving (ListSecurityKeys -> ListSecurityKeys -> Bool
(ListSecurityKeys -> ListSecurityKeys -> Bool)
-> (ListSecurityKeys -> ListSecurityKeys -> Bool)
-> Eq ListSecurityKeys
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListSecurityKeys -> ListSecurityKeys -> Bool
$c/= :: ListSecurityKeys -> ListSecurityKeys -> Bool
== :: ListSecurityKeys -> ListSecurityKeys -> Bool
$c== :: ListSecurityKeys -> ListSecurityKeys -> Bool
Prelude.Eq, ReadPrec [ListSecurityKeys]
ReadPrec ListSecurityKeys
Int -> ReadS ListSecurityKeys
ReadS [ListSecurityKeys]
(Int -> ReadS ListSecurityKeys)
-> ReadS [ListSecurityKeys]
-> ReadPrec ListSecurityKeys
-> ReadPrec [ListSecurityKeys]
-> Read ListSecurityKeys
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListSecurityKeys]
$creadListPrec :: ReadPrec [ListSecurityKeys]
readPrec :: ReadPrec ListSecurityKeys
$creadPrec :: ReadPrec ListSecurityKeys
readList :: ReadS [ListSecurityKeys]
$creadList :: ReadS [ListSecurityKeys]
readsPrec :: Int -> ReadS ListSecurityKeys
$creadsPrec :: Int -> ReadS ListSecurityKeys
Prelude.Read, Int -> ListSecurityKeys -> ShowS
[ListSecurityKeys] -> ShowS
ListSecurityKeys -> String
(Int -> ListSecurityKeys -> ShowS)
-> (ListSecurityKeys -> String)
-> ([ListSecurityKeys] -> ShowS)
-> Show ListSecurityKeys
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListSecurityKeys] -> ShowS
$cshowList :: [ListSecurityKeys] -> ShowS
show :: ListSecurityKeys -> String
$cshow :: ListSecurityKeys -> String
showsPrec :: Int -> ListSecurityKeys -> ShowS
$cshowsPrec :: Int -> ListSecurityKeys -> ShowS
Prelude.Show, (forall x. ListSecurityKeys -> Rep ListSecurityKeys x)
-> (forall x. Rep ListSecurityKeys x -> ListSecurityKeys)
-> Generic ListSecurityKeys
forall x. Rep ListSecurityKeys x -> ListSecurityKeys
forall x. ListSecurityKeys -> Rep ListSecurityKeys x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListSecurityKeys x -> ListSecurityKeys
$cfrom :: forall x. ListSecurityKeys -> Rep ListSecurityKeys x
Prelude.Generic)

-- |
-- Create a value of 'ListSecurityKeys' 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', 'listSecurityKeys_nextToken' - The token for the next set of results. Use the value returned in the
-- previous response in the next request to retrieve the next set of
-- results.
--
-- 'maxResults', 'listSecurityKeys_maxResults' - The maximum number of results to return per page.
--
-- 'instanceId', 'listSecurityKeys_instanceId' - The identifier of the Amazon Connect instance. You can find the
-- instanceId in the ARN of the instance.
newListSecurityKeys ::
  -- | 'instanceId'
  Prelude.Text ->
  ListSecurityKeys
newListSecurityKeys :: Text -> ListSecurityKeys
newListSecurityKeys Text
pInstanceId_ =
  ListSecurityKeys' :: Maybe Text -> Maybe Natural -> Text -> ListSecurityKeys
ListSecurityKeys'
    { $sel:nextToken:ListSecurityKeys' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListSecurityKeys' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:instanceId:ListSecurityKeys' :: Text
instanceId = Text
pInstanceId_
    }

-- | The token for the next set of results. Use the value returned in the
-- previous response in the next request to retrieve the next set of
-- results.
listSecurityKeys_nextToken :: Lens.Lens' ListSecurityKeys (Prelude.Maybe Prelude.Text)
listSecurityKeys_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListSecurityKeys -> f ListSecurityKeys
listSecurityKeys_nextToken = (ListSecurityKeys -> Maybe Text)
-> (ListSecurityKeys -> Maybe Text -> ListSecurityKeys)
-> Lens ListSecurityKeys ListSecurityKeys (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSecurityKeys' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListSecurityKeys' :: ListSecurityKeys -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListSecurityKeys
s@ListSecurityKeys' {} Maybe Text
a -> ListSecurityKeys
s {$sel:nextToken:ListSecurityKeys' :: Maybe Text
nextToken = Maybe Text
a} :: ListSecurityKeys)

-- | The maximum number of results to return per page.
listSecurityKeys_maxResults :: Lens.Lens' ListSecurityKeys (Prelude.Maybe Prelude.Natural)
listSecurityKeys_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListSecurityKeys -> f ListSecurityKeys
listSecurityKeys_maxResults = (ListSecurityKeys -> Maybe Natural)
-> (ListSecurityKeys -> Maybe Natural -> ListSecurityKeys)
-> Lens
     ListSecurityKeys ListSecurityKeys (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSecurityKeys' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListSecurityKeys' :: ListSecurityKeys -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListSecurityKeys
s@ListSecurityKeys' {} Maybe Natural
a -> ListSecurityKeys
s {$sel:maxResults:ListSecurityKeys' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListSecurityKeys)

-- | The identifier of the Amazon Connect instance. You can find the
-- instanceId in the ARN of the instance.
listSecurityKeys_instanceId :: Lens.Lens' ListSecurityKeys Prelude.Text
listSecurityKeys_instanceId :: (Text -> f Text) -> ListSecurityKeys -> f ListSecurityKeys
listSecurityKeys_instanceId = (ListSecurityKeys -> Text)
-> (ListSecurityKeys -> Text -> ListSecurityKeys)
-> Lens ListSecurityKeys ListSecurityKeys Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSecurityKeys' {Text
instanceId :: Text
$sel:instanceId:ListSecurityKeys' :: ListSecurityKeys -> Text
instanceId} -> Text
instanceId) (\s :: ListSecurityKeys
s@ListSecurityKeys' {} Text
a -> ListSecurityKeys
s {$sel:instanceId:ListSecurityKeys' :: Text
instanceId = Text
a} :: ListSecurityKeys)

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

instance Prelude.NFData ListSecurityKeys

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

instance Core.ToQuery ListSecurityKeys where
  toQuery :: ListSecurityKeys -> QueryString
toQuery ListSecurityKeys' {Maybe Natural
Maybe Text
Text
instanceId :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:instanceId:ListSecurityKeys' :: ListSecurityKeys -> Text
$sel:maxResults:ListSecurityKeys' :: ListSecurityKeys -> Maybe Natural
$sel:nextToken:ListSecurityKeys' :: ListSecurityKeys -> 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:/ 'newListSecurityKeysResponse' smart constructor.
data ListSecurityKeysResponse = ListSecurityKeysResponse'
  { -- | If there are additional results, this is the token for the next set of
    -- results.
    ListSecurityKeysResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The security keys.
    ListSecurityKeysResponse -> Maybe [SecurityKey]
securityKeys :: Prelude.Maybe [SecurityKey],
    -- | The response's http status code.
    ListSecurityKeysResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListSecurityKeysResponse -> ListSecurityKeysResponse -> Bool
(ListSecurityKeysResponse -> ListSecurityKeysResponse -> Bool)
-> (ListSecurityKeysResponse -> ListSecurityKeysResponse -> Bool)
-> Eq ListSecurityKeysResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListSecurityKeysResponse -> ListSecurityKeysResponse -> Bool
$c/= :: ListSecurityKeysResponse -> ListSecurityKeysResponse -> Bool
== :: ListSecurityKeysResponse -> ListSecurityKeysResponse -> Bool
$c== :: ListSecurityKeysResponse -> ListSecurityKeysResponse -> Bool
Prelude.Eq, ReadPrec [ListSecurityKeysResponse]
ReadPrec ListSecurityKeysResponse
Int -> ReadS ListSecurityKeysResponse
ReadS [ListSecurityKeysResponse]
(Int -> ReadS ListSecurityKeysResponse)
-> ReadS [ListSecurityKeysResponse]
-> ReadPrec ListSecurityKeysResponse
-> ReadPrec [ListSecurityKeysResponse]
-> Read ListSecurityKeysResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListSecurityKeysResponse]
$creadListPrec :: ReadPrec [ListSecurityKeysResponse]
readPrec :: ReadPrec ListSecurityKeysResponse
$creadPrec :: ReadPrec ListSecurityKeysResponse
readList :: ReadS [ListSecurityKeysResponse]
$creadList :: ReadS [ListSecurityKeysResponse]
readsPrec :: Int -> ReadS ListSecurityKeysResponse
$creadsPrec :: Int -> ReadS ListSecurityKeysResponse
Prelude.Read, Int -> ListSecurityKeysResponse -> ShowS
[ListSecurityKeysResponse] -> ShowS
ListSecurityKeysResponse -> String
(Int -> ListSecurityKeysResponse -> ShowS)
-> (ListSecurityKeysResponse -> String)
-> ([ListSecurityKeysResponse] -> ShowS)
-> Show ListSecurityKeysResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListSecurityKeysResponse] -> ShowS
$cshowList :: [ListSecurityKeysResponse] -> ShowS
show :: ListSecurityKeysResponse -> String
$cshow :: ListSecurityKeysResponse -> String
showsPrec :: Int -> ListSecurityKeysResponse -> ShowS
$cshowsPrec :: Int -> ListSecurityKeysResponse -> ShowS
Prelude.Show, (forall x.
 ListSecurityKeysResponse -> Rep ListSecurityKeysResponse x)
-> (forall x.
    Rep ListSecurityKeysResponse x -> ListSecurityKeysResponse)
-> Generic ListSecurityKeysResponse
forall x.
Rep ListSecurityKeysResponse x -> ListSecurityKeysResponse
forall x.
ListSecurityKeysResponse -> Rep ListSecurityKeysResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListSecurityKeysResponse x -> ListSecurityKeysResponse
$cfrom :: forall x.
ListSecurityKeysResponse -> Rep ListSecurityKeysResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListSecurityKeysResponse' 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', 'listSecurityKeysResponse_nextToken' - If there are additional results, this is the token for the next set of
-- results.
--
-- 'securityKeys', 'listSecurityKeysResponse_securityKeys' - The security keys.
--
-- 'httpStatus', 'listSecurityKeysResponse_httpStatus' - The response's http status code.
newListSecurityKeysResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListSecurityKeysResponse
newListSecurityKeysResponse :: Int -> ListSecurityKeysResponse
newListSecurityKeysResponse Int
pHttpStatus_ =
  ListSecurityKeysResponse' :: Maybe Text
-> Maybe [SecurityKey] -> Int -> ListSecurityKeysResponse
ListSecurityKeysResponse'
    { $sel:nextToken:ListSecurityKeysResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:securityKeys:ListSecurityKeysResponse' :: Maybe [SecurityKey]
securityKeys = Maybe [SecurityKey]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListSecurityKeysResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | If there are additional results, this is the token for the next set of
-- results.
listSecurityKeysResponse_nextToken :: Lens.Lens' ListSecurityKeysResponse (Prelude.Maybe Prelude.Text)
listSecurityKeysResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListSecurityKeysResponse -> f ListSecurityKeysResponse
listSecurityKeysResponse_nextToken = (ListSecurityKeysResponse -> Maybe Text)
-> (ListSecurityKeysResponse
    -> Maybe Text -> ListSecurityKeysResponse)
-> Lens' ListSecurityKeysResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSecurityKeysResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListSecurityKeysResponse' :: ListSecurityKeysResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListSecurityKeysResponse
s@ListSecurityKeysResponse' {} Maybe Text
a -> ListSecurityKeysResponse
s {$sel:nextToken:ListSecurityKeysResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListSecurityKeysResponse)

-- | The security keys.
listSecurityKeysResponse_securityKeys :: Lens.Lens' ListSecurityKeysResponse (Prelude.Maybe [SecurityKey])
listSecurityKeysResponse_securityKeys :: (Maybe [SecurityKey] -> f (Maybe [SecurityKey]))
-> ListSecurityKeysResponse -> f ListSecurityKeysResponse
listSecurityKeysResponse_securityKeys = (ListSecurityKeysResponse -> Maybe [SecurityKey])
-> (ListSecurityKeysResponse
    -> Maybe [SecurityKey] -> ListSecurityKeysResponse)
-> Lens' ListSecurityKeysResponse (Maybe [SecurityKey])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSecurityKeysResponse' {Maybe [SecurityKey]
securityKeys :: Maybe [SecurityKey]
$sel:securityKeys:ListSecurityKeysResponse' :: ListSecurityKeysResponse -> Maybe [SecurityKey]
securityKeys} -> Maybe [SecurityKey]
securityKeys) (\s :: ListSecurityKeysResponse
s@ListSecurityKeysResponse' {} Maybe [SecurityKey]
a -> ListSecurityKeysResponse
s {$sel:securityKeys:ListSecurityKeysResponse' :: Maybe [SecurityKey]
securityKeys = Maybe [SecurityKey]
a} :: ListSecurityKeysResponse) ((Maybe [SecurityKey] -> f (Maybe [SecurityKey]))
 -> ListSecurityKeysResponse -> f ListSecurityKeysResponse)
-> ((Maybe [SecurityKey] -> f (Maybe [SecurityKey]))
    -> Maybe [SecurityKey] -> f (Maybe [SecurityKey]))
-> (Maybe [SecurityKey] -> f (Maybe [SecurityKey]))
-> ListSecurityKeysResponse
-> f ListSecurityKeysResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [SecurityKey] [SecurityKey] [SecurityKey] [SecurityKey]
-> Iso
     (Maybe [SecurityKey])
     (Maybe [SecurityKey])
     (Maybe [SecurityKey])
     (Maybe [SecurityKey])
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 [SecurityKey] [SecurityKey] [SecurityKey] [SecurityKey]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.NFData ListSecurityKeysResponse