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