{-# 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.IdentityStore.DescribeGroup
(
DescribeGroup (..),
newDescribeGroup,
describeGroup_identityStoreId,
describeGroup_groupId,
DescribeGroupResponse (..),
newDescribeGroupResponse,
describeGroupResponse_httpStatus,
describeGroupResponse_groupId,
describeGroupResponse_displayName,
)
where
import qualified Amazonka.Core as Core
import Amazonka.IdentityStore.Types
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data DescribeGroup = DescribeGroup'
{
DescribeGroup -> Text
identityStoreId :: Prelude.Text,
DescribeGroup -> Text
groupId :: Prelude.Text
}
deriving (DescribeGroup -> DescribeGroup -> Bool
(DescribeGroup -> DescribeGroup -> Bool)
-> (DescribeGroup -> DescribeGroup -> Bool) -> Eq DescribeGroup
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeGroup -> DescribeGroup -> Bool
$c/= :: DescribeGroup -> DescribeGroup -> Bool
== :: DescribeGroup -> DescribeGroup -> Bool
$c== :: DescribeGroup -> DescribeGroup -> Bool
Prelude.Eq, ReadPrec [DescribeGroup]
ReadPrec DescribeGroup
Int -> ReadS DescribeGroup
ReadS [DescribeGroup]
(Int -> ReadS DescribeGroup)
-> ReadS [DescribeGroup]
-> ReadPrec DescribeGroup
-> ReadPrec [DescribeGroup]
-> Read DescribeGroup
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeGroup]
$creadListPrec :: ReadPrec [DescribeGroup]
readPrec :: ReadPrec DescribeGroup
$creadPrec :: ReadPrec DescribeGroup
readList :: ReadS [DescribeGroup]
$creadList :: ReadS [DescribeGroup]
readsPrec :: Int -> ReadS DescribeGroup
$creadsPrec :: Int -> ReadS DescribeGroup
Prelude.Read, Int -> DescribeGroup -> ShowS
[DescribeGroup] -> ShowS
DescribeGroup -> String
(Int -> DescribeGroup -> ShowS)
-> (DescribeGroup -> String)
-> ([DescribeGroup] -> ShowS)
-> Show DescribeGroup
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeGroup] -> ShowS
$cshowList :: [DescribeGroup] -> ShowS
show :: DescribeGroup -> String
$cshow :: DescribeGroup -> String
showsPrec :: Int -> DescribeGroup -> ShowS
$cshowsPrec :: Int -> DescribeGroup -> ShowS
Prelude.Show, (forall x. DescribeGroup -> Rep DescribeGroup x)
-> (forall x. Rep DescribeGroup x -> DescribeGroup)
-> Generic DescribeGroup
forall x. Rep DescribeGroup x -> DescribeGroup
forall x. DescribeGroup -> Rep DescribeGroup x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeGroup x -> DescribeGroup
$cfrom :: forall x. DescribeGroup -> Rep DescribeGroup x
Prelude.Generic)
newDescribeGroup ::
Prelude.Text ->
Prelude.Text ->
DescribeGroup
newDescribeGroup :: Text -> Text -> DescribeGroup
newDescribeGroup Text
pIdentityStoreId_ Text
pGroupId_ =
DescribeGroup' :: Text -> Text -> DescribeGroup
DescribeGroup'
{ $sel:identityStoreId:DescribeGroup' :: Text
identityStoreId = Text
pIdentityStoreId_,
$sel:groupId:DescribeGroup' :: Text
groupId = Text
pGroupId_
}
describeGroup_identityStoreId :: Lens.Lens' DescribeGroup Prelude.Text
describeGroup_identityStoreId :: (Text -> f Text) -> DescribeGroup -> f DescribeGroup
describeGroup_identityStoreId = (DescribeGroup -> Text)
-> (DescribeGroup -> Text -> DescribeGroup)
-> Lens DescribeGroup DescribeGroup Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeGroup' {Text
identityStoreId :: Text
$sel:identityStoreId:DescribeGroup' :: DescribeGroup -> Text
identityStoreId} -> Text
identityStoreId) (\s :: DescribeGroup
s@DescribeGroup' {} Text
a -> DescribeGroup
s {$sel:identityStoreId:DescribeGroup' :: Text
identityStoreId = Text
a} :: DescribeGroup)
describeGroup_groupId :: Lens.Lens' DescribeGroup Prelude.Text
describeGroup_groupId :: (Text -> f Text) -> DescribeGroup -> f DescribeGroup
describeGroup_groupId = (DescribeGroup -> Text)
-> (DescribeGroup -> Text -> DescribeGroup)
-> Lens DescribeGroup DescribeGroup Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeGroup' {Text
groupId :: Text
$sel:groupId:DescribeGroup' :: DescribeGroup -> Text
groupId} -> Text
groupId) (\s :: DescribeGroup
s@DescribeGroup' {} Text
a -> DescribeGroup
s {$sel:groupId:DescribeGroup' :: Text
groupId = Text
a} :: DescribeGroup)
instance Core.AWSRequest DescribeGroup where
type
AWSResponse DescribeGroup =
DescribeGroupResponse
request :: DescribeGroup -> Request DescribeGroup
request = Service -> DescribeGroup -> Request DescribeGroup
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DescribeGroup
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DescribeGroup)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DescribeGroup))
-> Logger
-> Service
-> Proxy DescribeGroup
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DescribeGroup)))
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 ->
Int -> Text -> Text -> DescribeGroupResponse
DescribeGroupResponse'
(Int -> Text -> Text -> DescribeGroupResponse)
-> Either String Int
-> Either String (Text -> Text -> DescribeGroupResponse)
forall (f :: * -> *) a b. Functor 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))
Either String (Text -> Text -> DescribeGroupResponse)
-> Either String Text
-> Either String (Text -> DescribeGroupResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String Text
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"GroupId")
Either String (Text -> DescribeGroupResponse)
-> Either String Text -> Either String DescribeGroupResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String Text
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"DisplayName")
)
instance Prelude.Hashable DescribeGroup
instance Prelude.NFData DescribeGroup
instance Core.ToHeaders DescribeGroup where
toHeaders :: DescribeGroup -> ResponseHeaders
toHeaders =
ResponseHeaders -> DescribeGroup -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"AWSIdentityStore.DescribeGroup" ::
Prelude.ByteString
),
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.ToJSON DescribeGroup where
toJSON :: DescribeGroup -> Value
toJSON DescribeGroup' {Text
groupId :: Text
identityStoreId :: Text
$sel:groupId:DescribeGroup' :: DescribeGroup -> Text
$sel:identityStoreId:DescribeGroup' :: DescribeGroup -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"IdentityStoreId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
identityStoreId),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"GroupId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
groupId)
]
)
instance Core.ToPath DescribeGroup where
toPath :: DescribeGroup -> ByteString
toPath = ByteString -> DescribeGroup -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DescribeGroup where
toQuery :: DescribeGroup -> QueryString
toQuery = QueryString -> DescribeGroup -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DescribeGroupResponse = DescribeGroupResponse'
{
DescribeGroupResponse -> Int
httpStatus :: Prelude.Int,
DescribeGroupResponse -> Text
groupId :: Prelude.Text,
DescribeGroupResponse -> Text
displayName :: Prelude.Text
}
deriving (DescribeGroupResponse -> DescribeGroupResponse -> Bool
(DescribeGroupResponse -> DescribeGroupResponse -> Bool)
-> (DescribeGroupResponse -> DescribeGroupResponse -> Bool)
-> Eq DescribeGroupResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeGroupResponse -> DescribeGroupResponse -> Bool
$c/= :: DescribeGroupResponse -> DescribeGroupResponse -> Bool
== :: DescribeGroupResponse -> DescribeGroupResponse -> Bool
$c== :: DescribeGroupResponse -> DescribeGroupResponse -> Bool
Prelude.Eq, ReadPrec [DescribeGroupResponse]
ReadPrec DescribeGroupResponse
Int -> ReadS DescribeGroupResponse
ReadS [DescribeGroupResponse]
(Int -> ReadS DescribeGroupResponse)
-> ReadS [DescribeGroupResponse]
-> ReadPrec DescribeGroupResponse
-> ReadPrec [DescribeGroupResponse]
-> Read DescribeGroupResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeGroupResponse]
$creadListPrec :: ReadPrec [DescribeGroupResponse]
readPrec :: ReadPrec DescribeGroupResponse
$creadPrec :: ReadPrec DescribeGroupResponse
readList :: ReadS [DescribeGroupResponse]
$creadList :: ReadS [DescribeGroupResponse]
readsPrec :: Int -> ReadS DescribeGroupResponse
$creadsPrec :: Int -> ReadS DescribeGroupResponse
Prelude.Read, Int -> DescribeGroupResponse -> ShowS
[DescribeGroupResponse] -> ShowS
DescribeGroupResponse -> String
(Int -> DescribeGroupResponse -> ShowS)
-> (DescribeGroupResponse -> String)
-> ([DescribeGroupResponse] -> ShowS)
-> Show DescribeGroupResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeGroupResponse] -> ShowS
$cshowList :: [DescribeGroupResponse] -> ShowS
show :: DescribeGroupResponse -> String
$cshow :: DescribeGroupResponse -> String
showsPrec :: Int -> DescribeGroupResponse -> ShowS
$cshowsPrec :: Int -> DescribeGroupResponse -> ShowS
Prelude.Show, (forall x. DescribeGroupResponse -> Rep DescribeGroupResponse x)
-> (forall x. Rep DescribeGroupResponse x -> DescribeGroupResponse)
-> Generic DescribeGroupResponse
forall x. Rep DescribeGroupResponse x -> DescribeGroupResponse
forall x. DescribeGroupResponse -> Rep DescribeGroupResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeGroupResponse x -> DescribeGroupResponse
$cfrom :: forall x. DescribeGroupResponse -> Rep DescribeGroupResponse x
Prelude.Generic)
newDescribeGroupResponse ::
Prelude.Int ->
Prelude.Text ->
Prelude.Text ->
DescribeGroupResponse
newDescribeGroupResponse :: Int -> Text -> Text -> DescribeGroupResponse
newDescribeGroupResponse
Int
pHttpStatus_
Text
pGroupId_
Text
pDisplayName_ =
DescribeGroupResponse' :: Int -> Text -> Text -> DescribeGroupResponse
DescribeGroupResponse'
{ $sel:httpStatus:DescribeGroupResponse' :: Int
httpStatus = Int
pHttpStatus_,
$sel:groupId:DescribeGroupResponse' :: Text
groupId = Text
pGroupId_,
$sel:displayName:DescribeGroupResponse' :: Text
displayName = Text
pDisplayName_
}
describeGroupResponse_httpStatus :: Lens.Lens' DescribeGroupResponse Prelude.Int
describeGroupResponse_httpStatus :: (Int -> f Int) -> DescribeGroupResponse -> f DescribeGroupResponse
describeGroupResponse_httpStatus = (DescribeGroupResponse -> Int)
-> (DescribeGroupResponse -> Int -> DescribeGroupResponse)
-> Lens DescribeGroupResponse DescribeGroupResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeGroupResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeGroupResponse' :: DescribeGroupResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeGroupResponse
s@DescribeGroupResponse' {} Int
a -> DescribeGroupResponse
s {$sel:httpStatus:DescribeGroupResponse' :: Int
httpStatus = Int
a} :: DescribeGroupResponse)
describeGroupResponse_groupId :: Lens.Lens' DescribeGroupResponse Prelude.Text
describeGroupResponse_groupId :: (Text -> f Text)
-> DescribeGroupResponse -> f DescribeGroupResponse
describeGroupResponse_groupId = (DescribeGroupResponse -> Text)
-> (DescribeGroupResponse -> Text -> DescribeGroupResponse)
-> Lens DescribeGroupResponse DescribeGroupResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeGroupResponse' {Text
groupId :: Text
$sel:groupId:DescribeGroupResponse' :: DescribeGroupResponse -> Text
groupId} -> Text
groupId) (\s :: DescribeGroupResponse
s@DescribeGroupResponse' {} Text
a -> DescribeGroupResponse
s {$sel:groupId:DescribeGroupResponse' :: Text
groupId = Text
a} :: DescribeGroupResponse)
describeGroupResponse_displayName :: Lens.Lens' DescribeGroupResponse Prelude.Text
describeGroupResponse_displayName :: (Text -> f Text)
-> DescribeGroupResponse -> f DescribeGroupResponse
describeGroupResponse_displayName = (DescribeGroupResponse -> Text)
-> (DescribeGroupResponse -> Text -> DescribeGroupResponse)
-> Lens DescribeGroupResponse DescribeGroupResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeGroupResponse' {Text
displayName :: Text
$sel:displayName:DescribeGroupResponse' :: DescribeGroupResponse -> Text
displayName} -> Text
displayName) (\s :: DescribeGroupResponse
s@DescribeGroupResponse' {} Text
a -> DescribeGroupResponse
s {$sel:displayName:DescribeGroupResponse' :: Text
displayName = Text
a} :: DescribeGroupResponse)
instance Prelude.NFData DescribeGroupResponse