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

import qualified Amazonka.Core as Core
import Amazonka.Lambda.Types.TracingMode
import qualified Amazonka.Lens as Lens
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
(TracingConfigResponse -> TracingConfigResponse -> Bool)
-> (TracingConfigResponse -> TracingConfigResponse -> Bool)
-> Eq TracingConfigResponse
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]
(Int -> ReadS TracingConfigResponse)
-> ReadS [TracingConfigResponse]
-> ReadPrec TracingConfigResponse
-> ReadPrec [TracingConfigResponse]
-> Read 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
(Int -> TracingConfigResponse -> ShowS)
-> (TracingConfigResponse -> String)
-> ([TracingConfigResponse] -> ShowS)
-> Show TracingConfigResponse
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. TracingConfigResponse -> Rep TracingConfigResponse x)
-> (forall x. Rep TracingConfigResponse x -> TracingConfigResponse)
-> Generic TracingConfigResponse
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' :: Maybe TracingMode -> TracingConfigResponse
TracingConfigResponse' {$sel:mode:TracingConfigResponse' :: Maybe TracingMode
mode = Maybe TracingMode
forall a. Maybe a
Prelude.Nothing}

-- | The tracing mode.
tracingConfigResponse_mode :: Lens.Lens' TracingConfigResponse (Prelude.Maybe TracingMode)
tracingConfigResponse_mode :: (Maybe TracingMode -> f (Maybe TracingMode))
-> TracingConfigResponse -> f TracingConfigResponse
tracingConfigResponse_mode = (TracingConfigResponse -> Maybe TracingMode)
-> (TracingConfigResponse
    -> Maybe TracingMode -> TracingConfigResponse)
-> Lens
     TracingConfigResponse
     TracingConfigResponse
     (Maybe TracingMode)
     (Maybe TracingMode)
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 Core.FromJSON TracingConfigResponse where
  parseJSON :: Value -> Parser TracingConfigResponse
parseJSON =
    String
-> (Object -> Parser TracingConfigResponse)
-> Value
-> Parser TracingConfigResponse
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"TracingConfigResponse"
      ( \Object
x ->
          Maybe TracingMode -> TracingConfigResponse
TracingConfigResponse'
            (Maybe TracingMode -> TracingConfigResponse)
-> Parser (Maybe TracingMode) -> Parser TracingConfigResponse
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe TracingMode)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Mode")
      )

instance Prelude.Hashable TracingConfigResponse

instance Prelude.NFData TracingConfigResponse