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