{-# 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.DescribeIndexFields
(
DescribeIndexFields (..),
newDescribeIndexFields,
describeIndexFields_deployed,
describeIndexFields_fieldNames,
describeIndexFields_domainName,
DescribeIndexFieldsResponse (..),
newDescribeIndexFieldsResponse,
describeIndexFieldsResponse_httpStatus,
describeIndexFieldsResponse_indexFields,
)
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 DescribeIndexFields = DescribeIndexFields'
{
DescribeIndexFields -> Maybe Bool
deployed :: Prelude.Maybe Prelude.Bool,
DescribeIndexFields -> Maybe [Text]
fieldNames :: Prelude.Maybe [Prelude.Text],
DescribeIndexFields -> Text
domainName :: Prelude.Text
}
deriving (DescribeIndexFields -> DescribeIndexFields -> Bool
(DescribeIndexFields -> DescribeIndexFields -> Bool)
-> (DescribeIndexFields -> DescribeIndexFields -> Bool)
-> Eq DescribeIndexFields
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeIndexFields -> DescribeIndexFields -> Bool
$c/= :: DescribeIndexFields -> DescribeIndexFields -> Bool
== :: DescribeIndexFields -> DescribeIndexFields -> Bool
$c== :: DescribeIndexFields -> DescribeIndexFields -> Bool
Prelude.Eq, ReadPrec [DescribeIndexFields]
ReadPrec DescribeIndexFields
Int -> ReadS DescribeIndexFields
ReadS [DescribeIndexFields]
(Int -> ReadS DescribeIndexFields)
-> ReadS [DescribeIndexFields]
-> ReadPrec DescribeIndexFields
-> ReadPrec [DescribeIndexFields]
-> Read DescribeIndexFields
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeIndexFields]
$creadListPrec :: ReadPrec [DescribeIndexFields]
readPrec :: ReadPrec DescribeIndexFields
$creadPrec :: ReadPrec DescribeIndexFields
readList :: ReadS [DescribeIndexFields]
$creadList :: ReadS [DescribeIndexFields]
readsPrec :: Int -> ReadS DescribeIndexFields
$creadsPrec :: Int -> ReadS DescribeIndexFields
Prelude.Read, Int -> DescribeIndexFields -> ShowS
[DescribeIndexFields] -> ShowS
DescribeIndexFields -> String
(Int -> DescribeIndexFields -> ShowS)
-> (DescribeIndexFields -> String)
-> ([DescribeIndexFields] -> ShowS)
-> Show DescribeIndexFields
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeIndexFields] -> ShowS
$cshowList :: [DescribeIndexFields] -> ShowS
show :: DescribeIndexFields -> String
$cshow :: DescribeIndexFields -> String
showsPrec :: Int -> DescribeIndexFields -> ShowS
$cshowsPrec :: Int -> DescribeIndexFields -> ShowS
Prelude.Show, (forall x. DescribeIndexFields -> Rep DescribeIndexFields x)
-> (forall x. Rep DescribeIndexFields x -> DescribeIndexFields)
-> Generic DescribeIndexFields
forall x. Rep DescribeIndexFields x -> DescribeIndexFields
forall x. DescribeIndexFields -> Rep DescribeIndexFields x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeIndexFields x -> DescribeIndexFields
$cfrom :: forall x. DescribeIndexFields -> Rep DescribeIndexFields x
Prelude.Generic)
newDescribeIndexFields ::
Prelude.Text ->
DescribeIndexFields
newDescribeIndexFields :: Text -> DescribeIndexFields
newDescribeIndexFields Text
pDomainName_ =
DescribeIndexFields' :: Maybe Bool -> Maybe [Text] -> Text -> DescribeIndexFields
DescribeIndexFields'
{ $sel:deployed:DescribeIndexFields' :: Maybe Bool
deployed = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:fieldNames:DescribeIndexFields' :: Maybe [Text]
fieldNames = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
$sel:domainName:DescribeIndexFields' :: Text
domainName = Text
pDomainName_
}
describeIndexFields_deployed :: Lens.Lens' DescribeIndexFields (Prelude.Maybe Prelude.Bool)
describeIndexFields_deployed :: (Maybe Bool -> f (Maybe Bool))
-> DescribeIndexFields -> f DescribeIndexFields
describeIndexFields_deployed = (DescribeIndexFields -> Maybe Bool)
-> (DescribeIndexFields -> Maybe Bool -> DescribeIndexFields)
-> Lens
DescribeIndexFields DescribeIndexFields (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeIndexFields' {Maybe Bool
deployed :: Maybe Bool
$sel:deployed:DescribeIndexFields' :: DescribeIndexFields -> Maybe Bool
deployed} -> Maybe Bool
deployed) (\s :: DescribeIndexFields
s@DescribeIndexFields' {} Maybe Bool
a -> DescribeIndexFields
s {$sel:deployed:DescribeIndexFields' :: Maybe Bool
deployed = Maybe Bool
a} :: DescribeIndexFields)
describeIndexFields_fieldNames :: Lens.Lens' DescribeIndexFields (Prelude.Maybe [Prelude.Text])
describeIndexFields_fieldNames :: (Maybe [Text] -> f (Maybe [Text]))
-> DescribeIndexFields -> f DescribeIndexFields
describeIndexFields_fieldNames = (DescribeIndexFields -> Maybe [Text])
-> (DescribeIndexFields -> Maybe [Text] -> DescribeIndexFields)
-> Lens
DescribeIndexFields
DescribeIndexFields
(Maybe [Text])
(Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeIndexFields' {Maybe [Text]
fieldNames :: Maybe [Text]
$sel:fieldNames:DescribeIndexFields' :: DescribeIndexFields -> Maybe [Text]
fieldNames} -> Maybe [Text]
fieldNames) (\s :: DescribeIndexFields
s@DescribeIndexFields' {} Maybe [Text]
a -> DescribeIndexFields
s {$sel:fieldNames:DescribeIndexFields' :: Maybe [Text]
fieldNames = Maybe [Text]
a} :: DescribeIndexFields) ((Maybe [Text] -> f (Maybe [Text]))
-> DescribeIndexFields -> f DescribeIndexFields)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> DescribeIndexFields
-> f DescribeIndexFields
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
describeIndexFields_domainName :: Lens.Lens' DescribeIndexFields Prelude.Text
describeIndexFields_domainName :: (Text -> f Text) -> DescribeIndexFields -> f DescribeIndexFields
describeIndexFields_domainName = (DescribeIndexFields -> Text)
-> (DescribeIndexFields -> Text -> DescribeIndexFields)
-> Lens DescribeIndexFields DescribeIndexFields Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeIndexFields' {Text
domainName :: Text
$sel:domainName:DescribeIndexFields' :: DescribeIndexFields -> Text
domainName} -> Text
domainName) (\s :: DescribeIndexFields
s@DescribeIndexFields' {} Text
a -> DescribeIndexFields
s {$sel:domainName:DescribeIndexFields' :: Text
domainName = Text
a} :: DescribeIndexFields)
instance Core.AWSRequest DescribeIndexFields where
type
AWSResponse DescribeIndexFields =
DescribeIndexFieldsResponse
request :: DescribeIndexFields -> Request DescribeIndexFields
request = Service -> DescribeIndexFields -> Request DescribeIndexFields
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
response :: Logger
-> Service
-> Proxy DescribeIndexFields
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeIndexFields)))
response =
Text
-> (Int
-> ResponseHeaders
-> [Node]
-> Either String (AWSResponse DescribeIndexFields))
-> Logger
-> Service
-> Proxy DescribeIndexFields
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeIndexFields)))
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
"DescribeIndexFieldsResult"
( \Int
s ResponseHeaders
h [Node]
x ->
Int -> [IndexFieldStatus] -> DescribeIndexFieldsResponse
DescribeIndexFieldsResponse'
(Int -> [IndexFieldStatus] -> DescribeIndexFieldsResponse)
-> Either String Int
-> Either
String ([IndexFieldStatus] -> DescribeIndexFieldsResponse)
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))
Either String ([IndexFieldStatus] -> DescribeIndexFieldsResponse)
-> Either String [IndexFieldStatus]
-> Either String DescribeIndexFieldsResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x [Node] -> Text -> Either String (Maybe [Node])
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"IndexFields" Either String (Maybe [Node]) -> [Node] -> Either String [Node]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [Node]
forall a. Monoid a => a
Prelude.mempty
Either String [Node]
-> ([Node] -> Either String [IndexFieldStatus])
-> Either String [IndexFieldStatus]
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= Text -> [Node] -> Either String [IndexFieldStatus]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"member"
)
)
instance Prelude.Hashable DescribeIndexFields
instance Prelude.NFData DescribeIndexFields
instance Core.ToHeaders DescribeIndexFields where
toHeaders :: DescribeIndexFields -> ResponseHeaders
toHeaders = ResponseHeaders -> DescribeIndexFields -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath DescribeIndexFields where
toPath :: DescribeIndexFields -> ByteString
toPath = ByteString -> DescribeIndexFields -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DescribeIndexFields where
toQuery :: DescribeIndexFields -> QueryString
toQuery DescribeIndexFields' {Maybe Bool
Maybe [Text]
Text
domainName :: Text
fieldNames :: Maybe [Text]
deployed :: Maybe Bool
$sel:domainName:DescribeIndexFields' :: DescribeIndexFields -> Text
$sel:fieldNames:DescribeIndexFields' :: DescribeIndexFields -> Maybe [Text]
$sel:deployed:DescribeIndexFields' :: DescribeIndexFields -> 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
"DescribeIndexFields" :: 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
"FieldNames"
ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe QueryString -> QueryString
forall a. ToQuery a => a -> QueryString
Core.toQuery
(ByteString -> [Text] -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList ByteString
"member" ([Text] -> QueryString) -> Maybe [Text] -> Maybe QueryString
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
fieldNames),
ByteString
"DomainName" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
domainName
]
data DescribeIndexFieldsResponse = DescribeIndexFieldsResponse'
{
DescribeIndexFieldsResponse -> Int
httpStatus :: Prelude.Int,
DescribeIndexFieldsResponse -> [IndexFieldStatus]
indexFields :: [IndexFieldStatus]
}
deriving (DescribeIndexFieldsResponse -> DescribeIndexFieldsResponse -> Bool
(DescribeIndexFieldsResponse
-> DescribeIndexFieldsResponse -> Bool)
-> (DescribeIndexFieldsResponse
-> DescribeIndexFieldsResponse -> Bool)
-> Eq DescribeIndexFieldsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeIndexFieldsResponse -> DescribeIndexFieldsResponse -> Bool
$c/= :: DescribeIndexFieldsResponse -> DescribeIndexFieldsResponse -> Bool
== :: DescribeIndexFieldsResponse -> DescribeIndexFieldsResponse -> Bool
$c== :: DescribeIndexFieldsResponse -> DescribeIndexFieldsResponse -> Bool
Prelude.Eq, ReadPrec [DescribeIndexFieldsResponse]
ReadPrec DescribeIndexFieldsResponse
Int -> ReadS DescribeIndexFieldsResponse
ReadS [DescribeIndexFieldsResponse]
(Int -> ReadS DescribeIndexFieldsResponse)
-> ReadS [DescribeIndexFieldsResponse]
-> ReadPrec DescribeIndexFieldsResponse
-> ReadPrec [DescribeIndexFieldsResponse]
-> Read DescribeIndexFieldsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeIndexFieldsResponse]
$creadListPrec :: ReadPrec [DescribeIndexFieldsResponse]
readPrec :: ReadPrec DescribeIndexFieldsResponse
$creadPrec :: ReadPrec DescribeIndexFieldsResponse
readList :: ReadS [DescribeIndexFieldsResponse]
$creadList :: ReadS [DescribeIndexFieldsResponse]
readsPrec :: Int -> ReadS DescribeIndexFieldsResponse
$creadsPrec :: Int -> ReadS DescribeIndexFieldsResponse
Prelude.Read, Int -> DescribeIndexFieldsResponse -> ShowS
[DescribeIndexFieldsResponse] -> ShowS
DescribeIndexFieldsResponse -> String
(Int -> DescribeIndexFieldsResponse -> ShowS)
-> (DescribeIndexFieldsResponse -> String)
-> ([DescribeIndexFieldsResponse] -> ShowS)
-> Show DescribeIndexFieldsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeIndexFieldsResponse] -> ShowS
$cshowList :: [DescribeIndexFieldsResponse] -> ShowS
show :: DescribeIndexFieldsResponse -> String
$cshow :: DescribeIndexFieldsResponse -> String
showsPrec :: Int -> DescribeIndexFieldsResponse -> ShowS
$cshowsPrec :: Int -> DescribeIndexFieldsResponse -> ShowS
Prelude.Show, (forall x.
DescribeIndexFieldsResponse -> Rep DescribeIndexFieldsResponse x)
-> (forall x.
Rep DescribeIndexFieldsResponse x -> DescribeIndexFieldsResponse)
-> Generic DescribeIndexFieldsResponse
forall x.
Rep DescribeIndexFieldsResponse x -> DescribeIndexFieldsResponse
forall x.
DescribeIndexFieldsResponse -> Rep DescribeIndexFieldsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeIndexFieldsResponse x -> DescribeIndexFieldsResponse
$cfrom :: forall x.
DescribeIndexFieldsResponse -> Rep DescribeIndexFieldsResponse x
Prelude.Generic)
newDescribeIndexFieldsResponse ::
Prelude.Int ->
DescribeIndexFieldsResponse
newDescribeIndexFieldsResponse :: Int -> DescribeIndexFieldsResponse
newDescribeIndexFieldsResponse Int
pHttpStatus_ =
DescribeIndexFieldsResponse' :: Int -> [IndexFieldStatus] -> DescribeIndexFieldsResponse
DescribeIndexFieldsResponse'
{ $sel:httpStatus:DescribeIndexFieldsResponse' :: Int
httpStatus =
Int
pHttpStatus_,
$sel:indexFields:DescribeIndexFieldsResponse' :: [IndexFieldStatus]
indexFields = [IndexFieldStatus]
forall a. Monoid a => a
Prelude.mempty
}
describeIndexFieldsResponse_httpStatus :: Lens.Lens' DescribeIndexFieldsResponse Prelude.Int
describeIndexFieldsResponse_httpStatus :: (Int -> f Int)
-> DescribeIndexFieldsResponse -> f DescribeIndexFieldsResponse
describeIndexFieldsResponse_httpStatus = (DescribeIndexFieldsResponse -> Int)
-> (DescribeIndexFieldsResponse
-> Int -> DescribeIndexFieldsResponse)
-> Lens
DescribeIndexFieldsResponse DescribeIndexFieldsResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeIndexFieldsResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeIndexFieldsResponse' :: DescribeIndexFieldsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeIndexFieldsResponse
s@DescribeIndexFieldsResponse' {} Int
a -> DescribeIndexFieldsResponse
s {$sel:httpStatus:DescribeIndexFieldsResponse' :: Int
httpStatus = Int
a} :: DescribeIndexFieldsResponse)
describeIndexFieldsResponse_indexFields :: Lens.Lens' DescribeIndexFieldsResponse [IndexFieldStatus]
describeIndexFieldsResponse_indexFields :: ([IndexFieldStatus] -> f [IndexFieldStatus])
-> DescribeIndexFieldsResponse -> f DescribeIndexFieldsResponse
describeIndexFieldsResponse_indexFields = (DescribeIndexFieldsResponse -> [IndexFieldStatus])
-> (DescribeIndexFieldsResponse
-> [IndexFieldStatus] -> DescribeIndexFieldsResponse)
-> Lens
DescribeIndexFieldsResponse
DescribeIndexFieldsResponse
[IndexFieldStatus]
[IndexFieldStatus]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeIndexFieldsResponse' {[IndexFieldStatus]
indexFields :: [IndexFieldStatus]
$sel:indexFields:DescribeIndexFieldsResponse' :: DescribeIndexFieldsResponse -> [IndexFieldStatus]
indexFields} -> [IndexFieldStatus]
indexFields) (\s :: DescribeIndexFieldsResponse
s@DescribeIndexFieldsResponse' {} [IndexFieldStatus]
a -> DescribeIndexFieldsResponse
s {$sel:indexFields:DescribeIndexFieldsResponse' :: [IndexFieldStatus]
indexFields = [IndexFieldStatus]
a} :: DescribeIndexFieldsResponse) (([IndexFieldStatus] -> f [IndexFieldStatus])
-> DescribeIndexFieldsResponse -> f DescribeIndexFieldsResponse)
-> (([IndexFieldStatus] -> f [IndexFieldStatus])
-> [IndexFieldStatus] -> f [IndexFieldStatus])
-> ([IndexFieldStatus] -> f [IndexFieldStatus])
-> DescribeIndexFieldsResponse
-> f DescribeIndexFieldsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([IndexFieldStatus] -> f [IndexFieldStatus])
-> [IndexFieldStatus] -> f [IndexFieldStatus]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Prelude.NFData DescribeIndexFieldsResponse