{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.CloudSearch.Types.IndexField
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.CloudSearch.Types.IndexField where

import Amazonka.CloudSearch.Types.DateArrayOptions
import Amazonka.CloudSearch.Types.DateOptions
import Amazonka.CloudSearch.Types.DoubleArrayOptions
import Amazonka.CloudSearch.Types.DoubleOptions
import Amazonka.CloudSearch.Types.IndexFieldType
import Amazonka.CloudSearch.Types.IntArrayOptions
import Amazonka.CloudSearch.Types.IntOptions
import Amazonka.CloudSearch.Types.LatLonOptions
import Amazonka.CloudSearch.Types.LiteralArrayOptions
import Amazonka.CloudSearch.Types.LiteralOptions
import Amazonka.CloudSearch.Types.TextArrayOptions
import Amazonka.CloudSearch.Types.TextOptions
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Configuration information for a field in the index, including its name,
-- type, and options. The supported options depend on the @IndexFieldType@.
--
-- /See:/ 'newIndexField' smart constructor.
data IndexField = IndexField'
  { IndexField -> Maybe DoubleArrayOptions
doubleArrayOptions :: Prelude.Maybe DoubleArrayOptions,
    IndexField -> Maybe DateOptions
dateOptions :: Prelude.Maybe DateOptions,
    IndexField -> Maybe TextArrayOptions
textArrayOptions :: Prelude.Maybe TextArrayOptions,
    IndexField -> Maybe DoubleOptions
doubleOptions :: Prelude.Maybe DoubleOptions,
    IndexField -> Maybe TextOptions
textOptions :: Prelude.Maybe TextOptions,
    IndexField -> Maybe LatLonOptions
latLonOptions :: Prelude.Maybe LatLonOptions,
    IndexField -> Maybe LiteralArrayOptions
literalArrayOptions :: Prelude.Maybe LiteralArrayOptions,
    IndexField -> Maybe IntArrayOptions
intArrayOptions :: Prelude.Maybe IntArrayOptions,
    IndexField -> Maybe DateArrayOptions
dateArrayOptions :: Prelude.Maybe DateArrayOptions,
    IndexField -> Maybe IntOptions
intOptions :: Prelude.Maybe IntOptions,
    IndexField -> Maybe LiteralOptions
literalOptions :: Prelude.Maybe LiteralOptions,
    -- | A string that represents the name of an index field. CloudSearch
    -- supports regular index fields as well as dynamic fields. A dynamic
    -- field\'s name defines a pattern that begins or ends with a wildcard. Any
    -- document fields that don\'t map to a regular index field but do match a
    -- dynamic field\'s pattern are configured with the dynamic field\'s
    -- indexing options.
    --
    -- Regular field names begin with a letter and can contain the following
    -- characters: a-z (lowercase), 0-9, and _ (underscore). Dynamic field
    -- names must begin or end with a wildcard (*). The wildcard can also be
    -- the only character in a dynamic field name. Multiple wildcards, and
    -- wildcards embedded within a string are not supported.
    --
    -- The name @score@ is reserved and cannot be used as a field name. To
    -- reference a document\'s ID, you can use the name @_id@.
    IndexField -> Text
indexFieldName :: Prelude.Text,
    IndexField -> IndexFieldType
indexFieldType :: IndexFieldType
  }
  deriving (IndexField -> IndexField -> Bool
(IndexField -> IndexField -> Bool)
-> (IndexField -> IndexField -> Bool) -> Eq IndexField
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: IndexField -> IndexField -> Bool
$c/= :: IndexField -> IndexField -> Bool
== :: IndexField -> IndexField -> Bool
$c== :: IndexField -> IndexField -> Bool
Prelude.Eq, ReadPrec [IndexField]
ReadPrec IndexField
Int -> ReadS IndexField
ReadS [IndexField]
(Int -> ReadS IndexField)
-> ReadS [IndexField]
-> ReadPrec IndexField
-> ReadPrec [IndexField]
-> Read IndexField
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [IndexField]
$creadListPrec :: ReadPrec [IndexField]
readPrec :: ReadPrec IndexField
$creadPrec :: ReadPrec IndexField
readList :: ReadS [IndexField]
$creadList :: ReadS [IndexField]
readsPrec :: Int -> ReadS IndexField
$creadsPrec :: Int -> ReadS IndexField
Prelude.Read, Int -> IndexField -> ShowS
[IndexField] -> ShowS
IndexField -> String
(Int -> IndexField -> ShowS)
-> (IndexField -> String)
-> ([IndexField] -> ShowS)
-> Show IndexField
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [IndexField] -> ShowS
$cshowList :: [IndexField] -> ShowS
show :: IndexField -> String
$cshow :: IndexField -> String
showsPrec :: Int -> IndexField -> ShowS
$cshowsPrec :: Int -> IndexField -> ShowS
Prelude.Show, (forall x. IndexField -> Rep IndexField x)
-> (forall x. Rep IndexField x -> IndexField) -> Generic IndexField
forall x. Rep IndexField x -> IndexField
forall x. IndexField -> Rep IndexField x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep IndexField x -> IndexField
$cfrom :: forall x. IndexField -> Rep IndexField x
Prelude.Generic)

-- |
-- Create a value of 'IndexField' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'doubleArrayOptions', 'indexField_doubleArrayOptions' - Undocumented member.
--
-- 'dateOptions', 'indexField_dateOptions' - Undocumented member.
--
-- 'textArrayOptions', 'indexField_textArrayOptions' - Undocumented member.
--
-- 'doubleOptions', 'indexField_doubleOptions' - Undocumented member.
--
-- 'textOptions', 'indexField_textOptions' - Undocumented member.
--
-- 'latLonOptions', 'indexField_latLonOptions' - Undocumented member.
--
-- 'literalArrayOptions', 'indexField_literalArrayOptions' - Undocumented member.
--
-- 'intArrayOptions', 'indexField_intArrayOptions' - Undocumented member.
--
-- 'dateArrayOptions', 'indexField_dateArrayOptions' - Undocumented member.
--
-- 'intOptions', 'indexField_intOptions' - Undocumented member.
--
-- 'literalOptions', 'indexField_literalOptions' - Undocumented member.
--
-- 'indexFieldName', 'indexField_indexFieldName' - A string that represents the name of an index field. CloudSearch
-- supports regular index fields as well as dynamic fields. A dynamic
-- field\'s name defines a pattern that begins or ends with a wildcard. Any
-- document fields that don\'t map to a regular index field but do match a
-- dynamic field\'s pattern are configured with the dynamic field\'s
-- indexing options.
--
-- Regular field names begin with a letter and can contain the following
-- characters: a-z (lowercase), 0-9, and _ (underscore). Dynamic field
-- names must begin or end with a wildcard (*). The wildcard can also be
-- the only character in a dynamic field name. Multiple wildcards, and
-- wildcards embedded within a string are not supported.
--
-- The name @score@ is reserved and cannot be used as a field name. To
-- reference a document\'s ID, you can use the name @_id@.
--
-- 'indexFieldType', 'indexField_indexFieldType' - Undocumented member.
newIndexField ::
  -- | 'indexFieldName'
  Prelude.Text ->
  -- | 'indexFieldType'
  IndexFieldType ->
  IndexField
newIndexField :: Text -> IndexFieldType -> IndexField
newIndexField Text
pIndexFieldName_ IndexFieldType
pIndexFieldType_ =
  IndexField' :: Maybe DoubleArrayOptions
-> Maybe DateOptions
-> Maybe TextArrayOptions
-> Maybe DoubleOptions
-> Maybe TextOptions
-> Maybe LatLonOptions
-> Maybe LiteralArrayOptions
-> Maybe IntArrayOptions
-> Maybe DateArrayOptions
-> Maybe IntOptions
-> Maybe LiteralOptions
-> Text
-> IndexFieldType
-> IndexField
IndexField'
    { $sel:doubleArrayOptions:IndexField' :: Maybe DoubleArrayOptions
doubleArrayOptions = Maybe DoubleArrayOptions
forall a. Maybe a
Prelude.Nothing,
      $sel:dateOptions:IndexField' :: Maybe DateOptions
dateOptions = Maybe DateOptions
forall a. Maybe a
Prelude.Nothing,
      $sel:textArrayOptions:IndexField' :: Maybe TextArrayOptions
textArrayOptions = Maybe TextArrayOptions
forall a. Maybe a
Prelude.Nothing,
      $sel:doubleOptions:IndexField' :: Maybe DoubleOptions
doubleOptions = Maybe DoubleOptions
forall a. Maybe a
Prelude.Nothing,
      $sel:textOptions:IndexField' :: Maybe TextOptions
textOptions = Maybe TextOptions
forall a. Maybe a
Prelude.Nothing,
      $sel:latLonOptions:IndexField' :: Maybe LatLonOptions
latLonOptions = Maybe LatLonOptions
forall a. Maybe a
Prelude.Nothing,
      $sel:literalArrayOptions:IndexField' :: Maybe LiteralArrayOptions
literalArrayOptions = Maybe LiteralArrayOptions
forall a. Maybe a
Prelude.Nothing,
      $sel:intArrayOptions:IndexField' :: Maybe IntArrayOptions
intArrayOptions = Maybe IntArrayOptions
forall a. Maybe a
Prelude.Nothing,
      $sel:dateArrayOptions:IndexField' :: Maybe DateArrayOptions
dateArrayOptions = Maybe DateArrayOptions
forall a. Maybe a
Prelude.Nothing,
      $sel:intOptions:IndexField' :: Maybe IntOptions
intOptions = Maybe IntOptions
forall a. Maybe a
Prelude.Nothing,
      $sel:literalOptions:IndexField' :: Maybe LiteralOptions
literalOptions = Maybe LiteralOptions
forall a. Maybe a
Prelude.Nothing,
      $sel:indexFieldName:IndexField' :: Text
indexFieldName = Text
pIndexFieldName_,
      $sel:indexFieldType:IndexField' :: IndexFieldType
indexFieldType = IndexFieldType
pIndexFieldType_
    }

-- | Undocumented member.
indexField_doubleArrayOptions :: Lens.Lens' IndexField (Prelude.Maybe DoubleArrayOptions)
indexField_doubleArrayOptions :: (Maybe DoubleArrayOptions -> f (Maybe DoubleArrayOptions))
-> IndexField -> f IndexField
indexField_doubleArrayOptions = (IndexField -> Maybe DoubleArrayOptions)
-> (IndexField -> Maybe DoubleArrayOptions -> IndexField)
-> Lens
     IndexField
     IndexField
     (Maybe DoubleArrayOptions)
     (Maybe DoubleArrayOptions)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IndexField' {Maybe DoubleArrayOptions
doubleArrayOptions :: Maybe DoubleArrayOptions
$sel:doubleArrayOptions:IndexField' :: IndexField -> Maybe DoubleArrayOptions
doubleArrayOptions} -> Maybe DoubleArrayOptions
doubleArrayOptions) (\s :: IndexField
s@IndexField' {} Maybe DoubleArrayOptions
a -> IndexField
s {$sel:doubleArrayOptions:IndexField' :: Maybe DoubleArrayOptions
doubleArrayOptions = Maybe DoubleArrayOptions
a} :: IndexField)

