{-# 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.WorkSpaces.ModifyAccount
(
ModifyAccount (..),
newModifyAccount,
modifyAccount_dedicatedTenancySupport,
modifyAccount_dedicatedTenancyManagementCidrRange,
ModifyAccountResponse (..),
newModifyAccountResponse,
modifyAccountResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.WorkSpaces.Types
data ModifyAccount = ModifyAccount'
{
ModifyAccount -> Maybe DedicatedTenancySupportEnum
dedicatedTenancySupport :: Prelude.Maybe DedicatedTenancySupportEnum,
ModifyAccount -> Maybe Text
dedicatedTenancyManagementCidrRange :: Prelude.Maybe Prelude.Text
}
deriving (ModifyAccount -> ModifyAccount -> Bool
(ModifyAccount -> ModifyAccount -> Bool)
-> (ModifyAccount -> ModifyAccount -> Bool) -> Eq ModifyAccount
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ModifyAccount -> ModifyAccount -> Bool
$c/= :: ModifyAccount -> ModifyAccount -> Bool
== :: ModifyAccount -> ModifyAccount -> Bool
$c== :: ModifyAccount -> ModifyAccount -> Bool
Prelude.Eq, ReadPrec [ModifyAccount]
ReadPrec ModifyAccount
Int -> ReadS ModifyAccount
ReadS [ModifyAccount]
(Int -> ReadS ModifyAccount)
-> ReadS [ModifyAccount]
-> ReadPrec ModifyAccount
-> ReadPrec [ModifyAccount]
-> Read ModifyAccount
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ModifyAccount]
$creadListPrec :: ReadPrec [ModifyAccount]
readPrec :: ReadPrec ModifyAccount
$creadPrec :: ReadPrec ModifyAccount
readList :: ReadS [ModifyAccount]
$creadList :: ReadS [ModifyAccount]
readsPrec :: Int -> ReadS ModifyAccount
$creadsPrec :: Int -> ReadS ModifyAccount
Prelude.Read, Int -> ModifyAccount -> ShowS
[ModifyAccount] -> ShowS
ModifyAccount -> String
(Int -> ModifyAccount -> ShowS)
-> (ModifyAccount -> String)
-> ([ModifyAccount] -> ShowS)
-> Show ModifyAccount
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ModifyAccount] -> ShowS
$cshowList :: [ModifyAccount] -> ShowS
show :: ModifyAccount -> String
$cshow :: ModifyAccount -> String
showsPrec :: Int -> ModifyAccount -> ShowS
$cshowsPrec :: Int -> ModifyAccount -> ShowS
Prelude.Show, (forall x. ModifyAccount -> Rep ModifyAccount x)
-> (forall x. Rep ModifyAccount x -> ModifyAccount)
-> Generic ModifyAccount
forall x. Rep ModifyAccount x -> ModifyAccount
forall x. ModifyAccount -> Rep ModifyAccount x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ModifyAccount x -> ModifyAccount
$cfrom :: forall x. ModifyAccount -> Rep ModifyAccount x
Prelude.Generic)
newModifyAccount ::
ModifyAccount
newModifyAccount :: ModifyAccount
newModifyAccount =
ModifyAccount' :: Maybe DedicatedTenancySupportEnum -> Maybe Text -> ModifyAccount
ModifyAccount'
{ $sel:dedicatedTenancySupport:ModifyAccount' :: Maybe DedicatedTenancySupportEnum
dedicatedTenancySupport =
Maybe DedicatedTenancySupportEnum
forall a. Maybe a
Prelude.Nothing,
$sel:dedicatedTenancyManagementCidrRange:ModifyAccount' :: Maybe Text
dedicatedTenancyManagementCidrRange =
Maybe Text
forall a. Maybe a
Prelude.Nothing
}
modifyAccount_dedicatedTenancySupport :: Lens.Lens' ModifyAccount (Prelude.Maybe DedicatedTenancySupportEnum)
modifyAccount_dedicatedTenancySupport :: (Maybe DedicatedTenancySupportEnum
-> f (Maybe DedicatedTenancySupportEnum))
-> ModifyAccount -> f ModifyAccount
modifyAccount_dedicatedTenancySupport = (ModifyAccount -> Maybe DedicatedTenancySupportEnum)
-> (ModifyAccount
-> Maybe DedicatedTenancySupportEnum -> ModifyAccount)
-> Lens
ModifyAccount
ModifyAccount
(Maybe DedicatedTenancySupportEnum)
(Maybe DedicatedTenancySupportEnum)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyAccount' {Maybe DedicatedTenancySupportEnum
dedicatedTenancySupport :: Maybe DedicatedTenancySupportEnum
$sel:dedicatedTenancySupport:ModifyAccount' :: ModifyAccount -> Maybe DedicatedTenancySupportEnum
dedicatedTenancySupport} -> Maybe DedicatedTenancySupportEnum
dedicatedTenancySupport) (\s :: ModifyAccount
s@ModifyAccount' {} Maybe DedicatedTenancySupportEnum
a -> ModifyAccount
s {$sel:dedicatedTenancySupport:ModifyAccount' :: Maybe DedicatedTenancySupportEnum
dedicatedTenancySupport = Maybe DedicatedTenancySupportEnum
a} :: ModifyAccount)
modifyAccount_dedicatedTenancyManagementCidrRange :: Lens.Lens' ModifyAccount (Prelude.Maybe Prelude.Text)
modifyAccount_dedicatedTenancyManagementCidrRange :: (Maybe Text -> f (Maybe Text)) -> ModifyAccount -> f ModifyAccount
modifyAccount_dedicatedTenancyManagementCidrRange = (ModifyAccount -> Maybe Text)
-> (ModifyAccount -> Maybe Text -> ModifyAccount)
-> Lens ModifyAccount ModifyAccount (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyAccount' {Maybe Text
dedicatedTenancyManagementCidrRange :: Maybe Text
$sel:dedicatedTenancyManagementCidrRange:ModifyAccount' :: ModifyAccount -> Maybe Text
dedicatedTenancyManagementCidrRange} -> Maybe Text
dedicatedTenancyManagementCidrRange) (\s :: ModifyAccount
s@ModifyAccount' {} Maybe Text
a -> ModifyAccount
s {$sel:dedicatedTenancyManagementCidrRange:ModifyAccount' :: Maybe Text
dedicatedTenancyManagementCidrRange = Maybe Text
a} :: ModifyAccount)
instance Core.AWSRequest ModifyAccount where
type
AWSResponse ModifyAccount =
ModifyAccountResponse
request :: ModifyAccount -> Request ModifyAccount
request = Service -> ModifyAccount -> Request ModifyAccount
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy ModifyAccount
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ModifyAccount)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse ModifyAccount))
-> Logger
-> Service
-> Proxy ModifyAccount
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ModifyAccount)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
( \Int
s ResponseHeaders
h ()
x ->
Int -> ModifyAccountResponse
ModifyAccountResponse'
(Int -> ModifyAccountResponse)
-> Either String Int -> Either String ModifyAccountResponse
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))
)
instance Prelude.Hashable ModifyAccount
instance Prelude.NFData ModifyAccount
instance Core.ToHeaders ModifyAccount where
toHeaders :: ModifyAccount -> ResponseHeaders
toHeaders =
ResponseHeaders -> ModifyAccount -> 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
"WorkspacesService.ModifyAccount" ::
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 ModifyAccount where
toJSON :: ModifyAccount -> Value
toJSON ModifyAccount' {Maybe Text
Maybe DedicatedTenancySupportEnum
dedicatedTenancyManagementCidrRange :: Maybe Text
dedicatedTenancySupport :: Maybe DedicatedTenancySupportEnum
$sel:dedicatedTenancyManagementCidrRange:ModifyAccount' :: ModifyAccount -> Maybe Text
$sel:dedicatedTenancySupport:ModifyAccount' :: ModifyAccount -> Maybe DedicatedTenancySupportEnum
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"DedicatedTenancySupport" Text -> DedicatedTenancySupportEnum -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(DedicatedTenancySupportEnum -> Pair)
-> Maybe DedicatedTenancySupportEnum -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe DedicatedTenancySupportEnum
dedicatedTenancySupport,
(Text
"DedicatedTenancyManagementCidrRange" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
dedicatedTenancyManagementCidrRange
]
)
instance Core.ToPath ModifyAccount where
toPath :: ModifyAccount -> ByteString
toPath = ByteString -> ModifyAccount -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery ModifyAccount where
toQuery :: ModifyAccount -> QueryString
toQuery = QueryString -> ModifyAccount -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data ModifyAccountResponse = ModifyAccountResponse'
{
ModifyAccountResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ModifyAccountResponse -> ModifyAccountResponse -> Bool
(ModifyAccountResponse -> ModifyAccountResponse -> Bool)
-> (ModifyAccountResponse -> ModifyAccountResponse -> Bool)
-> Eq ModifyAccountResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ModifyAccountResponse -> ModifyAccountResponse -> Bool
$c/= :: ModifyAccountResponse -> ModifyAccountResponse -> Bool
== :: ModifyAccountResponse -> ModifyAccountResponse -> Bool
$c== :: ModifyAccountResponse -> ModifyAccountResponse -> Bool
Prelude.Eq, ReadPrec [ModifyAccountResponse]
ReadPrec ModifyAccountResponse
Int -> ReadS ModifyAccountResponse
ReadS [ModifyAccountResponse]
(Int -> ReadS ModifyAccountResponse)
-> ReadS [ModifyAccountResponse]
-> ReadPrec ModifyAccountResponse
-> ReadPrec [ModifyAccountResponse]
-> Read ModifyAccountResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ModifyAccountResponse]
$creadListPrec :: ReadPrec [ModifyAccountResponse]
readPrec :: ReadPrec ModifyAccountResponse
$creadPrec :: ReadPrec ModifyAccountResponse
readList :: ReadS [ModifyAccountResponse]
$creadList :: ReadS [ModifyAccountResponse]
readsPrec :: Int -> ReadS ModifyAccountResponse
$creadsPrec :: Int -> ReadS ModifyAccountResponse
Prelude.Read, Int -> ModifyAccountResponse -> ShowS
[ModifyAccountResponse] -> ShowS
ModifyAccountResponse -> String
(Int -> ModifyAccountResponse -> ShowS)
-> (ModifyAccountResponse -> String)
-> ([ModifyAccountResponse] -> ShowS)
-> Show ModifyAccountResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ModifyAccountResponse] -> ShowS
$cshowList :: [ModifyAccountResponse] -> ShowS
show :: ModifyAccountResponse -> String
$cshow :: ModifyAccountResponse -> String
showsPrec :: Int -> ModifyAccountResponse -> ShowS
$cshowsPrec :: Int -> ModifyAccountResponse -> ShowS
Prelude.Show, (forall x. ModifyAccountResponse -> Rep ModifyAccountResponse x)
-> (forall x. Rep ModifyAccountResponse x -> ModifyAccountResponse)
-> Generic ModifyAccountResponse
forall x. Rep ModifyAccountResponse x -> ModifyAccountResponse
forall x. ModifyAccountResponse -> Rep ModifyAccountResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ModifyAccountResponse x -> ModifyAccountResponse
$cfrom :: forall x. ModifyAccountResponse -> Rep ModifyAccountResponse x
Prelude.Generic)
newModifyAccountResponse ::
Prelude.Int ->
ModifyAccountResponse
newModifyAccountResponse :: Int -> ModifyAccountResponse
newModifyAccountResponse Int
pHttpStatus_ =
ModifyAccountResponse' :: Int -> ModifyAccountResponse
ModifyAccountResponse' {$sel:httpStatus:ModifyAccountResponse' :: Int
httpStatus = Int
pHttpStatus_}
modifyAccountResponse_httpStatus :: Lens.Lens' ModifyAccountResponse Prelude.Int
modifyAccountResponse_httpStatus :: (Int -> f Int) -> ModifyAccountResponse -> f ModifyAccountResponse
modifyAccountResponse_httpStatus = (ModifyAccountResponse -> Int)
-> (ModifyAccountResponse -> Int -> ModifyAccountResponse)
-> Lens ModifyAccountResponse ModifyAccountResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyAccountResponse' {Int
httpStatus :: Int
$sel:httpStatus:ModifyAccountResponse' :: ModifyAccountResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ModifyAccountResponse
s@ModifyAccountResponse' {} Int
a -> ModifyAccountResponse
s {$sel:httpStatus:ModifyAccountResponse' :: Int
httpStatus = Int
a} :: ModifyAccountResponse)
instance Prelude.NFData ModifyAccountResponse