{-# 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.SecurityHub.Types.AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails
-- 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.SecurityHub.Types.AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.SecurityHub.Types.AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails

-- | A block device for the instance.
--
-- /See:/ 'newAwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails' smart constructor.
data AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails = AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails'
  { -- | The name of the virtual device (for example, @ephemeral0@).
    --
    -- You can provide either @VirtualName@ or @Ebs@, but not both.
    AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails
-> Maybe Text
virtualName :: Prelude.Maybe Prelude.Text,
    -- | Whether to suppress the device that is included in the block device
    -- mapping of the Amazon Machine Image (AMI).
    --
    -- If @NoDevice@ is @true@, then you cannot specify @Ebs@.>
    AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails
-> Maybe Bool
noDevice :: Prelude.Maybe Prelude.Bool,
    -- | Parameters that are used to automatically set up Amazon EBS volumes when
    -- an instance is launched.
    AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails
-> Maybe
     AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
ebs :: Prelude.Maybe AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails,
    -- | The device name that is exposed to the EC2 instance. For example,
    -- @\/dev\/sdh@ or @xvdh@.
    AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails
-> Maybe Text
deviceName :: Prelude.Maybe Prelude.Text
  }
  deriving (AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails
-> AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails
-> Bool
(AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails
 -> AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails
 -> Bool)
-> (AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails
    -> AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails
    -> Bool)
-> Eq AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails
-> AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails
-> Bool
$c/= :: AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails
-> AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails
-> Bool
== :: AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails
-> AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails
-> Bool
$c== :: AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails
-> AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails
-> Bool
Prelude.Eq, ReadPrec
  [AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails]
ReadPrec
  AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails
Int
-> ReadS
     AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails
ReadS [AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails]
(Int
 -> ReadS
      AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails)
-> ReadS
     [AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails]
-> ReadPrec
     AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails
-> ReadPrec
     [AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails]
-> Read AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec
  [AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails]
$creadListPrec :: ReadPrec
  [AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails]
readPrec :: ReadPrec
  AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails
$creadPrec :: ReadPrec
  AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails
readList :: ReadS [AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails]
$creadList :: ReadS [AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails]
readsPrec :: Int
-> ReadS
     AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails
$creadsPrec :: Int
-> ReadS
     AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails
Prelude.Read, Int
-> AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails
-> ShowS
[AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails]
-> ShowS
AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails
-> String
(Int
 -> AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails
 -> ShowS)
-> (AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails
    -> String)
-> ([AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails]
    -> ShowS)
-> Show AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails]
-> ShowS
$cshowList :: [AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails]
-> ShowS
show :: AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails
-> String
$cshow :: AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails
-> String
showsPrec :: Int
-> AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails
-> ShowS
$cshowsPrec :: Int
-> AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails
-> ShowS
Prelude.Show, (forall x.
 AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails
 -> Rep
      AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails x)
-> (forall x.
    Rep AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails x
    -> AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails)
-> Generic
     AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails
forall x.
Rep AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails x
-> AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails
forall x.
AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails
-> Rep
     AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails x
-> AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails
$cfrom :: forall x.
AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails
-> Rep
     AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails x
Prelude.Generic)

-- |
-- Create a value of 'AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails' 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:
--
-- 'virtualName', 'awsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails_virtualName' - The name of the virtual device (for example, @ephemeral0@).
--
-- You can provide either @VirtualName@ or @Ebs@, but not both.
--
-- 'noDevice', 'awsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails_noDevice' - Whether to suppress the device that is included in the block device
-- mapping of the Amazon Machine Image (AMI).
--
-- If @NoDevice@ is @true@, then you cannot specify @Ebs@.>
--
-- 'ebs', 'awsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails_ebs' - Parameters that are used to automatically set up Amazon EBS volumes when
-- an instance is launched.
--
-- 'deviceName', 'awsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails_deviceName' - The device name that is exposed to the EC2 instance. For example,
-- @\/dev\/sdh@ or @xvdh@.
newAwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails ::
  AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails
newAwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails :: AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails
newAwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails =
  AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails' :: Maybe Text
-> Maybe Bool
-> Maybe
     AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
-> Maybe Text
-> AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails
AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails'
    { $sel:virtualName:AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails' :: Maybe Text
virtualName =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:noDevice:AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails' :: Maybe Bool
noDevice =
        Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:ebs:AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails' :: Maybe
  AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
ebs =
        Maybe
  AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
forall a. Maybe a
Prelude.Nothing,
      $sel:deviceName:AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails' :: Maybe Text
deviceName =
        Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The name of the virtual device (for example, @ephemeral0@).
--
-- You can provide either @VirtualName@ or @Ebs@, but not both.
awsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails_virtualName :: Lens.Lens' AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails (Prelude.Maybe Prelude.Text)
awsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails_virtualName :: (Maybe Text -> f (Maybe Text))
-> AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails
-> f AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails
awsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails_virtualName = (AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails
 -> Maybe Text)
-> (AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails
    -> Maybe Text
    -> AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails)
-> Lens
     AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails
     AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails' {Maybe Text
virtualName :: Maybe Text
$sel:virtualName:AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails' :: AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails
-> Maybe Text
virtualName} -> Maybe Text
virtualName) (\s :: AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails
s@AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails' {} Maybe Text
a -> AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails
s {$sel:virtualName:AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails' :: Maybe Text
virtualName = Maybe Text
a} :: AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails)

