{-# 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.ElasticBeanstalk.Types.CustomAmi
-- 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.ElasticBeanstalk.Types.CustomAmi 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

-- | A custom AMI available to platforms.
--
-- /See:/ 'newCustomAmi' smart constructor.
data CustomAmi = CustomAmi'
  { -- | THe ID of the image used to create the custom AMI.
    CustomAmi -> Maybe Text
imageId :: Prelude.Maybe Prelude.Text,
    -- | The type of virtualization used to create the custom AMI.
    CustomAmi -> Maybe Text
virtualizationType :: Prelude.Maybe Prelude.Text
  }
  deriving (CustomAmi -> CustomAmi -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CustomAmi -> CustomAmi -> Bool
$c/= :: CustomAmi -> CustomAmi -> Bool
== :: CustomAmi -> CustomAmi -> Bool
$c== :: CustomAmi -> CustomAmi -> Bool
Prelude.Eq, ReadPrec [CustomAmi]
ReadPrec CustomAmi
Int -> ReadS CustomAmi
ReadS [CustomAmi]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CustomAmi]
$creadListPrec :: ReadPrec [CustomAmi]
readPrec :: ReadPrec CustomAmi
$creadPrec :: ReadPrec CustomAmi
readList :: ReadS [CustomAmi]
$creadList :: ReadS [CustomAmi]
readsPrec :: Int -> ReadS CustomAmi
$creadsPrec :: Int -> ReadS CustomAmi
Prelude.Read, Int -> CustomAmi -> ShowS
[CustomAmi] -> ShowS
CustomAmi -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CustomAmi] -> ShowS
$cshowList :: [CustomAmi] -> ShowS
show :: CustomAmi -> String
$cshow :: CustomAmi -> String
showsPrec :: Int -> CustomAmi -> ShowS
$cshowsPrec :: Int -> CustomAmi -> ShowS
Prelude.Show, forall x. Rep CustomAmi x -> CustomAmi
forall x. CustomAmi -> Rep CustomAmi x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CustomAmi x -> CustomAmi
$cfrom :: forall x. CustomAmi -> Rep CustomAmi x
Prelude.Generic)

-- |
-- Create a value of 'CustomAmi' 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:
--
-- 'imageId', 'customAmi_imageId' - THe ID of the image used to create the custom AMI.
--
-- 'virtualizationType', 'customAmi_virtualizationType' - The type of virtualization used to create the custom AMI.
newCustomAmi ::
  CustomAmi
newCustomAmi :: CustomAmi
newCustomAmi =
  CustomAmi'
    { $sel:imageId:CustomAmi' :: Maybe Text
imageId = forall a. Maybe a
Prelude.Nothing,
      $sel:virtualizationType:CustomAmi' :: Maybe Text
virtualizationType = forall a. Maybe a
Prelude.Nothing
    }

-- | THe ID of the image used to create the custom AMI.
customAmi_imageId :: Lens.Lens' CustomAmi (Prelude.Maybe Prelude.Text)
customAmi_imageId :: Lens' CustomAmi (Maybe Text)
customAmi_imageId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CustomAmi' {Maybe Text
imageId :: Maybe Text
$sel:imageId:CustomAmi' :: CustomAmi -> Maybe Text
imageId} -> Maybe Text
imageId) (\s :: CustomAmi
s@CustomAmi' {} Maybe Text
a -> CustomAmi
s {$sel:imageId:CustomAmi' :: Maybe Text
imageId = Maybe Text
a} :: CustomAmi)

-- | The type of virtualization used to create the custom AMI.
customAmi_virtualizationType :: Lens.Lens' CustomAmi (Prelude.Maybe Prelude.Text)
customAmi_virtualizationType :: Lens' CustomAmi (Maybe Text)
customAmi_virtualizationType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CustomAmi' {Maybe Text
virtualizationType :: Maybe Text
$sel:virtualizationType:CustomAmi' :: CustomAmi -> Maybe Text
virtualizationType} -> Maybe Text
virtualizationType) (\s :: CustomAmi
s@CustomAmi' {} Maybe Text
a -> CustomAmi
s {$sel:virtualizationType:CustomAmi' :: Maybe Text
virtualizationType = Maybe Text
a} :: CustomAmi)

instance Data.FromXML CustomAmi where
  parseXML :: [Node] -> Either String CustomAmi
parseXML [Node]
x =
    Maybe Text -> Maybe Text -> CustomAmi
CustomAmi'
      forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"ImageId")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"VirtualizationType")

instance Prelude.Hashable CustomAmi where
  hashWithSalt :: Int -> CustomAmi -> Int
hashWithSalt Int
_salt CustomAmi' {Maybe Text
virtualizationType :: Maybe Text
imageId :: Maybe Text
$sel:virtualizationType:CustomAmi' :: CustomAmi -> Maybe Text
$sel:imageId:CustomAmi' :: CustomAmi -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
imageId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
virtualizationType

instance Prelude.NFData CustomAmi where
  rnf :: CustomAmi -> ()
rnf CustomAmi' {Maybe Text
virtualizationType :: Maybe Text
imageId :: Maybe Text
$sel:virtualizationType:CustomAmi' :: CustomAmi -> Maybe Text
$sel:imageId:CustomAmi' :: CustomAmi -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
imageId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
virtualizationType