{-# 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.DirectoryService.UpdateNumberOfDomainControllers
(
UpdateNumberOfDomainControllers (..),
newUpdateNumberOfDomainControllers,
updateNumberOfDomainControllers_directoryId,
updateNumberOfDomainControllers_desiredNumber,
UpdateNumberOfDomainControllersResponse (..),
newUpdateNumberOfDomainControllersResponse,
updateNumberOfDomainControllersResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import Amazonka.DirectoryService.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 UpdateNumberOfDomainControllers = UpdateNumberOfDomainControllers'
{
UpdateNumberOfDomainControllers -> Text
directoryId :: Prelude.Text,
UpdateNumberOfDomainControllers -> Natural
desiredNumber :: Prelude.Natural
}
deriving (UpdateNumberOfDomainControllers
-> UpdateNumberOfDomainControllers -> Bool
(UpdateNumberOfDomainControllers
-> UpdateNumberOfDomainControllers -> Bool)
-> (UpdateNumberOfDomainControllers
-> UpdateNumberOfDomainControllers -> Bool)
-> Eq UpdateNumberOfDomainControllers
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateNumberOfDomainControllers
-> UpdateNumberOfDomainControllers -> Bool
$c/= :: UpdateNumberOfDomainControllers
-> UpdateNumberOfDomainControllers -> Bool
== :: UpdateNumberOfDomainControllers
-> UpdateNumberOfDomainControllers -> Bool
$c== :: UpdateNumberOfDomainControllers
-> UpdateNumberOfDomainControllers -> Bool
Prelude.Eq, ReadPrec [UpdateNumberOfDomainControllers]
ReadPrec UpdateNumberOfDomainControllers
Int -> ReadS UpdateNumberOfDomainControllers
ReadS [UpdateNumberOfDomainControllers]
(Int -> ReadS UpdateNumberOfDomainControllers)
-> ReadS [UpdateNumberOfDomainControllers]
-> ReadPrec UpdateNumberOfDomainControllers
-> ReadPrec [UpdateNumberOfDomainControllers]
-> Read UpdateNumberOfDomainControllers
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateNumberOfDomainControllers]
$creadListPrec :: ReadPrec [UpdateNumberOfDomainControllers]
readPrec :: ReadPrec UpdateNumberOfDomainControllers
$creadPrec :: ReadPrec UpdateNumberOfDomainControllers
readList :: ReadS [UpdateNumberOfDomainControllers]
$creadList :: ReadS [UpdateNumberOfDomainControllers]
readsPrec :: Int -> ReadS UpdateNumberOfDomainControllers
$creadsPrec :: Int -> ReadS UpdateNumberOfDomainControllers
Prelude.Read, Int -> UpdateNumberOfDomainControllers -> ShowS
[UpdateNumberOfDomainControllers] -> ShowS
UpdateNumberOfDomainControllers -> String
(Int -> UpdateNumberOfDomainControllers -> ShowS)
-> (UpdateNumberOfDomainControllers -> String)
-> ([UpdateNumberOfDomainControllers] -> ShowS)
-> Show UpdateNumberOfDomainControllers
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateNumberOfDomainControllers] -> ShowS
$cshowList :: [UpdateNumberOfDomainControllers] -> ShowS
show :: UpdateNumberOfDomainControllers -> String
$cshow :: UpdateNumberOfDomainControllers -> String
showsPrec :: Int -> UpdateNumberOfDomainControllers -> ShowS
$cshowsPrec :: Int -> UpdateNumberOfDomainControllers -> ShowS
Prelude.Show, (forall x.
UpdateNumberOfDomainControllers
-> Rep UpdateNumberOfDomainControllers x)
-> (forall x.
Rep UpdateNumberOfDomainControllers x
-> UpdateNumberOfDomainControllers)
-> Generic UpdateNumberOfDomainControllers
forall x.
Rep UpdateNumberOfDomainControllers x
-> UpdateNumberOfDomainControllers
forall x.
UpdateNumberOfDomainControllers
-> Rep UpdateNumberOfDomainControllers x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateNumberOfDomainControllers x
-> UpdateNumberOfDomainControllers
$cfrom :: forall x.
UpdateNumberOfDomainControllers
-> Rep UpdateNumberOfDomainControllers x
Prelude.Generic)
newUpdateNumberOfDomainControllers ::
Prelude.Text ->
Prelude.Natural ->
UpdateNumberOfDomainControllers
newUpdateNumberOfDomainControllers :: Text -> Natural -> UpdateNumberOfDomainControllers
newUpdateNumberOfDomainControllers
Text
pDirectoryId_
Natural
pDesiredNumber_ =
UpdateNumberOfDomainControllers' :: Text -> Natural -> UpdateNumberOfDomainControllers
UpdateNumberOfDomainControllers'
{ $sel:directoryId:UpdateNumberOfDomainControllers' :: Text
directoryId =
Text
pDirectoryId_,
$sel:desiredNumber:UpdateNumberOfDomainControllers' :: Natural
desiredNumber = Natural
pDesiredNumber_
}
updateNumberOfDomainControllers_directoryId :: Lens.Lens' UpdateNumberOfDomainControllers Prelude.Text
updateNumberOfDomainControllers_directoryId :: (Text -> f Text)
-> UpdateNumberOfDomainControllers
-> f UpdateNumberOfDomainControllers
updateNumberOfDomainControllers_directoryId = (UpdateNumberOfDomainControllers -> Text)
-> (UpdateNumberOfDomainControllers
-> Text -> UpdateNumberOfDomainControllers)
-> Lens
UpdateNumberOfDomainControllers
UpdateNumberOfDomainControllers
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateNumberOfDomainControllers' {Text
directoryId :: Text
$sel:directoryId:UpdateNumberOfDomainControllers' :: UpdateNumberOfDomainControllers -> Text
directoryId} -> Text
directoryId) (\s :: UpdateNumberOfDomainControllers
s@UpdateNumberOfDomainControllers' {} Text
a -> UpdateNumberOfDomainControllers
s {$sel:directoryId:UpdateNumberOfDomainControllers' :: Text
directoryId = Text
a} :: UpdateNumberOfDomainControllers)
updateNumberOfDomainControllers_desiredNumber :: Lens.Lens' UpdateNumberOfDomainControllers Prelude.Natural
updateNumberOfDomainControllers_desiredNumber :: (Natural -> f Natural)
-> UpdateNumberOfDomainControllers
-> f UpdateNumberOfDomainControllers
updateNumberOfDomainControllers_desiredNumber = (UpdateNumberOfDomainControllers -> Natural)
-> (UpdateNumberOfDomainControllers
-> Natural -> UpdateNumberOfDomainControllers)
-> Lens
UpdateNumberOfDomainControllers
UpdateNumberOfDomainControllers
Natural
Natural
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateNumberOfDomainControllers' {Natural
desiredNumber :: Natural
$sel:desiredNumber:UpdateNumberOfDomainControllers' :: UpdateNumberOfDomainControllers -> Natural
desiredNumber} -> Natural
desiredNumber) (\s :: UpdateNumberOfDomainControllers
s@UpdateNumberOfDomainControllers' {} Natural
a -> UpdateNumberOfDomainControllers
s {$sel:desiredNumber:UpdateNumberOfDomainControllers' :: Natural
desiredNumber = Natural
a} :: UpdateNumberOfDomainControllers)
instance
Core.AWSRequest
UpdateNumberOfDomainControllers
where
type
AWSResponse UpdateNumberOfDomainControllers =
UpdateNumberOfDomainControllersResponse
request :: UpdateNumberOfDomainControllers
-> Request UpdateNumberOfDomainControllers
request = Service
-> UpdateNumberOfDomainControllers
-> Request UpdateNumberOfDomainControllers
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy UpdateNumberOfDomainControllers
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse UpdateNumberOfDomainControllers)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse UpdateNumberOfDomainControllers))
-> Logger
-> Service
-> Proxy UpdateNumberOfDomainControllers
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse UpdateNumberOfDomainControllers)))
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 -> UpdateNumberOfDomainControllersResponse
UpdateNumberOfDomainControllersResponse'
(Int -> UpdateNumberOfDomainControllersResponse)
-> Either String Int
-> Either String UpdateNumberOfDomainControllersResponse
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
UpdateNumberOfDomainControllers
instance
Prelude.NFData
UpdateNumberOfDomainControllers
instance
Core.ToHeaders
UpdateNumberOfDomainControllers
where
toHeaders :: UpdateNumberOfDomainControllers -> ResponseHeaders
toHeaders =
ResponseHeaders
-> UpdateNumberOfDomainControllers -> 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
"DirectoryService_20150416.UpdateNumberOfDomainControllers" ::
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 UpdateNumberOfDomainControllers where
toJSON :: UpdateNumberOfDomainControllers -> Value
toJSON UpdateNumberOfDomainControllers' {Natural
Text
desiredNumber :: Natural
directoryId :: Text
$sel:desiredNumber:UpdateNumberOfDomainControllers' :: UpdateNumberOfDomainControllers -> Natural
$sel:directoryId:UpdateNumberOfDomainControllers' :: UpdateNumberOfDomainControllers -> 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
"DirectoryId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
directoryId),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"DesiredNumber" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Natural
desiredNumber)
]
)
instance Core.ToPath UpdateNumberOfDomainControllers where
toPath :: UpdateNumberOfDomainControllers -> ByteString
toPath = ByteString -> UpdateNumberOfDomainControllers -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery UpdateNumberOfDomainControllers where
toQuery :: UpdateNumberOfDomainControllers -> QueryString
toQuery = QueryString -> UpdateNumberOfDomainControllers -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data UpdateNumberOfDomainControllersResponse = UpdateNumberOfDomainControllersResponse'
{
UpdateNumberOfDomainControllersResponse -> Int
httpStatus :: Prelude.Int
}
deriving (UpdateNumberOfDomainControllersResponse
-> UpdateNumberOfDomainControllersResponse -> Bool
(UpdateNumberOfDomainControllersResponse
-> UpdateNumberOfDomainControllersResponse -> Bool)
-> (UpdateNumberOfDomainControllersResponse
-> UpdateNumberOfDomainControllersResponse -> Bool)
-> Eq UpdateNumberOfDomainControllersResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateNumberOfDomainControllersResponse
-> UpdateNumberOfDomainControllersResponse -> Bool
$c/= :: UpdateNumberOfDomainControllersResponse
-> UpdateNumberOfDomainControllersResponse -> Bool
== :: UpdateNumberOfDomainControllersResponse
-> UpdateNumberOfDomainControllersResponse -> Bool
$c== :: UpdateNumberOfDomainControllersResponse
-> UpdateNumberOfDomainControllersResponse -> Bool
Prelude.Eq, ReadPrec [UpdateNumberOfDomainControllersResponse]
ReadPrec UpdateNumberOfDomainControllersResponse
Int -> ReadS UpdateNumberOfDomainControllersResponse
ReadS [UpdateNumberOfDomainControllersResponse]
(Int -> ReadS UpdateNumberOfDomainControllersResponse)
-> ReadS [UpdateNumberOfDomainControllersResponse]
-> ReadPrec UpdateNumberOfDomainControllersResponse
-> ReadPrec [UpdateNumberOfDomainControllersResponse]
-> Read UpdateNumberOfDomainControllersResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateNumberOfDomainControllersResponse]
$creadListPrec :: ReadPrec [UpdateNumberOfDomainControllersResponse]
readPrec :: ReadPrec UpdateNumberOfDomainControllersResponse
$creadPrec :: ReadPrec UpdateNumberOfDomainControllersResponse
readList :: ReadS [UpdateNumberOfDomainControllersResponse]
$creadList :: ReadS [UpdateNumberOfDomainControllersResponse]
readsPrec :: Int -> ReadS UpdateNumberOfDomainControllersResponse
$creadsPrec :: Int -> ReadS UpdateNumberOfDomainControllersResponse
Prelude.Read, Int -> UpdateNumberOfDomainControllersResponse -> ShowS
[UpdateNumberOfDomainControllersResponse] -> ShowS
UpdateNumberOfDomainControllersResponse -> String
(Int -> UpdateNumberOfDomainControllersResponse -> ShowS)
-> (UpdateNumberOfDomainControllersResponse -> String)
-> ([UpdateNumberOfDomainControllersResponse] -> ShowS)
-> Show UpdateNumberOfDomainControllersResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateNumberOfDomainControllersResponse] -> ShowS
$cshowList :: [UpdateNumberOfDomainControllersResponse] -> ShowS
show :: UpdateNumberOfDomainControllersResponse -> String
$cshow :: UpdateNumberOfDomainControllersResponse -> String
showsPrec :: Int -> UpdateNumberOfDomainControllersResponse -> ShowS
$cshowsPrec :: Int -> UpdateNumberOfDomainControllersResponse -> ShowS
Prelude.Show, (forall x.
UpdateNumberOfDomainControllersResponse
-> Rep UpdateNumberOfDomainControllersResponse x)
-> (forall x.
Rep UpdateNumberOfDomainControllersResponse x
-> UpdateNumberOfDomainControllersResponse)
-> Generic UpdateNumberOfDomainControllersResponse
forall x.
Rep UpdateNumberOfDomainControllersResponse x
-> UpdateNumberOfDomainControllersResponse
forall x.
UpdateNumberOfDomainControllersResponse
-> Rep UpdateNumberOfDomainControllersResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateNumberOfDomainControllersResponse x
-> UpdateNumberOfDomainControllersResponse
$cfrom :: forall x.
UpdateNumberOfDomainControllersResponse
-> Rep UpdateNumberOfDomainControllersResponse x
Prelude.Generic)
newUpdateNumberOfDomainControllersResponse ::
Prelude.Int ->
UpdateNumberOfDomainControllersResponse
newUpdateNumberOfDomainControllersResponse :: Int -> UpdateNumberOfDomainControllersResponse
newUpdateNumberOfDomainControllersResponse
Int
pHttpStatus_ =
UpdateNumberOfDomainControllersResponse' :: Int -> UpdateNumberOfDomainControllersResponse
UpdateNumberOfDomainControllersResponse'
{ $sel:httpStatus:UpdateNumberOfDomainControllersResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
updateNumberOfDomainControllersResponse_httpStatus :: Lens.Lens' UpdateNumberOfDomainControllersResponse Prelude.Int
updateNumberOfDomainControllersResponse_httpStatus :: (Int -> f Int)
-> UpdateNumberOfDomainControllersResponse
-> f UpdateNumberOfDomainControllersResponse
updateNumberOfDomainControllersResponse_httpStatus = (UpdateNumberOfDomainControllersResponse -> Int)
-> (UpdateNumberOfDomainControllersResponse
-> Int -> UpdateNumberOfDomainControllersResponse)
-> Lens
UpdateNumberOfDomainControllersResponse
UpdateNumberOfDomainControllersResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateNumberOfDomainControllersResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateNumberOfDomainControllersResponse' :: UpdateNumberOfDomainControllersResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateNumberOfDomainControllersResponse
s@UpdateNumberOfDomainControllersResponse' {} Int
a -> UpdateNumberOfDomainControllersResponse
s {$sel:httpStatus:UpdateNumberOfDomainControllersResponse' :: Int
httpStatus = Int
a} :: UpdateNumberOfDomainControllersResponse)
instance
Prelude.NFData
UpdateNumberOfDomainControllersResponse