{-# 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.IAM.ListServiceSpecificCredentials
(
ListServiceSpecificCredentials (..),
newListServiceSpecificCredentials,
listServiceSpecificCredentials_serviceName,
listServiceSpecificCredentials_userName,
ListServiceSpecificCredentialsResponse (..),
newListServiceSpecificCredentialsResponse,
listServiceSpecificCredentialsResponse_serviceSpecificCredentials,
listServiceSpecificCredentialsResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.IAM.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data ListServiceSpecificCredentials = ListServiceSpecificCredentials'
{
ListServiceSpecificCredentials -> Maybe Text
serviceName :: Prelude.Maybe Prelude.Text,
ListServiceSpecificCredentials -> Maybe Text
userName :: Prelude.Maybe Prelude.Text
}
deriving (ListServiceSpecificCredentials
-> ListServiceSpecificCredentials -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListServiceSpecificCredentials
-> ListServiceSpecificCredentials -> Bool
$c/= :: ListServiceSpecificCredentials
-> ListServiceSpecificCredentials -> Bool
== :: ListServiceSpecificCredentials
-> ListServiceSpecificCredentials -> Bool
$c== :: ListServiceSpecificCredentials
-> ListServiceSpecificCredentials -> Bool
Prelude.Eq, ReadPrec [ListServiceSpecificCredentials]
ReadPrec ListServiceSpecificCredentials
Int -> ReadS ListServiceSpecificCredentials
ReadS [ListServiceSpecificCredentials]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListServiceSpecificCredentials]
$creadListPrec :: ReadPrec [ListServiceSpecificCredentials]
readPrec :: ReadPrec ListServiceSpecificCredentials
$creadPrec :: ReadPrec ListServiceSpecificCredentials
readList :: ReadS [ListServiceSpecificCredentials]
$creadList :: ReadS [ListServiceSpecificCredentials]
readsPrec :: Int -> ReadS ListServiceSpecificCredentials
$creadsPrec :: Int -> ReadS ListServiceSpecificCredentials
Prelude.Read, Int -> ListServiceSpecificCredentials -> ShowS
[ListServiceSpecificCredentials] -> ShowS
ListServiceSpecificCredentials -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListServiceSpecificCredentials] -> ShowS
$cshowList :: [ListServiceSpecificCredentials] -> ShowS
show :: ListServiceSpecificCredentials -> String
$cshow :: ListServiceSpecificCredentials -> String
showsPrec :: Int -> ListServiceSpecificCredentials -> ShowS
$cshowsPrec :: Int -> ListServiceSpecificCredentials -> ShowS
Prelude.Show, forall x.
Rep ListServiceSpecificCredentials x
-> ListServiceSpecificCredentials
forall x.
ListServiceSpecificCredentials
-> Rep ListServiceSpecificCredentials x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListServiceSpecificCredentials x
-> ListServiceSpecificCredentials
$cfrom :: forall x.
ListServiceSpecificCredentials
-> Rep ListServiceSpecificCredentials x
Prelude.Generic)
newListServiceSpecificCredentials ::
ListServiceSpecificCredentials
newListServiceSpecificCredentials :: ListServiceSpecificCredentials
newListServiceSpecificCredentials =
ListServiceSpecificCredentials'
{ $sel:serviceName:ListServiceSpecificCredentials' :: Maybe Text
serviceName =
forall a. Maybe a
Prelude.Nothing,
$sel:userName:ListServiceSpecificCredentials' :: Maybe Text
userName = forall a. Maybe a
Prelude.Nothing
}
listServiceSpecificCredentials_serviceName :: Lens.Lens' ListServiceSpecificCredentials (Prelude.Maybe Prelude.Text)
listServiceSpecificCredentials_serviceName :: Lens' ListServiceSpecificCredentials (Maybe Text)
listServiceSpecificCredentials_serviceName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListServiceSpecificCredentials' {Maybe Text
serviceName :: Maybe Text
$sel:serviceName:ListServiceSpecificCredentials' :: ListServiceSpecificCredentials -> Maybe Text
serviceName} -> Maybe Text
serviceName) (\s :: ListServiceSpecificCredentials
s@ListServiceSpecificCredentials' {} Maybe Text
a -> ListServiceSpecificCredentials
s {$sel:serviceName:ListServiceSpecificCredentials' :: Maybe Text
serviceName = Maybe Text
a} :: ListServiceSpecificCredentials)
listServiceSpecificCredentials_userName :: Lens.Lens' ListServiceSpecificCredentials (Prelude.Maybe Prelude.Text)
listServiceSpecificCredentials_userName :: Lens' ListServiceSpecificCredentials (Maybe Text)
listServiceSpecificCredentials_userName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListServiceSpecificCredentials' {Maybe Text
userName :: Maybe Text
$sel:userName:ListServiceSpecificCredentials' :: ListServiceSpecificCredentials -> Maybe Text
userName} -> Maybe Text
userName) (\s :: ListServiceSpecificCredentials
s@ListServiceSpecificCredentials' {} Maybe Text
a -> ListServiceSpecificCredentials
s {$sel:userName:ListServiceSpecificCredentials' :: Maybe Text
userName = Maybe Text
a} :: ListServiceSpecificCredentials)
instance
Core.AWSRequest
ListServiceSpecificCredentials
where
type
AWSResponse ListServiceSpecificCredentials =
ListServiceSpecificCredentialsResponse
request :: (Service -> Service)
-> ListServiceSpecificCredentials
-> Request ListServiceSpecificCredentials
request Service -> Service
overrides =
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy ListServiceSpecificCredentials
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse ListServiceSpecificCredentials)))
response =
forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
-> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
Text
"ListServiceSpecificCredentialsResult"
( \Int
s ResponseHeaders
h [Node]
x ->
Maybe [ServiceSpecificCredentialMetadata]
-> Int -> ListServiceSpecificCredentialsResponse
ListServiceSpecificCredentialsResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( [Node]
x
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"ServiceSpecificCredentials"
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (forall a. FromXML a => Text -> [Node] -> Either String [a]
Data.parseXMLList Text
"member")
)
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
ListServiceSpecificCredentials
where
hashWithSalt :: Int -> ListServiceSpecificCredentials -> Int
hashWithSalt
Int
_salt
ListServiceSpecificCredentials' {Maybe Text
userName :: Maybe Text
serviceName :: Maybe Text
$sel:userName:ListServiceSpecificCredentials' :: ListServiceSpecificCredentials -> Maybe Text
$sel:serviceName:ListServiceSpecificCredentials' :: ListServiceSpecificCredentials -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
serviceName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
userName
instance
Prelude.NFData
ListServiceSpecificCredentials
where
rnf :: ListServiceSpecificCredentials -> ()
rnf ListServiceSpecificCredentials' {Maybe Text
userName :: Maybe Text
serviceName :: Maybe Text
$sel:userName:ListServiceSpecificCredentials' :: ListServiceSpecificCredentials -> Maybe Text
$sel:serviceName:ListServiceSpecificCredentials' :: ListServiceSpecificCredentials -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
serviceName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
userName
instance
Data.ToHeaders
ListServiceSpecificCredentials
where
toHeaders :: ListServiceSpecificCredentials -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
instance Data.ToPath ListServiceSpecificCredentials where
toPath :: ListServiceSpecificCredentials -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery ListServiceSpecificCredentials where
toQuery :: ListServiceSpecificCredentials -> QueryString
toQuery ListServiceSpecificCredentials' {Maybe Text
userName :: Maybe Text
serviceName :: Maybe Text
$sel:userName:ListServiceSpecificCredentials' :: ListServiceSpecificCredentials -> Maybe Text
$sel:serviceName:ListServiceSpecificCredentials' :: ListServiceSpecificCredentials -> Maybe Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: ( ByteString
"ListServiceSpecificCredentials" ::
Prelude.ByteString
),
ByteString
"Version"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2010-05-08" :: Prelude.ByteString),
ByteString
"ServiceName" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
serviceName,
ByteString
"UserName" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
userName
]
data ListServiceSpecificCredentialsResponse = ListServiceSpecificCredentialsResponse'
{
ListServiceSpecificCredentialsResponse
-> Maybe [ServiceSpecificCredentialMetadata]
serviceSpecificCredentials :: Prelude.Maybe [ServiceSpecificCredentialMetadata],
ListServiceSpecificCredentialsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ListServiceSpecificCredentialsResponse
-> ListServiceSpecificCredentialsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListServiceSpecificCredentialsResponse
-> ListServiceSpecificCredentialsResponse -> Bool
$c/= :: ListServiceSpecificCredentialsResponse
-> ListServiceSpecificCredentialsResponse -> Bool
== :: ListServiceSpecificCredentialsResponse
-> ListServiceSpecificCredentialsResponse -> Bool
$c== :: ListServiceSpecificCredentialsResponse
-> ListServiceSpecificCredentialsResponse -> Bool
Prelude.Eq, ReadPrec [ListServiceSpecificCredentialsResponse]
ReadPrec ListServiceSpecificCredentialsResponse
Int -> ReadS ListServiceSpecificCredentialsResponse
ReadS [ListServiceSpecificCredentialsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListServiceSpecificCredentialsResponse]
$creadListPrec :: ReadPrec [ListServiceSpecificCredentialsResponse]
readPrec :: ReadPrec ListServiceSpecificCredentialsResponse
$creadPrec :: ReadPrec ListServiceSpecificCredentialsResponse
readList :: ReadS [ListServiceSpecificCredentialsResponse]
$creadList :: ReadS [ListServiceSpecificCredentialsResponse]
readsPrec :: Int -> ReadS ListServiceSpecificCredentialsResponse
$creadsPrec :: Int -> ReadS ListServiceSpecificCredentialsResponse
Prelude.Read, Int -> ListServiceSpecificCredentialsResponse -> ShowS
[ListServiceSpecificCredentialsResponse] -> ShowS
ListServiceSpecificCredentialsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListServiceSpecificCredentialsResponse] -> ShowS
$cshowList :: [ListServiceSpecificCredentialsResponse] -> ShowS
show :: ListServiceSpecificCredentialsResponse -> String
$cshow :: ListServiceSpecificCredentialsResponse -> String
showsPrec :: Int -> ListServiceSpecificCredentialsResponse -> ShowS
$cshowsPrec :: Int -> ListServiceSpecificCredentialsResponse -> ShowS
Prelude.Show, forall x.
Rep ListServiceSpecificCredentialsResponse x
-> ListServiceSpecificCredentialsResponse
forall x.
ListServiceSpecificCredentialsResponse
-> Rep ListServiceSpecificCredentialsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListServiceSpecificCredentialsResponse x
-> ListServiceSpecificCredentialsResponse
$cfrom :: forall x.
ListServiceSpecificCredentialsResponse
-> Rep ListServiceSpecificCredentialsResponse x
Prelude.Generic)
newListServiceSpecificCredentialsResponse ::
Prelude.Int ->
ListServiceSpecificCredentialsResponse
newListServiceSpecificCredentialsResponse :: Int -> ListServiceSpecificCredentialsResponse
newListServiceSpecificCredentialsResponse
Int
pHttpStatus_ =
ListServiceSpecificCredentialsResponse'
{ $sel:serviceSpecificCredentials:ListServiceSpecificCredentialsResponse' :: Maybe [ServiceSpecificCredentialMetadata]
serviceSpecificCredentials =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListServiceSpecificCredentialsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
listServiceSpecificCredentialsResponse_serviceSpecificCredentials :: Lens.Lens' ListServiceSpecificCredentialsResponse (Prelude.Maybe [ServiceSpecificCredentialMetadata])
listServiceSpecificCredentialsResponse_serviceSpecificCredentials :: Lens'
ListServiceSpecificCredentialsResponse
(Maybe [ServiceSpecificCredentialMetadata])
listServiceSpecificCredentialsResponse_serviceSpecificCredentials = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListServiceSpecificCredentialsResponse' {Maybe [ServiceSpecificCredentialMetadata]
serviceSpecificCredentials :: Maybe [ServiceSpecificCredentialMetadata]
$sel:serviceSpecificCredentials:ListServiceSpecificCredentialsResponse' :: ListServiceSpecificCredentialsResponse
-> Maybe [ServiceSpecificCredentialMetadata]
serviceSpecificCredentials} -> Maybe [ServiceSpecificCredentialMetadata]
serviceSpecificCredentials) (\s :: ListServiceSpecificCredentialsResponse
s@ListServiceSpecificCredentialsResponse' {} Maybe [ServiceSpecificCredentialMetadata]
a -> ListServiceSpecificCredentialsResponse
s {$sel:serviceSpecificCredentials:ListServiceSpecificCredentialsResponse' :: Maybe [ServiceSpecificCredentialMetadata]
serviceSpecificCredentials = Maybe [ServiceSpecificCredentialMetadata]
a} :: ListServiceSpecificCredentialsResponse) 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
listServiceSpecificCredentialsResponse_httpStatus :: Lens.Lens' ListServiceSpecificCredentialsResponse Prelude.Int
listServiceSpecificCredentialsResponse_httpStatus :: Lens' ListServiceSpecificCredentialsResponse Int
listServiceSpecificCredentialsResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListServiceSpecificCredentialsResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListServiceSpecificCredentialsResponse' :: ListServiceSpecificCredentialsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListServiceSpecificCredentialsResponse
s@ListServiceSpecificCredentialsResponse' {} Int
a -> ListServiceSpecificCredentialsResponse
s {$sel:httpStatus:ListServiceSpecificCredentialsResponse' :: Int
httpStatus = Int
a} :: ListServiceSpecificCredentialsResponse)
instance
Prelude.NFData
ListServiceSpecificCredentialsResponse
where
rnf :: ListServiceSpecificCredentialsResponse -> ()
rnf ListServiceSpecificCredentialsResponse' {Int
Maybe [ServiceSpecificCredentialMetadata]
httpStatus :: Int
serviceSpecificCredentials :: Maybe [ServiceSpecificCredentialMetadata]
$sel:httpStatus:ListServiceSpecificCredentialsResponse' :: ListServiceSpecificCredentialsResponse -> Int
$sel:serviceSpecificCredentials:ListServiceSpecificCredentialsResponse' :: ListServiceSpecificCredentialsResponse
-> Maybe [ServiceSpecificCredentialMetadata]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [ServiceSpecificCredentialMetadata]
serviceSpecificCredentials
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus