{-# 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.ImageBuilder.Types.EbsInstanceBlockDeviceSpecification
-- 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.ImageBuilder.Types.EbsInstanceBlockDeviceSpecification where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.ImageBuilder.Types.EbsVolumeType
import qualified Amazonka.Prelude as Prelude

-- | Amazon EBS-specific block device mapping specifications.
--
-- /See:/ 'newEbsInstanceBlockDeviceSpecification' smart constructor.
data EbsInstanceBlockDeviceSpecification = EbsInstanceBlockDeviceSpecification'
  { -- | Use to configure delete on termination of the associated device.
    EbsInstanceBlockDeviceSpecification -> Maybe Bool
deleteOnTermination :: Prelude.Maybe Prelude.Bool,
    -- | Use to configure device encryption.
    EbsInstanceBlockDeviceSpecification -> Maybe Bool
encrypted :: Prelude.Maybe Prelude.Bool,
    -- | Use to configure device IOPS.
    EbsInstanceBlockDeviceSpecification -> Maybe Natural
iops :: Prelude.Maybe Prelude.Natural,
    -- | Use to configure the KMS key to use when encrypting the device.
    EbsInstanceBlockDeviceSpecification -> Maybe Text
kmsKeyId :: Prelude.Maybe Prelude.Text,
    -- | The snapshot that defines the device contents.
    EbsInstanceBlockDeviceSpecification -> Maybe Text
snapshotId :: Prelude.Maybe Prelude.Text,
    -- | __For GP3 volumes only__ – The throughput in MiB\/s that the volume
    -- supports.
    EbsInstanceBlockDeviceSpecification -> Maybe Natural
throughput :: Prelude.Maybe Prelude.Natural,
    -- | Use to override the device\'s volume size.
    EbsInstanceBlockDeviceSpecification -> Maybe Natural
volumeSize :: Prelude.Maybe Prelude.Natural,
    -- | Use to override the device\'s volume type.
    EbsInstanceBlockDeviceSpecification -> Maybe EbsVolumeType
volumeType :: Prelude.Maybe EbsVolumeType
  }
  deriving (EbsInstanceBlockDeviceSpecification
-> EbsInstanceBlockDeviceSpecification -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EbsInstanceBlockDeviceSpecification
-> EbsInstanceBlockDeviceSpecification -> Bool
$c/= :: EbsInstanceBlockDeviceSpecification
-> EbsInstanceBlockDeviceSpecification -> Bool
== :: EbsInstanceBlockDeviceSpecification
-> EbsInstanceBlockDeviceSpecification -> Bool
$c== :: EbsInstanceBlockDeviceSpecification
-> EbsInstanceBlockDeviceSpecification -> Bool
Prelude.Eq, ReadPrec [EbsInstanceBlockDeviceSpecification]
ReadPrec EbsInstanceBlockDeviceSpecification
Int -> ReadS EbsInstanceBlockDeviceSpecification
ReadS [EbsInstanceBlockDeviceSpecification]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EbsInstanceBlockDeviceSpecification]
$creadListPrec :: ReadPrec [EbsInstanceBlockDeviceSpecification]
readPrec :: ReadPrec EbsInstanceBlockDeviceSpecification
$creadPrec :: ReadPrec EbsInstanceBlockDeviceSpecification
readList :: ReadS [EbsInstanceBlockDeviceSpecification]
$creadList :: ReadS [EbsInstanceBlockDeviceSpecification]
readsPrec :: Int -> ReadS EbsInstanceBlockDeviceSpecification
$creadsPrec :: Int -> ReadS EbsInstanceBlockDeviceSpecification
Prelude.Read, Int -> EbsInstanceBlockDeviceSpecification -> ShowS
[EbsInstanceBlockDeviceSpecification] -> ShowS
EbsInstanceBlockDeviceSpecification -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EbsInstanceBlockDeviceSpecification] -> ShowS
$cshowList :: [EbsInstanceBlockDeviceSpecification] -> ShowS
show :: EbsInstanceBlockDeviceSpecification -> String
$cshow :: EbsInstanceBlockDeviceSpecification -> String
showsPrec :: Int -> EbsInstanceBlockDeviceSpecification -> ShowS
$cshowsPrec :: Int -> EbsInstanceBlockDeviceSpecification -> ShowS
Prelude.Show, forall x.
Rep EbsInstanceBlockDeviceSpecification x
-> EbsInstanceBlockDeviceSpecification
forall x.
EbsInstanceBlockDeviceSpecification
-> Rep EbsInstanceBlockDeviceSpecification x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep EbsInstanceBlockDeviceSpecification x
-> EbsInstanceBlockDeviceSpecification
$cfrom :: forall x.
EbsInstanceBlockDeviceSpecification
-> Rep EbsInstanceBlockDeviceSpecification x
Prelude.Generic)

