{-# 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.IoT.Types.ThingIndexingConfiguration
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.IoT.Types.ThingIndexingConfiguration where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.IoT.Types.DeviceDefenderIndexingMode
import Amazonka.IoT.Types.Field
import Amazonka.IoT.Types.IndexingFilter
import Amazonka.IoT.Types.NamedShadowIndexingMode
import Amazonka.IoT.Types.ThingConnectivityIndexingMode
import Amazonka.IoT.Types.ThingIndexingMode
import qualified Amazonka.Prelude as Prelude

-- | The thing indexing configuration. For more information, see
-- <https://docs.aws.amazon.com/iot/latest/developerguide/managing-index.html Managing Thing Indexing>.
--
-- /See:/ 'newThingIndexingConfiguration' smart constructor.
data ThingIndexingConfiguration = ThingIndexingConfiguration'
  { -- | Contains custom field names and their data type.
    ThingIndexingConfiguration -> Maybe [Field]
customFields :: Prelude.Maybe [Field],
    -- | Device Defender indexing mode. Valid values are:
    --
    -- -   VIOLATIONS – Your thing index contains Device Defender violations.
    --     To enable Device Defender indexing, /deviceDefenderIndexingMode/
    --     must not be set to OFF.
    --
    -- -   OFF - Device Defender indexing is disabled.
    --
    -- For more information about Device Defender violations, see
    -- <https://docs.aws.amazon.com/iot/latest/developerguide/device-defender-detect.html Device Defender Detect.>
    ThingIndexingConfiguration -> Maybe DeviceDefenderIndexingMode
deviceDefenderIndexingMode :: Prelude.Maybe DeviceDefenderIndexingMode,
    -- | Provides additional filters for specific data sources. Named shadow is
    -- the only data source that currently supports and requires a filter. To
    -- add named shadows to your fleet indexing configuration, set
    -- @namedShadowIndexingMode@ to be @ON@ and specify your shadow names in
    -- @filter@.
    ThingIndexingConfiguration -> Maybe IndexingFilter
filter' :: Prelude.Maybe IndexingFilter,
    -- | Contains fields that are indexed and whose types are already known by
    -- the Fleet Indexing service.
    ThingIndexingConfiguration -> Maybe [Field]
managedFields :: Prelude.Maybe [Field],
    -- | Named shadow indexing mode. Valid values are:
    --
    -- -   ON – Your thing index contains named shadow. To enable thing named
    --     shadow indexing, /namedShadowIndexingMode/ must not be set to OFF.
    --
    -- -   OFF - Named shadow indexing is disabled.
    --
    -- For more information about Shadows, see
    -- <https://docs.aws.amazon.com/iot/latest/developerguide/iot-device-shadows.html IoT Device Shadow service.>
    ThingIndexingConfiguration -> Maybe NamedShadowIndexingMode
namedShadowIndexingMode :: Prelude.Maybe NamedShadowIndexingMode,
    -- | Thing connectivity indexing mode. Valid values are:
    --
    -- -   STATUS – Your thing index contains connectivity status. To enable
    --     thing connectivity indexing, /thingIndexMode/ must not be set to
    --     OFF.
    --
    -- -   OFF - Thing connectivity status indexing is disabled.
    ThingIndexingConfiguration -> Maybe ThingConnectivityIndexingMode
thingConnectivityIndexingMode :: Prelude.Maybe ThingConnectivityIndexingMode,
    -- | Thing indexing mode. Valid values are:
    --
    -- -   REGISTRY – Your thing index contains registry data only.
    --
    -- -   REGISTRY_AND_SHADOW - Your thing index contains registry and shadow
    --     data.
    --
    -- -   OFF - Thing indexing is disabled.
    ThingIndexingConfiguration -> ThingIndexingMode
thingIndexingMode :: ThingIndexingMode
  }
  deriving (ThingIndexingConfiguration -> ThingIndexingConfiguration -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ThingIndexingConfiguration -> ThingIndexingConfiguration -> Bool
$c/= :: ThingIndexingConfiguration -> ThingIndexingConfiguration -> Bool
== :: ThingIndexingConfiguration -> ThingIndexingConfiguration -> Bool
$c== :: ThingIndexingConfiguration -> ThingIndexingConfiguration -> Bool
Prelude.Eq, ReadPrec [ThingIndexingConfiguration]
ReadPrec ThingIndexingConfiguration
Int -> ReadS ThingIndexingConfiguration
ReadS [ThingIndexingConfiguration]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ThingIndexingConfiguration]
$creadListPrec :: ReadPrec [ThingIndexingConfiguration]
readPrec :: ReadPrec ThingIndexingConfiguration
$creadPrec :: ReadPrec ThingIndexingConfiguration
readList :: ReadS [ThingIndexingConfiguration]
$creadList :: ReadS [ThingIndexingConfiguration]
readsPrec :: Int -> ReadS ThingIndexingConfiguration
$creadsPrec :: Int -> ReadS ThingIndexingConfiguration
Prelude.Read, Int -> ThingIndexingConfiguration -> ShowS
[ThingIndexingConfiguration] -> ShowS
ThingIndexingConfiguration -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ThingIndexingConfiguration] -> ShowS
$cshowList :: [ThingIndexingConfiguration] -> ShowS
show :: ThingIndexingConfiguration -> String
$cshow :: ThingIndexingConfiguration -> String
showsPrec :: Int -> ThingIndexingConfiguration -> ShowS
$cshowsPrec :: Int -> ThingIndexingConfiguration -> ShowS
Prelude.Show, forall x.
Rep ThingIndexingConfiguration x -> ThingIndexingConfiguration
forall x.
ThingIndexingConfiguration -> Rep ThingIndexingConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ThingIndexingConfiguration x -> ThingIndexingConfiguration
$cfrom :: forall x.
ThingIndexingConfiguration -> Rep ThingIndexingConfiguration x
Prelude.Generic)

