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