{-# 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.RobOMaker.Types.LoggingConfig
-- 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.RobOMaker.Types.LoggingConfig 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

-- | The logging configuration.
--
-- /See:/ 'newLoggingConfig' smart constructor.
data LoggingConfig = LoggingConfig'
  { -- | A boolean indicating whether to record all ROS topics.
    --
    -- This API is no longer supported and will throw an error if used.
    LoggingConfig -> Maybe Bool
recordAllRosTopics :: Prelude.Maybe Prelude.Bool
  }
  deriving (LoggingConfig -> LoggingConfig -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LoggingConfig -> LoggingConfig -> Bool
$c/= :: LoggingConfig -> LoggingConfig -> Bool
== :: LoggingConfig -> LoggingConfig -> Bool
$c== :: LoggingConfig -> LoggingConfig -> Bool
Prelude.Eq, ReadPrec [LoggingConfig]
ReadPrec LoggingConfig
Int -> ReadS LoggingConfig
ReadS [LoggingConfig]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [LoggingConfig]
$creadListPrec :: ReadPrec [LoggingConfig]
readPrec :: ReadPrec LoggingConfig
$creadPrec :: ReadPrec LoggingConfig
readList :: ReadS [LoggingConfig]
$creadList :: ReadS [LoggingConfig]
readsPrec :: Int -> ReadS LoggingConfig
$creadsPrec :: Int -> ReadS LoggingConfig
Prelude.Read, Int -> LoggingConfig -> ShowS
[LoggingConfig] -> ShowS
LoggingConfig -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LoggingConfig] -> ShowS
$cshowList :: [LoggingConfig] -> ShowS
show :: LoggingConfig -> String
$cshow :: LoggingConfig -> String
showsPrec :: Int -> LoggingConfig -> ShowS
$cshowsPrec :: Int -> LoggingConfig -> ShowS
Prelude.Show, forall x. Rep LoggingConfig x -> LoggingConfig
forall x. LoggingConfig -> Rep LoggingConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep LoggingConfig x -> LoggingConfig
$cfrom :: forall x. LoggingConfig -> Rep LoggingConfig x
Prelude.Generic)

-- |
-- Create a value of 'LoggingConfig' 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:
--
-- 'recordAllRosTopics', 'loggingConfig_recordAllRosTopics' - A boolean indicating whether to record all ROS topics.
--
-- This API is no longer supported and will throw an error if used.
newLoggingConfig ::
  LoggingConfig
newLoggingConfig :: LoggingConfig
newLoggingConfig =
  LoggingConfig'
    { $sel:recordAllRosTopics:LoggingConfig' :: Maybe Bool
recordAllRosTopics =
        forall a. Maybe a
Prelude.Nothing
    }

-- | A boolean indicating whether to record all ROS topics.
--
-- This API is no longer supported and will throw an error if used.
loggingConfig_recordAllRosTopics :: Lens.Lens' LoggingConfig (Prelude.Maybe Prelude.Bool)
loggingConfig_recordAllRosTopics :: Lens' LoggingConfig (Maybe Bool)
loggingConfig_recordAllRosTopics = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LoggingConfig' {Maybe Bool
recordAllRosTopics :: Maybe Bool
$sel:recordAllRosTopics:LoggingConfig' :: LoggingConfig -> Maybe Bool
recordAllRosTopics} -> Maybe Bool
recordAllRosTopics) (\s :: LoggingConfig
s@LoggingConfig' {} Maybe Bool
a -> LoggingConfig
s {$sel:recordAllRosTopics:LoggingConfig' :: Maybe Bool
recordAllRosTopics = Maybe Bool
a} :: LoggingConfig)

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

instance Prelude.Hashable LoggingConfig where
  hashWithSalt :: Int -> LoggingConfig -> Int
hashWithSalt Int
_salt LoggingConfig' {Maybe Bool
recordAllRosTopics :: Maybe Bool
$sel:recordAllRosTopics:LoggingConfig' :: LoggingConfig -> Maybe Bool
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
recordAllRosTopics

instance Prelude.NFData LoggingConfig where
  rnf :: LoggingConfig -> ()
rnf LoggingConfig' {Maybe Bool
recordAllRosTopics :: Maybe Bool
$sel:recordAllRosTopics:LoggingConfig' :: LoggingConfig -> Maybe Bool
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
recordAllRosTopics

instance Data.ToJSON LoggingConfig where
  toJSON :: LoggingConfig -> Value
toJSON LoggingConfig' {Maybe Bool
recordAllRosTopics :: Maybe Bool
$sel:recordAllRosTopics:LoggingConfig' :: LoggingConfig -> Maybe Bool
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"recordAllRosTopics" 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 Bool
recordAllRosTopics
          ]
      )