{-# 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.DescribeAvailabilityOptions
(
DescribeAvailabilityOptions (..),
newDescribeAvailabilityOptions,
describeAvailabilityOptions_deployed,
describeAvailabilityOptions_domainName,
DescribeAvailabilityOptionsResponse (..),
newDescribeAvailabilityOptionsResponse,
describeAvailabilityOptionsResponse_availabilityOptions,
describeAvailabilityOptionsResponse_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 DescribeAvailabilityOptions = DescribeAvailabilityOptions'
{
DescribeAvailabilityOptions -> Maybe Bool
deployed :: Prelude.Maybe Prelude.Bool,
DescribeAvailabilityOptions -> Text
domainName :: Prelude.Text
}
deriving (DescribeAvailabilityOptions -> DescribeAvailabilityOptions -> Bool
(DescribeAvailabilityOptions
-> DescribeAvailabilityOptions -> Bool)
-> (DescribeAvailabilityOptions
-> DescribeAvailabilityOptions -> Bool)
-> Eq DescribeAvailabilityOptions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeAvailabilityOptions -> DescribeAvailabilityOptions -> Bool
$c/= :: DescribeAvailabilityOptions -> DescribeAvailabilityOptions -> Bool
== :: DescribeAvailabilityOptions -> DescribeAvailabilityOptions -> Bool
$c== :: DescribeAvailabilityOptions -> DescribeAvailabilityOptions -> Bool
Prelude.Eq, ReadPrec [DescribeAvailabilityOptions]
ReadPrec DescribeAvailabilityOptions
Int -> ReadS DescribeAvailabilityOptions
ReadS [DescribeAvailabilityOptions]
(Int -> ReadS DescribeAvailabilityOptions)
-> ReadS [DescribeAvailabilityOptions]
-> ReadPrec DescribeAvailabilityOptions
-> ReadPrec [DescribeAvailabilityOptions]
-> Read DescribeAvailabilityOptions
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeAvailabilityOptions]
$creadListPrec :: ReadPrec [DescribeAvailabilityOptions]
readPrec :: ReadPrec DescribeAvailabilityOptions
$creadPrec :: ReadPrec DescribeAvailabilityOptions
readList :: ReadS [DescribeAvailabilityOptions]
$creadList :: ReadS [DescribeAvailabilityOptions]
readsPrec :: Int -> ReadS DescribeAvailabilityOptions
$creadsPrec :: Int -> ReadS DescribeAvailabilityOptions
Prelude.Read, Int -> DescribeAvailabilityOptions -> ShowS
[DescribeAvailabilityOptions] -> ShowS
DescribeAvailabilityOptions -> String
(Int -> DescribeAvailabilityOptions -> ShowS)
-> (DescribeAvailabilityOptions -> String)
-> ([DescribeAvailabilityOptions] -> ShowS)
-> Show DescribeAvailabilityOptions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeAvailabilityOptions] -> ShowS
$cshowList :: [DescribeAvailabilityOptions] -> ShowS
show :: DescribeAvailabilityOptions -> String
$cshow :: DescribeAvailabilityOptions -> String
showsPrec :: Int -> DescribeAvailabilityOptions -> ShowS
$cshowsPrec :: Int -> DescribeAvailabilityOptions -> ShowS
Prelude.Show, (forall x.
DescribeAvailabilityOptions -> Rep DescribeAvailabilityOptions x)
-> (forall x.
Rep DescribeAvailabilityOptions x -> DescribeAvailabilityOptions)
-> Generic DescribeAvailabilityOptions
forall x.
Rep DescribeAvailabilityOptions x -> DescribeAvailabilityOptions
forall x.
DescribeAvailabilityOptions -> Rep DescribeAvailabilityOptions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeAvailabilityOptions x -> DescribeAvailabilityOptions
$cfrom :: forall x.
DescribeAvailabilityOptions -> Rep DescribeAvailabilityOptions x
Prelude.Generic)
newDescribeAvailabilityOptions ::
Prelude.Text ->
DescribeAvailabilityOptions
newDescribeAvailabilityOptions :: Text -> DescribeAvailabilityOptions
newDescribeAvailabilityOptions Text
pDomainName_ =
DescribeAvailabilityOptions' :: Maybe Bool -> Text -> DescribeAvailabilityOptions
DescribeAvailabilityOptions'
{ $sel:deployed:DescribeAvailabilityOptions' :: Maybe Bool
deployed =
Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:domainName:DescribeAvailabilityOptions' :: Text
domainName = Text
pDomainName_
}
describeAvailabilityOptions_deployed :: Lens.Lens' DescribeAvailabilityOptions (Prelude.Maybe Prelude.Bool)
describeAvailabilityOptions_deployed :: (Maybe Bool -> f (Maybe Bool))
-> DescribeAvailabilityOptions -> f DescribeAvailabilityOptions
describeAvailabilityOptions_deployed = (DescribeAvailabilityOptions -> Maybe Bool)
-> (DescribeAvailabilityOptions
-> Maybe Bool -> DescribeAvailabilityOptions)
-> Lens
DescribeAvailabilityOptions
DescribeAvailabilityOptions
(Maybe Bool)
(Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAvailabilityOptions' {Maybe Bool
deployed :: Maybe Bool
$sel:deployed:DescribeAvailabilityOptions' :: DescribeAvailabilityOptions -> Maybe Bool
deployed} -> Maybe Bool
deployed) (\s :: DescribeAvailabilityOptions
s@DescribeAvailabilityOptions' {} Maybe Bool
a -> DescribeAvailabilityOptions
s {$sel:deployed:DescribeAvailabilityOptions' :: Maybe Bool
deployed = Maybe Bool
a} :: DescribeAvailabilityOptions)
describeAvailabilityOptions_domainName :: Lens.Lens' DescribeAvailabilityOptions Prelude.Text
describeAvailabilityOptions_domainName :: (Text -> f Text)
-> DescribeAvailabilityOptions -> f DescribeAvailabilityOptions
describeAvailabilityOptions_domainName = (DescribeAvailabilityOptions -> Text)
-> (DescribeAvailabilityOptions
-> Text -> DescribeAvailabilityOptions)
-> Lens
DescribeAvailabilityOptions DescribeAvailabilityOptions Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAvailabilityOptions' {Text
domainName :: Text
$sel:domainName:DescribeAvailabilityOptions' :: DescribeAvailabilityOptions -> Text
domainName} -> Text
domainName) (\s :: DescribeAvailabilityOptions
s@DescribeAvailabilityOptions' {} Text
a -> DescribeAvailabilityOptions
s {$sel:domainName:DescribeAvailabilityOptions' :: Text
domainName = Text
a} :: DescribeAvailabilityOptions)
instance Core.AWSRequest DescribeAvailabilityOptions where
type
AWSResponse DescribeAvailabilityOptions =
DescribeAvailabilityOptionsResponse
request :: DescribeAvailabilityOptions -> Request DescribeAvailabilityOptions
request = Service
-> DescribeAvailabilityOptions
-> Request DescribeAvailabilityOptions
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
response :: Logger
-> Service
-> Proxy DescribeAvailabilityOptions
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeAvailabilityOptions)))
response =
Text
-> (Int
-> ResponseHeaders
-> [Node]
-> Either String (AWSResponse DescribeAvailabilityOptions))
-> Logger
-> Service
-> Proxy DescribeAvailabilityOptions
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeAvailabilityOptions)))
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
"DescribeAvailabilityOptionsResult"
( \Int
s ResponseHeaders
h [Node]
x ->
Maybe AvailabilityOptionsStatus
-> Int -> DescribeAvailabilityOptionsResponse
DescribeAvailabilityOptionsResponse'
(Maybe AvailabilityOptionsStatus
-> Int -> DescribeAvailabilityOptionsResponse)
-> Either String (Maybe AvailabilityOptionsStatus)
-> Either String (Int -> DescribeAvailabilityOptionsResponse)
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 -> DescribeAvailabilityOptionsResponse)
-> Either String Int
-> Either String DescribeAvailabilityOptionsResponse
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 DescribeAvailabilityOptions
instance Prelude.NFData DescribeAvailabilityOptions
instance Core.ToHeaders DescribeAvailabilityOptions where
toHeaders :: DescribeAvailabilityOptions -> ResponseHeaders
toHeaders = ResponseHeaders -> DescribeAvailabilityOptions -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath DescribeAvailabilityOptions where
toPath :: DescribeAvailabilityOptions -> ByteString
toPath = ByteString -> DescribeAvailabilityOptions -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DescribeAvailabilityOptions where
toQuery :: DescribeAvailabilityOptions -> QueryString
toQuery DescribeAvailabilityOptions' {Maybe Bool
Text
domainName :: Text
deployed :: Maybe Bool
$sel:domainName:DescribeAvailabilityOptions' :: DescribeAvailabilityOptions -> Text
$sel:deployed:DescribeAvailabilityOptions' :: DescribeAvailabilityOptions -> Maybe Bool
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: ( ByteString
"DescribeAvailabilityOptions" ::
Prelude.ByteString
),
ByteString
"Version"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2013-01-01" :: Prelude.ByteString),
ByteString
"Deployed" ByteString -> Maybe Bool -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Bool
deployed,
ByteString
"DomainName" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
domainName
]
data DescribeAvailabilityOptionsResponse = DescribeAvailabilityOptionsResponse'
{
DescribeAvailabilityOptionsResponse
-> Maybe AvailabilityOptionsStatus
availabilityOptions :: Prelude.Maybe AvailabilityOptionsStatus,
DescribeAvailabilityOptionsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DescribeAvailabilityOptionsResponse
-> DescribeAvailabilityOptionsResponse -> Bool
(DescribeAvailabilityOptionsResponse
-> DescribeAvailabilityOptionsResponse -> Bool)
-> (DescribeAvailabilityOptionsResponse
-> DescribeAvailabilityOptionsResponse -> Bool)
-> Eq DescribeAvailabilityOptionsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeAvailabilityOptionsResponse
-> DescribeAvailabilityOptionsResponse -> Bool
$c/= :: DescribeAvailabilityOptionsResponse
-> DescribeAvailabilityOptionsResponse -> Bool
== :: DescribeAvailabilityOptionsResponse
-> DescribeAvailabilityOptionsResponse -> Bool
$c== :: DescribeAvailabilityOptionsResponse
-> DescribeAvailabilityOptionsResponse -> Bool
Prelude.Eq, ReadPrec [DescribeAvailabilityOptionsResponse]
ReadPrec DescribeAvailabilityOptionsResponse
Int -> ReadS DescribeAvailabilityOptionsResponse
ReadS [DescribeAvailabilityOptionsResponse]
(Int -> ReadS DescribeAvailabilityOptionsResponse)
-> ReadS [DescribeAvailabilityOptionsResponse]
-> ReadPrec DescribeAvailabilityOptionsResponse
-> ReadPrec [DescribeAvailabilityOptionsResponse]
-> Read DescribeAvailabilityOptionsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeAvailabilityOptionsResponse]
$creadListPrec :: ReadPrec [DescribeAvailabilityOptionsResponse]
readPrec :: ReadPrec DescribeAvailabilityOptionsResponse
$creadPrec :: ReadPrec DescribeAvailabilityOptionsResponse
readList :: ReadS [DescribeAvailabilityOptionsResponse]
$creadList :: ReadS [DescribeAvailabilityOptionsResponse]
readsPrec :: Int -> ReadS DescribeAvailabilityOptionsResponse
$creadsPrec :: Int -> ReadS DescribeAvailabilityOptionsResponse
Prelude.Read, Int -> DescribeAvailabilityOptionsResponse -> ShowS
[DescribeAvailabilityOptionsResponse] -> ShowS
DescribeAvailabilityOptionsResponse -> String
(Int -> DescribeAvailabilityOptionsResponse -> ShowS)
-> (DescribeAvailabilityOptionsResponse -> String)
-> ([DescribeAvailabilityOptionsResponse] -> ShowS)
-> Show DescribeAvailabilityOptionsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeAvailabilityOptionsResponse] -> ShowS
$cshowList :: [DescribeAvailabilityOptionsResponse] -> ShowS
show :: DescribeAvailabilityOptionsResponse -> String
$cshow :: DescribeAvailabilityOptionsResponse -> String
showsPrec :: Int -> DescribeAvailabilityOptionsResponse -> ShowS
$cshowsPrec :: Int -> DescribeAvailabilityOptionsResponse -> ShowS
Prelude.Show, (forall x.
DescribeAvailabilityOptionsResponse
-> Rep DescribeAvailabilityOptionsResponse x)
-> (forall x.
Rep DescribeAvailabilityOptionsResponse x
-> DescribeAvailabilityOptionsResponse)
-> Generic DescribeAvailabilityOptionsResponse
forall x.
Rep DescribeAvailabilityOptionsResponse x
-> DescribeAvailabilityOptionsResponse
forall x.
DescribeAvailabilityOptionsResponse
-> Rep DescribeAvailabilityOptionsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeAvailabilityOptionsResponse x
-> DescribeAvailabilityOptionsResponse
$cfrom :: forall x.
DescribeAvailabilityOptionsResponse
-> Rep DescribeAvailabilityOptionsResponse x
Prelude.Generic)
newDescribeAvailabilityOptionsResponse ::
Prelude.Int ->
DescribeAvailabilityOptionsResponse
newDescribeAvailabilityOptionsResponse :: Int -> DescribeAvailabilityOptionsResponse
newDescribeAvailabilityOptionsResponse Int
pHttpStatus_ =
DescribeAvailabilityOptionsResponse' :: Maybe AvailabilityOptionsStatus
-> Int -> DescribeAvailabilityOptionsResponse
DescribeAvailabilityOptionsResponse'
{ $sel:availabilityOptions:DescribeAvailabilityOptionsResponse' :: Maybe AvailabilityOptionsStatus
availabilityOptions =
Maybe AvailabilityOptionsStatus
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DescribeAvailabilityOptionsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
describeAvailabilityOptionsResponse_availabilityOptions :: Lens.Lens' DescribeAvailabilityOptionsResponse (Prelude.Maybe AvailabilityOptionsStatus)
describeAvailabilityOptionsResponse_availabilityOptions :: (Maybe AvailabilityOptionsStatus
-> f (Maybe AvailabilityOptionsStatus))
-> DescribeAvailabilityOptionsResponse
-> f DescribeAvailabilityOptionsResponse
describeAvailabilityOptionsResponse_availabilityOptions = (DescribeAvailabilityOptionsResponse
-> Maybe AvailabilityOptionsStatus)
-> (DescribeAvailabilityOptionsResponse
-> Maybe AvailabilityOptionsStatus
-> DescribeAvailabilityOptionsResponse)
-> Lens
DescribeAvailabilityOptionsResponse
DescribeAvailabilityOptionsResponse
(Maybe AvailabilityOptionsStatus)
(Maybe AvailabilityOptionsStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAvailabilityOptionsResponse' {Maybe AvailabilityOptionsStatus
availabilityOptions :: Maybe AvailabilityOptionsStatus
$sel:availabilityOptions:DescribeAvailabilityOptionsResponse' :: DescribeAvailabilityOptionsResponse
-> Maybe AvailabilityOptionsStatus
availabilityOptions} -> Maybe AvailabilityOptionsStatus
availabilityOptions) (\s :: DescribeAvailabilityOptionsResponse
s@DescribeAvailabilityOptionsResponse' {} Maybe AvailabilityOptionsStatus
a -> DescribeAvailabilityOptionsResponse
s {$sel:availabilityOptions:DescribeAvailabilityOptionsResponse' :: Maybe AvailabilityOptionsStatus
availabilityOptions = Maybe AvailabilityOptionsStatus
a} :: DescribeAvailabilityOptionsResponse)
describeAvailabilityOptionsResponse_httpStatus :: Lens.Lens' DescribeAvailabilityOptionsResponse Prelude.Int
describeAvailabilityOptionsResponse_httpStatus :: (Int -> f Int)
-> DescribeAvailabilityOptionsResponse
-> f DescribeAvailabilityOptionsResponse
describeAvailabilityOptionsResponse_httpStatus = (DescribeAvailabilityOptionsResponse -> Int)
-> (DescribeAvailabilityOptionsResponse
-> Int -> DescribeAvailabilityOptionsResponse)
-> Lens
DescribeAvailabilityOptionsResponse
DescribeAvailabilityOptionsResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAvailabilityOptionsResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeAvailabilityOptionsResponse' :: DescribeAvailabilityOptionsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeAvailabilityOptionsResponse
s@DescribeAvailabilityOptionsResponse' {} Int
a -> DescribeAvailabilityOptionsResponse
s {$sel:httpStatus:DescribeAvailabilityOptionsResponse' :: Int
httpStatus = Int
a} :: DescribeAvailabilityOptionsResponse)
instance
Prelude.NFData
DescribeAvailabilityOptionsResponse