{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.Pipes.Types.EcsEphemeralStorage
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.Pipes.Types.EcsEphemeralStorage where

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

-- | The amount of ephemeral storage to allocate for the task. This parameter
-- is used to expand the total amount of ephemeral storage available,
-- beyond the default amount, for tasks hosted on Fargate. For more
-- information, see
-- <https://docs.aws.amazon.com/AmazonECS/latest/userguide/using_data_volumes.html Fargate task storage>
-- in the /Amazon ECS User Guide for Fargate/.
--
-- This parameter is only supported for tasks hosted on Fargate using Linux
-- platform version @1.4.0@ or later. This parameter is not supported for
-- Windows containers on Fargate.
--
-- /See:/ 'newEcsEphemeralStorage' smart constructor.
data EcsEphemeralStorage = EcsEphemeralStorage'
  { -- | The total amount, in GiB, of ephemeral storage to set for the task. The
    -- minimum supported value is @21@ GiB and the maximum supported value is
    -- @200@ GiB.
    EcsEphemeralStorage -> Natural
sizeInGiB :: Prelude.Natural
  }
  deriving (EcsEphemeralStorage -> EcsEphemeralStorage -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EcsEphemeralStorage -> EcsEphemeralStorage -> Bool
$c/= :: EcsEphemeralStorage -> EcsEphemeralStorage -> Bool
== :: EcsEphemeralStorage -> EcsEphemeralStorage -> Bool
$c== :: EcsEphemeralStorage -> EcsEphemeralStorage -> Bool
Prelude.Eq, ReadPrec [EcsEphemeralStorage]
ReadPrec EcsEphemeralStorage
Int -> ReadS EcsEphemeralStorage
ReadS [EcsEphemeralStorage]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EcsEphemeralStorage]
$creadListPrec :: ReadPrec [EcsEphemeralStorage]
readPrec :: ReadPrec EcsEphemeralStorage
$creadPrec :: ReadPrec EcsEphemeralStorage
readList :: ReadS [EcsEphemeralStorage]
$creadList :: ReadS [EcsEphemeralStorage]
readsPrec :: Int -> ReadS EcsEphemeralStorage
$creadsPrec :: Int -> ReadS EcsEphemeralStorage
Prelude.Read, Int -> EcsEphemeralStorage -> ShowS
[EcsEphemeralStorage] -> ShowS
EcsEphemeralStorage -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EcsEphemeralStorage] -> ShowS
$cshowList :: [EcsEphemeralStorage] -> ShowS
show :: EcsEphemeralStorage -> String
$cshow :: EcsEphemeralStorage -> String
showsPrec :: Int -> EcsEphemeralStorage -> ShowS
$cshowsPrec :: Int -> EcsEphemeralStorage -> ShowS
Prelude.Show, forall x. Rep EcsEphemeralStorage x -> EcsEphemeralStorage
forall x. EcsEphemeralStorage -> Rep EcsEphemeralStorage x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep EcsEphemeralStorage x -> EcsEphemeralStorage
$cfrom :: forall x. EcsEphemeralStorage -> Rep EcsEphemeralStorage x
Prelude.Generic)

-- |
-- Create a value of 'EcsEphemeralStorage' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'sizeInGiB', 'ecsEphemeralStorage_sizeInGiB' - The total amount, in GiB, of ephemeral storage to set for the task. The
-- minimum supported value is @21@ GiB and the maximum supported value is
-- @200@ GiB.
newEcsEphemeralStorage ::
  -- | 'sizeInGiB'
  Prelude.Natural ->
  EcsEphemeralStorage
newEcsEphemeralStorage :: Natural -> EcsEphemeralStorage
newEcsEphemeralStorage Natural
pSizeInGiB_ =
  EcsEphemeralStorage' {$sel:sizeInGiB:EcsEphemeralStorage' :: Natural
sizeInGiB = Natural
pSizeInGiB_}

-- | The total amount, in GiB, of ephemeral storage to set for the task. The
-- minimum supported value is @21@ GiB and the maximum supported value is
-- @200@ GiB.
ecsEphemeralStorage_sizeInGiB :: Lens.Lens' EcsEphemeralStorage Prelude.Natural
ecsEphemeralStorage_sizeInGiB :: Lens' EcsEphemeralStorage Natural
ecsEphemeralStorage_sizeInGiB = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EcsEphemeralStorage' {Natural
sizeInGiB :: Natural
$sel:sizeInGiB:EcsEphemeralStorage' :: EcsEphemeralStorage -> Natural
sizeInGiB} -> Natural
sizeInGiB) (\s :: EcsEphemeralStorage
s@EcsEphemeralStorage' {} Natural
a -> EcsEphemeralStorage
s {$sel:sizeInGiB:EcsEphemeralStorage' :: Natural
sizeInGiB = Natural
a} :: EcsEphemeralStorage)

instance Data.FromJSON EcsEphemeralStorage where
  parseJSON :: Value -> Parser EcsEphemeralStorage
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"EcsEphemeralStorage"
      ( \Object
x ->
          Natural -> EcsEphemeralStorage
EcsEphemeralStorage'
            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
"sizeInGiB")
      )

instance Prelude.Hashable EcsEphemeralStorage where
  hashWithSalt :: Int -> EcsEphemeralStorage -> Int
hashWithSalt Int
_salt EcsEphemeralStorage' {Natural
sizeInGiB :: Natural
$sel:sizeInGiB:EcsEphemeralStorage' :: EcsEphemeralStorage -> Natural
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Natural
sizeInGiB

instance Prelude.NFData EcsEphemeralStorage where
  rnf :: EcsEphemeralStorage -> ()
rnf EcsEphemeralStorage' {Natural
sizeInGiB :: Natural
$sel:sizeInGiB:EcsEphemeralStorage' :: EcsEphemeralStorage -> Natural
..} = forall a. NFData a => a -> ()
Prelude.rnf Natural
sizeInGiB

instance Data.ToJSON EcsEphemeralStorage where
  toJSON :: EcsEphemeralStorage -> Value
toJSON EcsEphemeralStorage' {Natural
sizeInGiB :: Natural
$sel:sizeInGiB:EcsEphemeralStorage' :: EcsEphemeralStorage -> Natural
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [forall a. a -> Maybe a
Prelude.Just (Key
"sizeInGiB" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Natural
sizeInGiB)]
      )