{-# 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.EphemeralStorage where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data EphemeralStorage = EphemeralStorage'
{
EphemeralStorage -> Int
sizeInGiB :: Prelude.Int
}
deriving (EphemeralStorage -> EphemeralStorage -> Bool
(EphemeralStorage -> EphemeralStorage -> Bool)
-> (EphemeralStorage -> EphemeralStorage -> Bool)
-> Eq EphemeralStorage
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EphemeralStorage -> EphemeralStorage -> Bool
$c/= :: EphemeralStorage -> EphemeralStorage -> Bool
== :: EphemeralStorage -> EphemeralStorage -> Bool
$c== :: EphemeralStorage -> EphemeralStorage -> Bool
Prelude.Eq, ReadPrec [EphemeralStorage]
ReadPrec EphemeralStorage
Int -> ReadS EphemeralStorage
ReadS [EphemeralStorage]
(Int -> ReadS EphemeralStorage)
-> ReadS [EphemeralStorage]
-> ReadPrec EphemeralStorage
-> ReadPrec [EphemeralStorage]
-> Read EphemeralStorage
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EphemeralStorage]
$creadListPrec :: ReadPrec [EphemeralStorage]
readPrec :: ReadPrec EphemeralStorage
$creadPrec :: ReadPrec EphemeralStorage
readList :: ReadS [EphemeralStorage]
$creadList :: ReadS [EphemeralStorage]
readsPrec :: Int -> ReadS EphemeralStorage
$creadsPrec :: Int -> ReadS EphemeralStorage
Prelude.Read, Int -> EphemeralStorage -> ShowS
[EphemeralStorage] -> ShowS
EphemeralStorage -> String
(Int -> EphemeralStorage -> ShowS)
-> (EphemeralStorage -> String)
-> ([EphemeralStorage] -> ShowS)
-> Show EphemeralStorage
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EphemeralStorage] -> ShowS
$cshowList :: [EphemeralStorage] -> ShowS
show :: EphemeralStorage -> String
$cshow :: EphemeralStorage -> String
showsPrec :: Int -> EphemeralStorage -> ShowS
$cshowsPrec :: Int -> EphemeralStorage -> ShowS
Prelude.Show, (forall x. EphemeralStorage -> Rep EphemeralStorage x)
-> (forall x. Rep EphemeralStorage x -> EphemeralStorage)
-> Generic EphemeralStorage
forall x. Rep EphemeralStorage x -> EphemeralStorage
forall x. EphemeralStorage -> Rep EphemeralStorage x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep EphemeralStorage x -> EphemeralStorage
$cfrom :: forall x. EphemeralStorage -> Rep EphemeralStorage x
Prelude.Generic)
newEphemeralStorage ::
Prelude.Int ->
EphemeralStorage
newEphemeralStorage :: Int -> EphemeralStorage
newEphemeralStorage Int
pSizeInGiB_ =
EphemeralStorage' :: Int -> EphemeralStorage
EphemeralStorage' {$sel:sizeInGiB:EphemeralStorage' :: Int
sizeInGiB = Int
pSizeInGiB_}
ephemeralStorage_sizeInGiB :: Lens.Lens' EphemeralStorage Prelude.Int
ephemeralStorage_sizeInGiB :: (Int -> f Int) -> EphemeralStorage -> f EphemeralStorage
ephemeralStorage_sizeInGiB = (EphemeralStorage -> Int)
-> (EphemeralStorage -> Int -> EphemeralStorage)
-> Lens EphemeralStorage EphemeralStorage Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EphemeralStorage' {Int
sizeInGiB :: Int
$sel:sizeInGiB:EphemeralStorage' :: EphemeralStorage -> Int
sizeInGiB} -> Int
sizeInGiB) (\s :: EphemeralStorage
s@EphemeralStorage' {} Int
a -> EphemeralStorage
s {$sel:sizeInGiB:EphemeralStorage' :: Int
sizeInGiB = Int
a} :: EphemeralStorage)
instance Core.FromJSON EphemeralStorage where
parseJSON :: Value -> Parser EphemeralStorage
parseJSON =
String
-> (Object -> Parser EphemeralStorage)
-> Value
-> Parser EphemeralStorage
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"EphemeralStorage"
( \Object
x ->
Int -> EphemeralStorage
EphemeralStorage'
(Int -> EphemeralStorage) -> Parser Int -> Parser EphemeralStorage
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser Int
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"sizeInGiB")
)
instance Prelude.Hashable EphemeralStorage
instance Prelude.NFData EphemeralStorage
instance Core.ToJSON EphemeralStorage where
toJSON :: EphemeralStorage -> Value
toJSON EphemeralStorage' {Int
sizeInGiB :: Int
$sel:sizeInGiB:EphemeralStorage' :: EphemeralStorage -> Int
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"sizeInGiB" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Int
sizeInGiB)]
)