{-# 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.IoTEvents.Types.AnalysisResultLocation
-- 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.IoTEvents.Types.AnalysisResultLocation where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude

-- | Contains information that you can use to locate the field in your
-- detector model that the analysis result references.
--
-- /See:/ 'newAnalysisResultLocation' smart constructor.
data AnalysisResultLocation = AnalysisResultLocation'
  { -- | A <https://github.com/json-path/JsonPath JsonPath> expression that
    -- identifies the error field in your detector model.
    AnalysisResultLocation -> Maybe Text
path :: Prelude.Maybe Prelude.Text
  }
  deriving (AnalysisResultLocation -> AnalysisResultLocation -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AnalysisResultLocation -> AnalysisResultLocation -> Bool
$c/= :: AnalysisResultLocation -> AnalysisResultLocation -> Bool
== :: AnalysisResultLocation -> AnalysisResultLocation -> Bool
$c== :: AnalysisResultLocation -> AnalysisResultLocation -> Bool
Prelude.Eq, ReadPrec [AnalysisResultLocation]
ReadPrec AnalysisResultLocation
Int -> ReadS AnalysisResultLocation
ReadS [AnalysisResultLocation]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AnalysisResultLocation]
$creadListPrec :: ReadPrec [AnalysisResultLocation]
readPrec :: ReadPrec AnalysisResultLocation
$creadPrec :: ReadPrec AnalysisResultLocation
readList :: ReadS [AnalysisResultLocation]
$creadList :: ReadS [AnalysisResultLocation]
readsPrec :: Int -> ReadS AnalysisResultLocation
$creadsPrec :: Int -> ReadS AnalysisResultLocation
Prelude.Read, Int -> AnalysisResultLocation -> ShowS
[AnalysisResultLocation] -> ShowS
AnalysisResultLocation -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AnalysisResultLocation] -> ShowS
$cshowList :: [AnalysisResultLocation] -> ShowS
show :: AnalysisResultLocation -> String
$cshow :: AnalysisResultLocation -> String
showsPrec :: Int -> AnalysisResultLocation -> ShowS
$cshowsPrec :: Int -> AnalysisResultLocation -> ShowS
Prelude.Show, forall x. Rep AnalysisResultLocation x -> AnalysisResultLocation
forall x. AnalysisResultLocation -> Rep AnalysisResultLocation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AnalysisResultLocation x -> AnalysisResultLocation
$cfrom :: forall x. AnalysisResultLocation -> Rep AnalysisResultLocation x
Prelude.Generic)

-- |
-- Create a value of 'AnalysisResultLocation' 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:
--
-- 'path', 'analysisResultLocation_path' - A <https://github.com/json-path/JsonPath JsonPath> expression that
-- identifies the error field in your detector model.
newAnalysisResultLocation ::
  AnalysisResultLocation
newAnalysisResultLocation :: AnalysisResultLocation
newAnalysisResultLocation =
  AnalysisResultLocation' {$sel:path:AnalysisResultLocation' :: Maybe Text
path = forall a. Maybe a
Prelude.Nothing}

-- | A <https://github.com/json-path/JsonPath JsonPath> expression that
-- identifies the error field in your detector model.
analysisResultLocation_path :: Lens.Lens' AnalysisResultLocation (Prelude.Maybe Prelude.Text)
analysisResultLocation_path :: Lens' AnalysisResultLocation (Maybe Text)
analysisResultLocation_path = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AnalysisResultLocation' {Maybe Text
path :: Maybe Text
$sel:path:AnalysisResultLocation' :: AnalysisResultLocation -> Maybe Text
path} -> Maybe Text
path) (\s :: AnalysisResultLocation
s@AnalysisResultLocation' {} Maybe Text
a -> AnalysisResultLocation
s {$sel:path:AnalysisResultLocation' :: Maybe Text
path = Maybe Text
a} :: AnalysisResultLocation)

instance Data.FromJSON AnalysisResultLocation where
  parseJSON :: Value -> Parser AnalysisResultLocation
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"AnalysisResultLocation"
      ( \Object
x ->
          Maybe Text -> AnalysisResultLocation
AnalysisResultLocation'
            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
"path")
      )

instance Prelude.Hashable AnalysisResultLocation where
  hashWithSalt :: Int -> AnalysisResultLocation -> Int
hashWithSalt Int
_salt AnalysisResultLocation' {Maybe Text
path :: Maybe Text
$sel:path:AnalysisResultLocation' :: AnalysisResultLocation -> Maybe Text
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
path

instance Prelude.NFData AnalysisResultLocation where
  rnf :: AnalysisResultLocation -> ()
rnf AnalysisResultLocation' {Maybe Text
path :: Maybe Text
$sel:path:AnalysisResultLocation' :: AnalysisResultLocation -> Maybe Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
path