{-# 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.WorkSpacesWeb.ListIdentityProviders
(
ListIdentityProviders (..),
newListIdentityProviders,
listIdentityProviders_maxResults,
listIdentityProviders_nextToken,
listIdentityProviders_portalArn,
ListIdentityProvidersResponse (..),
newListIdentityProvidersResponse,
listIdentityProvidersResponse_identityProviders,
listIdentityProvidersResponse_nextToken,
listIdentityProvidersResponse_httpStatus,
)
where
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
import Amazonka.WorkSpacesWeb.Types
data ListIdentityProviders = ListIdentityProviders'
{
ListIdentityProviders -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
ListIdentityProviders -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListIdentityProviders -> Text
portalArn :: Prelude.Text
}
deriving (ListIdentityProviders -> ListIdentityProviders -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListIdentityProviders -> ListIdentityProviders -> Bool
$c/= :: ListIdentityProviders -> ListIdentityProviders -> Bool
== :: ListIdentityProviders -> ListIdentityProviders -> Bool
$c== :: ListIdentityProviders -> ListIdentityProviders -> Bool
Prelude.Eq, ReadPrec [ListIdentityProviders]
ReadPrec ListIdentityProviders
Int -> ReadS ListIdentityProviders
ReadS [ListIdentityProviders]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListIdentityProviders]
$creadListPrec :: ReadPrec [ListIdentityProviders]
readPrec :: ReadPrec ListIdentityProviders
$creadPrec :: ReadPrec ListIdentityProviders
readList :: ReadS [ListIdentityProviders]
$creadList :: ReadS [ListIdentityProviders]
readsPrec :: Int -> ReadS ListIdentityProviders
$creadsPrec :: Int -> ReadS ListIdentityProviders
Prelude.Read, Int -> ListIdentityProviders -> ShowS
[ListIdentityProviders] -> ShowS
ListIdentityProviders -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListIdentityProviders] -> ShowS
$cshowList :: [ListIdentityProviders] -> ShowS
show :: ListIdentityProviders -> String
$cshow :: ListIdentityProviders -> String
showsPrec :: Int -> ListIdentityProviders -> ShowS
$cshowsPrec :: Int -> ListIdentityProviders -> ShowS
Prelude.Show, forall x. Rep ListIdentityProviders x -> ListIdentityProviders
forall x. ListIdentityProviders -> Rep ListIdentityProviders x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListIdentityProviders x -> ListIdentityProviders
$cfrom :: forall x. ListIdentityProviders -> Rep ListIdentityProviders x
Prelude.Generic)
newListIdentityProviders ::
Prelude.Text ->
ListIdentityProviders
newListIdentityProviders :: Text -> ListIdentityProviders
newListIdentityProviders Text
pPortalArn_ =
ListIdentityProviders'
{ $sel:maxResults:ListIdentityProviders' :: Maybe Natural
maxResults =
forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListIdentityProviders' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
$sel:portalArn:ListIdentityProviders' :: Text
portalArn = Text
pPortalArn_
}
listIdentityProviders_maxResults :: Lens.Lens' ListIdentityProviders (Prelude.Maybe Prelude.Natural)
listIdentityProviders_maxResults :: Lens' ListIdentityProviders (Maybe Natural)
listIdentityProviders_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListIdentityProviders' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListIdentityProviders' :: ListIdentityProviders -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListIdentityProviders
s@ListIdentityProviders' {} Maybe Natural
a -> ListIdentityProviders
s {$sel:maxResults:ListIdentityProviders' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListIdentityProviders)
listIdentityProviders_nextToken :: Lens.Lens' ListIdentityProviders (Prelude.Maybe Prelude.Text)
listIdentityProviders_nextToken :: Lens' ListIdentityProviders (Maybe Text)
listIdentityProviders_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListIdentityProviders' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListIdentityProviders' :: ListIdentityProviders -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListIdentityProviders
s@ListIdentityProviders' {} Maybe Text
a -> ListIdentityProviders
s {$sel:nextToken:ListIdentityProviders' :: Maybe Text
nextToken = Maybe Text
a} :: ListIdentityProviders)
listIdentityProviders_portalArn :: Lens.Lens' ListIdentityProviders Prelude.Text
listIdentityProviders_portalArn :: Lens' ListIdentityProviders Text
listIdentityProviders_portalArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListIdentityProviders' {Text
portalArn :: Text
$sel:portalArn:ListIdentityProviders' :: ListIdentityProviders -> Text
portalArn} -> Text
portalArn) (\s :: ListIdentityProviders
s@ListIdentityProviders' {} Text
a -> ListIdentityProviders
s {$sel:portalArn:ListIdentityProviders' :: Text
portalArn = Text
a} :: ListIdentityProviders)
instance Core.AWSRequest ListIdentityProviders where
type
AWSResponse ListIdentityProviders =
ListIdentityProvidersResponse
request :: (Service -> Service)
-> ListIdentityProviders -> Request ListIdentityProviders
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 ListIdentityProviders
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ListIdentityProviders)))
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 [IdentityProviderSummary]
-> Maybe Text -> Int -> ListIdentityProvidersResponse
ListIdentityProvidersResponse'
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
"identityProviders"
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.<*> (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.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable ListIdentityProviders where
hashWithSalt :: Int -> ListIdentityProviders -> Int
hashWithSalt Int
_salt ListIdentityProviders' {Maybe Natural
Maybe Text
Text
portalArn :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:portalArn:ListIdentityProviders' :: ListIdentityProviders -> Text
$sel:nextToken:ListIdentityProviders' :: ListIdentityProviders -> Maybe Text
$sel:maxResults:ListIdentityProviders' :: ListIdentityProviders -> 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
portalArn
instance Prelude.NFData ListIdentityProviders where
rnf :: ListIdentityProviders -> ()
rnf ListIdentityProviders' {Maybe Natural
Maybe Text
Text
portalArn :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:portalArn:ListIdentityProviders' :: ListIdentityProviders -> Text
$sel:nextToken:ListIdentityProviders' :: ListIdentityProviders -> Maybe Text
$sel:maxResults:ListIdentityProviders' :: ListIdentityProviders -> 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
portalArn
instance Data.ToHeaders ListIdentityProviders where
toHeaders :: ListIdentityProviders -> 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 ListIdentityProviders where
toPath :: ListIdentityProviders -> ByteString
toPath ListIdentityProviders' {Maybe Natural
Maybe Text
Text
portalArn :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:portalArn:ListIdentityProviders' :: ListIdentityProviders -> Text
$sel:nextToken:ListIdentityProviders' :: ListIdentityProviders -> Maybe Text
$sel:maxResults:ListIdentityProviders' :: ListIdentityProviders -> Maybe Natural
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/portals/",
forall a. ToByteString a => a -> ByteString
Data.toBS Text
portalArn,
ByteString
"/identityProviders"
]
instance Data.ToQuery ListIdentityProviders where
toQuery :: ListIdentityProviders -> QueryString
toQuery ListIdentityProviders' {Maybe Natural
Maybe Text
Text
portalArn :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:portalArn:ListIdentityProviders' :: ListIdentityProviders -> Text
$sel:nextToken:ListIdentityProviders' :: ListIdentityProviders -> Maybe Text
$sel:maxResults:ListIdentityProviders' :: ListIdentityProviders -> 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 ListIdentityProvidersResponse = ListIdentityProvidersResponse'
{
ListIdentityProvidersResponse -> Maybe [IdentityProviderSummary]
identityProviders :: Prelude.Maybe [IdentityProviderSummary],
ListIdentityProvidersResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListIdentityProvidersResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ListIdentityProvidersResponse
-> ListIdentityProvidersResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListIdentityProvidersResponse
-> ListIdentityProvidersResponse -> Bool
$c/= :: ListIdentityProvidersResponse
-> ListIdentityProvidersResponse -> Bool
== :: ListIdentityProvidersResponse
-> ListIdentityProvidersResponse -> Bool
$c== :: ListIdentityProvidersResponse
-> ListIdentityProvidersResponse -> Bool
Prelude.Eq, Int -> ListIdentityProvidersResponse -> ShowS
[ListIdentityProvidersResponse] -> ShowS
ListIdentityProvidersResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListIdentityProvidersResponse] -> ShowS
$cshowList :: [ListIdentityProvidersResponse] -> ShowS
show :: ListIdentityProvidersResponse -> String
$cshow :: ListIdentityProvidersResponse -> String
showsPrec :: Int -> ListIdentityProvidersResponse -> ShowS
$cshowsPrec :: Int -> ListIdentityProvidersResponse -> ShowS
Prelude.Show, forall x.
Rep ListIdentityProvidersResponse x
-> ListIdentityProvidersResponse
forall x.
ListIdentityProvidersResponse
-> Rep ListIdentityProvidersResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListIdentityProvidersResponse x
-> ListIdentityProvidersResponse
$cfrom :: forall x.
ListIdentityProvidersResponse
-> Rep ListIdentityProvidersResponse x
Prelude.Generic)
newListIdentityProvidersResponse ::
Prelude.Int ->
ListIdentityProvidersResponse
newListIdentityProvidersResponse :: Int -> ListIdentityProvidersResponse
newListIdentityProvidersResponse Int
pHttpStatus_ =
ListIdentityProvidersResponse'
{ $sel:identityProviders:ListIdentityProvidersResponse' :: Maybe [IdentityProviderSummary]
identityProviders =
forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListIdentityProvidersResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListIdentityProvidersResponse' :: Int
httpStatus = Int
pHttpStatus_
}
listIdentityProvidersResponse_identityProviders :: Lens.Lens' ListIdentityProvidersResponse (Prelude.Maybe [IdentityProviderSummary])
listIdentityProvidersResponse_identityProviders :: Lens'
ListIdentityProvidersResponse (Maybe [IdentityProviderSummary])
listIdentityProvidersResponse_identityProviders = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListIdentityProvidersResponse' {Maybe [IdentityProviderSummary]
identityProviders :: Maybe [IdentityProviderSummary]
$sel:identityProviders:ListIdentityProvidersResponse' :: ListIdentityProvidersResponse -> Maybe [IdentityProviderSummary]
identityProviders} -> Maybe [IdentityProviderSummary]
identityProviders) (\s :: ListIdentityProvidersResponse
s@ListIdentityProvidersResponse' {} Maybe [IdentityProviderSummary]
a -> ListIdentityProvidersResponse
s {$sel:identityProviders:ListIdentityProvidersResponse' :: Maybe [IdentityProviderSummary]
identityProviders = Maybe [IdentityProviderSummary]
a} :: ListIdentityProvidersResponse) 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
listIdentityProvidersResponse_nextToken :: Lens.Lens' ListIdentityProvidersResponse (Prelude.Maybe Prelude.Text)
listIdentityProvidersResponse_nextToken :: Lens' ListIdentityProvidersResponse (Maybe Text)
listIdentityProvidersResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListIdentityProvidersResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListIdentityProvidersResponse' :: ListIdentityProvidersResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListIdentityProvidersResponse
s@ListIdentityProvidersResponse' {} Maybe Text
a -> ListIdentityProvidersResponse
s {$sel:nextToken:ListIdentityProvidersResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListIdentityProvidersResponse)
listIdentityProvidersResponse_httpStatus :: Lens.Lens' ListIdentityProvidersResponse Prelude.Int
listIdentityProvidersResponse_httpStatus :: Lens' ListIdentityProvidersResponse Int
listIdentityProvidersResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListIdentityProvidersResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListIdentityProvidersResponse' :: ListIdentityProvidersResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListIdentityProvidersResponse
s@ListIdentityProvidersResponse' {} Int
a -> ListIdentityProvidersResponse
s {$sel:httpStatus:ListIdentityProvidersResponse' :: Int
httpStatus = Int
a} :: ListIdentityProvidersResponse)
instance Prelude.NFData ListIdentityProvidersResponse where
rnf :: ListIdentityProvidersResponse -> ()
rnf ListIdentityProvidersResponse' {Int
Maybe [IdentityProviderSummary]
Maybe Text
httpStatus :: Int
nextToken :: Maybe Text
identityProviders :: Maybe [IdentityProviderSummary]
$sel:httpStatus:ListIdentityProvidersResponse' :: ListIdentityProvidersResponse -> Int
$sel:nextToken:ListIdentityProvidersResponse' :: ListIdentityProvidersResponse -> Maybe Text
$sel:identityProviders:ListIdentityProvidersResponse' :: ListIdentityProvidersResponse -> Maybe [IdentityProviderSummary]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [IdentityProviderSummary]
identityProviders
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 Int
httpStatus