-- | Undocumented member.
indexField_dateOptions :: Lens.Lens' IndexField (Prelude.Maybe DateOptions)
indexField_dateOptions :: (Maybe DateOptions -> f (Maybe DateOptions))
-> IndexField -> f IndexField
indexField_dateOptions = (IndexField -> Maybe DateOptions)
-> (IndexField -> Maybe DateOptions -> IndexField)
-> Lens
     IndexField IndexField (Maybe DateOptions) (Maybe DateOptions)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IndexField' {Maybe DateOptions
dateOptions :: Maybe DateOptions
$sel:dateOptions:IndexField' :: IndexField -> Maybe DateOptions
dateOptions} -> Maybe DateOptions
dateOptions) (\s :: IndexField
s@IndexField' {} Maybe DateOptions
a -> IndexField
s {$sel:dateOptions:IndexField' :: Maybe DateOptions
dateOptions = Maybe DateOptions
a} :: IndexField)

-- | Undocumented member.
indexField_textArrayOptions :: Lens.Lens' IndexField (Prelude.Maybe TextArrayOptions)
indexField_textArrayOptions :: (Maybe TextArrayOptions -> f (Maybe TextArrayOptions))
-> IndexField -> f IndexField
indexField_textArrayOptions = (IndexField -> Maybe TextArrayOptions)
-> (IndexField -> Maybe TextArrayOptions -> IndexField)
-> Lens
     IndexField
     IndexField
     (Maybe TextArrayOptions)
     (Maybe TextArrayOptions)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IndexField' {Maybe TextArrayOptions
