{-# 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 #-}
module Amazonka.Connect.ListSecurityKeys
(
ListSecurityKeys (..),
newListSecurityKeys,
listSecurityKeys_maxResults,
listSecurityKeys_nextToken,
listSecurityKeys_instanceId,
ListSecurityKeysResponse (..),
newListSecurityKeysResponse,
listSecurityKeysResponse_nextToken,
listSecurityKeysResponse_securityKeys,
listSecurityKeysResponse_httpStatus,
)
where
import Amazonka.Connect.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data ListSecurityKeys = ListSecurityKeys'
{
ListSecurityKeys -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
ListSecurityKeys -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListSecurityKeys -> Text
instanceId :: Prelude.Text
}
deriving (ListSecurityKeys -> ListSecurityKeys -> Bool
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]
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
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. 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)
newListSecurityKeys ::
Prelude.Text ->
ListSecurityKeys
newListSecurityKeys :: Text -> ListSecurityKeys
newListSecurityKeys Text
pInstanceId_ =
ListSecurityKeys'
{ $sel:maxResults:ListSecurityKeys' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListSecurityKeys' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
$sel:instanceId:ListSecurityKeys' :: Text
instanceId = Text
pInstanceId_
}
listSecurityKeys_maxResults :: Lens.Lens' ListSecurityKeys (Prelude.Maybe Prelude.Natural)
listSecurityKeys_maxResults :: Lens' ListSecurityKeys (Maybe Natural)
listSecurityKeys_maxResults = 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)
listSecurityKeys_nextToken :: Lens.Lens' ListSecurityKeys (Prelude.Maybe Prelude.Text)
listSecurityKeys_nextToken :: Lens' ListSecurityKeys (Maybe Text)
listSecurityKeys_nextToken = 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)
listSecurityKeys_instanceId :: Lens.Lens' ListSecurityKeys Prelude.Text
listSecurityKeys_instanceId :: Lens' ListSecurityKeys Text
listSecurityKeys_instanceId = 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
| forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse ListSecurityKeys
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListSecurityKeysResponse (Maybe Text)
listSecurityKeysResponse_nextToken
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
) =
forall a. Maybe a
Prelude.Nothing
| forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse ListSecurityKeys
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListSecurityKeysResponse (Maybe [SecurityKey])
listSecurityKeysResponse_securityKeys
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
) =
forall a. Maybe a
Prelude.Nothing
| Bool
Prelude.otherwise =
forall a. a -> Maybe a
Prelude.Just
forall a b. (a -> b) -> a -> b
Prelude.$ ListSecurityKeys
rq
forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListSecurityKeys (Maybe Text)
listSecurityKeys_nextToken
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListSecurityKeys
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListSecurityKeysResponse (Maybe Text)
listSecurityKeysResponse_nextToken
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
instance Core.AWSRequest ListSecurityKeys where
type
AWSResponse ListSecurityKeys =
ListSecurityKeysResponse
request :: (Service -> Service)
-> ListSecurityKeys -> Request ListSecurityKeys
request Service -> Service
overrides =
forall a. ToRequest a => Service -> a -> Request a
Request.get (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy ListSecurityKeys
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListSecurityKeys)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> 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'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"NextToken")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"SecurityKeys" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable ListSecurityKeys where
hashWithSalt :: Int -> ListSecurityKeys -> Int
hashWithSalt Int
_salt ListSecurityKeys' {Maybe Natural
Maybe Text
Text
instanceId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:instanceId:ListSecurityKeys' :: ListSecurityKeys -> Text
$sel:nextToken:ListSecurityKeys' :: ListSecurityKeys -> Maybe Text
$sel:maxResults:ListSecurityKeys' :: ListSecurityKeys -> Maybe Natural
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxResults
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
instanceId
instance Prelude.NFData ListSecurityKeys where
rnf :: ListSecurityKeys -> ()
rnf ListSecurityKeys' {Maybe Natural
Maybe Text
Text
instanceId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:instanceId:ListSecurityKeys' :: ListSecurityKeys -> Text
$sel:nextToken:ListSecurityKeys' :: ListSecurityKeys -> Maybe Text
$sel:maxResults:ListSecurityKeys' :: ListSecurityKeys -> Maybe Natural
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
maxResults
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
instanceId
instance Data.ToHeaders ListSecurityKeys where
toHeaders :: ListSecurityKeys -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToPath ListSecurityKeys where
toPath :: ListSecurityKeys -> ByteString
toPath ListSecurityKeys' {Maybe Natural
Maybe Text
Text
instanceId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:instanceId:ListSecurityKeys' :: ListSecurityKeys -> Text
$sel:nextToken:ListSecurityKeys' :: ListSecurityKeys -> Maybe Text
$sel:maxResults:ListSecurityKeys' :: ListSecurityKeys -> Maybe Natural
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/instance/",
forall a. ToByteString a => a -> ByteString
Data.toBS Text
instanceId,
ByteString
"/security-keys"
]
instance Data.ToQuery ListSecurityKeys where
toQuery :: ListSecurityKeys -> QueryString
toQuery ListSecurityKeys' {Maybe Natural
Maybe Text
Text
instanceId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:instanceId:ListSecurityKeys' :: ListSecurityKeys -> Text
$sel:nextToken:ListSecurityKeys' :: ListSecurityKeys -> Maybe Text
$sel:maxResults:ListSecurityKeys' :: ListSecurityKeys -> Maybe Natural
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"maxResults" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Natural
maxResults,
ByteString
"nextToken" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
nextToken
]
data ListSecurityKeysResponse = ListSecurityKeysResponse'
{
ListSecurityKeysResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListSecurityKeysResponse -> Maybe [SecurityKey]
securityKeys :: Prelude.Maybe [SecurityKey],
ListSecurityKeysResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ListSecurityKeysResponse -> ListSecurityKeysResponse -> Bool
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]
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
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.
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)
newListSecurityKeysResponse ::
Prelude.Int ->
ListSecurityKeysResponse
newListSecurityKeysResponse :: Int -> ListSecurityKeysResponse
newListSecurityKeysResponse Int
pHttpStatus_ =
ListSecurityKeysResponse'
{ $sel:nextToken:ListSecurityKeysResponse' :: Maybe Text
nextToken =
forall a. Maybe a
Prelude.Nothing,
$sel:securityKeys:ListSecurityKeysResponse' :: Maybe [SecurityKey]
securityKeys = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListSecurityKeysResponse' :: Int
httpStatus = Int
pHttpStatus_
}
listSecurityKeysResponse_nextToken :: Lens.Lens' ListSecurityKeysResponse (Prelude.Maybe Prelude.Text)
listSecurityKeysResponse_nextToken :: Lens' ListSecurityKeysResponse (Maybe Text)
listSecurityKeysResponse_nextToken = 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)
listSecurityKeysResponse_securityKeys :: Lens.Lens' ListSecurityKeysResponse (Prelude.Maybe [SecurityKey])
listSecurityKeysResponse_securityKeys :: Lens' ListSecurityKeysResponse (Maybe [SecurityKey])
listSecurityKeysResponse_securityKeys = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
listSecurityKeysResponse_httpStatus :: Lens.Lens' ListSecurityKeysResponse Prelude.Int
listSecurityKeysResponse_httpStatus :: Lens' ListSecurityKeysResponse Int
listSecurityKeysResponse_httpStatus = 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 where
rnf :: ListSecurityKeysResponse -> ()
rnf ListSecurityKeysResponse' {Int
Maybe [SecurityKey]
Maybe Text
httpStatus :: Int
securityKeys :: Maybe [SecurityKey]
nextToken :: Maybe Text
$sel:httpStatus:ListSecurityKeysResponse' :: ListSecurityKeysResponse -> Int
$sel:securityKeys:ListSecurityKeysResponse' :: ListSecurityKeysResponse -> Maybe [SecurityKey]
$sel:nextToken:ListSecurityKeysResponse' :: ListSecurityKeysResponse -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [SecurityKey]
securityKeys
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus