{-# 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.Greengrass.DisassociateRoleFromGroup
(
DisassociateRoleFromGroup (..),
newDisassociateRoleFromGroup,
disassociateRoleFromGroup_groupId,
DisassociateRoleFromGroupResponse (..),
newDisassociateRoleFromGroupResponse,
disassociateRoleFromGroupResponse_disassociatedAt,
disassociateRoleFromGroupResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import Amazonka.Greengrass.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 DisassociateRoleFromGroup = DisassociateRoleFromGroup'
{
DisassociateRoleFromGroup -> Text
groupId :: Prelude.Text
}
deriving (DisassociateRoleFromGroup -> DisassociateRoleFromGroup -> Bool
(DisassociateRoleFromGroup -> DisassociateRoleFromGroup -> Bool)
-> (DisassociateRoleFromGroup -> DisassociateRoleFromGroup -> Bool)
-> Eq DisassociateRoleFromGroup
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DisassociateRoleFromGroup -> DisassociateRoleFromGroup -> Bool
$c/= :: DisassociateRoleFromGroup -> DisassociateRoleFromGroup -> Bool
== :: DisassociateRoleFromGroup -> DisassociateRoleFromGroup -> Bool
$c== :: DisassociateRoleFromGroup -> DisassociateRoleFromGroup -> Bool
Prelude.Eq, ReadPrec [DisassociateRoleFromGroup]
ReadPrec DisassociateRoleFromGroup
Int -> ReadS DisassociateRoleFromGroup
ReadS [DisassociateRoleFromGroup]
(Int -> ReadS DisassociateRoleFromGroup)
-> ReadS [DisassociateRoleFromGroup]
-> ReadPrec DisassociateRoleFromGroup
-> ReadPrec [DisassociateRoleFromGroup]
-> Read DisassociateRoleFromGroup
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DisassociateRoleFromGroup]
$creadListPrec :: ReadPrec [DisassociateRoleFromGroup]
readPrec :: ReadPrec DisassociateRoleFromGroup
$creadPrec :: ReadPrec DisassociateRoleFromGroup
readList :: ReadS [DisassociateRoleFromGroup]
$creadList :: ReadS [DisassociateRoleFromGroup]
readsPrec :: Int -> ReadS DisassociateRoleFromGroup
$creadsPrec :: Int -> ReadS DisassociateRoleFromGroup
Prelude.Read, Int -> DisassociateRoleFromGroup -> ShowS
[DisassociateRoleFromGroup] -> ShowS
DisassociateRoleFromGroup -> String
(Int -> DisassociateRoleFromGroup -> ShowS)
-> (DisassociateRoleFromGroup -> String)
-> ([DisassociateRoleFromGroup] -> ShowS)
-> Show DisassociateRoleFromGroup
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DisassociateRoleFromGroup] -> ShowS
$cshowList :: [DisassociateRoleFromGroup] -> ShowS
show :: DisassociateRoleFromGroup -> String
$cshow :: DisassociateRoleFromGroup -> String
showsPrec :: Int -> DisassociateRoleFromGroup -> ShowS
$cshowsPrec :: Int -> DisassociateRoleFromGroup -> ShowS
Prelude.Show, (forall x.
DisassociateRoleFromGroup -> Rep DisassociateRoleFromGroup x)
-> (forall x.
Rep DisassociateRoleFromGroup x -> DisassociateRoleFromGroup)
-> Generic DisassociateRoleFromGroup
forall x.
Rep DisassociateRoleFromGroup x -> DisassociateRoleFromGroup
forall x.
DisassociateRoleFromGroup -> Rep DisassociateRoleFromGroup x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DisassociateRoleFromGroup x -> DisassociateRoleFromGroup
$cfrom :: forall x.
DisassociateRoleFromGroup -> Rep DisassociateRoleFromGroup x
Prelude.Generic)
newDisassociateRoleFromGroup ::
Prelude.Text ->
DisassociateRoleFromGroup
newDisassociateRoleFromGroup :: Text -> DisassociateRoleFromGroup
newDisassociateRoleFromGroup Text
pGroupId_ =
DisassociateRoleFromGroup' :: Text -> DisassociateRoleFromGroup
DisassociateRoleFromGroup' {$sel:groupId:DisassociateRoleFromGroup' :: Text
groupId = Text
pGroupId_}
disassociateRoleFromGroup_groupId :: Lens.Lens' DisassociateRoleFromGroup Prelude.Text
disassociateRoleFromGroup_groupId :: (Text -> f Text)
-> DisassociateRoleFromGroup -> f DisassociateRoleFromGroup
disassociateRoleFromGroup_groupId = (DisassociateRoleFromGroup -> Text)
-> (DisassociateRoleFromGroup -> Text -> DisassociateRoleFromGroup)
-> Lens
DisassociateRoleFromGroup DisassociateRoleFromGroup Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DisassociateRoleFromGroup' {Text
groupId :: Text
$sel:groupId:DisassociateRoleFromGroup' :: DisassociateRoleFromGroup -> Text
groupId} -> Text
groupId) (\s :: DisassociateRoleFromGroup
s@DisassociateRoleFromGroup' {} Text
a -> DisassociateRoleFromGroup
s {$sel:groupId:DisassociateRoleFromGroup' :: Text
groupId = Text
a} :: DisassociateRoleFromGroup)
instance Core.AWSRequest DisassociateRoleFromGroup where
type
AWSResponse DisassociateRoleFromGroup =
DisassociateRoleFromGroupResponse
request :: DisassociateRoleFromGroup -> Request DisassociateRoleFromGroup
request = Service
-> DisassociateRoleFromGroup -> Request DisassociateRoleFromGroup
forall a. ToRequest a => Service -> a -> Request a
Request.delete Service
defaultService
response :: Logger
-> Service
-> Proxy DisassociateRoleFromGroup
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DisassociateRoleFromGroup)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DisassociateRoleFromGroup))
-> Logger
-> Service
-> Proxy DisassociateRoleFromGroup
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DisassociateRoleFromGroup)))
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 -> Int -> DisassociateRoleFromGroupResponse
DisassociateRoleFromGroupResponse'
(Maybe Text -> Int -> DisassociateRoleFromGroupResponse)
-> Either String (Maybe Text)
-> Either String (Int -> DisassociateRoleFromGroupResponse)
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
"DisassociatedAt")
Either String (Int -> DisassociateRoleFromGroupResponse)
-> Either String Int
-> Either String DisassociateRoleFromGroupResponse
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 DisassociateRoleFromGroup
instance Prelude.NFData DisassociateRoleFromGroup
instance Core.ToHeaders DisassociateRoleFromGroup where
toHeaders :: DisassociateRoleFromGroup -> ResponseHeaders
toHeaders =
ResponseHeaders -> DisassociateRoleFromGroup -> 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.1" ::
Prelude.ByteString
)
]
)
instance Core.ToPath DisassociateRoleFromGroup where
toPath :: DisassociateRoleFromGroup -> ByteString
toPath DisassociateRoleFromGroup' {Text
groupId :: Text
$sel:groupId:DisassociateRoleFromGroup' :: DisassociateRoleFromGroup -> Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/greengrass/groups/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
groupId, ByteString
"/role"]
instance Core.ToQuery DisassociateRoleFromGroup where
toQuery :: DisassociateRoleFromGroup -> QueryString
toQuery = QueryString -> DisassociateRoleFromGroup -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DisassociateRoleFromGroupResponse = DisassociateRoleFromGroupResponse'
{
DisassociateRoleFromGroupResponse -> Maybe Text
disassociatedAt :: Prelude.Maybe Prelude.Text,
DisassociateRoleFromGroupResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DisassociateRoleFromGroupResponse
-> DisassociateRoleFromGroupResponse -> Bool
(DisassociateRoleFromGroupResponse
-> DisassociateRoleFromGroupResponse -> Bool)
-> (DisassociateRoleFromGroupResponse
-> DisassociateRoleFromGroupResponse -> Bool)
-> Eq DisassociateRoleFromGroupResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DisassociateRoleFromGroupResponse
-> DisassociateRoleFromGroupResponse -> Bool
$c/= :: DisassociateRoleFromGroupResponse
-> DisassociateRoleFromGroupResponse -> Bool
== :: DisassociateRoleFromGroupResponse
-> DisassociateRoleFromGroupResponse -> Bool
$c== :: DisassociateRoleFromGroupResponse
-> DisassociateRoleFromGroupResponse -> Bool
Prelude.Eq, ReadPrec [DisassociateRoleFromGroupResponse]
ReadPrec DisassociateRoleFromGroupResponse
Int -> ReadS DisassociateRoleFromGroupResponse
ReadS [DisassociateRoleFromGroupResponse]
(Int -> ReadS DisassociateRoleFromGroupResponse)
-> ReadS [DisassociateRoleFromGroupResponse]
-> ReadPrec DisassociateRoleFromGroupResponse
-> ReadPrec [DisassociateRoleFromGroupResponse]
-> Read DisassociateRoleFromGroupResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DisassociateRoleFromGroupResponse]
$creadListPrec :: ReadPrec [DisassociateRoleFromGroupResponse]
readPrec :: ReadPrec DisassociateRoleFromGroupResponse
$creadPrec :: ReadPrec DisassociateRoleFromGroupResponse
readList :: ReadS [DisassociateRoleFromGroupResponse]
$creadList :: ReadS [DisassociateRoleFromGroupResponse]
readsPrec :: Int -> ReadS DisassociateRoleFromGroupResponse
$creadsPrec :: Int -> ReadS DisassociateRoleFromGroupResponse
Prelude.Read, Int -> DisassociateRoleFromGroupResponse -> ShowS
[DisassociateRoleFromGroupResponse] -> ShowS
DisassociateRoleFromGroupResponse -> String
(Int -> DisassociateRoleFromGroupResponse -> ShowS)
-> (DisassociateRoleFromGroupResponse -> String)
-> ([DisassociateRoleFromGroupResponse] -> ShowS)
-> Show DisassociateRoleFromGroupResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DisassociateRoleFromGroupResponse] -> ShowS
$cshowList :: [DisassociateRoleFromGroupResponse] -> ShowS
show :: DisassociateRoleFromGroupResponse -> String
$cshow :: DisassociateRoleFromGroupResponse -> String
showsPrec :: Int -> DisassociateRoleFromGroupResponse -> ShowS
$cshowsPrec :: Int -> DisassociateRoleFromGroupResponse -> ShowS
Prelude.Show, (forall x.
DisassociateRoleFromGroupResponse
-> Rep DisassociateRoleFromGroupResponse x)
-> (forall x.
Rep DisassociateRoleFromGroupResponse x
-> DisassociateRoleFromGroupResponse)
-> Generic DisassociateRoleFromGroupResponse
forall x.
Rep DisassociateRoleFromGroupResponse x
-> DisassociateRoleFromGroupResponse
forall x.
DisassociateRoleFromGroupResponse
-> Rep DisassociateRoleFromGroupResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DisassociateRoleFromGroupResponse x
-> DisassociateRoleFromGroupResponse
$cfrom :: forall x.
DisassociateRoleFromGroupResponse
-> Rep DisassociateRoleFromGroupResponse x
Prelude.Generic)
newDisassociateRoleFromGroupResponse ::
Prelude.Int ->
DisassociateRoleFromGroupResponse
newDisassociateRoleFromGroupResponse :: Int -> DisassociateRoleFromGroupResponse
newDisassociateRoleFromGroupResponse Int
pHttpStatus_ =
DisassociateRoleFromGroupResponse' :: Maybe Text -> Int -> DisassociateRoleFromGroupResponse
DisassociateRoleFromGroupResponse'
{ $sel:disassociatedAt:DisassociateRoleFromGroupResponse' :: Maybe Text
disassociatedAt =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DisassociateRoleFromGroupResponse' :: Int
httpStatus = Int
pHttpStatus_
}
disassociateRoleFromGroupResponse_disassociatedAt :: Lens.Lens' DisassociateRoleFromGroupResponse (Prelude.Maybe Prelude.Text)
disassociateRoleFromGroupResponse_disassociatedAt :: (Maybe Text -> f (Maybe Text))
-> DisassociateRoleFromGroupResponse
-> f DisassociateRoleFromGroupResponse
disassociateRoleFromGroupResponse_disassociatedAt = (DisassociateRoleFromGroupResponse -> Maybe Text)
-> (DisassociateRoleFromGroupResponse
-> Maybe Text -> DisassociateRoleFromGroupResponse)
-> Lens
DisassociateRoleFromGroupResponse
DisassociateRoleFromGroupResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DisassociateRoleFromGroupResponse' {Maybe Text
disassociatedAt :: Maybe Text
$sel:disassociatedAt:DisassociateRoleFromGroupResponse' :: DisassociateRoleFromGroupResponse -> Maybe Text
disassociatedAt} -> Maybe Text
disassociatedAt) (\s :: DisassociateRoleFromGroupResponse
s@DisassociateRoleFromGroupResponse' {} Maybe Text
a -> DisassociateRoleFromGroupResponse
s {$sel:disassociatedAt:DisassociateRoleFromGroupResponse' :: Maybe Text
disassociatedAt = Maybe Text
a} :: DisassociateRoleFromGroupResponse)
disassociateRoleFromGroupResponse_httpStatus :: Lens.Lens' DisassociateRoleFromGroupResponse Prelude.Int
disassociateRoleFromGroupResponse_httpStatus :: (Int -> f Int)
-> DisassociateRoleFromGroupResponse
-> f DisassociateRoleFromGroupResponse
disassociateRoleFromGroupResponse_httpStatus = (DisassociateRoleFromGroupResponse -> Int)
-> (DisassociateRoleFromGroupResponse
-> Int -> DisassociateRoleFromGroupResponse)
-> Lens
DisassociateRoleFromGroupResponse
DisassociateRoleFromGroupResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DisassociateRoleFromGroupResponse' {Int
httpStatus :: Int
$sel:httpStatus:DisassociateRoleFromGroupResponse' :: DisassociateRoleFromGroupResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DisassociateRoleFromGroupResponse
s@DisassociateRoleFromGroupResponse' {} Int
a -> DisassociateRoleFromGroupResponse
s {$sel:httpStatus:DisassociateRoleFromGroupResponse' :: Int
httpStatus = Int
a} :: DisassociateRoleFromGroupResponse)
instance
Prelude.NFData
DisassociateRoleFromGroupResponse