textArrayOptions :: Maybe TextArrayOptions
$sel:textArrayOptions:IndexField' :: IndexField -> Maybe TextArrayOptions
textArrayOptions} -> Maybe TextArrayOptions
textArrayOptions) (\s :: IndexField
s@IndexField' {} Maybe TextArrayOptions
a -> IndexField
s {$sel:textArrayOptions:IndexField' :: Maybe TextArrayOptions
textArrayOptions = Maybe TextArrayOptions
a} :: IndexField)

-- | Undocumented member.
indexField_doubleOptions :: Lens.Lens' IndexField (Prelude.Maybe DoubleOptions)
indexField_doubleOptions :: (Maybe DoubleOptions -> f (Maybe DoubleOptions))
-> IndexField -> f IndexField
indexField_doubleOptions = (IndexField -> Maybe DoubleOptions)
-> (IndexField -> Maybe DoubleOptions -> IndexField)
-> Lens
     IndexField IndexField (Maybe DoubleOptions) (Maybe DoubleOptions)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IndexField' {Maybe DoubleOptions
doubleOptions :: Maybe DoubleOptions
$sel:doubleOptions:IndexField' :: IndexField -> Maybe DoubleOptions
doubleOptions} -> Maybe DoubleOptions
doubleOptions) (\s :: IndexField
s@IndexField' {} Maybe DoubleOptions
a -> IndexField
s {$sel:doubleOptions:IndexField' :: Maybe DoubleOptions
doubleOptions = Maybe DoubleOptions
a} :: IndexField)

