{-# 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.DisassociateServiceRoleFromAccount
(
DisassociateServiceRoleFromAccount (..),
newDisassociateServiceRoleFromAccount,
DisassociateServiceRoleFromAccountResponse (..),
newDisassociateServiceRoleFromAccountResponse,
disassociateServiceRoleFromAccountResponse_disassociatedAt,
disassociateServiceRoleFromAccountResponse_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 DisassociateServiceRoleFromAccount = DisassociateServiceRoleFromAccount'
{
}
deriving (DisassociateServiceRoleFromAccount
-> DisassociateServiceRoleFromAccount -> Bool
(DisassociateServiceRoleFromAccount
-> DisassociateServiceRoleFromAccount -> Bool)
-> (DisassociateServiceRoleFromAccount
-> DisassociateServiceRoleFromAccount -> Bool)
-> Eq DisassociateServiceRoleFromAccount
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DisassociateServiceRoleFromAccount
-> DisassociateServiceRoleFromAccount -> Bool
$c/= :: DisassociateServiceRoleFromAccount
-> DisassociateServiceRoleFromAccount -> Bool
== :: DisassociateServiceRoleFromAccount
-> DisassociateServiceRoleFromAccount -> Bool
$c== :: DisassociateServiceRoleFromAccount
-> DisassociateServiceRoleFromAccount -> Bool
Prelude.Eq, ReadPrec [DisassociateServiceRoleFromAccount]
ReadPrec DisassociateServiceRoleFromAccount
Int -> ReadS DisassociateServiceRoleFromAccount
ReadS [DisassociateServiceRoleFromAccount]
(Int -> ReadS DisassociateServiceRoleFromAccount)
-> ReadS [DisassociateServiceRoleFromAccount]
-> ReadPrec DisassociateServiceRoleFromAccount
-> ReadPrec [DisassociateServiceRoleFromAccount]
-> Read DisassociateServiceRoleFromAccount
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DisassociateServiceRoleFromAccount]
$creadListPrec :: ReadPrec [DisassociateServiceRoleFromAccount]
readPrec :: ReadPrec DisassociateServiceRoleFromAccount
$creadPrec :: ReadPrec DisassociateServiceRoleFromAccount
readList :: ReadS [DisassociateServiceRoleFromAccount]
$creadList :: ReadS [DisassociateServiceRoleFromAccount]
readsPrec :: Int -> ReadS DisassociateServiceRoleFromAccount
$creadsPrec :: Int -> ReadS DisassociateServiceRoleFromAccount
Prelude.Read, Int -> DisassociateServiceRoleFromAccount -> ShowS
[DisassociateServiceRoleFromAccount] -> ShowS
DisassociateServiceRoleFromAccount -> String
(Int -> DisassociateServiceRoleFromAccount -> ShowS)
-> (DisassociateServiceRoleFromAccount -> String)
-> ([DisassociateServiceRoleFromAccount] -> ShowS)
-> Show DisassociateServiceRoleFromAccount
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DisassociateServiceRoleFromAccount] -> ShowS
$cshowList :: [DisassociateServiceRoleFromAccount] -> ShowS
show :: DisassociateServiceRoleFromAccount -> String
$cshow :: DisassociateServiceRoleFromAccount -> String
showsPrec :: Int -> DisassociateServiceRoleFromAccount -> ShowS
$cshowsPrec :: Int -> DisassociateServiceRoleFromAccount -> ShowS
Prelude.Show, (forall x.
DisassociateServiceRoleFromAccount
-> Rep DisassociateServiceRoleFromAccount x)
-> (forall x.
Rep DisassociateServiceRoleFromAccount x
-> DisassociateServiceRoleFromAccount)
-> Generic DisassociateServiceRoleFromAccount
forall x.
Rep DisassociateServiceRoleFromAccount x
-> DisassociateServiceRoleFromAccount
forall x.
DisassociateServiceRoleFromAccount
-> Rep DisassociateServiceRoleFromAccount x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DisassociateServiceRoleFromAccount x
-> DisassociateServiceRoleFromAccount
$cfrom :: forall x.
DisassociateServiceRoleFromAccount
-> Rep DisassociateServiceRoleFromAccount x
Prelude.Generic)
newDisassociateServiceRoleFromAccount ::
DisassociateServiceRoleFromAccount
newDisassociateServiceRoleFromAccount :: DisassociateServiceRoleFromAccount
newDisassociateServiceRoleFromAccount =
DisassociateServiceRoleFromAccount
DisassociateServiceRoleFromAccount'
instance
Core.AWSRequest
DisassociateServiceRoleFromAccount
where
type
AWSResponse DisassociateServiceRoleFromAccount =
DisassociateServiceRoleFromAccountResponse
request :: DisassociateServiceRoleFromAccount
-> Request DisassociateServiceRoleFromAccount
request = Service
-> DisassociateServiceRoleFromAccount
-> Request DisassociateServiceRoleFromAccount
forall a. ToRequest a => Service -> a -> Request a
Request.delete Service
defaultService
response :: Logger
-> Service
-> Proxy DisassociateServiceRoleFromAccount
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse DisassociateServiceRoleFromAccount)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DisassociateServiceRoleFromAccount))
-> Logger
-> Service
-> Proxy DisassociateServiceRoleFromAccount
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse DisassociateServiceRoleFromAccount)))
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 -> DisassociateServiceRoleFromAccountResponse
DisassociateServiceRoleFromAccountResponse'
(Maybe Text -> Int -> DisassociateServiceRoleFromAccountResponse)
-> Either String (Maybe Text)
-> Either
String (Int -> DisassociateServiceRoleFromAccountResponse)
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 -> DisassociateServiceRoleFromAccountResponse)
-> Either String Int
-> Either String DisassociateServiceRoleFromAccountResponse
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
DisassociateServiceRoleFromAccount
instance
Prelude.NFData
DisassociateServiceRoleFromAccount
instance
Core.ToHeaders
DisassociateServiceRoleFromAccount
where
toHeaders :: DisassociateServiceRoleFromAccount -> ResponseHeaders
toHeaders =
ResponseHeaders
-> DisassociateServiceRoleFromAccount -> 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
DisassociateServiceRoleFromAccount
where
toPath :: DisassociateServiceRoleFromAccount -> ByteString
toPath = ByteString -> DisassociateServiceRoleFromAccount -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/greengrass/servicerole"
instance
Core.ToQuery
DisassociateServiceRoleFromAccount
where
toQuery :: DisassociateServiceRoleFromAccount -> QueryString
toQuery = QueryString -> DisassociateServiceRoleFromAccount -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DisassociateServiceRoleFromAccountResponse = DisassociateServiceRoleFromAccountResponse'
{
DisassociateServiceRoleFromAccountResponse -> Maybe Text
disassociatedAt :: Prelude.Maybe Prelude.Text,
DisassociateServiceRoleFromAccountResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DisassociateServiceRoleFromAccountResponse
-> DisassociateServiceRoleFromAccountResponse -> Bool
(DisassociateServiceRoleFromAccountResponse
-> DisassociateServiceRoleFromAccountResponse -> Bool)
-> (DisassociateServiceRoleFromAccountResponse
-> DisassociateServiceRoleFromAccountResponse -> Bool)
-> Eq DisassociateServiceRoleFromAccountResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DisassociateServiceRoleFromAccountResponse
-> DisassociateServiceRoleFromAccountResponse -> Bool
$c/= :: DisassociateServiceRoleFromAccountResponse
-> DisassociateServiceRoleFromAccountResponse -> Bool
== :: DisassociateServiceRoleFromAccountResponse
-> DisassociateServiceRoleFromAccountResponse -> Bool
$c== :: DisassociateServiceRoleFromAccountResponse
-> DisassociateServiceRoleFromAccountResponse -> Bool
Prelude.Eq, ReadPrec [DisassociateServiceRoleFromAccountResponse]
ReadPrec DisassociateServiceRoleFromAccountResponse
Int -> ReadS DisassociateServiceRoleFromAccountResponse
ReadS [DisassociateServiceRoleFromAccountResponse]
(Int -> ReadS DisassociateServiceRoleFromAccountResponse)
-> ReadS [DisassociateServiceRoleFromAccountResponse]
-> ReadPrec DisassociateServiceRoleFromAccountResponse
-> ReadPrec [DisassociateServiceRoleFromAccountResponse]
-> Read DisassociateServiceRoleFromAccountResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DisassociateServiceRoleFromAccountResponse]
$creadListPrec :: ReadPrec [DisassociateServiceRoleFromAccountResponse]
readPrec :: ReadPrec DisassociateServiceRoleFromAccountResponse
$creadPrec :: ReadPrec DisassociateServiceRoleFromAccountResponse
readList :: ReadS [DisassociateServiceRoleFromAccountResponse]
$creadList :: ReadS [DisassociateServiceRoleFromAccountResponse]
readsPrec :: Int -> ReadS DisassociateServiceRoleFromAccountResponse
$creadsPrec :: Int -> ReadS DisassociateServiceRoleFromAccountResponse
Prelude.Read, Int -> DisassociateServiceRoleFromAccountResponse -> ShowS
[DisassociateServiceRoleFromAccountResponse] -> ShowS
DisassociateServiceRoleFromAccountResponse -> String
(Int -> DisassociateServiceRoleFromAccountResponse -> ShowS)
-> (DisassociateServiceRoleFromAccountResponse -> String)
-> ([DisassociateServiceRoleFromAccountResponse] -> ShowS)
-> Show DisassociateServiceRoleFromAccountResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DisassociateServiceRoleFromAccountResponse] -> ShowS
$cshowList :: [DisassociateServiceRoleFromAccountResponse] -> ShowS
show :: DisassociateServiceRoleFromAccountResponse -> String
$cshow :: DisassociateServiceRoleFromAccountResponse -> String
showsPrec :: Int -> DisassociateServiceRoleFromAccountResponse -> ShowS
$cshowsPrec :: Int -> DisassociateServiceRoleFromAccountResponse -> ShowS
Prelude.Show, (forall x.
DisassociateServiceRoleFromAccountResponse
-> Rep DisassociateServiceRoleFromAccountResponse x)
-> (forall x.
Rep DisassociateServiceRoleFromAccountResponse x
-> DisassociateServiceRoleFromAccountResponse)
-> Generic DisassociateServiceRoleFromAccountResponse
forall x.
Rep DisassociateServiceRoleFromAccountResponse x
-> DisassociateServiceRoleFromAccountResponse
forall x.
DisassociateServiceRoleFromAccountResponse
-> Rep DisassociateServiceRoleFromAccountResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DisassociateServiceRoleFromAccountResponse x
-> DisassociateServiceRoleFromAccountResponse
$cfrom :: forall x.
DisassociateServiceRoleFromAccountResponse
-> Rep DisassociateServiceRoleFromAccountResponse x
Prelude.Generic)
newDisassociateServiceRoleFromAccountResponse ::
Prelude.Int ->
DisassociateServiceRoleFromAccountResponse
newDisassociateServiceRoleFromAccountResponse :: Int -> DisassociateServiceRoleFromAccountResponse
newDisassociateServiceRoleFromAccountResponse
Int
pHttpStatus_ =
DisassociateServiceRoleFromAccountResponse' :: Maybe Text -> Int -> DisassociateServiceRoleFromAccountResponse
DisassociateServiceRoleFromAccountResponse'
{ $sel:disassociatedAt:DisassociateServiceRoleFromAccountResponse' :: Maybe Text
disassociatedAt =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DisassociateServiceRoleFromAccountResponse' :: Int
httpStatus = Int
pHttpStatus_
}
disassociateServiceRoleFromAccountResponse_disassociatedAt :: Lens.Lens' DisassociateServiceRoleFromAccountResponse (Prelude.Maybe Prelude.Text)
disassociateServiceRoleFromAccountResponse_disassociatedAt :: (Maybe Text -> f (Maybe Text))
-> DisassociateServiceRoleFromAccountResponse
-> f DisassociateServiceRoleFromAccountResponse
disassociateServiceRoleFromAccountResponse_disassociatedAt = (DisassociateServiceRoleFromAccountResponse -> Maybe Text)
-> (DisassociateServiceRoleFromAccountResponse
-> Maybe Text -> DisassociateServiceRoleFromAccountResponse)
-> Lens
DisassociateServiceRoleFromAccountResponse
DisassociateServiceRoleFromAccountResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DisassociateServiceRoleFromAccountResponse' {Maybe Text
disassociatedAt :: Maybe Text
$sel:disassociatedAt:DisassociateServiceRoleFromAccountResponse' :: DisassociateServiceRoleFromAccountResponse -> Maybe Text
disassociatedAt} -> Maybe Text
disassociatedAt) (\s :: DisassociateServiceRoleFromAccountResponse
s@DisassociateServiceRoleFromAccountResponse' {} Maybe Text
a -> DisassociateServiceRoleFromAccountResponse
s {$sel:disassociatedAt:DisassociateServiceRoleFromAccountResponse' :: Maybe Text
disassociatedAt = Maybe Text
a} :: DisassociateServiceRoleFromAccountResponse)
disassociateServiceRoleFromAccountResponse_httpStatus :: Lens.Lens' DisassociateServiceRoleFromAccountResponse Prelude.Int
disassociateServiceRoleFromAccountResponse_httpStatus :: (Int -> f Int)
-> DisassociateServiceRoleFromAccountResponse
-> f DisassociateServiceRoleFromAccountResponse
disassociateServiceRoleFromAccountResponse_httpStatus = (DisassociateServiceRoleFromAccountResponse -> Int)
-> (DisassociateServiceRoleFromAccountResponse
-> Int -> DisassociateServiceRoleFromAccountResponse)
-> Lens
DisassociateServiceRoleFromAccountResponse
DisassociateServiceRoleFromAccountResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DisassociateServiceRoleFromAccountResponse' {Int
httpStatus :: Int
$sel:httpStatus:DisassociateServiceRoleFromAccountResponse' :: DisassociateServiceRoleFromAccountResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DisassociateServiceRoleFromAccountResponse
s@DisassociateServiceRoleFromAccountResponse' {} Int
a -> DisassociateServiceRoleFromAccountResponse
s {$sel:httpStatus:DisassociateServiceRoleFromAccountResponse' :: Int
httpStatus = Int
a} :: DisassociateServiceRoleFromAccountResponse)
instance
Prelude.NFData
DisassociateServiceRoleFromAccountResponse