{-# 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 #-}
module Amazonka.AppRunner.Types.TraceConfiguration where
import Amazonka.AppRunner.Types.TracingVendor
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
data TraceConfiguration = TraceConfiguration'
{
TraceConfiguration -> TracingVendor
vendor :: TracingVendor
}
deriving (TraceConfiguration -> TraceConfiguration -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TraceConfiguration -> TraceConfiguration -> Bool
$c/= :: TraceConfiguration -> TraceConfiguration -> Bool
== :: TraceConfiguration -> TraceConfiguration -> Bool
$c== :: TraceConfiguration -> TraceConfiguration -> Bool
Prelude.Eq, ReadPrec [TraceConfiguration]
ReadPrec TraceConfiguration
Int -> ReadS TraceConfiguration
ReadS [TraceConfiguration]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TraceConfiguration]
$creadListPrec :: ReadPrec [TraceConfiguration]
readPrec :: ReadPrec TraceConfiguration
$creadPrec :: ReadPrec TraceConfiguration
readList :: ReadS [TraceConfiguration]
$creadList :: ReadS [TraceConfiguration]
readsPrec :: Int -> ReadS TraceConfiguration
$creadsPrec :: Int -> ReadS TraceConfiguration
Prelude.Read, Int -> TraceConfiguration -> ShowS
[TraceConfiguration] -> ShowS
TraceConfiguration -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TraceConfiguration] -> ShowS
$cshowList :: [TraceConfiguration] -> ShowS
show :: TraceConfiguration -> String
$cshow :: TraceConfiguration -> String
showsPrec :: Int -> TraceConfiguration -> ShowS
$cshowsPrec :: Int -> TraceConfiguration -> ShowS
Prelude.Show, forall x. Rep TraceConfiguration x -> TraceConfiguration
forall x. TraceConfiguration -> Rep TraceConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TraceConfiguration x -> TraceConfiguration
$cfrom :: forall x. TraceConfiguration -> Rep TraceConfiguration x
Prelude.Generic)
newTraceConfiguration ::
TracingVendor ->
TraceConfiguration
newTraceConfiguration :: TracingVendor -> TraceConfiguration
newTraceConfiguration TracingVendor
pVendor_ =
TraceConfiguration' {$sel:vendor:TraceConfiguration' :: TracingVendor
vendor = TracingVendor
pVendor_}
traceConfiguration_vendor :: Lens.Lens' TraceConfiguration TracingVendor
traceConfiguration_vendor :: Lens' TraceConfiguration TracingVendor
traceConfiguration_vendor = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TraceConfiguration' {TracingVendor
vendor :: TracingVendor
$sel:vendor:TraceConfiguration' :: TraceConfiguration -> TracingVendor
vendor} -> TracingVendor
vendor) (\s :: TraceConfiguration
s@TraceConfiguration' {} TracingVendor
a -> TraceConfiguration
s {$sel:vendor:TraceConfiguration' :: TracingVendor
vendor = TracingVendor
a} :: TraceConfiguration)
instance Data.FromJSON TraceConfiguration where
parseJSON :: Value -> Parser TraceConfiguration
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"TraceConfiguration"
( \Object
x ->
TracingVendor -> TraceConfiguration
TraceConfiguration' forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"Vendor")
)
instance Prelude.Hashable TraceConfiguration where
hashWithSalt :: Int -> TraceConfiguration -> Int
hashWithSalt Int
_salt TraceConfiguration' {TracingVendor
vendor :: TracingVendor
$sel:vendor:TraceConfiguration' :: TraceConfiguration -> TracingVendor
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` TracingVendor
vendor
instance Prelude.NFData TraceConfiguration where
rnf :: TraceConfiguration -> ()
rnf TraceConfiguration' {TracingVendor
vendor :: TracingVendor
$sel:vendor:TraceConfiguration' :: TraceConfiguration -> TracingVendor
..} = forall a. NFData a => a -> ()
Prelude.rnf TracingVendor
vendor
instance Data.ToJSON TraceConfiguration where
toJSON :: TraceConfiguration -> Value
toJSON TraceConfiguration' {TracingVendor
vendor :: TracingVendor
$sel:vendor:TraceConfiguration' :: TraceConfiguration -> TracingVendor
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[forall a. a -> Maybe a
Prelude.Just (Key
"Vendor" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= TracingVendor
vendor)]
)