-- |
-- Create a value of 'EbsInstanceBlockDeviceSpecification' 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:
--
-- 'deleteOnTermination', 'ebsInstanceBlockDeviceSpecification_deleteOnTermination' - Use to configure delete on termination of the associated device.
--
-- 'encrypted', 'ebsInstanceBlockDeviceSpecification_encrypted' - Use to configure device encryption.
--
-- 'iops', 'ebsInstanceBlockDeviceSpecification_iops' - Use to configure device IOPS.
--
-- 'kmsKeyId', 'ebsInstanceBlockDeviceSpecification_kmsKeyId' - Use to configure the KMS key to use when encrypting the device.
--
-- 'snapshotId', 'ebsInstanceBlockDeviceSpecification_snapshotId' - The snapshot that defines the device contents.
--
-- 'throughput', 'ebsInstanceBlockDeviceSpecification_throughput' - __For GP3 volumes only__ – The throughput in MiB\/s that the volume
-- supports.
--
-- 'volumeSize', 'ebsInstanceBlockDeviceSpecification_volumeSize' - Use to override the device\'s volume size.
--
-- 'volumeType', 'ebsInstanceBlockDeviceSpecification_volumeType' - Use to override the device\'s volume type.
newEbsInstanceBlockDeviceSpecification ::
  EbsInstanceBlockDeviceSpecification
newEbsInstanceBlockDeviceSpecification :: EbsInstanceBlockDeviceSpecification
newEbsInstanceBlockDeviceSpecification =
  EbsInstanceBlockDeviceSpecification'
    { $sel:deleteOnTermination:EbsInstanceBlockDeviceSpecification' :: Maybe Bool
deleteOnTermination =
        forall a. Maybe a
Prelude.Nothing,
      $sel:encrypted:EbsInstanceBlockDeviceSpecification' :: Maybe Bool
encrypted = forall a. Maybe a
Prelude.Nothing,
      $sel:iops:EbsInstanceBlockDeviceSpecification' :: Maybe Natural
iops = forall a. Maybe a
Prelude.Nothing,
      $sel:kmsKeyId:EbsInstanceBlockDeviceSpecification' :: Maybe Text
kmsKeyId = forall a. Maybe a
Prelude.Nothing,
      $sel:snapshotId:EbsInstanceBlockDeviceSpecification' :: Maybe Text
snapshotId = forall a. Maybe a
Prelude.Nothing,
      $sel:throughput:EbsInstanceBlockDeviceSpecification' :: Maybe Natural
throughput = forall a. Maybe a
Prelude.Nothing,
      $sel:volumeSize:EbsInstanceBlockDeviceSpecification' :: Maybe Natural
volumeSize = forall a. Maybe a
Prelude.Nothing,
      $sel:volumeType:EbsInstanceBlockDeviceSpecification' :: Maybe EbsVolumeType
volumeType = forall a. Maybe a
Prelude.Nothing
    }

-- | Use to configure delete on termination of the associated device.
ebsInstanceBlockDeviceSpecification_deleteOnTermination :: Lens.Lens' EbsInstanceBlockDeviceSpecification (Prelude.Maybe Prelude.Bool)
ebsInstanceBlockDeviceSpecification_deleteOnTermination :: Lens' EbsInstanceBlockDeviceSpecification (Maybe Bool)
ebsInstanceBlockDeviceSpecification_deleteOnTermination = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EbsInstanceBlockDeviceSpecification' {Maybe Bool
deleteOnTermination :: Maybe Bool
$sel:deleteOnTermination:EbsInstanceBlockDeviceSpecification' :: EbsInstanceBlockDeviceSpecification -> Maybe Bool
deleteOnTermination} -> Maybe Bool
deleteOnTermination) (\s :: EbsInstanceBlockDeviceSpecification
s@EbsInstanceBlockDeviceSpecification' {} Maybe Bool
a -> EbsInstanceBlockDeviceSpecification
s {$sel:deleteOnTermination:EbsInstanceBlockDeviceSpecification' :: Maybe Bool
deleteOnTermination = Maybe Bool
a} :: EbsInstanceBlockDeviceSpecification)

-- | Use to configure device encryption.
ebsInstanceBlockDeviceSpecification_encrypted :: Lens.Lens' EbsInstanceBlockDeviceSpecification (Prelude.Maybe Prelude.Bool)
ebsInstanceBlockDeviceSpecification_encrypted :: Lens' EbsInstanceBlockDeviceSpecification (Maybe Bool)
ebsInstanceBlockDeviceSpecification_encrypted = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EbsInstanceBlockDeviceSpecification' {Maybe Bool
encrypted :: Maybe Bool
$sel:encrypted:EbsInstanceBlockDeviceSpecification' :: EbsInstanceBlockDeviceSpecification -> Maybe Bool
encrypted} -> Maybe Bool
encrypted) (\s :: EbsInstanceBlockDeviceSpecification
s@EbsInstanceBlockDeviceSpecification' {} Maybe Bool
a -> EbsInstanceBlockDeviceSpecification
s {$sel:encrypted:EbsInstanceBlockDeviceSpecification' :: Maybe Bool
encrypted = Maybe Bool
a} :: EbsInstanceBlockDeviceSpecification)

-- | Use to configure device IOPS.
ebsInstanceBlockDeviceSpecification_iops :: Lens.Lens' EbsInstanceBlockDeviceSpecification (Prelude.Maybe Prelude.Natural)
ebsInstanceBlockDeviceSpecification_iops :: Lens' EbsInstanceBlockDeviceSpecification (Maybe Natural)
ebsInstanceBlockDeviceSpecification_iops = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EbsInstanceBlockDeviceSpecification' {Maybe Natural
iops :: Maybe Natural
$sel:iops:EbsInstanceBlockDeviceSpecification' :: EbsInstanceBlockDeviceSpecification -> Maybe Natural
iops} -> Maybe Natural
iops) (\s :: EbsInstanceBlockDeviceSpecification
s@EbsInstanceBlockDeviceSpecification' {} Maybe Natural
a -> EbsInstanceBlockDeviceSpecification
s {$sel:iops:EbsInstanceBlockDeviceSpecification' :: Maybe Natural
iops = Maybe Natural
a} :: EbsInstanceBlockDeviceSpecification)

-- | Use to configure the KMS key to use when encrypting the device.
ebsInstanceBlockDeviceSpecification_kmsKeyId :: Lens.Lens' EbsInstanceBlockDeviceSpecification (Prelude.Maybe Prelude.Text)
ebsInstanceBlockDeviceSpecification_kmsKeyId :: Lens' EbsInstanceBlockDeviceSpecification (Maybe Text)
ebsInstanceBlockDeviceSpecification_kmsKeyId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EbsInstanceBlockDeviceSpecification' {Maybe Text
kmsKeyId :: Maybe Text
$sel:kmsKeyId:EbsInstanceBlockDeviceSpecification' :: EbsInstanceBlockDeviceSpecification -> Maybe Text
kmsKeyId} -> Maybe Text
kmsKeyId) (\s :: EbsInstanceBlockDeviceSpecification
s@EbsInstanceBlockDeviceSpecification' {} Maybe Text
a -> EbsInstanceBlockDeviceSpecification
s {$sel:kmsKeyId:EbsInstanceBlockDeviceSpecification' :: Maybe Text
kmsKeyId = Maybe Text
a} :: EbsInstanceBlockDeviceSpecification)

-- | The snapshot that defines the device contents.
ebsInstanceBlockDeviceSpecification_snapshotId :: Lens.Lens' EbsInstanceBlockDeviceSpecification (Prelude.Maybe Prelude.Text)
ebsInstanceBlockDeviceSpecification_snapshotId :: Lens' EbsInstanceBlockDeviceSpecification (Maybe Text)
ebsInstanceBlockDeviceSpecification_snapshotId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EbsInstanceBlockDeviceSpecification' {Maybe Text
snapshotId :: Maybe Text
$sel:snapshotId:EbsInstanceBlockDeviceSpecification' :: EbsInstanceBlockDeviceSpecification -> Maybe Text
snapshotId} -> Maybe Text
snapshotId) (\s :: EbsInstanceBlockDeviceSpecification
s@EbsInstanceBlockDeviceSpecification' {} Maybe Text
a -> EbsInstanceBlockDeviceSpecification
s {$sel:snapshotId:EbsInstanceBlockDeviceSpecification' :: Maybe Text
snapshotId = Maybe Text
a} :: EbsInstanceBlockDeviceSpecification)

-- | __For GP3 volumes only__ – The throughput in MiB\/s that the volume
-- supports.
ebsInstanceBlockDeviceSpecification_throughput :: Lens.Lens' EbsInstanceBlockDeviceSpecification (Prelude.Maybe Prelude.Natural)
ebsInstanceBlockDeviceSpecification_throughput :: Lens' EbsInstanceBlockDeviceSpecification (Maybe Natural)
ebsInstanceBlockDeviceSpecification_throughput = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EbsInstanceBlockDeviceSpecification' {Maybe Natural
throughput :: Maybe Natural
$sel:throughput:EbsInstanceBlockDeviceSpecification' :: EbsInstanceBlockDeviceSpecification -> Maybe Natural
throughput} -> Maybe Natural
throughput) (\s :: EbsInstanceBlockDeviceSpecification
s@EbsInstanceBlockDeviceSpecification' {} Maybe Natural
a -> EbsInstanceBlockDeviceSpecification
s {$sel:throughput:EbsInstanceBlockDeviceSpecification' :: Maybe Natural
throughput = Maybe Natural
a} :: EbsInstanceBlockDeviceSpecification)

-- | Use to override the device\'s volume size.
ebsInstanceBlockDeviceSpecification_volumeSize :: Lens.Lens' EbsInstanceBlockDeviceSpecification (Prelude.Maybe Prelude.Natural)
ebsInstanceBlockDeviceSpecification_volumeSize :: Lens' EbsInstanceBlockDeviceSpecification (Maybe Natural)
ebsInstanceBlockDeviceSpecification_volumeSize = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EbsInstanceBlockDeviceSpecification' {Maybe Natural
volumeSize :: Maybe Natural
$sel:volumeSize:EbsInstanceBlockDeviceSpecification' :: EbsInstanceBlockDeviceSpecification -> Maybe Natural
volumeSize} -> Maybe Natural
volumeSize) (\s :: EbsInstanceBlockDeviceSpecification
s@EbsInstanceBlockDeviceSpecification' {} Maybe Natural
a -> EbsInstanceBlockDeviceSpecification
s {$sel:volumeSize:EbsInstanceBlockDeviceSpecification' :: Maybe Natural
volumeSize = Maybe Natural
a} :: EbsInstanceBlockDeviceSpecification)

