{-# 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-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.ImageBuilder.Types.EbsInstanceBlockDeviceSpecification where

import qualified Amazonka.Core as Core
import Amazonka.ImageBuilder.Types.EbsVolumeType
import qualified Amazonka.Lens as Lens
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,
    -- | __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 configure device IOPS.
    EbsInstanceBlockDeviceSpecification -> Maybe Natural
iops :: Prelude.Maybe Prelude.Natural,
    -- | Use to configure device encryption.
    EbsInstanceBlockDeviceSpecification -> Maybe Bool
encrypted :: Prelude.Maybe Prelude.Bool,
    -- | Use to configure the KMS key to use when encrypting the device.
    EbsInstanceBlockDeviceSpecification -> Maybe Text
kmsKeyId :: Prelude.Maybe Prelude.Text,
    -- | Use to override the device\'s volume type.
    EbsInstanceBlockDeviceSpecification -> Maybe EbsVolumeType
volumeType :: Prelude.Maybe EbsVolumeType,
    -- | The snapshot that defines the device contents.
    EbsInstanceBlockDeviceSpecification -> Maybe Text
snapshotId :: Prelude.Maybe Prelude.Text
  }
  deriving (EbsInstanceBlockDeviceSpecification
-> EbsInstanceBlockDeviceSpecification -> Bool
(EbsInstanceBlockDeviceSpecification
 -> EbsInstanceBlockDeviceSpecification -> Bool)
-> (EbsInstanceBlockDeviceSpecification
    -> EbsInstanceBlockDeviceSpecification -> Bool)
-> Eq EbsInstanceBlockDeviceSpecification
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]
(Int -> ReadS EbsInstanceBlockDeviceSpecification)
-> ReadS [EbsInstanceBlockDeviceSpecification]
-> ReadPrec EbsInstanceBlockDeviceSpecification
-> ReadPrec [EbsInstanceBlockDeviceSpecification]
-> Read 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
(Int -> EbsInstanceBlockDeviceSpecification -> ShowS)
-> (EbsInstanceBlockDeviceSpecification -> String)
-> ([EbsInstanceBlockDeviceSpecification] -> ShowS)
-> Show EbsInstanceBlockDeviceSpecification
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.
 EbsInstanceBlockDeviceSpecification
 -> Rep EbsInstanceBlockDeviceSpecification x)
-> (forall x.
    Rep EbsInstanceBlockDeviceSpecification x
    -> EbsInstanceBlockDeviceSpecification)
-> Generic EbsInstanceBlockDeviceSpecification
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.
--
-- '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.
--
-- 'iops', 'ebsInstanceBlockDeviceSpecification_iops' - Use to configure device IOPS.
--
-- 'encrypted', 'ebsInstanceBlockDeviceSpecification_encrypted' - Use to configure device encryption.
--
-- 'kmsKeyId', 'ebsInstanceBlockDeviceSpecification_kmsKeyId' - Use to configure the KMS key to use when encrypting the device.
--
-- 'volumeType', 'ebsInstanceBlockDeviceSpecification_volumeType' - Use to override the device\'s volume type.
--
-- 'snapshotId', 'ebsInstanceBlockDeviceSpecification_snapshotId' - The snapshot that defines the device contents.
newEbsInstanceBlockDeviceSpecification ::
  EbsInstanceBlockDeviceSpecification
newEbsInstanceBlockDeviceSpecification :: EbsInstanceBlockDeviceSpecification
newEbsInstanceBlockDeviceSpecification =
  EbsInstanceBlockDeviceSpecification' :: Maybe Bool
