{-# 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.MacieV2.DeleteInvitations
(
DeleteInvitations (..),
newDeleteInvitations,
deleteInvitations_accountIds,
DeleteInvitationsResponse (..),
newDeleteInvitationsResponse,
deleteInvitationsResponse_unprocessedAccounts,
deleteInvitationsResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MacieV2.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data DeleteInvitations = DeleteInvitations'
{
DeleteInvitations -> [Text]
accountIds :: [Prelude.Text]
}
deriving (DeleteInvitations -> DeleteInvitations -> Bool
(DeleteInvitations -> DeleteInvitations -> Bool)
-> (DeleteInvitations -> DeleteInvitations -> Bool)
-> Eq DeleteInvitations
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteInvitations -> DeleteInvitations -> Bool
$c/= :: DeleteInvitations -> DeleteInvitations -> Bool
== :: DeleteInvitations -> DeleteInvitations -> Bool
$c== :: DeleteInvitations -> DeleteInvitations -> Bool
Prelude.Eq, ReadPrec [DeleteInvitations]
ReadPrec DeleteInvitations
Int -> ReadS DeleteInvitations
ReadS [DeleteInvitations]
(Int -> ReadS DeleteInvitations)
-> ReadS [DeleteInvitations]
-> ReadPrec DeleteInvitations
-> ReadPrec [DeleteInvitations]
-> Read DeleteInvitations
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteInvitations]
$creadListPrec :: ReadPrec [DeleteInvitations]
readPrec :: ReadPrec DeleteInvitations
$creadPrec :: ReadPrec DeleteInvitations
readList :: ReadS [DeleteInvitations]
$creadList :: ReadS [DeleteInvitations]
readsPrec :: Int -> ReadS DeleteInvitations
$creadsPrec :: Int -> ReadS DeleteInvitations
Prelude.Read, Int -> DeleteInvitations -> ShowS
[DeleteInvitations] -> ShowS
DeleteInvitations -> String
(Int -> DeleteInvitations -> ShowS)
-> (DeleteInvitations -> String)
-> ([DeleteInvitations] -> ShowS)
-> Show DeleteInvitations
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteInvitations] -> ShowS
$cshowList :: [DeleteInvitations] -> ShowS
show :: DeleteInvitations -> String
$cshow :: DeleteInvitations -> String
showsPrec :: Int -> DeleteInvitations -> ShowS
$cshowsPrec :: Int -> DeleteInvitations -> ShowS
Prelude.Show, (forall x. DeleteInvitations -> Rep DeleteInvitations x)
-> (forall x. Rep DeleteInvitations x -> DeleteInvitations)
-> Generic DeleteInvitations
forall x. Rep DeleteInvitations x -> DeleteInvitations
forall x. DeleteInvitations -> Rep DeleteInvitations x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteInvitations x -> DeleteInvitations
$cfrom :: forall x. DeleteInvitations -> Rep DeleteInvitations x
Prelude.Generic)
newDeleteInvitations ::
DeleteInvitations
newDeleteInvitations :: DeleteInvitations
newDeleteInvitations =
DeleteInvitations' :: [Text] -> DeleteInvitations
DeleteInvitations' {$sel:accountIds:DeleteInvitations' :: [Text]
accountIds = [Text]
forall a. Monoid a => a
Prelude.mempty}
deleteInvitations_accountIds :: Lens.Lens' DeleteInvitations [Prelude.Text]
deleteInvitations_accountIds :: ([Text] -> f [Text]) -> DeleteInvitations -> f DeleteInvitations
deleteInvitations_accountIds = (DeleteInvitations -> [Text])
-> (DeleteInvitations -> [Text] -> DeleteInvitations)
-> Lens DeleteInvitations DeleteInvitations [Text] [Text]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteInvitations' {[Text]
accountIds :: [Text]
$sel:accountIds:DeleteInvitations' :: DeleteInvitations -> [Text]
accountIds} -> [Text]
accountIds) (\s :: DeleteInvitations
s@DeleteInvitations' {} [Text]
a -> DeleteInvitations
s {$sel:accountIds:DeleteInvitations' :: [Text]
accountIds = [Text]
a} :: DeleteInvitations) (([Text] -> f [Text]) -> DeleteInvitations -> f DeleteInvitations)
-> (([Text] -> f [Text]) -> [Text] -> f [Text])
-> ([Text] -> f [Text])
-> DeleteInvitations
-> f DeleteInvitations
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Text] -> f [Text]) -> [Text] -> f [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.AWSRequest DeleteInvitations where
type
AWSResponse DeleteInvitations =
DeleteInvitationsResponse
request :: DeleteInvitations -> Request DeleteInvitations
request = Service -> DeleteInvitations -> Request DeleteInvitations
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteInvitations
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteInvitations)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DeleteInvitations))
-> Logger
-> Service
-> Proxy DeleteInvitations
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteInvitations)))
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 [UnprocessedAccount] -> Int -> DeleteInvitationsResponse
DeleteInvitationsResponse'
(Maybe [UnprocessedAccount] -> Int -> DeleteInvitationsResponse)
-> Either String (Maybe [UnprocessedAccount])
-> Either String (Int -> DeleteInvitationsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x Object
-> Text -> Either String (Maybe (Maybe [UnprocessedAccount]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"unprocessedAccounts"
Either String (Maybe (Maybe [UnprocessedAccount]))
-> Maybe [UnprocessedAccount]
-> Either String (Maybe [UnprocessedAccount])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [UnprocessedAccount]
forall a. Monoid a => a
Prelude.mempty
)
Either String (Int -> DeleteInvitationsResponse)
-> Either String Int -> Either String DeleteInvitationsResponse
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 DeleteInvitations
instance Prelude.NFData DeleteInvitations
instance Core.ToHeaders DeleteInvitations where
toHeaders :: DeleteInvitations -> ResponseHeaders
toHeaders =
ResponseHeaders -> DeleteInvitations -> 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.ToJSON DeleteInvitations where
toJSON :: DeleteInvitations -> Value
toJSON DeleteInvitations' {[Text]
accountIds :: [Text]
$sel:accountIds:DeleteInvitations' :: DeleteInvitations -> [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
"accountIds" Text -> [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= [Text]
accountIds)]
)
instance Core.ToPath DeleteInvitations where
toPath :: DeleteInvitations -> ByteString
toPath = ByteString -> DeleteInvitations -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/invitations/delete"
instance Core.ToQuery DeleteInvitations where
toQuery :: DeleteInvitations -> QueryString
toQuery = QueryString -> DeleteInvitations -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DeleteInvitationsResponse = DeleteInvitationsResponse'
{
DeleteInvitationsResponse -> Maybe [UnprocessedAccount]
unprocessedAccounts :: Prelude.Maybe [UnprocessedAccount],
DeleteInvitationsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteInvitationsResponse -> DeleteInvitationsResponse -> Bool
(DeleteInvitationsResponse -> DeleteInvitationsResponse -> Bool)
-> (DeleteInvitationsResponse -> DeleteInvitationsResponse -> Bool)
-> Eq DeleteInvitationsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteInvitationsResponse -> DeleteInvitationsResponse -> Bool
$c/= :: DeleteInvitationsResponse -> DeleteInvitationsResponse -> Bool
== :: DeleteInvitationsResponse -> DeleteInvitationsResponse -> Bool
$c== :: DeleteInvitationsResponse -> DeleteInvitationsResponse -> Bool
Prelude.Eq, ReadPrec [DeleteInvitationsResponse]
ReadPrec DeleteInvitationsResponse
Int -> ReadS DeleteInvitationsResponse
ReadS [DeleteInvitationsResponse]
(Int -> ReadS DeleteInvitationsResponse)
-> ReadS [DeleteInvitationsResponse]
-> ReadPrec DeleteInvitationsResponse
-> ReadPrec [DeleteInvitationsResponse]
-> Read DeleteInvitationsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteInvitationsResponse]
$creadListPrec :: ReadPrec [DeleteInvitationsResponse]
readPrec :: ReadPrec DeleteInvitationsResponse
$creadPrec :: ReadPrec DeleteInvitationsResponse
readList :: ReadS [DeleteInvitationsResponse]
$creadList :: ReadS [DeleteInvitationsResponse]
readsPrec :: Int -> ReadS DeleteInvitationsResponse
$creadsPrec :: Int -> ReadS DeleteInvitationsResponse
Prelude.Read, Int -> DeleteInvitationsResponse -> ShowS
[DeleteInvitationsResponse] -> ShowS
DeleteInvitationsResponse -> String
(Int -> DeleteInvitationsResponse -> ShowS)
-> (DeleteInvitationsResponse -> String)
-> ([DeleteInvitationsResponse] -> ShowS)
-> Show DeleteInvitationsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteInvitationsResponse] -> ShowS
$cshowList :: [DeleteInvitationsResponse] -> ShowS
show :: DeleteInvitationsResponse -> String
$cshow :: DeleteInvitationsResponse -> String
showsPrec :: Int -> DeleteInvitationsResponse -> ShowS
$cshowsPrec :: Int -> DeleteInvitationsResponse -> ShowS
Prelude.Show, (forall x.
DeleteInvitationsResponse -> Rep DeleteInvitationsResponse x)
-> (forall x.
Rep DeleteInvitationsResponse x -> DeleteInvitationsResponse)
-> Generic DeleteInvitationsResponse
forall x.
Rep DeleteInvitationsResponse x -> DeleteInvitationsResponse
forall x.
DeleteInvitationsResponse -> Rep DeleteInvitationsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteInvitationsResponse x -> DeleteInvitationsResponse
$cfrom :: forall x.
DeleteInvitationsResponse -> Rep DeleteInvitationsResponse x
Prelude.Generic)
newDeleteInvitationsResponse ::
Prelude.Int ->
DeleteInvitationsResponse
newDeleteInvitationsResponse :: Int -> DeleteInvitationsResponse
newDeleteInvitationsResponse Int
pHttpStatus_ =
DeleteInvitationsResponse' :: Maybe [UnprocessedAccount] -> Int -> DeleteInvitationsResponse
DeleteInvitationsResponse'
{ $sel:unprocessedAccounts:DeleteInvitationsResponse' :: Maybe [UnprocessedAccount]
unprocessedAccounts =
Maybe [UnprocessedAccount]
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DeleteInvitationsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
deleteInvitationsResponse_unprocessedAccounts :: Lens.Lens' DeleteInvitationsResponse (Prelude.Maybe [UnprocessedAccount])
deleteInvitationsResponse_unprocessedAccounts :: (Maybe [UnprocessedAccount] -> f (Maybe [UnprocessedAccount]))
-> DeleteInvitationsResponse -> f DeleteInvitationsResponse
deleteInvitationsResponse_unprocessedAccounts = (DeleteInvitationsResponse -> Maybe [UnprocessedAccount])
-> (DeleteInvitationsResponse
-> Maybe [UnprocessedAccount] -> DeleteInvitationsResponse)
-> Lens
DeleteInvitationsResponse
DeleteInvitationsResponse
(Maybe [UnprocessedAccount])
(Maybe [UnprocessedAccount])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteInvitationsResponse' {Maybe [UnprocessedAccount]
unprocessedAccounts :: Maybe [UnprocessedAccount]
$sel:unprocessedAccounts:DeleteInvitationsResponse' :: DeleteInvitationsResponse -> Maybe [UnprocessedAccount]
unprocessedAccounts} -> Maybe [UnprocessedAccount]
unprocessedAccounts) (\s :: DeleteInvitationsResponse
s@DeleteInvitationsResponse' {} Maybe [UnprocessedAccount]
a -> DeleteInvitationsResponse
s {$sel:unprocessedAccounts:DeleteInvitationsResponse' :: Maybe [UnprocessedAccount]
unprocessedAccounts = Maybe [UnprocessedAccount]
a} :: DeleteInvitationsResponse) ((Maybe [UnprocessedAccount] -> f (Maybe [UnprocessedAccount]))
-> DeleteInvitationsResponse -> f DeleteInvitationsResponse)
-> ((Maybe [UnprocessedAccount] -> f (Maybe [UnprocessedAccount]))
-> Maybe [UnprocessedAccount] -> f (Maybe [UnprocessedAccount]))
-> (Maybe [UnprocessedAccount] -> f (Maybe [UnprocessedAccount]))
-> DeleteInvitationsResponse
-> f DeleteInvitationsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[UnprocessedAccount]
[UnprocessedAccount]
[UnprocessedAccount]
[UnprocessedAccount]
-> Iso
(Maybe [UnprocessedAccount])
(Maybe [UnprocessedAccount])
(Maybe [UnprocessedAccount])
(Maybe [UnprocessedAccount])
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
[UnprocessedAccount]
[UnprocessedAccount]
[UnprocessedAccount]
[UnprocessedAccount]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
deleteInvitationsResponse_httpStatus :: Lens.Lens' DeleteInvitationsResponse Prelude.Int
deleteInvitationsResponse_httpStatus :: (Int -> f Int)
-> DeleteInvitationsResponse -> f DeleteInvitationsResponse
deleteInvitationsResponse_httpStatus = (DeleteInvitationsResponse -> Int)
-> (DeleteInvitationsResponse -> Int -> DeleteInvitationsResponse)
-> Lens DeleteInvitationsResponse DeleteInvitationsResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteInvitationsResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteInvitationsResponse' :: DeleteInvitationsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteInvitationsResponse
s@DeleteInvitationsResponse' {} Int
a -> DeleteInvitationsResponse
s {$sel:httpStatus:DeleteInvitationsResponse' :: Int
httpStatus = Int
a} :: DeleteInvitationsResponse)
instance Prelude.NFData DeleteInvitationsResponse