-- | Undocumented member.
indexField_textOptions :: Lens.Lens' IndexField (Prelude.Maybe TextOptions)
indexField_textOptions :: (Maybe TextOptions -> f (Maybe TextOptions))
-> IndexField -> f IndexField
indexField_textOptions = (IndexField -> Maybe TextOptions)
-> (IndexField -> Maybe TextOptions -> IndexField)
-> Lens
     IndexField IndexField (Maybe TextOptions) (Maybe TextOptions)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IndexField' {Maybe TextOptions
textOptions :: Maybe TextOptions
$sel:textOptions:IndexField' :: IndexField -> Maybe TextOptions
textOptions} -> Maybe TextOptions
textOptions) (\s :: IndexField
s@IndexField' {} Maybe TextOptions
a -> IndexField
s {$sel:textOptions:IndexField' :: Maybe TextOptions
textOptions = Maybe TextOptions
a} :: IndexField)

-- | Undocumented member.
indexField_latLonOptions :: Lens.Lens' IndexField (Prelude.Maybe LatLonOptions)
indexField_latLonOptions :: (Maybe LatLonOptions -> f (Maybe LatLonOptions))
-> IndexField -> f IndexField
indexField_latLonOptions = (IndexField -> Maybe LatLonOptions)
-> (IndexField -> Maybe LatLonOptions -> IndexField)
-> Lens
     IndexField IndexField (Maybe LatLonOptions) (Maybe LatLonOptions)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IndexField' {Maybe LatLonOptions
latLonOptions :: Maybe LatLonOptions
$sel:latLonOptions:IndexField' :: IndexField -> Maybe LatLonOptions
latLonOptions} -> Maybe LatLonOptions
latLonOptions) (\s :: IndexField
s@IndexField' {} Maybe LatLonOptions
a -> IndexField
s {$sel:latLonOptions:IndexField' :: Maybe LatLonOptions
latLonOptions = Maybe LatLonOptions
a} :: IndexField)

-- | Undocumented member.
indexField_literalArrayOptions :: Lens.Lens' IndexField (Prelude.Maybe LiteralArrayOptions)
indexField_literalArrayOptions :: (Maybe LiteralArrayOptions -> f (Maybe LiteralArrayOptions))
-> IndexField -> f IndexField
indexField_literalArrayOptions = (IndexField -> Maybe LiteralArrayOptions)
-> (IndexField -> Maybe LiteralArrayOptions -> IndexField)
-> Lens
     IndexField
     IndexField
     (Maybe LiteralArrayOptions)
     (Maybe LiteralArrayOptions)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IndexField' {Maybe LiteralArrayOptions
literalArrayOptions :: Maybe LiteralArrayOptions
$sel:literalArrayOptions:IndexField' :: IndexField -> Maybe LiteralArrayOptions
literalArrayOptions} -> Maybe LiteralArrayOptions
literalArrayOptions) (\s :: IndexField
s@IndexField' {} Maybe LiteralArrayOptions
a -> IndexField
s {$sel:literalArrayOptions:IndexField' :: Maybe LiteralArrayOptions
literalArrayOptions = Maybe LiteralArrayOptions
a} :: IndexField)

-- | Undocumented member.
indexField_intArrayOptions :: Lens.Lens' IndexField (Prelude.Maybe IntArrayOptions)
indexField_intArrayOptions :: (Maybe IntArrayOptions -> f (Maybe IntArrayOptions))
-> IndexField -> f IndexField
indexField_intArrayOptions = (IndexField -> Maybe IntArrayOptions)
-> (IndexField -> Maybe IntArrayOptions -> IndexField)
-> Lens
     IndexField
     IndexField
     (Maybe IntArrayOptions)
     (Maybe IntArrayOptions)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IndexField' {Maybe IntArrayOptions