-> Maybe Natural
-> Maybe Natural
-> Maybe Natural
-> Maybe Bool
-> Maybe Text
-> Maybe EbsVolumeType
-> Maybe Text
-> EbsInstanceBlockDeviceSpecification
EbsInstanceBlockDeviceSpecification'
    { $sel:deleteOnTermination:EbsInstanceBlockDeviceSpecification' :: Maybe Bool
deleteOnTermination =
        Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:throughput:EbsInstanceBlockDeviceSpecification' :: Maybe Natural
throughput = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:volumeSize:EbsInstanceBlockDeviceSpecification' :: Maybe Natural
volumeSize = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:iops:EbsInstanceBlockDeviceSpecification' :: Maybe Natural
iops = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:encrypted:EbsInstanceBlockDeviceSpecification' :: Maybe Bool
encrypted = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:kmsKeyId:EbsInstanceBlockDeviceSpecification' :: Maybe Text
kmsKeyId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:volumeType:EbsInstanceBlockDeviceSpecification' :: Maybe EbsVolumeType
volumeType = Maybe EbsVolumeType
forall a. Maybe a
Prelude.Nothing,
      $sel:snapshotId:EbsInstanceBlockDeviceSpecification' :: Maybe Text
snapshotId = Maybe Text
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 :: (Maybe Bool -> f (Maybe Bool))
-> EbsInstanceBlockDeviceSpecification
-> f EbsInstanceBlockDeviceSpecification
ebsInstanceBlockDeviceSpecification_deleteOnTermination = (EbsInstanceBlockDeviceSpecification -> Maybe Bool)
-> (EbsInstanceBlockDeviceSpecification
    -> Maybe Bool -> EbsInstanceBlockDeviceSpecification)
-> Lens
     EbsInstanceBlockDeviceSpecification
     EbsInstanceBlockDeviceSpecification
     (Maybe Bool)
     (Maybe Bool)
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)

-- | __For GP3 volumes only__ – The throughput in MiB\/s that the volume
-- supports.
ebsInstanceBlockDeviceSpecification_throughput :: Lens.Lens' EbsInstanceBlockDeviceSpecification (Prelude.Maybe Prelude.Natural)
ebsInstanceBlockDeviceSpecification_throughput :: (Maybe Natural -> f (Maybe Natural))
-> EbsInstanceBlockDeviceSpecification
-> f EbsInstanceBlockDeviceSpecification
ebsInstanceBlockDeviceSpecification_throughput = (EbsInstanceBlockDeviceSpecification -> Maybe Natural)
-> (EbsInstanceBlockDeviceSpecification
    -> Maybe Natural -> EbsInstanceBlockDeviceSpecification)
-> Lens
     EbsInstanceBlockDeviceSpecification
     EbsInstanceBlockDeviceSpecification
     (Maybe Natural)
     (Maybe Natural)
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 :: (Maybe Natural -> f (Maybe Natural))
-> EbsInstanceBlockDeviceSpecification
-> f EbsInstanceBlockDeviceSpecification
ebsInstanceBlockDeviceSpecification_volumeSize = (EbsInstanceBlockDeviceSpecification -> Maybe Natural)
-> (EbsInstanceBlockDeviceSpecification
    -> Maybe Natural -> EbsInstanceBlockDeviceSpecification)
-> Lens
     EbsInstanceBlockDeviceSpecification
     EbsInstanceBlockDeviceSpecification
     (Maybe Natural)
     (Maybe Natural)
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 configure device IOPS.
ebsInstanceBlockDeviceSpecification_iops :: Lens.Lens' EbsInstanceBlockDeviceSpecification (Prelude.Maybe Prelude.Natural)
ebsInstanceBlockDeviceSpecification_iops :: (Maybe Natural -> f (Maybe Natural))
-> EbsInstanceBlockDeviceSpecification
-> f EbsInstanceBlockDeviceSpecification
ebsInstanceBlockDeviceSpecification_iops = (EbsInstanceBlockDeviceSpecification -> Maybe Natural)
-> (EbsInstanceBlockDeviceSpecification
    -> Maybe Natural -> EbsInstanceBlockDeviceSpecification)