-- |
-- Create a value of 'ThingIndexingConfiguration' 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:
--
-- 'customFields', 'thingIndexingConfiguration_customFields' - Contains custom field names and their data type.
--
-- 'deviceDefenderIndexingMode', 'thingIndexingConfiguration_deviceDefenderIndexingMode' - Device Defender indexing mode. Valid values are:
--
-- -   VIOLATIONS – Your thing index contains Device Defender violations.
--     To enable Device Defender indexing, /deviceDefenderIndexingMode/
--     must not be set to OFF.
--
-- -   OFF - Device Defender indexing is disabled.
--
-- For more information about Device Defender violations, see
-- <https://docs.aws.amazon.com/iot/latest/developerguide/device-defender-detect.html Device Defender Detect.>
--
-- 'filter'', 'thingIndexingConfiguration_filter' - Provides additional filters for specific data sources. Named shadow is
-- the only data source that currently supports and requires a filter. To
-- add named shadows to your fleet indexing configuration, set
-- @namedShadowIndexingMode@ to be @ON@ and specify your shadow names in
-- @filter@.
--
-- 'managedFields', 'thingIndexingConfiguration_managedFields' - Contains fields that are indexed and whose types are already known by
-- the Fleet Indexing service.
--
-- 'namedShadowIndexingMode', 'thingIndexingConfiguration_namedShadowIndexingMode' - Named shadow indexing mode. Valid values are:
--
-- -   ON – Your thing index contains named shadow. To enable thing named
--     shadow indexing, /namedShadowIndexingMode/ must not be set to OFF.
--
-- -   OFF - Named shadow indexing is disabled.
--
-- For more information about Shadows, see
-- <https://docs.aws.amazon.com/iot/latest/developerguide/iot-device-shadows.html IoT Device Shadow service.>
--
-- 'thingConnectivityIndexingMode', 'thingIndexingConfiguration_thingConnectivityIndexingMode' - Thing connectivity indexing mode. Valid values are:
--
-- -   STATUS – Your thing index contains connectivity status. To enable
--     thing connectivity indexing, /thingIndexMode/ must not be set to
--     OFF.
--
-- -   OFF - Thing connectivity status indexing is disabled.
--
-- 'thingIndexingMode', 'thingIndexingConfiguration_thingIndexingMode' - Thing indexing mode. Valid values are:
--
-- -   REGISTRY – Your thing index contains registry data only.
--
-- -   REGISTRY_AND_SHADOW - Your thing index contains registry and shadow
--     data.
--
-- -   OFF - Thing indexing is disabled.
newThingIndexingConfiguration ::
  -- | 'thingIndexingMode'
  ThingIndexingMode ->
  ThingIndexingConfiguration
