{-# 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.UpdateRadius
(
UpdateRadius (..),
newUpdateRadius,
updateRadius_directoryId,
updateRadius_radiusSettings,
UpdateRadiusResponse (..),
newUpdateRadiusResponse,
updateRadiusResponse_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 UpdateRadius = UpdateRadius'
{
UpdateRadius -> Text
directoryId :: Prelude.Text,
UpdateRadius -> RadiusSettings
radiusSettings :: RadiusSettings
}
deriving (UpdateRadius -> UpdateRadius -> Bool
(UpdateRadius -> UpdateRadius -> Bool)
-> (UpdateRadius -> UpdateRadius -> Bool) -> Eq UpdateRadius
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateRadius -> UpdateRadius -> Bool
$c/= :: UpdateRadius -> UpdateRadius -> Bool
== :: UpdateRadius -> UpdateRadius -> Bool
$c== :: UpdateRadius -> UpdateRadius -> Bool
Prelude.Eq, Int -> UpdateRadius -> ShowS
[UpdateRadius] -> ShowS
UpdateRadius -> String
(Int -> UpdateRadius -> ShowS)
-> (UpdateRadius -> String)
-> ([UpdateRadius] -> ShowS)
-> Show UpdateRadius
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateRadius] -> ShowS
$cshowList :: [UpdateRadius] -> ShowS
show :: UpdateRadius -> String
$cshow :: UpdateRadius -> String
showsPrec :: Int -> UpdateRadius -> ShowS
$cshowsPrec :: Int -> UpdateRadius -> ShowS
Prelude.Show, (forall x. UpdateRadius -> Rep UpdateRadius x)
-> (forall x. Rep UpdateRadius x -> UpdateRadius)
-> Generic UpdateRadius
forall x. Rep UpdateRadius x -> UpdateRadius
forall x. UpdateRadius -> Rep UpdateRadius x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateRadius x -> UpdateRadius
$cfrom :: forall x. UpdateRadius -> Rep UpdateRadius x
Prelude.Generic)
newUpdateRadius ::
Prelude.Text ->
RadiusSettings ->
UpdateRadius
newUpdateRadius :: Text -> RadiusSettings -> UpdateRadius
newUpdateRadius Text
pDirectoryId_ RadiusSettings
pRadiusSettings_ =
UpdateRadius' :: Text -> RadiusSettings -> UpdateRadius
UpdateRadius'
{ $sel:directoryId:UpdateRadius' :: Text
directoryId = Text
pDirectoryId_,
$sel:radiusSettings:UpdateRadius' :: RadiusSettings
radiusSettings = RadiusSettings
pRadiusSettings_
}
updateRadius_directoryId :: Lens.Lens' UpdateRadius Prelude.Text
updateRadius_directoryId :: (Text -> f Text) -> UpdateRadius -> f UpdateRadius
updateRadius_directoryId = (UpdateRadius -> Text)
-> (UpdateRadius -> Text -> UpdateRadius)
-> Lens UpdateRadius UpdateRadius Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateRadius' {Text
directoryId :: Text
$sel:directoryId:UpdateRadius' :: UpdateRadius -> Text
directoryId} -> Text
directoryId) (\s :: UpdateRadius
s@UpdateRadius' {} Text
a -> UpdateRadius
s {$sel:directoryId:UpdateRadius' :: Text
directoryId = Text
a} :: UpdateRadius)
updateRadius_radiusSettings :: Lens.Lens' UpdateRadius RadiusSettings
updateRadius_radiusSettings :: (RadiusSettings -> f RadiusSettings)
-> UpdateRadius -> f UpdateRadius
updateRadius_radiusSettings = (UpdateRadius -> RadiusSettings)
-> (UpdateRadius -> RadiusSettings -> UpdateRadius)
-> Lens UpdateRadius UpdateRadius RadiusSettings RadiusSettings
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateRadius' {RadiusSettings
radiusSettings :: RadiusSettings
$sel:radiusSettings:UpdateRadius' :: UpdateRadius -> RadiusSettings
radiusSettings} -> RadiusSettings
radiusSettings) (\s :: UpdateRadius
s@UpdateRadius' {} RadiusSettings
a -> UpdateRadius
s {$sel:radiusSettings:UpdateRadius' :: RadiusSettings
radiusSettings = RadiusSettings
a} :: UpdateRadius)
instance Core.AWSRequest UpdateRadius where
type AWSResponse UpdateRadius = UpdateRadiusResponse
request :: UpdateRadius -> Request UpdateRadius
request = Service -> UpdateRadius -> Request UpdateRadius
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy UpdateRadius
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateRadius)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse UpdateRadius))
-> Logger
-> Service
-> Proxy UpdateRadius
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateRadius)))
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 -> UpdateRadiusResponse
UpdateRadiusResponse'
(Int -> UpdateRadiusResponse)
-> Either String Int -> Either String UpdateRadiusResponse
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 UpdateRadius
instance Prelude.NFData UpdateRadius
instance Core.ToHeaders UpdateRadius where
toHeaders :: UpdateRadius -> ResponseHeaders
toHeaders =
ResponseHeaders -> UpdateRadius -> 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.UpdateRadius" ::
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 UpdateRadius where
toJSON :: UpdateRadius -> Value
toJSON UpdateRadius' {Text
RadiusSettings
radiusSettings :: RadiusSettings
directoryId :: Text
$sel:radiusSettings:UpdateRadius' :: UpdateRadius -> RadiusSettings
$sel:directoryId:UpdateRadius' :: UpdateRadius -> 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
"RadiusSettings" Text -> RadiusSettings -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= RadiusSettings
radiusSettings)
]
)
instance Core.ToPath UpdateRadius where
toPath :: UpdateRadius -> ByteString
toPath = ByteString -> UpdateRadius -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery UpdateRadius where
toQuery :: UpdateRadius -> QueryString
toQuery = QueryString -> UpdateRadius -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data UpdateRadiusResponse = UpdateRadiusResponse'
{
UpdateRadiusResponse -> Int
httpStatus :: Prelude.Int
}
deriving (UpdateRadiusResponse -> UpdateRadiusResponse -> Bool
(UpdateRadiusResponse -> UpdateRadiusResponse -> Bool)
-> (UpdateRadiusResponse -> UpdateRadiusResponse -> Bool)
-> Eq UpdateRadiusResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateRadiusResponse -> UpdateRadiusResponse -> Bool
$c/= :: UpdateRadiusResponse -> UpdateRadiusResponse -> Bool
== :: UpdateRadiusResponse -> UpdateRadiusResponse -> Bool
$c== :: UpdateRadiusResponse -> UpdateRadiusResponse -> Bool
Prelude.Eq, ReadPrec [UpdateRadiusResponse]
ReadPrec UpdateRadiusResponse
Int -> ReadS UpdateRadiusResponse
ReadS [UpdateRadiusResponse]
(Int -> ReadS UpdateRadiusResponse)
-> ReadS [UpdateRadiusResponse]
-> ReadPrec UpdateRadiusResponse
-> ReadPrec [UpdateRadiusResponse]
-> Read UpdateRadiusResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateRadiusResponse]
$creadListPrec :: ReadPrec [UpdateRadiusResponse]
readPrec :: ReadPrec UpdateRadiusResponse
$creadPrec :: ReadPrec UpdateRadiusResponse
readList :: ReadS [UpdateRadiusResponse]
$creadList :: ReadS [UpdateRadiusResponse]
readsPrec :: Int -> ReadS UpdateRadiusResponse
$creadsPrec :: Int -> ReadS UpdateRadiusResponse
Prelude.Read, Int -> UpdateRadiusResponse -> ShowS
[UpdateRadiusResponse] -> ShowS
UpdateRadiusResponse -> String
(Int -> UpdateRadiusResponse -> ShowS)
-> (UpdateRadiusResponse -> String)
-> ([UpdateRadiusResponse] -> ShowS)
-> Show UpdateRadiusResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateRadiusResponse] -> ShowS
$cshowList :: [UpdateRadiusResponse] -> ShowS
show :: UpdateRadiusResponse -> String
$cshow :: UpdateRadiusResponse -> String
showsPrec :: Int -> UpdateRadiusResponse -> ShowS
$cshowsPrec :: Int -> UpdateRadiusResponse -> ShowS
Prelude.Show, (forall x. UpdateRadiusResponse -> Rep UpdateRadiusResponse x)
-> (forall x. Rep UpdateRadiusResponse x -> UpdateRadiusResponse)
-> Generic UpdateRadiusResponse
forall x. Rep UpdateRadiusResponse x -> UpdateRadiusResponse
forall x. UpdateRadiusResponse -> Rep UpdateRadiusResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateRadiusResponse x -> UpdateRadiusResponse
$cfrom :: forall x. UpdateRadiusResponse -> Rep UpdateRadiusResponse x
Prelude.Generic)
newUpdateRadiusResponse ::
Prelude.Int ->
UpdateRadiusResponse
newUpdateRadiusResponse :: Int -> UpdateRadiusResponse
newUpdateRadiusResponse Int
pHttpStatus_ =
UpdateRadiusResponse' :: Int -> UpdateRadiusResponse
UpdateRadiusResponse' {$sel:httpStatus:UpdateRadiusResponse' :: Int
httpStatus = Int
pHttpStatus_}
updateRadiusResponse_httpStatus :: Lens.Lens' UpdateRadiusResponse Prelude.Int
updateRadiusResponse_httpStatus :: (Int -> f Int) -> UpdateRadiusResponse -> f UpdateRadiusResponse
updateRadiusResponse_httpStatus = (UpdateRadiusResponse -> Int)
-> (UpdateRadiusResponse -> Int -> UpdateRadiusResponse)
-> Lens UpdateRadiusResponse UpdateRadiusResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateRadiusResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateRadiusResponse' :: UpdateRadiusResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateRadiusResponse
s@UpdateRadiusResponse' {} Int
a -> UpdateRadiusResponse
s {$sel:httpStatus:UpdateRadiusResponse' :: Int
httpStatus = Int
a} :: UpdateRadiusResponse)
instance Prelude.NFData UpdateRadiusResponse