{-# 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.CloudSearch.UpdateAvailabilityOptions
(
UpdateAvailabilityOptions (..),
newUpdateAvailabilityOptions,
updateAvailabilityOptions_domainName,
updateAvailabilityOptions_multiAZ,
UpdateAvailabilityOptionsResponse (..),
newUpdateAvailabilityOptionsResponse,
updateAvailabilityOptionsResponse_availabilityOptions,
updateAvailabilityOptionsResponse_httpStatus,
)
where
import Amazonka.CloudSearch.Types
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
data UpdateAvailabilityOptions = UpdateAvailabilityOptions'
{ UpdateAvailabilityOptions -> Text
domainName :: Prelude.Text,
UpdateAvailabilityOptions -> Bool
multiAZ :: Prelude.Bool
}
deriving (UpdateAvailabilityOptions -> UpdateAvailabilityOptions -> Bool
(UpdateAvailabilityOptions -> UpdateAvailabilityOptions -> Bool)
-> (UpdateAvailabilityOptions -> UpdateAvailabilityOptions -> Bool)
-> Eq UpdateAvailabilityOptions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateAvailabilityOptions -> UpdateAvailabilityOptions -> Bool
$c/= :: UpdateAvailabilityOptions -> UpdateAvailabilityOptions -> Bool
== :: UpdateAvailabilityOptions -> UpdateAvailabilityOptions -> Bool
$c== :: UpdateAvailabilityOptions -> UpdateAvailabilityOptions -> Bool
Prelude.Eq, ReadPrec [UpdateAvailabilityOptions]
ReadPrec UpdateAvailabilityOptions
Int -> ReadS UpdateAvailabilityOptions
ReadS [UpdateAvailabilityOptions]
(Int -> ReadS UpdateAvailabilityOptions)
-> ReadS [UpdateAvailabilityOptions]
-> ReadPrec UpdateAvailabilityOptions
-> ReadPrec [UpdateAvailabilityOptions]
-> Read UpdateAvailabilityOptions
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateAvailabilityOptions]
$creadListPrec :: ReadPrec [UpdateAvailabilityOptions]
readPrec :: ReadPrec UpdateAvailabilityOptions
$creadPrec :: ReadPrec UpdateAvailabilityOptions
readList :: ReadS [UpdateAvailabilityOptions]
$creadList :: ReadS [UpdateAvailabilityOptions]
readsPrec :: Int -> ReadS UpdateAvailabilityOptions
$creadsPrec :: Int -> ReadS UpdateAvailabilityOptions
Prelude.Read, Int -> UpdateAvailabilityOptions -> ShowS
[UpdateAvailabilityOptions] -> ShowS
UpdateAvailabilityOptions -> String
(Int -> UpdateAvailabilityOptions -> ShowS)
-> (UpdateAvailabilityOptions -> String)
-> ([UpdateAvailabilityOptions] -> ShowS)
-> Show UpdateAvailabilityOptions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateAvailabilityOptions] -> ShowS
$cshowList :: [UpdateAvailabilityOptions] -> ShowS
show :: UpdateAvailabilityOptions -> String
$cshow :: UpdateAvailabilityOptions -> String
showsPrec :: Int -> UpdateAvailabilityOptions -> ShowS
$cshowsPrec :: Int -> UpdateAvailabilityOptions -> ShowS
Prelude.Show, (forall x.
UpdateAvailabilityOptions -> Rep UpdateAvailabilityOptions x)
-> (forall x.
Rep UpdateAvailabilityOptions x -> UpdateAvailabilityOptions)
-> Generic UpdateAvailabilityOptions
forall x.
Rep UpdateAvailabilityOptions x -> UpdateAvailabilityOptions
forall x.
UpdateAvailabilityOptions -> Rep UpdateAvailabilityOptions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateAvailabilityOptions x -> UpdateAvailabilityOptions
$cfrom :: forall x.
UpdateAvailabilityOptions -> Rep UpdateAvailabilityOptions x
Prelude.Generic)
newUpdateAvailabilityOptions ::
Prelude.Text ->
Prelude.Bool ->
UpdateAvailabilityOptions
newUpdateAvailabilityOptions :: Text -> Bool -> UpdateAvailabilityOptions
newUpdateAvailabilityOptions Text
pDomainName_ Bool
pMultiAZ_ =
UpdateAvailabilityOptions' :: Text -> Bool -> UpdateAvailabilityOptions
UpdateAvailabilityOptions'
{ $sel:domainName:UpdateAvailabilityOptions' :: Text
domainName =
Text
pDomainName_,
$sel:multiAZ:UpdateAvailabilityOptions' :: Bool
multiAZ = Bool
pMultiAZ_
}
updateAvailabilityOptions_domainName :: Lens.Lens' UpdateAvailabilityOptions Prelude.Text
updateAvailabilityOptions_domainName :: (Text -> f Text)
-> UpdateAvailabilityOptions -> f UpdateAvailabilityOptions
updateAvailabilityOptions_domainName = (UpdateAvailabilityOptions -> Text)
-> (UpdateAvailabilityOptions -> Text -> UpdateAvailabilityOptions)
-> Lens
UpdateAvailabilityOptions UpdateAvailabilityOptions Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAvailabilityOptions' {Text
domainName :: Text
$sel:domainName:UpdateAvailabilityOptions' :: UpdateAvailabilityOptions -> Text
domainName} -> Text
domainName) (\s :: UpdateAvailabilityOptions
s@UpdateAvailabilityOptions' {} Text
a -> UpdateAvailabilityOptions
s {$sel:domainName:UpdateAvailabilityOptions' :: Text
domainName = Text
a} :: UpdateAvailabilityOptions)
updateAvailabilityOptions_multiAZ :: Lens.Lens' UpdateAvailabilityOptions Prelude.Bool
updateAvailabilityOptions_multiAZ :: (Bool -> f Bool)
-> UpdateAvailabilityOptions -> f UpdateAvailabilityOptions
updateAvailabilityOptions_multiAZ = (UpdateAvailabilityOptions -> Bool)
-> (UpdateAvailabilityOptions -> Bool -> UpdateAvailabilityOptions)
-> Lens
UpdateAvailabilityOptions UpdateAvailabilityOptions Bool Bool
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAvailabilityOptions' {Bool
multiAZ :: Bool
$sel:multiAZ:UpdateAvailabilityOptions' :: UpdateAvailabilityOptions -> Bool
multiAZ} -> Bool
multiAZ) (\s :: UpdateAvailabilityOptions
s@UpdateAvailabilityOptions' {} Bool
a -> UpdateAvailabilityOptions
s {$sel:multiAZ:UpdateAvailabilityOptions' :: Bool
multiAZ = Bool
a} :: UpdateAvailabilityOptions)
instance Core.AWSRequest UpdateAvailabilityOptions where
type
AWSResponse UpdateAvailabilityOptions =
UpdateAvailabilityOptionsResponse
request :: UpdateAvailabilityOptions -> Request UpdateAvailabilityOptions
request = Service
-> UpdateAvailabilityOptions -> Request UpdateAvailabilityOptions
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
response :: Logger
-> Service
-> Proxy UpdateAvailabilityOptions
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateAvailabilityOptions)))
response =
Text
-> (Int
-> ResponseHeaders
-> [Node]
-> Either String (AWSResponse UpdateAvailabilityOptions))
-> Logger
-> Service
-> Proxy UpdateAvailabilityOptions
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateAvailabilityOptions)))
forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
-> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
Text
"UpdateAvailabilityOptionsResult"
( \Int
s ResponseHeaders
h [Node]
x ->
Maybe AvailabilityOptionsStatus
-> Int -> UpdateAvailabilityOptionsResponse
UpdateAvailabilityOptionsResponse'
(Maybe AvailabilityOptionsStatus
-> Int -> UpdateAvailabilityOptionsResponse)
-> Either String (Maybe AvailabilityOptionsStatus)
-> Either String (Int -> UpdateAvailabilityOptionsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe AvailabilityOptionsStatus)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"AvailabilityOptions")
Either String (Int -> UpdateAvailabilityOptionsResponse)
-> Either String Int
-> Either String UpdateAvailabilityOptionsResponse
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 UpdateAvailabilityOptions
instance Prelude.NFData UpdateAvailabilityOptions
instance Core.ToHeaders UpdateAvailabilityOptions where
toHeaders :: UpdateAvailabilityOptions -> ResponseHeaders
toHeaders = ResponseHeaders -> UpdateAvailabilityOptions -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath UpdateAvailabilityOptions where
toPath :: UpdateAvailabilityOptions -> ByteString
toPath = ByteString -> UpdateAvailabilityOptions -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery UpdateAvailabilityOptions where
toQuery :: UpdateAvailabilityOptions -> QueryString
toQuery UpdateAvailabilityOptions' {Bool
Text
multiAZ :: Bool
domainName :: Text
$sel:multiAZ:UpdateAvailabilityOptions' :: UpdateAvailabilityOptions -> Bool
$sel:domainName:UpdateAvailabilityOptions' :: UpdateAvailabilityOptions -> Text
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"UpdateAvailabilityOptions" :: Prelude.ByteString),
ByteString
"Version"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2013-01-01" :: Prelude.ByteString),
ByteString
"DomainName" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
domainName,
ByteString
"MultiAZ" ByteString -> Bool -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Bool
multiAZ
]
data UpdateAvailabilityOptionsResponse = UpdateAvailabilityOptionsResponse'
{
UpdateAvailabilityOptionsResponse
-> Maybe AvailabilityOptionsStatus
availabilityOptions :: Prelude.Maybe AvailabilityOptionsStatus,
UpdateAvailabilityOptionsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (UpdateAvailabilityOptionsResponse
-> UpdateAvailabilityOptionsResponse -> Bool
(UpdateAvailabilityOptionsResponse
-> UpdateAvailabilityOptionsResponse -> Bool)
-> (UpdateAvailabilityOptionsResponse
-> UpdateAvailabilityOptionsResponse -> Bool)
-> Eq UpdateAvailabilityOptionsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateAvailabilityOptionsResponse
-> UpdateAvailabilityOptionsResponse -> Bool
$c/= :: UpdateAvailabilityOptionsResponse
-> UpdateAvailabilityOptionsResponse -> Bool
== :: UpdateAvailabilityOptionsResponse
-> UpdateAvailabilityOptionsResponse -> Bool
$c== :: UpdateAvailabilityOptionsResponse
-> UpdateAvailabilityOptionsResponse -> Bool
Prelude.Eq, ReadPrec [UpdateAvailabilityOptionsResponse]
ReadPrec UpdateAvailabilityOptionsResponse
Int -> ReadS UpdateAvailabilityOptionsResponse
ReadS [UpdateAvailabilityOptionsResponse]
(Int -> ReadS UpdateAvailabilityOptionsResponse)
-> ReadS [UpdateAvailabilityOptionsResponse]
-> ReadPrec UpdateAvailabilityOptionsResponse
-> ReadPrec [UpdateAvailabilityOptionsResponse]
-> Read UpdateAvailabilityOptionsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateAvailabilityOptionsResponse]
$creadListPrec :: ReadPrec [UpdateAvailabilityOptionsResponse]
readPrec :: ReadPrec UpdateAvailabilityOptionsResponse
$creadPrec :: ReadPrec UpdateAvailabilityOptionsResponse
readList :: ReadS [UpdateAvailabilityOptionsResponse]
$creadList :: ReadS [UpdateAvailabilityOptionsResponse]
readsPrec :: Int -> ReadS UpdateAvailabilityOptionsResponse
$creadsPrec :: Int -> ReadS UpdateAvailabilityOptionsResponse
Prelude.Read, Int -> UpdateAvailabilityOptionsResponse -> ShowS
[UpdateAvailabilityOptionsResponse] -> ShowS
UpdateAvailabilityOptionsResponse -> String
(Int -> UpdateAvailabilityOptionsResponse -> ShowS)
-> (UpdateAvailabilityOptionsResponse -> String)
-> ([UpdateAvailabilityOptionsResponse] -> ShowS)
-> Show UpdateAvailabilityOptionsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateAvailabilityOptionsResponse] -> ShowS
$cshowList :: [UpdateAvailabilityOptionsResponse] -> ShowS
show :: UpdateAvailabilityOptionsResponse -> String
$cshow :: UpdateAvailabilityOptionsResponse -> String
showsPrec :: Int -> UpdateAvailabilityOptionsResponse -> ShowS
$cshowsPrec :: Int -> UpdateAvailabilityOptionsResponse -> ShowS
Prelude.Show, (forall x.
UpdateAvailabilityOptionsResponse
-> Rep UpdateAvailabilityOptionsResponse x)
-> (forall x.
Rep UpdateAvailabilityOptionsResponse x
-> UpdateAvailabilityOptionsResponse)
-> Generic UpdateAvailabilityOptionsResponse
forall x.
Rep UpdateAvailabilityOptionsResponse x
-> UpdateAvailabilityOptionsResponse
forall x.
UpdateAvailabilityOptionsResponse
-> Rep UpdateAvailabilityOptionsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateAvailabilityOptionsResponse x
-> UpdateAvailabilityOptionsResponse
$cfrom :: forall x.
UpdateAvailabilityOptionsResponse
-> Rep UpdateAvailabilityOptionsResponse x
Prelude.Generic)
newUpdateAvailabilityOptionsResponse ::
Prelude.Int ->
UpdateAvailabilityOptionsResponse
newUpdateAvailabilityOptionsResponse :: Int -> UpdateAvailabilityOptionsResponse
newUpdateAvailabilityOptionsResponse Int
pHttpStatus_ =
UpdateAvailabilityOptionsResponse' :: Maybe AvailabilityOptionsStatus
-> Int -> UpdateAvailabilityOptionsResponse
UpdateAvailabilityOptionsResponse'
{ $sel:availabilityOptions:UpdateAvailabilityOptionsResponse' :: Maybe AvailabilityOptionsStatus
availabilityOptions =
Maybe AvailabilityOptionsStatus
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:UpdateAvailabilityOptionsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
updateAvailabilityOptionsResponse_availabilityOptions :: Lens.Lens' UpdateAvailabilityOptionsResponse (Prelude.Maybe AvailabilityOptionsStatus)
updateAvailabilityOptionsResponse_availabilityOptions :: (Maybe AvailabilityOptionsStatus
-> f (Maybe AvailabilityOptionsStatus))
-> UpdateAvailabilityOptionsResponse
-> f UpdateAvailabilityOptionsResponse
updateAvailabilityOptionsResponse_availabilityOptions = (UpdateAvailabilityOptionsResponse
-> Maybe AvailabilityOptionsStatus)
-> (UpdateAvailabilityOptionsResponse
-> Maybe AvailabilityOptionsStatus
-> UpdateAvailabilityOptionsResponse)
-> Lens
UpdateAvailabilityOptionsResponse
UpdateAvailabilityOptionsResponse
(Maybe AvailabilityOptionsStatus)
(Maybe AvailabilityOptionsStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAvailabilityOptionsResponse' {Maybe AvailabilityOptionsStatus
availabilityOptions :: Maybe AvailabilityOptionsStatus
$sel:availabilityOptions:UpdateAvailabilityOptionsResponse' :: UpdateAvailabilityOptionsResponse
-> Maybe AvailabilityOptionsStatus
availabilityOptions} -> Maybe AvailabilityOptionsStatus
availabilityOptions) (\s :: UpdateAvailabilityOptionsResponse
s@UpdateAvailabilityOptionsResponse' {} Maybe AvailabilityOptionsStatus
a -> UpdateAvailabilityOptionsResponse
s {$sel:availabilityOptions:UpdateAvailabilityOptionsResponse' :: Maybe AvailabilityOptionsStatus
availabilityOptions = Maybe AvailabilityOptionsStatus
a} :: UpdateAvailabilityOptionsResponse)
updateAvailabilityOptionsResponse_httpStatus :: Lens.Lens' UpdateAvailabilityOptionsResponse Prelude.Int
updateAvailabilityOptionsResponse_httpStatus :: (Int -> f Int)
-> UpdateAvailabilityOptionsResponse
-> f UpdateAvailabilityOptionsResponse
updateAvailabilityOptionsResponse_httpStatus = (UpdateAvailabilityOptionsResponse -> Int)
-> (UpdateAvailabilityOptionsResponse
-> Int -> UpdateAvailabilityOptionsResponse)
-> Lens
UpdateAvailabilityOptionsResponse
UpdateAvailabilityOptionsResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAvailabilityOptionsResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateAvailabilityOptionsResponse' :: UpdateAvailabilityOptionsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateAvailabilityOptionsResponse
s@UpdateAvailabilityOptionsResponse' {} Int
a -> UpdateAvailabilityOptionsResponse
s {$sel:httpStatus:UpdateAvailabilityOptionsResponse' :: Int
httpStatus = Int
a} :: UpdateAvailabilityOptionsResponse)
instance
Prelude.NFData
UpdateAvailabilityOptionsResponse