newThingIndexingConfiguration :: ThingIndexingMode -> ThingIndexingConfiguration
newThingIndexingConfiguration ThingIndexingMode
pThingIndexingMode_ =
  ThingIndexingConfiguration'
    { $sel:customFields:ThingIndexingConfiguration' :: Maybe [Field]
customFields =
        forall a. Maybe a
Prelude.Nothing,
      $sel:deviceDefenderIndexingMode:ThingIndexingConfiguration' :: Maybe DeviceDefenderIndexingMode
deviceDefenderIndexingMode = forall a. Maybe a
Prelude.Nothing,
      $sel:filter':ThingIndexingConfiguration' :: Maybe IndexingFilter
filter' = forall a. Maybe a
Prelude.Nothing,
      $sel:managedFields:ThingIndexingConfiguration' :: Maybe [Field]
managedFields = forall a. Maybe a
Prelude.Nothing,
      $sel:namedShadowIndexingMode:ThingIndexingConfiguration' :: Maybe NamedShadowIndexingMode
namedShadowIndexingMode = forall a. Maybe a
Prelude.Nothing,
      $sel:thingConnectivityIndexingMode:ThingIndexingConfiguration' :: Maybe ThingConnectivityIndexingMode
thingConnectivityIndexingMode = forall a. Maybe a
Prelude.Nothing,
      $sel:thingIndexingMode:ThingIndexingConfiguration' :: ThingIndexingMode
thingIndexingMode = ThingIndexingMode
pThingIndexingMode_
    }

-- | Contains custom field names and their data type.
thingIndexingConfiguration_customFields :: Lens.Lens' ThingIndexingConfiguration (Prelude.Maybe [Field])
thingIndexingConfiguration_customFields :: Lens' ThingIndexingConfiguration (Maybe [Field])
thingIndexingConfiguration_customFields = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ThingIndexingConfiguration' {Maybe [Field]
customFields :: Maybe [Field]
$sel:customFields:ThingIndexingConfiguration' :: ThingIndexingConfiguration -> Maybe [Field]
customFields} -> Maybe [Field]
customFields) (\s :: ThingIndexingConfiguration
s@ThingIndexingConfiguration' {} Maybe [Field]
a -> ThingIndexingConfiguration
s {$sel:customFields:ThingIndexingConfiguration' :: Maybe [Field]
customFields = Maybe [Field]
a} :: ThingIndexingConfiguration) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Device Defender indexing mode. Valid values are:
--
-- -   VIOLATIONS – Your thing index contains Device Defender violations.
--     To enable Device Defender indexing, /deviceDefenderIndexingMode/
--     must not be set to OFF.
--
-- -   OFF - Device Defender indexing is disabled.
--
-- For more information about Device Defender violations, see
-- <https://docs.aws.amazon.com/iot/latest/developerguide/device-defender-detect.html Device Defender Detect.>
thingIndexingConfiguration_deviceDefenderIndexingMode :: Lens.Lens' ThingIndexingConfiguration (Prelude.Maybe DeviceDefenderIndexingMode)
thingIndexingConfiguration_deviceDefenderIndexingMode :: Lens' ThingIndexingConfiguration (Maybe DeviceDefenderIndexingMode)
thingIndexingConfiguration_deviceDefenderIndexingMode = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ThingIndexingConfiguration' {Maybe DeviceDefenderIndexingMode
deviceDefenderIndexingMode :: Maybe DeviceDefenderIndexingMode
$sel:deviceDefenderIndexingMode:ThingIndexingConfiguration' :: ThingIndexingConfiguration -> Maybe DeviceDefenderIndexingMode
deviceDefenderIndexingMode} -> Maybe DeviceDefenderIndexingMode
deviceDefenderIndexingMode) (\s :: ThingIndexingConfiguration
s@ThingIndexingConfiguration' {} Maybe DeviceDefenderIndexingMode
a -> ThingIndexingConfiguration
s {$sel:deviceDefenderIndexingMode:ThingIndexingConfiguration' :: Maybe DeviceDefenderIndexingMode
deviceDefenderIndexingMode = Maybe DeviceDefenderIndexingMode
a} :: ThingIndexingConfiguration)

-- | Provides additional filters for specific data sources. Named shadow is
-- the only data source that currently supports and requires a filter. To
-- add named shadows to your fleet indexing configuration, set
-- @namedShadowIndexingMode@ to be @ON@ and specify your shadow names in
-- @filter@.
thingIndexingConfiguration_filter :: Lens.Lens' ThingIndexingConfiguration (Prelude.Maybe IndexingFilter)
thingIndexingConfiguration_filter :: Lens' ThingIndexingConfiguration (Maybe IndexingFilter)
thingIndexingConfiguration_filter = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ThingIndexingConfiguration' {Maybe IndexingFilter
filter' :: Maybe IndexingFilter
$sel:filter':ThingIndexingConfiguration' :: ThingIndexingConfiguration -> Maybe IndexingFilter
filter'} -> Maybe IndexingFilter
filter') (\s :: ThingIndexingConfiguration
s@ThingIndexingConfiguration' {} Maybe IndexingFilter
a -> ThingIndexingConfiguration
s {$sel:filter':ThingIndexingConfiguration' :: Maybe IndexingFilter
filter' = Maybe IndexingFilter
a} :: ThingIndexingConfiguration)