-> Lens
     EbsInstanceBlockDeviceSpecification
     EbsInstanceBlockDeviceSpecification
     (Maybe Natural)
     (Maybe Natural)
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 device encryption.
ebsInstanceBlockDeviceSpecification_encrypted :: Lens.Lens' EbsInstanceBlockDeviceSpecification (Prelude.Maybe Prelude.Bool)
ebsInstanceBlockDeviceSpecification_encrypted :: (Maybe Bool -> f (Maybe Bool))
-> EbsInstanceBlockDeviceSpecification
-> f EbsInstanceBlockDeviceSpecification
ebsInstanceBlockDeviceSpecification_encrypted = (EbsInstanceBlockDeviceSpecification -> Maybe Bool)
-> (EbsInstanceBlockDeviceSpecification
    -> Maybe Bool -> EbsInstanceBlockDeviceSpecification)
-> Lens
     EbsInstanceBlockDeviceSpecification
     EbsInstanceBlockDeviceSpecification
     (Maybe Bool)
     (Maybe Bool)
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 the KMS key to use when encrypting the device.
ebsInstanceBlockDeviceSpecification_kmsKeyId :: Lens.Lens' EbsInstanceBlockDeviceSpecification (Prelude.Maybe Prelude.Text)
ebsInstanceBlockDeviceSpecification_kmsKeyId :: (Maybe Text -> f (Maybe Text))
-> EbsInstanceBlockDeviceSpecification
-> f EbsInstanceBlockDeviceSpecification
ebsInstanceBlockDeviceSpecification_kmsKeyId = (EbsInstanceBlockDeviceSpecification -> Maybe Text)
-> (EbsInstanceBlockDeviceSpecification
    -> Maybe Text -> EbsInstanceBlockDeviceSpecification)
-> Lens
     EbsInstanceBlockDeviceSpecification
     EbsInstanceBlockDeviceSpecification
     (Maybe Text)
     (Maybe Text)
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)

-- | Use to override the device\'s volume type.
ebsInstanceBlockDeviceSpecification_volumeType :: Lens.Lens' EbsInstanceBlockDeviceSpecification (Prelude.Maybe EbsVolumeType)
ebsInstanceBlockDeviceSpecification_volumeType :: (Maybe EbsVolumeType -> f (Maybe EbsVolumeType))
-> EbsInstanceBlockDeviceSpecification
-> f EbsInstanceBlockDeviceSpecification
ebsInstanceBlockDeviceSpecification_volumeType = (EbsInstanceBlockDeviceSpecification -> Maybe EbsVolumeType)
-> (EbsInstanceBlockDeviceSpecification
    -> Maybe EbsVolumeType -> EbsInstanceBlockDeviceSpecification)
-> Lens
     EbsInstanceBlockDeviceSpecification
     EbsInstanceBlockDeviceSpecification
     (Maybe EbsVolumeType)
     (Maybe EbsVolumeType)
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)

-- | The snapshot that defines the device contents.
ebsInstanceBlockDeviceSpecification_snapshotId :: Lens.Lens' EbsInstanceBlockDeviceSpecification (Prelude.Maybe Prelude.Text)
ebsInstanceBlockDeviceSpecification_snapshotId :: (Maybe Text -> f (Maybe Text))
-> EbsInstanceBlockDeviceSpecification
-> f EbsInstanceBlockDeviceSpecification
ebsInstanceBlockDeviceSpecification_snapshotId = (EbsInstanceBlockDeviceSpecification -> Maybe Text)
-> (EbsInstanceBlockDeviceSpecification
    -> Maybe Text -> EbsInstanceBlockDeviceSpecification)
-> Lens
     EbsInstanceBlockDeviceSpecification
     EbsInstanceBlockDeviceSpecification
     (Maybe Text)
     (Maybe Text)
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)

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

instance
  Prelude.Hashable
    EbsInstanceBlockDeviceSpecification

instance
  Prelude.NFData
    EbsInstanceBlockDeviceSpecification

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