-- | Use to override the device\'s volume type.
ebsInstanceBlockDeviceSpecification_volumeType :: Lens.Lens' EbsInstanceBlockDeviceSpecification (Prelude.Maybe EbsVolumeType)
ebsInstanceBlockDeviceSpecification_volumeType :: Lens' EbsInstanceBlockDeviceSpecification (Maybe EbsVolumeType)
ebsInstanceBlockDeviceSpecification_volumeType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EbsInstanceBlockDeviceSpecification' {Maybe EbsVolumeType
volumeType :: Maybe EbsVolumeType
$sel:volumeType:EbsInstanceBlockDeviceSpecification' :: EbsInstanceBlockDeviceSpecification -> Maybe EbsVolumeType
volumeType} -> Maybe EbsVolumeType
volumeType) (\s :: EbsInstanceBlockDeviceSpecification
s@EbsInstanceBlockDeviceSpecification' {} Maybe EbsVolumeType
a -> EbsInstanceBlockDeviceSpecification
s {$sel:volumeType:EbsInstanceBlockDeviceSpecification' :: Maybe EbsVolumeType
volumeType = Maybe EbsVolumeType
a} :: EbsInstanceBlockDeviceSpecification)

instance
  Data.FromJSON
    EbsInstanceBlockDeviceSpecification
  where
  parseJSON :: Value -> Parser EbsInstanceBlockDeviceSpecification
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"EbsInstanceBlockDeviceSpecification"
      ( \Object
x ->
          Maybe Bool
-> Maybe Bool
-> Maybe Natural
-> Maybe Text
-> Maybe Text
-> Maybe Natural
-> Maybe Natural
-> Maybe EbsVolumeType
-> EbsInstanceBlockDeviceSpecification
EbsInstanceBlockDeviceSpecification'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"deleteOnTermination")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"encrypted")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"iops")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"kmsKeyId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"snapshotId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"throughput")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"volumeSize")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"volumeType")
      )

instance
  Prelude.Hashable
    EbsInstanceBlockDeviceSpecification
  where
  hashWithSalt :: Int -> EbsInstanceBlockDeviceSpecification -> Int
hashWithSalt
    Int
_salt
    EbsInstanceBlockDeviceSpecification' {Maybe Bool
Maybe Natural
Maybe Text
Maybe EbsVolumeType
volumeType :: Maybe EbsVolumeType
volumeSize :: Maybe Natural
throughput :: Maybe Natural
snapshotId :: Maybe Text
kmsKeyId :: Maybe Text
iops :: Maybe Natural
encrypted :: Maybe Bool
deleteOnTermination :: Maybe Bool
$sel:volumeType:EbsInstanceBlockDeviceSpecification' :: EbsInstanceBlockDeviceSpecification -> Maybe EbsVolumeType
$sel:volumeSize:EbsInstanceBlockDeviceSpecification' :: EbsInstanceBlockDeviceSpecification -> Maybe Natural
$sel:throughput:EbsInstanceBlockDeviceSpecification' :: EbsInstanceBlockDeviceSpecification -> Maybe Natural
$sel:snapshotId:EbsInstanceBlockDeviceSpecification' :: EbsInstanceBlockDeviceSpecification -> Maybe Text
$sel:kmsKeyId:EbsInstanceBlockDeviceSpecification' :: EbsInstanceBlockDeviceSpecification -> Maybe Text
$sel:iops:EbsInstanceBlockDeviceSpecification' :: EbsInstanceBlockDeviceSpecification -> Maybe Natural
$sel:encrypted:EbsInstanceBlockDeviceSpecification' :: EbsInstanceBlockDeviceSpecification -> Maybe Bool
$sel:deleteOnTermination:EbsInstanceBlockDeviceSpecification' :: EbsInstanceBlockDeviceSpecification -> Maybe Bool
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
deleteOnTermination
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
encrypted
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
iops
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
kmsKeyId
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
snapshotId
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
throughput
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
volumeSize
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe EbsVolumeType
volumeType

instance
  Prelude.NFData
    EbsInstanceBlockDeviceSpecification
  where
  rnf :: EbsInstanceBlockDeviceSpecification -> ()