-- | Contains fields that are indexed and whose types are already known by
-- the Fleet Indexing service.
thingIndexingConfiguration_managedFields :: Lens.Lens' ThingIndexingConfiguration (Prelude.Maybe [Field])
thingIndexingConfiguration_managedFields :: Lens' ThingIndexingConfiguration (Maybe [Field])
thingIndexingConfiguration_managedFields = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ThingIndexingConfiguration' {Maybe [Field]
managedFields :: Maybe [Field]
$sel:managedFields:ThingIndexingConfiguration' :: ThingIndexingConfiguration -> Maybe [Field]
managedFields} -> Maybe [Field]
managedFields) (\s :: ThingIndexingConfiguration
s@ThingIndexingConfiguration' {} Maybe [Field]
a -> ThingIndexingConfiguration
s {$sel:managedFields:ThingIndexingConfiguration' :: Maybe [Field]
managedFields = Maybe [Field]
a} :: ThingIndexingConfiguration) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Named shadow indexing mode. Valid values are:
--
-- -   ON – Your thing index contains named shadow. To enable thing named
--     shadow indexing, /namedShadowIndexingMode/ must not be set to OFF.
--
-- -   OFF - Named shadow indexing is disabled.
--
-- For more information about Shadows, see
-- <https://docs.aws.amazon.com/iot/latest/developerguide/iot-device-shadows.html IoT Device Shadow service.>
thingIndexingConfiguration_namedShadowIndexingMode :: Lens.Lens' ThingIndexingConfiguration (Prelude.Maybe NamedShadowIndexingMode)
thingIndexingConfiguration_namedShadowIndexingMode :: Lens' ThingIndexingConfiguration (Maybe NamedShadowIndexingMode)
thingIndexingConfiguration_namedShadowIndexingMode = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ThingIndexingConfiguration' {Maybe NamedShadowIndexingMode
namedShadowIndexingMode :: Maybe NamedShadowIndexingMode
$sel:namedShadowIndexingMode:ThingIndexingConfiguration' :: ThingIndexingConfiguration -> Maybe NamedShadowIndexingMode
namedShadowIndexingMode} -> Maybe NamedShadowIndexingMode
namedShadowIndexingMode) (\s :: ThingIndexingConfiguration
s@ThingIndexingConfiguration' {} Maybe NamedShadowIndexingMode
a -> ThingIndexingConfiguration
s {$sel:namedShadowIndexingMode:ThingIndexingConfiguration' :: Maybe NamedShadowIndexingMode
namedShadowIndexingMode = Maybe NamedShadowIndexingMode
a} :: ThingIndexingConfiguration)

-- | Thing connectivity indexing mode. Valid values are:
--
-- -   STATUS – Your thing index contains connectivity status. To enable
--     thing connectivity indexing, /thingIndexMode/ must not be set to
--     OFF.
--
-- -   OFF - Thing connectivity status indexing is disabled.
thingIndexingConfiguration_thingConnectivityIndexingMode :: Lens.Lens' ThingIndexingConfiguration (Prelude.Maybe ThingConnectivityIndexingMode)
thingIndexingConfiguration_thingConnectivityIndexingMode :: Lens'
  ThingIndexingConfiguration (Maybe ThingConnectivityIndexingMode)
thingIndexingConfiguration_thingConnectivityIndexingMode = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ThingIndexingConfiguration' {Maybe ThingConnectivityIndexingMode
thingConnectivityIndexingMode :: Maybe ThingConnectivityIndexingMode
$sel:thingConnectivityIndexingMode:ThingIndexingConfiguration' :: ThingIndexingConfiguration -> Maybe ThingConnectivityIndexingMode
thingConnectivityIndexingMode} -> Maybe ThingConnectivityIndexingMode
thingConnectivityIndexingMode) (\s :: ThingIndexingConfiguration
s@ThingIndexingConfiguration' {} Maybe ThingConnectivityIndexingMode
a -> ThingIndexingConfiguration
s {$sel:thingConnectivityIndexingMode:ThingIndexingConfiguration' :: Maybe ThingConnectivityIndexingMode
thingConnectivityIndexingMode = Maybe ThingConnectivityIndexingMode
a} :: ThingIndexingConfiguration)

