{-# 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.Lambda.Types.TracingConfigResponse
-- 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.Lambda.Types.TracingConfigResponse where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Lambda.Types.TracingMode
import qualified Amazonka.Prelude as Prelude

-- | The function\'s X-Ray tracing configuration.
--
-- /See:/ 'newTracingConfigResponse' smart constructor.
data TracingConfigResponse = TracingConfigResponse'
  { -- | The tracing mode.
    TracingConfigResponse -> Maybe TracingMode
mode :: Prelude.Maybe TracingMode
  }
  deriving (TracingConfigResponse -> TracingConfigResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TracingConfigResponse -> TracingConfigResponse -> Bool
$c/= :: TracingConfigResponse -> TracingConfigResponse -> Bool
== :: TracingConfigResponse -> TracingConfigResponse -> Bool
$c== :: TracingConfigResponse -> TracingConfigResponse -> Bool
Prelude.Eq, ReadPrec [TracingConfigResponse]
ReadPrec TracingConfigResponse
Int -> ReadS TracingConfigResponse
ReadS [TracingConfigResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TracingConfigResponse]
$creadListPrec :: ReadPrec [TracingConfigResponse]
readPrec :: ReadPrec TracingConfigResponse
$creadPrec :: ReadPrec TracingConfigResponse
readList :: ReadS [TracingConfigResponse]
$creadList :: ReadS [TracingConfigResponse]
readsPrec :: Int -> ReadS TracingConfigResponse
$creadsPrec :: Int -> ReadS TracingConfigResponse
Prelude.Read, Int -> TracingConfigResponse -> ShowS
[TracingConfigResponse] -> ShowS
TracingConfigResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TracingConfigResponse] -> ShowS
$cshowList :: [TracingConfigResponse] -> ShowS
show :: TracingConfigResponse -> String
$cshow :: TracingConfigResponse -> String
showsPrec :: Int -> TracingConfigResponse -> ShowS
$cshowsPrec :: Int -> TracingConfigResponse -> ShowS
Prelude.Show, forall x. Rep TracingConfigResponse x -> TracingConfigResponse
forall x. TracingConfigResponse -> Rep TracingConfigResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TracingConfigResponse x -> TracingConfigResponse
$cfrom :: forall x. TracingConfigResponse -> Rep TracingConfigResponse x
Prelude.Generic)

-- |
-- Create a value of 'TracingConfigResponse' 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:
--
-- 'mode', 'tracingConfigResponse_mode' - The tracing mode.
newTracingConfigResponse ::
  TracingConfigResponse
newTracingConfigResponse :: TracingConfigResponse
newTracingConfigResponse =
  TracingConfigResponse' {$sel:mode:TracingConfigResponse' :: Maybe TracingMode
mode = forall a. Maybe a
Prelude.Nothing}

-- | The tracing mode.
tracingConfigResponse_mode :: Lens.Lens' TracingConfigResponse (Prelude.Maybe TracingMode)
tracingConfigResponse_mode :: Lens' TracingConfigResponse (Maybe TracingMode)
tracingConfigResponse_mode = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TracingConfigResponse' {Maybe TracingMode
mode :: Maybe TracingMode
$sel:mode:TracingConfigResponse' :: TracingConfigResponse -> Maybe TracingMode
mode} -> Maybe TracingMode
mode) (\s :: TracingConfigResponse
s@TracingConfigResponse' {} Maybe TracingMode
a -> TracingConfigResponse
s {$sel:mode:TracingConfigResponse' :: Maybe TracingMode
mode = Maybe TracingMode
a} :: TracingConfigResponse)

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

instance Prelude.Hashable TracingConfigResponse where
  hashWithSalt :: Int -> TracingConfigResponse -> Int
hashWithSalt Int
_salt TracingConfigResponse' {Maybe TracingMode
mode :: Maybe TracingMode
$sel:mode:TracingConfigResponse' :: TracingConfigResponse -> Maybe TracingMode
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe TracingMode
mode

instance Prelude.NFData TracingConfigResponse where
  rnf :: TracingConfigResponse -> ()
rnf TracingConfigResponse' {Maybe TracingMode
mode :: Maybe TracingMode
$sel:mode:TracingConfigResponse' :: TracingConfigResponse -> Maybe TracingMode
..} = forall a. NFData a => a -> ()
Prelude.rnf Maybe TracingMode
mode