-- | Whether to suppress the device that is included in the block device
-- mapping of the Amazon Machine Image (AMI).
--
-- If @NoDevice@ is @true@, then you cannot specify @Ebs@.>
awsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails_noDevice :: Lens.Lens' AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails (Prelude.Maybe Prelude.Bool)
awsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails_noDevice :: (Maybe Bool -> f (Maybe Bool))
-> AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails
-> f AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails
awsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails_noDevice = (AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails
 -> Maybe Bool)
-> (AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails
    -> Maybe Bool
    -> AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails)
-> Lens
     AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails
     AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails' {Maybe Bool
noDevice :: Maybe Bool
$sel:noDevice:AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails' :: AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails
-> Maybe Bool
noDevice} -> Maybe Bool
noDevice) (\s :: AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails
s@AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails' {} Maybe Bool
a -> AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails
s {$sel:noDevice:AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails' :: Maybe Bool
noDevice = Maybe Bool
a} :: AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails)

-- | Parameters that are used to automatically set up Amazon EBS volumes when
-- an instance is launched.
awsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails_ebs :: Lens.Lens' AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails (Prelude.Maybe AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails)
awsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails_ebs :: (Maybe
   AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
 -> f (Maybe
         AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails))
-> AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails
-> f AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails
awsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails_ebs = (AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails
 -> Maybe
      AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails)
-> (AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails
    -> Maybe
         AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
    -> AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails)
-> Lens
     AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails
     AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails
     (Maybe
        AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails)
     (Maybe
        AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails' {Maybe
  AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
ebs :: Maybe
  AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
$sel:ebs:AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails' :: AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails
-> Maybe
     AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
ebs} -> Maybe
  AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
ebs) (\s :: AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails
s@AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails' {} Maybe
  AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
a -> AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails
s {$sel:ebs:AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails' :: Maybe
  AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
ebs = Maybe
  AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
a} :: AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails)

-- | The device name that is exposed to the EC2 instance. For example,
-- @\/dev\/sdh@ or @xvdh@.
awsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails_deviceName :: Lens.Lens' AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails (Prelude.Maybe Prelude.Text)
awsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails_deviceName :: (Maybe Text -> f (Maybe Text))
-> AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails
-> f AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails
awsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails_deviceName = (AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails
 -> Maybe Text)
-> (AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails
    -> Maybe Text
    -> AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails)
-> Lens
     AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails
     AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails' {Maybe Text
deviceName :: Maybe Text
$sel:deviceName:AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails' :: AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails
-> Maybe Text
deviceName} -> Maybe Text
deviceName) (\s :: AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails
s@AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails' {} Maybe Text
a -> AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails
s {$sel:deviceName:AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails' :: Maybe Text
deviceName = Maybe Text
a} :: AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails)

instance
  Core.FromJSON
    AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails
  where
  parseJSON :: Value
-> Parser
     AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails
parseJSON =
    String
-> (Object
    -> Parser
         AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails)
-> Value
-> Parser
     AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails"
      ( \Object
x ->
          Maybe Text
-> Maybe Bool
-> Maybe
     AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
-> Maybe Text
-> AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails
AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails'
            (Maybe Text
 -> Maybe Bool
 -> Maybe
      AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
 -> Maybe Text
 -> AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails)
-> Parser (Maybe Text)
-> Parser
     (Maybe Bool
      -> Maybe
           AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
      -> Maybe Text
      -> AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails)
forall (f :: * -> *) a b. Functor 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
"VirtualName")
              Parser
  (Maybe Bool
   -> Maybe
        AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
   -> Maybe Text
   -> AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails)
-> Parser (Maybe Bool)
-> Parser
     (Maybe
        AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
      -> Maybe Text
      -> AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails)
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
"NoDevice")
              Parser
  (Maybe
     AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
   -> Maybe Text
   -> AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails)
-> Parser
     (Maybe
        AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails)
-> Parser
     (Maybe Text
      -> AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object
-> Text
-> Parser
     (Maybe
        AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Ebs")
              Parser
  (Maybe Text
   -> AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails)
-> Parser (Maybe Text)
-> Parser
     AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails
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
"DeviceName")
      )

instance
  Prelude.Hashable
    AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails

instance
  Prelude.NFData
    AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails

instance
  Core.ToJSON
    AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails
  where
  toJSON :: AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails
-> Value
toJSON
    AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails' {Maybe Bool
Maybe Text
Maybe
  AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
deviceName :: Maybe Text
ebs :: Maybe
  AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
noDevice :: Maybe Bool
virtualName :: Maybe Text
$sel:deviceName:AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails' :: AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails
-> Maybe Text
$sel:ebs:AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails' :: AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails
-> Maybe
     AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
$sel:noDevice:AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails' :: AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails
-> Maybe Bool
$sel:virtualName:AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails' :: AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails
-> Maybe Text
..} =
      [Pair] -> Value
Core.object
        ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
            [ (Text
"VirtualName" 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
virtualName,
              (Text
"NoDevice" 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
noDevice,
              (Text
"Ebs" Text
-> AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
-> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
 -> Pair)
-> Maybe
     AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
-> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe
  AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
ebs,
              (Text
"DeviceName" 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
deviceName
            ]
        )