intArrayOptions :: Maybe IntArrayOptions
$sel:intArrayOptions:IndexField' :: IndexField -> Maybe IntArrayOptions
intArrayOptions} -> Maybe IntArrayOptions
intArrayOptions) (\s :: IndexField
s@IndexField' {} Maybe IntArrayOptions
a -> IndexField
s {$sel:intArrayOptions:IndexField' :: Maybe IntArrayOptions
intArrayOptions = Maybe IntArrayOptions
a} :: IndexField)

-- | Undocumented member.
indexField_dateArrayOptions :: Lens.Lens' IndexField (Prelude.Maybe DateArrayOptions)
indexField_dateArrayOptions :: (Maybe DateArrayOptions -> f (Maybe DateArrayOptions))
-> IndexField -> f IndexField
indexField_dateArrayOptions = (IndexField -> Maybe DateArrayOptions)
-> (IndexField -> Maybe DateArrayOptions -> IndexField)
-> Lens
     IndexField
     IndexField
     (Maybe DateArrayOptions)
     (Maybe DateArrayOptions)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IndexField' {Maybe DateArrayOptions
dateArrayOptions :: Maybe DateArrayOptions
$sel:dateArrayOptions:IndexField' :: IndexField -> Maybe DateArrayOptions
dateArrayOptions} -> Maybe DateArrayOptions
dateArrayOptions) (\s :: IndexField
s@IndexField' {} Maybe DateArrayOptions
a -> IndexField
s {$sel:dateArrayOptions:IndexField' :: Maybe DateArrayOptions
dateArrayOptions = Maybe DateArrayOptions
a} :: IndexField)

-- | Undocumented member.
indexField_intOptions :: Lens.Lens' IndexField (Prelude.Maybe IntOptions)
indexField_intOptions :: (Maybe IntOptions -> f (Maybe IntOptions))
-> IndexField -> f IndexField
indexField_intOptions = (IndexField -> Maybe IntOptions)
-> (IndexField -> Maybe IntOptions -> IndexField)
-> Lens IndexField IndexField (Maybe IntOptions) (Maybe IntOptions)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IndexField' {Maybe IntOptions
intOptions :: Maybe IntOptions
$sel:intOptions:IndexField' :: IndexField -> Maybe IntOptions
intOptions} -> Maybe IntOptions
intOptions) (\s :: IndexField
s@IndexField' {} Maybe IntOptions
a -> IndexField
s {$sel:intOptions:IndexField' :: Maybe IntOptions
intOptions = Maybe IntOptions
a} :: IndexField)

-- | Undocumented member.
indexField_literalOptions :: Lens.Lens' IndexField (Prelude.Maybe LiteralOptions)
indexField_literalOptions :: (Maybe LiteralOptions -> f (Maybe LiteralOptions))
-> IndexField -> f IndexField
indexField_literalOptions = (IndexField -> Maybe LiteralOptions)
-> (IndexField -> Maybe LiteralOptions -> IndexField)
-> Lens
     IndexField IndexField (Maybe LiteralOptions) (Maybe LiteralOptions)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IndexField' {Maybe LiteralOptions
literalOptions :: Maybe LiteralOptions
$sel:literalOptions:IndexField' :: IndexField -> Maybe LiteralOptions
literalOptions} -> Maybe LiteralOptions
literalOptions) (\s :: IndexField
s@IndexField' {} Maybe LiteralOptions
a -> IndexField
s {$sel:literalOptions:IndexField' :: Maybe LiteralOptions
literalOptions = Maybe LiteralOptions
a} :: IndexField)

-- | A string that represents the name of an index field. CloudSearch
-- supports regular index fields as well as dynamic fields. A dynamic
-- field\'s name defines a pattern that begins or ends with a wildcard. Any
-- document fields that don\'t map to a regular index field but do match a
-- dynamic field\'s pattern are configured with the dynamic field\'s
-- indexing options.
--
-- Regular field names begin with a letter and can contain the following
-- characters: a-z (lowercase), 0-9, and _ (underscore). Dynamic field
-- names must begin or end with a wildcard (*). The wildcard can also be
-- the only character in a dynamic field name. Multiple wildcards, and
-- wildcards embedded within a string are not supported.
--
-- The name @score@ is reserved and cannot be used as a field name. To
-- reference a document\'s ID, you can use the name @_id@.
indexField_indexFieldName :: Lens.Lens' IndexField Prelude.Text
indexField_indexFieldName :: (Text -> f Text) -> IndexField -> f IndexField
indexField_indexFieldName = (IndexField -> Text)
-> (IndexField -> Text -> IndexField)
-> Lens IndexField IndexField Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IndexField' {Text
indexFieldName :: Text
$sel:indexFieldName:IndexField' :: IndexField -> Text
indexFieldName} -> Text
indexFieldName) (\s :: IndexField
s@IndexField' {} Text
a -> IndexField
s {$sel:indexFieldName:IndexField' :: Text
indexFieldName = Text
a} :: IndexField)