-- | Thing indexing mode. Valid values are:
--
-- -   REGISTRY – Your thing index contains registry data only.
--
-- -   REGISTRY_AND_SHADOW - Your thing index contains registry and shadow
--     data.
--
-- -   OFF - Thing indexing is disabled.
thingIndexingConfiguration_thingIndexingMode :: Lens.Lens' ThingIndexingConfiguration ThingIndexingMode
thingIndexingConfiguration_thingIndexingMode :: Lens' ThingIndexingConfiguration ThingIndexingMode
thingIndexingConfiguration_thingIndexingMode = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ThingIndexingConfiguration' {ThingIndexingMode
thingIndexingMode :: ThingIndexingMode
$sel:thingIndexingMode:ThingIndexingConfiguration' :: ThingIndexingConfiguration -> ThingIndexingMode
thingIndexingMode} -> ThingIndexingMode
thingIndexingMode) (\s :: ThingIndexingConfiguration
s@ThingIndexingConfiguration' {} ThingIndexingMode
a -> ThingIndexingConfiguration
s {$sel:thingIndexingMode:ThingIndexingConfiguration' :: ThingIndexingMode
thingIndexingMode = ThingIndexingMode
a} :: ThingIndexingConfiguration)

instance Data.FromJSON ThingIndexingConfiguration where
  parseJSON :: Value -> Parser ThingIndexingConfiguration
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ThingIndexingConfiguration"
      ( \Object
x ->
          Maybe [Field]
-> Maybe DeviceDefenderIndexingMode
-> Maybe IndexingFilter
-> Maybe [Field]
-> Maybe NamedShadowIndexingMode
-> Maybe ThingConnectivityIndexingMode
-> ThingIndexingMode
-> ThingIndexingConfiguration
ThingIndexingConfiguration'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"customFields" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"deviceDefenderIndexingMode")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"filter")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"managedFields" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"namedShadowIndexingMode")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"thingConnectivityIndexingMode")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"thingIndexingMode")
      )

instance Prelude.Hashable ThingIndexingConfiguration where
  hashWithSalt :: Int -> ThingIndexingConfiguration -> Int
hashWithSalt Int
_salt ThingIndexingConfiguration' {Maybe [Field]
Maybe DeviceDefenderIndexingMode
Maybe IndexingFilter
Maybe NamedShadowIndexingMode
Maybe ThingConnectivityIndexingMode
ThingIndexingMode
thingIndexingMode :: ThingIndexingMode
thingConnectivityIndexingMode :: Maybe ThingConnectivityIndexingMode
namedShadowIndexingMode :: Maybe NamedShadowIndexingMode
managedFields :: Maybe [Field]
filter' :: Maybe IndexingFilter
deviceDefenderIndexingMode :: Maybe DeviceDefenderIndexingMode
customFields :: Maybe [Field]
$sel:thingIndexingMode:ThingIndexingConfiguration' :: ThingIndexingConfiguration -> ThingIndexingMode
$sel:thingConnectivityIndexingMode:ThingIndexingConfiguration' :: ThingIndexingConfiguration -> Maybe ThingConnectivityIndexingMode
$sel:namedShadowIndexingMode:ThingIndexingConfiguration' :: ThingIndexingConfiguration -> Maybe NamedShadowIndexingMode
$sel:managedFields:ThingIndexingConfiguration' :: ThingIndexingConfiguration -> Maybe [Field]
$sel:filter':ThingIndexingConfiguration' :: ThingIndexingConfiguration -> Maybe IndexingFilter
$sel:deviceDefenderIndexingMode:ThingIndexingConfiguration' :: ThingIndexingConfiguration -> Maybe DeviceDefenderIndexingMode
$sel:customFields:ThingIndexingConfiguration' :: ThingIndexingConfiguration -> Maybe [Field]
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Field]
customFields
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe DeviceDefenderIndexingMode
deviceDefenderIndexingMode
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe IndexingFilter
filter'
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Field]
managedFields
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe NamedShadowIndexingMode
namedShadowIndexingMode
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ThingConnectivityIndexingMode
thingConnectivityIndexingMode
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ThingIndexingMode
thingIndexingMode

instance Prelude.NFData ThingIndexingConfiguration where
  rnf :: ThingIndexingConfiguration -> ()
