{-# 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.Organizations.MoveAccount
(
MoveAccount (..),
newMoveAccount,
moveAccount_accountId,
moveAccount_sourceParentId,
moveAccount_destinationParentId,
MoveAccountResponse (..),
newMoveAccountResponse,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.Organizations.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data MoveAccount = MoveAccount'
{
MoveAccount -> Text
accountId :: Prelude.Text,
MoveAccount -> Text
sourceParentId :: Prelude.Text,
MoveAccount -> Text
destinationParentId :: Prelude.Text
}
deriving (MoveAccount -> MoveAccount -> Bool
(MoveAccount -> MoveAccount -> Bool)
-> (MoveAccount -> MoveAccount -> Bool) -> Eq MoveAccount
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MoveAccount -> MoveAccount -> Bool
$c/= :: MoveAccount -> MoveAccount -> Bool
== :: MoveAccount -> MoveAccount -> Bool
$c== :: MoveAccount -> MoveAccount -> Bool
Prelude.Eq, ReadPrec [MoveAccount]
ReadPrec MoveAccount
Int -> ReadS MoveAccount
ReadS [MoveAccount]
(Int -> ReadS MoveAccount)
-> ReadS [MoveAccount]
-> ReadPrec MoveAccount
-> ReadPrec [MoveAccount]
-> Read MoveAccount
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [MoveAccount]
$creadListPrec :: ReadPrec [MoveAccount]
readPrec :: ReadPrec MoveAccount
$creadPrec :: ReadPrec MoveAccount
readList :: ReadS [MoveAccount]
$creadList :: ReadS [MoveAccount]
readsPrec :: Int -> ReadS MoveAccount
$creadsPrec :: Int -> ReadS MoveAccount
Prelude.Read, Int -> MoveAccount -> ShowS
[MoveAccount] -> ShowS
MoveAccount -> String
(Int -> MoveAccount -> ShowS)
-> (MoveAccount -> String)
-> ([MoveAccount] -> ShowS)
-> Show MoveAccount
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MoveAccount] -> ShowS
$cshowList :: [MoveAccount] -> ShowS
show :: MoveAccount -> String
$cshow :: MoveAccount -> String
showsPrec :: Int -> MoveAccount -> ShowS
$cshowsPrec :: Int -> MoveAccount -> ShowS
Prelude.Show, (forall x. MoveAccount -> Rep MoveAccount x)
-> (forall x. Rep MoveAccount x -> MoveAccount)
-> Generic MoveAccount
forall x. Rep MoveAccount x -> MoveAccount
forall x. MoveAccount -> Rep MoveAccount x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep MoveAccount x -> MoveAccount
$cfrom :: forall x. MoveAccount -> Rep MoveAccount x
Prelude.Generic)
newMoveAccount ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
MoveAccount
newMoveAccount :: Text -> Text -> Text -> MoveAccount
newMoveAccount
Text
pAccountId_
Text
pSourceParentId_
Text
pDestinationParentId_ =
MoveAccount' :: Text -> Text -> Text -> MoveAccount
MoveAccount'
{ $sel:accountId:MoveAccount' :: Text
accountId = Text
pAccountId_,
$sel:sourceParentId:MoveAccount' :: Text
sourceParentId = Text
pSourceParentId_,
$sel:destinationParentId:MoveAccount' :: Text
destinationParentId = Text
pDestinationParentId_
}
moveAccount_accountId :: Lens.Lens' MoveAccount Prelude.Text
moveAccount_accountId :: (Text -> f Text) -> MoveAccount -> f MoveAccount
moveAccount_accountId = (MoveAccount -> Text)
-> (MoveAccount -> Text -> MoveAccount)
-> Lens MoveAccount MoveAccount Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MoveAccount' {Text
accountId :: Text
$sel:accountId:MoveAccount' :: MoveAccount -> Text
accountId} -> Text
accountId) (\s :: MoveAccount
s@MoveAccount' {} Text
a -> MoveAccount
s {$sel:accountId:MoveAccount' :: Text
accountId = Text
a} :: MoveAccount)
moveAccount_sourceParentId :: Lens.Lens' MoveAccount Prelude.Text
moveAccount_sourceParentId :: (Text -> f Text) -> MoveAccount -> f MoveAccount
moveAccount_sourceParentId = (MoveAccount -> Text)
-> (MoveAccount -> Text -> MoveAccount)
-> Lens MoveAccount MoveAccount Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MoveAccount' {Text
sourceParentId :: Text
$sel:sourceParentId:MoveAccount' :: MoveAccount -> Text
sourceParentId} -> Text
sourceParentId) (\s :: MoveAccount
s@MoveAccount' {} Text
a -> MoveAccount
s {$sel:sourceParentId:MoveAccount' :: Text
sourceParentId = Text
a} :: MoveAccount)
moveAccount_destinationParentId :: Lens.Lens' MoveAccount Prelude.Text
moveAccount_destinationParentId :: (Text -> f Text) -> MoveAccount -> f MoveAccount
moveAccount_destinationParentId = (MoveAccount -> Text)
-> (MoveAccount -> Text -> MoveAccount)
-> Lens MoveAccount MoveAccount Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MoveAccount' {Text
destinationParentId :: Text
$sel:destinationParentId:MoveAccount' :: MoveAccount -> Text
destinationParentId} -> Text
destinationParentId) (\s :: MoveAccount
s@MoveAccount' {} Text
a -> MoveAccount
s {$sel:destinationParentId:MoveAccount' :: Text
destinationParentId = Text
a} :: MoveAccount)
instance Core.AWSRequest MoveAccount where
type AWSResponse MoveAccount = MoveAccountResponse
request :: MoveAccount -> Request MoveAccount
request = Service -> MoveAccount -> Request MoveAccount
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy MoveAccount
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse MoveAccount)))
response = AWSResponse MoveAccount
-> Logger
-> Service
-> Proxy MoveAccount
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse MoveAccount)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull AWSResponse MoveAccount
MoveAccountResponse
MoveAccountResponse'
instance Prelude.Hashable MoveAccount
instance Prelude.NFData MoveAccount
instance Core.ToHeaders MoveAccount where
toHeaders :: MoveAccount -> [Header]
toHeaders =
[Header] -> MoveAccount -> [Header]
forall a b. a -> b -> a
Prelude.const
( [[Header]] -> [Header]
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# ( ByteString
"AWSOrganizationsV20161128.MoveAccount" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
HeaderName -> ByteString -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON MoveAccount where
toJSON :: MoveAccount -> Value
toJSON MoveAccount' {Text
destinationParentId :: Text
sourceParentId :: Text
accountId :: Text
$sel:destinationParentId:MoveAccount' :: MoveAccount -> Text
$sel:sourceParentId:MoveAccount' :: MoveAccount -> Text
$sel:accountId:MoveAccount' :: MoveAccount -> 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
"AccountId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
accountId),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"SourceParentId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
sourceParentId),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"DestinationParentId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
destinationParentId)
]
)
instance Core.ToPath MoveAccount where
toPath :: MoveAccount -> ByteString
toPath = ByteString -> MoveAccount -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery MoveAccount where
toQuery :: MoveAccount -> QueryString
toQuery = QueryString -> MoveAccount -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data MoveAccountResponse = MoveAccountResponse'
{
}
deriving (MoveAccountResponse -> MoveAccountResponse -> Bool
(MoveAccountResponse -> MoveAccountResponse -> Bool)
-> (MoveAccountResponse -> MoveAccountResponse -> Bool)
-> Eq MoveAccountResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MoveAccountResponse -> MoveAccountResponse -> Bool
$c/= :: MoveAccountResponse -> MoveAccountResponse -> Bool
== :: MoveAccountResponse -> MoveAccountResponse -> Bool
$c== :: MoveAccountResponse -> MoveAccountResponse -> Bool
Prelude.Eq, ReadPrec [MoveAccountResponse]
ReadPrec MoveAccountResponse
Int -> ReadS MoveAccountResponse
ReadS [MoveAccountResponse]
(Int -> ReadS MoveAccountResponse)
-> ReadS [MoveAccountResponse]
-> ReadPrec MoveAccountResponse
-> ReadPrec [MoveAccountResponse]
-> Read MoveAccountResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [MoveAccountResponse]
$creadListPrec :: ReadPrec [MoveAccountResponse]
readPrec :: ReadPrec MoveAccountResponse
$creadPrec :: ReadPrec MoveAccountResponse
readList :: ReadS [MoveAccountResponse]
$creadList :: ReadS [MoveAccountResponse]
readsPrec :: Int -> ReadS MoveAccountResponse
$creadsPrec :: Int -> ReadS MoveAccountResponse
Prelude.Read, Int -> MoveAccountResponse -> ShowS
[MoveAccountResponse] -> ShowS
MoveAccountResponse -> String
(Int -> MoveAccountResponse -> ShowS)
-> (MoveAccountResponse -> String)
-> ([MoveAccountResponse] -> ShowS)
-> Show MoveAccountResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MoveAccountResponse] -> ShowS
$cshowList :: [MoveAccountResponse] -> ShowS
show :: MoveAccountResponse -> String
$cshow :: MoveAccountResponse -> String
showsPrec :: Int -> MoveAccountResponse -> ShowS
$cshowsPrec :: Int -> MoveAccountResponse -> ShowS
Prelude.Show, (forall x. MoveAccountResponse -> Rep MoveAccountResponse x)
-> (forall x. Rep MoveAccountResponse x -> MoveAccountResponse)
-> Generic MoveAccountResponse
forall x. Rep MoveAccountResponse x -> MoveAccountResponse
forall x. MoveAccountResponse -> Rep MoveAccountResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep MoveAccountResponse x -> MoveAccountResponse
$cfrom :: forall x. MoveAccountResponse -> Rep MoveAccountResponse x
Prelude.Generic)
newMoveAccountResponse ::
MoveAccountResponse
newMoveAccountResponse :: MoveAccountResponse
newMoveAccountResponse = MoveAccountResponse
MoveAccountResponse'
instance Prelude.NFData MoveAccountResponse