-- | Undocumented member.
indexField_indexFieldType :: Lens.Lens' IndexField IndexFieldType
indexField_indexFieldType :: (IndexFieldType -> f IndexFieldType) -> IndexField -> f IndexField
indexField_indexFieldType = (IndexField -> IndexFieldType)
-> (IndexField -> IndexFieldType -> IndexField)
-> Lens IndexField IndexField IndexFieldType IndexFieldType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IndexField' {IndexFieldType
indexFieldType :: IndexFieldType
$sel:indexFieldType:IndexField' :: IndexField -> IndexFieldType
indexFieldType} -> IndexFieldType
indexFieldType) (\s :: IndexField
s@IndexField' {} IndexFieldType
a -> IndexField
s {$sel:indexFieldType:IndexField' :: IndexFieldType
indexFieldType = IndexFieldType
a} :: IndexField)

instance Core.FromXML IndexField where
  parseXML :: [Node] -> Either String IndexField
parseXML [Node]
x =
    Maybe DoubleArrayOptions
-> Maybe DateOptions
-> Maybe TextArrayOptions
-> Maybe DoubleOptions
-> Maybe TextOptions
-> Maybe LatLonOptions
-> Maybe LiteralArrayOptions
-> Maybe IntArrayOptions
-> Maybe DateArrayOptions
-> Maybe IntOptions
-> Maybe LiteralOptions
-> Text
-> IndexFieldType
-> IndexField
IndexField'
      (Maybe DoubleArrayOptions
 -> Maybe DateOptions
 -> Maybe TextArrayOptions
 -> Maybe DoubleOptions
 -> Maybe TextOptions
 -> Maybe LatLonOptions
 -> Maybe LiteralArrayOptions
 -> Maybe IntArrayOptions
 -> Maybe DateArrayOptions
 -> Maybe IntOptions
 -> Maybe LiteralOptions
 -> Text
 -> IndexFieldType
 -> IndexField)
-> Either String (Maybe DoubleArrayOptions)
-> Either
     String
     (Maybe DateOptions
      -> Maybe TextArrayOptions
      -> Maybe DoubleOptions
      -> Maybe TextOptions
      -> Maybe LatLonOptions
      -> Maybe LiteralArrayOptions
      -> Maybe IntArrayOptions
      -> Maybe DateArrayOptions
      -> Maybe IntOptions
      -> Maybe LiteralOptions
      -> Text
      -> IndexFieldType
      -> IndexField)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe DoubleArrayOptions)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"DoubleArrayOptions")
      Either
  String
  (Maybe DateOptions
   -> Maybe TextArrayOptions
   -> Maybe DoubleOptions
   -> Maybe TextOptions
   -> Maybe LatLonOptions
   -> Maybe LiteralArrayOptions
   -> Maybe IntArrayOptions
   -> Maybe DateArrayOptions
   -> Maybe IntOptions
   -> Maybe LiteralOptions
   -> Text
   -> IndexFieldType
   -> IndexField)
-> Either String (Maybe DateOptions)
-> Either
     String
     (Maybe TextArrayOptions
      -> Maybe DoubleOptions
      -> Maybe TextOptions
      -> Maybe LatLonOptions
      -> Maybe LiteralArrayOptions
      -> Maybe IntArrayOptions
      -> Maybe DateArrayOptions
      -> Maybe IntOptions
      -> Maybe LiteralOptions
      -> Text
      -> IndexFieldType
      -> IndexField)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe DateOptions)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"DateOptions")
      Either
  String
  (Maybe TextArrayOptions
   -> Maybe DoubleOptions
   -> Maybe TextOptions
   -> Maybe LatLonOptions
   -> Maybe LiteralArrayOptions
   -> Maybe IntArrayOptions
   -> Maybe DateArrayOptions
   -> Maybe IntOptions
   -> Maybe LiteralOptions
   -> Text
   -> IndexFieldType
   -> IndexField)