rnf ThingIndexingConfiguration' {Maybe [Field]
Maybe DeviceDefenderIndexingMode
Maybe IndexingFilter
Maybe NamedShadowIndexingMode
Maybe ThingConnectivityIndexingMode
ThingIndexingMode
thingIndexingMode :: ThingIndexingMode
thingConnectivityIndexingMode :: Maybe ThingConnectivityIndexingMode
namedShadowIndexingMode :: Maybe NamedShadowIndexingMode
managedFields :: Maybe [Field]
filter' :: Maybe IndexingFilter
deviceDefenderIndexingMode :: Maybe DeviceDefenderIndexingMode
customFields :: Maybe [Field]
$sel:thingIndexingMode:ThingIndexingConfiguration' :: ThingIndexingConfiguration -> ThingIndexingMode
$sel:thingConnectivityIndexingMode:ThingIndexingConfiguration' :: ThingIndexingConfiguration -> Maybe ThingConnectivityIndexingMode
$sel:namedShadowIndexingMode:ThingIndexingConfiguration' :: ThingIndexingConfiguration -> Maybe NamedShadowIndexingMode
$sel:managedFields:ThingIndexingConfiguration' :: ThingIndexingConfiguration -> Maybe [Field]
$sel:filter':ThingIndexingConfiguration' :: ThingIndexingConfiguration -> Maybe IndexingFilter
$sel:deviceDefenderIndexingMode:ThingIndexingConfiguration' :: ThingIndexingConfiguration -> Maybe DeviceDefenderIndexingMode
$sel:customFields:ThingIndexingConfiguration' :: ThingIndexingConfiguration -> Maybe [Field]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [Field]
customFields
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe DeviceDefenderIndexingMode
deviceDefenderIndexingMode
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe IndexingFilter
filter'
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Field]
managedFields
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe NamedShadowIndexingMode
namedShadowIndexingMode
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ThingConnectivityIndexingMode
thingConnectivityIndexingMode
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf ThingIndexingMode
thingIndexingMode

instance Data.ToJSON ThingIndexingConfiguration where
  toJSON :: ThingIndexingConfiguration -> Value
toJSON ThingIndexingConfiguration' {Maybe [Field]
Maybe DeviceDefenderIndexingMode
Maybe IndexingFilter
Maybe NamedShadowIndexingMode
Maybe ThingConnectivityIndexingMode
ThingIndexingMode
thingIndexingMode :: ThingIndexingMode
thingConnectivityIndexingMode :: Maybe ThingConnectivityIndexingMode
namedShadowIndexingMode :: Maybe NamedShadowIndexingMode
managedFields :: Maybe [Field]
filter' :: Maybe IndexingFilter
deviceDefenderIndexingMode :: Maybe DeviceDefenderIndexingMode
customFields :: Maybe [Field]
$sel:thingIndexingMode:ThingIndexingConfiguration' :: ThingIndexingConfiguration -> ThingIndexingMode
$sel:thingConnectivityIndexingMode:ThingIndexingConfiguration' :: ThingIndexingConfiguration -> Maybe ThingConnectivityIndexingMode
$sel:namedShadowIndexingMode:ThingIndexingConfiguration' :: ThingIndexingConfiguration -> Maybe NamedShadowIndexingMode
$sel:managedFields:ThingIndexingConfiguration' :: ThingIndexingConfiguration -> Maybe [Field]
$sel:filter':ThingIndexingConfiguration' :: ThingIndexingConfiguration -> Maybe IndexingFilter
$sel:deviceDefenderIndexingMode:ThingIndexingConfiguration' :: ThingIndexingConfiguration -> Maybe DeviceDefenderIndexingMode
$sel:customFields:ThingIndexingConfiguration' :: ThingIndexingConfiguration -> Maybe [Field]
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"customFields" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Field]
customFields,
            (Key
"deviceDefenderIndexingMode" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe DeviceDefenderIndexingMode
deviceDefenderIndexingMode,
            (Key
"filter" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe IndexingFilter
filter',
            (Key
"managedFields" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Field]
managedFields,
            (Key
"namedShadowIndexingMode" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe NamedShadowIndexingMode
namedShadowIndexingMode,
            (Key
"thingConnectivityIndexingMode" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ThingConnectivityIndexingMode
thingConnectivityIndexingMode,
            forall a. a -> Maybe a
Prelude.Just
              (Key
"thingIndexingMode" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= ThingIndexingMode
thingIndexingMode)
          ]
      )