{-# 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.QuickSight.ListGroups
(
ListGroups (..),
newListGroups,
listGroups_nextToken,
listGroups_maxResults,
listGroups_awsAccountId,
listGroups_namespace,
ListGroupsResponse (..),
newListGroupsResponse,
listGroupsResponse_requestId,
listGroupsResponse_groupList,
listGroupsResponse_nextToken,
listGroupsResponse_status,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.QuickSight.Types
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data ListGroups = ListGroups'
{
ListGroups -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListGroups -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
ListGroups -> Text
awsAccountId :: Prelude.Text,
ListGroups -> Text
namespace :: Prelude.Text
}
deriving (ListGroups -> ListGroups -> Bool
(ListGroups -> ListGroups -> Bool)
-> (ListGroups -> ListGroups -> Bool) -> Eq ListGroups
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListGroups -> ListGroups -> Bool
$c/= :: ListGroups -> ListGroups -> Bool
== :: ListGroups -> ListGroups -> Bool
$c== :: ListGroups -> ListGroups -> Bool
Prelude.Eq, ReadPrec [ListGroups]
ReadPrec ListGroups
Int -> ReadS ListGroups
ReadS [ListGroups]
(Int -> ReadS ListGroups)
-> ReadS [ListGroups]
-> ReadPrec ListGroups
-> ReadPrec [ListGroups]
-> Read ListGroups
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListGroups]
$creadListPrec :: ReadPrec [ListGroups]
readPrec :: ReadPrec ListGroups
$creadPrec :: ReadPrec ListGroups
readList :: ReadS [ListGroups]
$creadList :: ReadS [ListGroups]
readsPrec :: Int -> ReadS ListGroups
$creadsPrec :: Int -> ReadS ListGroups
Prelude.Read, Int -> ListGroups -> ShowS
[ListGroups] -> ShowS
ListGroups -> String
(Int -> ListGroups -> ShowS)
-> (ListGroups -> String)
-> ([ListGroups] -> ShowS)
-> Show ListGroups
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListGroups] -> ShowS
$cshowList :: [ListGroups] -> ShowS
show :: ListGroups -> String
$cshow :: ListGroups -> String
showsPrec :: Int -> ListGroups -> ShowS
$cshowsPrec :: Int -> ListGroups -> ShowS
Prelude.Show, (forall x. ListGroups -> Rep ListGroups x)
-> (forall x. Rep ListGroups x -> ListGroups) -> Generic ListGroups
forall x. Rep ListGroups x -> ListGroups
forall x. ListGroups -> Rep ListGroups x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListGroups x -> ListGroups
$cfrom :: forall x. ListGroups -> Rep ListGroups x
Prelude.Generic)
newListGroups ::
Prelude.Text ->
Prelude.Text ->
ListGroups
newListGroups :: Text -> Text -> ListGroups
newListGroups Text
pAwsAccountId_ Text
pNamespace_ =
ListGroups' :: Maybe Text -> Maybe Natural -> Text -> Text -> ListGroups
ListGroups'
{ $sel:nextToken:ListGroups' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:maxResults:ListGroups' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:awsAccountId:ListGroups' :: Text
awsAccountId = Text
pAwsAccountId_,
$sel:namespace:ListGroups' :: Text
namespace = Text
pNamespace_
}
listGroups_nextToken :: Lens.Lens' ListGroups (Prelude.Maybe Prelude.Text)
listGroups_nextToken :: (Maybe Text -> f (Maybe Text)) -> ListGroups -> f ListGroups
listGroups_nextToken = (ListGroups -> Maybe Text)
-> (ListGroups -> Maybe Text -> ListGroups)
-> Lens ListGroups ListGroups (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListGroups' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListGroups' :: ListGroups -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListGroups
s@ListGroups' {} Maybe Text
a -> ListGroups
s {$sel:nextToken:ListGroups' :: Maybe Text
nextToken = Maybe Text
a} :: ListGroups)
listGroups_maxResults :: Lens.Lens' ListGroups (Prelude.Maybe Prelude.Natural)
listGroups_maxResults :: (Maybe Natural -> f (Maybe Natural)) -> ListGroups -> f ListGroups
listGroups_maxResults = (ListGroups -> Maybe Natural)
-> (ListGroups -> Maybe Natural -> ListGroups)
-> Lens ListGroups ListGroups (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListGroups' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListGroups' :: ListGroups -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListGroups
s@ListGroups' {} Maybe Natural
a -> ListGroups
s {$sel:maxResults:ListGroups' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListGroups)
listGroups_awsAccountId :: Lens.Lens' ListGroups Prelude.Text
listGroups_awsAccountId :: (Text -> f Text) -> ListGroups -> f ListGroups
listGroups_awsAccountId = (ListGroups -> Text)
-> (ListGroups -> Text -> ListGroups)
-> Lens ListGroups ListGroups Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListGroups' {Text
awsAccountId :: Text
$sel:awsAccountId:ListGroups' :: ListGroups -> Text
awsAccountId} -> Text
awsAccountId) (\s :: ListGroups
s@ListGroups' {} Text
a -> ListGroups
s {$sel:awsAccountId:ListGroups' :: Text
awsAccountId = Text
a} :: ListGroups)
listGroups_namespace :: Lens.Lens' ListGroups Prelude.Text
listGroups_namespace :: (Text -> f Text) -> ListGroups -> f ListGroups
listGroups_namespace = (ListGroups -> Text)
-> (ListGroups -> Text -> ListGroups)
-> Lens ListGroups ListGroups Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListGroups' {Text
namespace :: Text
$sel:namespace:ListGroups' :: ListGroups -> Text
namespace} -> Text
namespace) (\s :: ListGroups
s@ListGroups' {} Text
a -> ListGroups
s {$sel:namespace:ListGroups' :: Text
namespace = Text
a} :: ListGroups)
instance Core.AWSRequest ListGroups where
type AWSResponse ListGroups = ListGroupsResponse
request :: ListGroups -> Request ListGroups
request = Service -> ListGroups -> Request ListGroups
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
response :: Logger
-> Service
-> Proxy ListGroups
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListGroups)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse ListGroups))
-> Logger
-> Service
-> Proxy ListGroups
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListGroups)))
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 [Group] -> Maybe Text -> Int -> ListGroupsResponse
ListGroupsResponse'
(Maybe Text
-> Maybe [Group] -> Maybe Text -> Int -> ListGroupsResponse)
-> Either String (Maybe Text)
-> Either
String (Maybe [Group] -> Maybe Text -> Int -> ListGroupsResponse)
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
"RequestId")
Either
String (Maybe [Group] -> Maybe Text -> Int -> ListGroupsResponse)
-> Either String (Maybe [Group])
-> Either String (Maybe Text -> Int -> ListGroupsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (Maybe [Group]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"GroupList" Either String (Maybe (Maybe [Group]))
-> Maybe [Group] -> Either String (Maybe [Group])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [Group]
forall a. Monoid a => a
Prelude.mempty)
Either String (Maybe Text -> Int -> ListGroupsResponse)
-> Either String (Maybe Text)
-> Either String (Int -> ListGroupsResponse)
forall (f :: * -> *) a b. Applicative f => 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 -> ListGroupsResponse)
-> Either String Int -> Either String ListGroupsResponse
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 ListGroups
instance Prelude.NFData ListGroups
instance Core.ToHeaders ListGroups where
toHeaders :: ListGroups -> ResponseHeaders
toHeaders =
ResponseHeaders -> ListGroups -> 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.0" ::
Prelude.ByteString
)
]
)
instance Core.ToPath ListGroups where
toPath :: ListGroups -> ByteString
toPath ListGroups' {Maybe Natural
Maybe Text
Text
namespace :: Text
awsAccountId :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:namespace:ListGroups' :: ListGroups -> Text
$sel:awsAccountId:ListGroups' :: ListGroups -> Text
$sel:maxResults:ListGroups' :: ListGroups -> Maybe Natural
$sel:nextToken:ListGroups' :: ListGroups -> Maybe Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/accounts/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
awsAccountId,
ByteString
"/namespaces/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
namespace,
ByteString
"/groups"
]
instance Core.ToQuery ListGroups where
toQuery :: ListGroups -> QueryString
toQuery ListGroups' {Maybe Natural
Maybe Text
Text
namespace :: Text
awsAccountId :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:namespace:ListGroups' :: ListGroups -> Text
$sel:awsAccountId:ListGroups' :: ListGroups -> Text
$sel:maxResults:ListGroups' :: ListGroups -> Maybe Natural
$sel:nextToken:ListGroups' :: ListGroups -> Maybe Text
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"next-token" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
nextToken,
ByteString
"max-results" ByteString -> Maybe Natural -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Natural
maxResults
]
data ListGroupsResponse = ListGroupsResponse'
{
ListGroupsResponse -> Maybe Text
requestId :: Prelude.Maybe Prelude.Text,
ListGroupsResponse -> Maybe [Group]
groupList :: Prelude.Maybe [Group],
ListGroupsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListGroupsResponse -> Int
status :: Prelude.Int
}
deriving (ListGroupsResponse -> ListGroupsResponse -> Bool
(ListGroupsResponse -> ListGroupsResponse -> Bool)
-> (ListGroupsResponse -> ListGroupsResponse -> Bool)
-> Eq ListGroupsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListGroupsResponse -> ListGroupsResponse -> Bool
$c/= :: ListGroupsResponse -> ListGroupsResponse -> Bool
== :: ListGroupsResponse -> ListGroupsResponse -> Bool
$c== :: ListGroupsResponse -> ListGroupsResponse -> Bool
Prelude.Eq, ReadPrec [ListGroupsResponse]
ReadPrec ListGroupsResponse
Int -> ReadS ListGroupsResponse
ReadS [ListGroupsResponse]
(Int -> ReadS ListGroupsResponse)
-> ReadS [ListGroupsResponse]
-> ReadPrec ListGroupsResponse
-> ReadPrec [ListGroupsResponse]
-> Read ListGroupsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListGroupsResponse]
$creadListPrec :: ReadPrec [ListGroupsResponse]
readPrec :: ReadPrec ListGroupsResponse
$creadPrec :: ReadPrec ListGroupsResponse
readList :: ReadS [ListGroupsResponse]
$creadList :: ReadS [ListGroupsResponse]
readsPrec :: Int -> ReadS ListGroupsResponse
$creadsPrec :: Int -> ReadS ListGroupsResponse
Prelude.Read, Int -> ListGroupsResponse -> ShowS
[ListGroupsResponse] -> ShowS
ListGroupsResponse -> String
(Int -> ListGroupsResponse -> ShowS)
-> (ListGroupsResponse -> String)
-> ([ListGroupsResponse] -> ShowS)
-> Show ListGroupsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListGroupsResponse] -> ShowS
$cshowList :: [ListGroupsResponse] -> ShowS
show :: ListGroupsResponse -> String
$cshow :: ListGroupsResponse -> String
showsPrec :: Int -> ListGroupsResponse -> ShowS
$cshowsPrec :: Int -> ListGroupsResponse -> ShowS
Prelude.Show, (forall x. ListGroupsResponse -> Rep ListGroupsResponse x)
-> (forall x. Rep ListGroupsResponse x -> ListGroupsResponse)
-> Generic ListGroupsResponse
forall x. Rep ListGroupsResponse x -> ListGroupsResponse
forall x. ListGroupsResponse -> Rep ListGroupsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListGroupsResponse x -> ListGroupsResponse
$cfrom :: forall x. ListGroupsResponse -> Rep ListGroupsResponse x
Prelude.Generic)
newListGroupsResponse ::
Prelude.Int ->
ListGroupsResponse
newListGroupsResponse :: Int -> ListGroupsResponse
newListGroupsResponse Int
pStatus_ =
ListGroupsResponse' :: Maybe Text
-> Maybe [Group] -> Maybe Text -> Int -> ListGroupsResponse
ListGroupsResponse'
{ $sel:requestId:ListGroupsResponse' :: Maybe Text
requestId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:groupList:ListGroupsResponse' :: Maybe [Group]
groupList = Maybe [Group]
forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListGroupsResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:status:ListGroupsResponse' :: Int
status = Int
pStatus_
}
listGroupsResponse_requestId :: Lens.Lens' ListGroupsResponse (Prelude.Maybe Prelude.Text)
listGroupsResponse_requestId :: (Maybe Text -> f (Maybe Text))
-> ListGroupsResponse -> f ListGroupsResponse
listGroupsResponse_requestId = (ListGroupsResponse -> Maybe Text)
-> (ListGroupsResponse -> Maybe Text -> ListGroupsResponse)
-> Lens
ListGroupsResponse ListGroupsResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListGroupsResponse' {Maybe Text
requestId :: Maybe Text
$sel:requestId:ListGroupsResponse' :: ListGroupsResponse -> Maybe Text
requestId} -> Maybe Text
requestId) (\s :: ListGroupsResponse
s@ListGroupsResponse' {} Maybe Text
a -> ListGroupsResponse
s {$sel:requestId:ListGroupsResponse' :: Maybe Text
requestId = Maybe Text
a} :: ListGroupsResponse)
listGroupsResponse_groupList :: Lens.Lens' ListGroupsResponse (Prelude.Maybe [Group])
listGroupsResponse_groupList :: (Maybe [Group] -> f (Maybe [Group]))
-> ListGroupsResponse -> f ListGroupsResponse
listGroupsResponse_groupList = (ListGroupsResponse -> Maybe [Group])
-> (ListGroupsResponse -> Maybe [Group] -> ListGroupsResponse)
-> Lens
ListGroupsResponse
ListGroupsResponse
(Maybe [Group])
(Maybe [Group])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListGroupsResponse' {Maybe [Group]
groupList :: Maybe [Group]
$sel:groupList:ListGroupsResponse' :: ListGroupsResponse -> Maybe [Group]
groupList} -> Maybe [Group]
groupList) (\s :: ListGroupsResponse
s@ListGroupsResponse' {} Maybe [Group]
a -> ListGroupsResponse
s {$sel:groupList:ListGroupsResponse' :: Maybe [Group]
groupList = Maybe [Group]
a} :: ListGroupsResponse) ((Maybe [Group] -> f (Maybe [Group]))
-> ListGroupsResponse -> f ListGroupsResponse)
-> ((Maybe [Group] -> f (Maybe [Group]))
-> Maybe [Group] -> f (Maybe [Group]))
-> (Maybe [Group] -> f (Maybe [Group]))
-> ListGroupsResponse
-> f ListGroupsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Group] [Group] [Group] [Group]
-> Iso
(Maybe [Group]) (Maybe [Group]) (Maybe [Group]) (Maybe [Group])
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 [Group] [Group] [Group] [Group]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
listGroupsResponse_nextToken :: Lens.Lens' ListGroupsResponse (Prelude.Maybe Prelude.Text)
listGroupsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListGroupsResponse -> f ListGroupsResponse
listGroupsResponse_nextToken = (ListGroupsResponse -> Maybe Text)
-> (ListGroupsResponse -> Maybe Text -> ListGroupsResponse)
-> Lens
ListGroupsResponse ListGroupsResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListGroupsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListGroupsResponse' :: ListGroupsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListGroupsResponse
s@ListGroupsResponse' {} Maybe Text
a -> ListGroupsResponse
s {$sel:nextToken:ListGroupsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListGroupsResponse)
listGroupsResponse_status :: Lens.Lens' ListGroupsResponse Prelude.Int
listGroupsResponse_status :: (Int -> f Int) -> ListGroupsResponse -> f ListGroupsResponse
listGroupsResponse_status = (ListGroupsResponse -> Int)
-> (ListGroupsResponse -> Int -> ListGroupsResponse)
-> Lens ListGroupsResponse ListGroupsResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListGroupsResponse' {Int
status :: Int
$sel:status:ListGroupsResponse' :: ListGroupsResponse -> Int
status} -> Int
status) (\s :: ListGroupsResponse
s@ListGroupsResponse' {} Int
a -> ListGroupsResponse
s {$sel:status:ListGroupsResponse' :: Int
status = Int
a} :: ListGroupsResponse)
instance Prelude.NFData ListGroupsResponse