-> Either String (Maybe TextArrayOptions)
-> Either
     String
     (Maybe DoubleOptions
      -> Maybe TextOptions
      -> Maybe LatLonOptions
      -> Maybe LiteralArrayOptions
      -> Maybe IntArrayOptions
      -> Maybe DateArrayOptions
      -> Maybe IntOptions
      -> Maybe LiteralOptions
      -> Text
      -> IndexFieldType
      -> IndexField)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe TextArrayOptions)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"TextArrayOptions")
      Either
  String
  (Maybe DoubleOptions
   -> Maybe TextOptions
   -> Maybe LatLonOptions
   -> Maybe LiteralArrayOptions
   -> Maybe IntArrayOptions
   -> Maybe DateArrayOptions
   -> Maybe IntOptions
   -> Maybe LiteralOptions
   -> Text
   -> IndexFieldType
   -> IndexField)
-> Either String (Maybe DoubleOptions)
-> Either
     String
     (Maybe TextOptions
      -> Maybe LatLonOptions
      -> Maybe LiteralArrayOptions
      -> Maybe IntArrayOptions
      -> Maybe DateArrayOptions
      -> Maybe IntOptions
      -> Maybe LiteralOptions
      -> Text
      -> IndexFieldType
      -> IndexField)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe DoubleOptions)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"DoubleOptions")
      Either
  String
  (Maybe TextOptions
   -> Maybe LatLonOptions
   -> Maybe LiteralArrayOptions
   -> Maybe IntArrayOptions
   -> Maybe DateArrayOptions
   -> Maybe IntOptions
   -> Maybe LiteralOptions
   -> Text
   -> IndexFieldType
   -> IndexField)
-> Either String (Maybe TextOptions)
-> Either
     String
     (Maybe LatLonOptions
      -> Maybe LiteralArrayOptions
      -> Maybe IntArrayOptions
      -> Maybe DateArrayOptions
      -> Maybe IntOptions
      -> Maybe LiteralOptions
      -> Text
      -> IndexFieldType
      -> IndexField)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe TextOptions)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"TextOptions")
      Either
  String
  (Maybe LatLonOptions
   -> Maybe LiteralArrayOptions
   -> Maybe IntArrayOptions
   -> Maybe DateArrayOptions
   -> Maybe IntOptions
   -> Maybe LiteralOptions
   -> Text
   -> IndexFieldType
   -> IndexField)
-> Either String (Maybe LatLonOptions)
-> Either
     String
     (Maybe LiteralArrayOptions
      -> Maybe IntArrayOptions
      -> Maybe DateArrayOptions
      -> Maybe IntOptions
      -> Maybe LiteralOptions
      -> Text
      -> IndexFieldType
      -> IndexField)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe LatLonOptions)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"LatLonOptions")
      Either
  String
  (Maybe LiteralArrayOptions
   -> Maybe IntArrayOptions
   -> Maybe DateArrayOptions
   -> Maybe IntOptions
   -> Maybe LiteralOptions
   -> Text
   -> IndexFieldType
   -> IndexField)
-> Either String (Maybe LiteralArrayOptions)
-> Either
     String
     (Maybe IntArrayOptions
      -> Maybe DateArrayOptions
      -> Maybe IntOptions
      -> Maybe LiteralOptions
      -> Text
      -> IndexFieldType
      -> IndexField)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe LiteralArrayOptions)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"LiteralArrayOptions")
      Either
  String
  (Maybe IntArrayOptions
   -> Maybe DateArrayOptions
   -> Maybe IntOptions
   -> Maybe LiteralOptions
   -> Text
   -> IndexFieldType
   -> IndexField)
-> Either String (Maybe IntArrayOptions)
-> Either
     String
     (Maybe DateArrayOptions
      -> Maybe IntOptions
      -> Maybe LiteralOptions
      -> Text
      -> IndexFieldType
      -> IndexField)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe IntArrayOptions)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"IntArrayOptions")
      Either
  String
  (Maybe DateArrayOptions
   -> Maybe IntOptions
   -> Maybe LiteralOptions
   -> Text
   -> IndexFieldType
   -> IndexField)
-> Either String (Maybe DateArrayOptions)
-> Either
     String
     (Maybe IntOptions
      -> Maybe LiteralOptions -> Text -> IndexFieldType -> IndexField)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe DateArrayOptions)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"DateArrayOptions")
      Either
  String
  (Maybe IntOptions
   -> Maybe LiteralOptions -> Text -> IndexFieldType -> IndexField)
-> Either String (Maybe IntOptions)
-> Either
     String
     (Maybe LiteralOptions -> Text -> IndexFieldType -> IndexField)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe IntOptions)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"IntOptions")
      Either
  String
  (Maybe LiteralOptions -> Text -> IndexFieldType -> IndexField)