rnf EbsInstanceBlockDeviceSpecification' {Maybe Bool
Maybe Natural
Maybe Text
Maybe EbsVolumeType
volumeType :: Maybe EbsVolumeType
volumeSize :: Maybe Natural
throughput :: Maybe Natural
snapshotId :: Maybe Text
kmsKeyId :: Maybe Text
iops :: Maybe Natural
encrypted :: Maybe Bool
deleteOnTermination :: Maybe Bool
$sel:volumeType:EbsInstanceBlockDeviceSpecification' :: EbsInstanceBlockDeviceSpecification -> Maybe EbsVolumeType
$sel:volumeSize:EbsInstanceBlockDeviceSpecification' :: EbsInstanceBlockDeviceSpecification -> Maybe Natural
$sel:throughput:EbsInstanceBlockDeviceSpecification' :: EbsInstanceBlockDeviceSpecification -> Maybe Natural
$sel:snapshotId:EbsInstanceBlockDeviceSpecification' :: EbsInstanceBlockDeviceSpecification -> Maybe Text
$sel:kmsKeyId:EbsInstanceBlockDeviceSpecification' :: EbsInstanceBlockDeviceSpecification -> Maybe Text
$sel:iops:EbsInstanceBlockDeviceSpecification' :: EbsInstanceBlockDeviceSpecification -> Maybe Natural
$sel:encrypted:EbsInstanceBlockDeviceSpecification' :: EbsInstanceBlockDeviceSpecification -> Maybe Bool
$sel:deleteOnTermination:EbsInstanceBlockDeviceSpecification' :: EbsInstanceBlockDeviceSpecification -> Maybe Bool
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
deleteOnTermination
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
encrypted
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
iops
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
kmsKeyId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
snapshotId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
throughput
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
volumeSize
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe EbsVolumeType
volumeType

instance
  Data.ToJSON
    EbsInstanceBlockDeviceSpecification
  where
  toJSON :: EbsInstanceBlockDeviceSpecification -> Value
toJSON EbsInstanceBlockDeviceSpecification' {Maybe Bool
Maybe Natural
Maybe Text
Maybe EbsVolumeType
volumeType :: Maybe EbsVolumeType
volumeSize :: Maybe Natural
throughput :: Maybe Natural
snapshotId :: Maybe Text
kmsKeyId :: Maybe Text
iops :: Maybe Natural
encrypted :: Maybe Bool
deleteOnTermination :: Maybe Bool
$sel:volumeType:EbsInstanceBlockDeviceSpecification' :: EbsInstanceBlockDeviceSpecification -> Maybe EbsVolumeType
$sel:volumeSize:EbsInstanceBlockDeviceSpecification' :: EbsInstanceBlockDeviceSpecification -> Maybe Natural
$sel:throughput:EbsInstanceBlockDeviceSpecification' :: EbsInstanceBlockDeviceSpecification -> Maybe Natural
$sel:snapshotId:EbsInstanceBlockDeviceSpecification' :: EbsInstanceBlockDeviceSpecification -> Maybe Text
$sel:kmsKeyId:EbsInstanceBlockDeviceSpecification' :: EbsInstanceBlockDeviceSpecification -> Maybe Text
$sel:iops:EbsInstanceBlockDeviceSpecification' :: EbsInstanceBlockDeviceSpecification -> Maybe Natural
$sel:encrypted:EbsInstanceBlockDeviceSpecification' :: EbsInstanceBlockDeviceSpecification -> Maybe Bool
$sel:deleteOnTermination:EbsInstanceBlockDeviceSpecification' :: EbsInstanceBlockDeviceSpecification -> Maybe Bool
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"deleteOnTermination" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
deleteOnTermination,
            (Key
"encrypted" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
encrypted,
            (Key
"iops" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
iops,
            (Key
"kmsKeyId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
kmsKeyId,
            (Key
"snapshotId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
snapshotId,
            (Key
"throughput" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
throughput,
            (Key
"volumeSize" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
volumeSize,
            (Key
"volumeType" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe EbsVolumeType
volumeType
          ]
      )