-> Either String (Maybe LiteralOptions)
-> Either String (Text -> IndexFieldType -> IndexField)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe LiteralOptions)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"LiteralOptions")
      Either String (Text -> IndexFieldType -> IndexField)
-> Either String Text
-> Either String (IndexFieldType -> IndexField)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String Text
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"IndexFieldName")
      Either String (IndexFieldType -> IndexField)
-> Either String IndexFieldType -> Either String IndexField
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String IndexFieldType
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"IndexFieldType")

instance Prelude.Hashable IndexField

instance Prelude.NFData IndexField

instance Core.ToQuery IndexField where
  toQuery :: IndexField -> QueryString
toQuery IndexField' {Maybe DateArrayOptions
Maybe DateOptions
Maybe DoubleArrayOptions
Maybe DoubleOptions
Maybe IntArrayOptions
Maybe IntOptions
Maybe LatLonOptions
Maybe LiteralArrayOptions
Maybe LiteralOptions
Maybe TextArrayOptions
Maybe TextOptions
Text
IndexFieldType
indexFieldType :: IndexFieldType
indexFieldName :: Text
literalOptions :: Maybe LiteralOptions
intOptions :: Maybe IntOptions
dateArrayOptions :: Maybe DateArrayOptions
intArrayOptions :: Maybe IntArrayOptions
literalArrayOptions :: Maybe LiteralArrayOptions
latLonOptions :: Maybe LatLonOptions
textOptions :: Maybe TextOptions
doubleOptions :: Maybe DoubleOptions
textArrayOptions :: Maybe TextArrayOptions
dateOptions :: Maybe DateOptions
doubleArrayOptions :: Maybe DoubleArrayOptions
$sel:indexFieldType:IndexField' :: IndexField -> IndexFieldType
$sel:indexFieldName:IndexField' :: IndexField -> Text
$sel:literalOptions:IndexField' :: IndexField -> Maybe LiteralOptions
$sel:intOptions:IndexField' :: IndexField -> Maybe IntOptions
$sel:dateArrayOptions:IndexField' :: IndexField -> Maybe DateArrayOptions
$sel:intArrayOptions:IndexField' :: IndexField -> Maybe IntArrayOptions
$sel:literalArrayOptions:IndexField' :: IndexField -> Maybe LiteralArrayOptions
$sel:latLonOptions:IndexField' :: IndexField -> Maybe LatLonOptions
$sel:textOptions:IndexField' :: IndexField -> Maybe TextOptions
$sel:doubleOptions:IndexField' :: IndexField -> Maybe DoubleOptions
$sel:textArrayOptions:IndexField' :: IndexField -> Maybe TextArrayOptions
$sel:dateOptions:IndexField' :: IndexField -> Maybe DateOptions
$sel:doubleArrayOptions:IndexField' :: IndexField -> Maybe DoubleArrayOptions
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"DoubleArrayOptions" ByteString -> Maybe DoubleArrayOptions -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe DoubleArrayOptions
doubleArrayOptions,
        ByteString
"DateOptions" ByteString -> Maybe DateOptions -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe DateOptions
dateOptions,
        ByteString
"TextArrayOptions" ByteString -> Maybe TextArrayOptions -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe TextArrayOptions
textArrayOptions,
        ByteString
"DoubleOptions" ByteString -> Maybe DoubleOptions -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe DoubleOptions
doubleOptions,
        ByteString
"TextOptions" ByteString -> Maybe TextOptions -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe TextOptions
textOptions,
        ByteString
"LatLonOptions" ByteString -> Maybe LatLonOptions -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe LatLonOptions
latLonOptions,
        ByteString
"LiteralArrayOptions" ByteString -> Maybe LiteralArrayOptions -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe LiteralArrayOptions
literalArrayOptions,
        ByteString
"IntArrayOptions" ByteString -> Maybe IntArrayOptions -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe IntArrayOptions
intArrayOptions,
        ByteString
"DateArrayOptions" ByteString -> Maybe DateArrayOptions -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe DateArrayOptions
dateArrayOptions,
        ByteString
"IntOptions" ByteString -> Maybe IntOptions -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe IntOptions
intOptions,
        ByteString
"LiteralOptions" ByteString -> Maybe LiteralOptions -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe LiteralOptions
literalOptions,
        ByteString
"IndexFieldName" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
indexFieldName,
        ByteString
"IndexFieldType" ByteString -> IndexFieldType -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: IndexFieldType
indexFieldType
      ]