{-# 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 #-}
module Amazonka.Snowball.Types.CompatibleImage where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data CompatibleImage = CompatibleImage'
{
CompatibleImage -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
CompatibleImage -> Maybe Text
amiId :: Prelude.Maybe Prelude.Text
}
deriving (CompatibleImage -> CompatibleImage -> Bool
(CompatibleImage -> CompatibleImage -> Bool)
-> (CompatibleImage -> CompatibleImage -> Bool)
-> Eq CompatibleImage
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CompatibleImage -> CompatibleImage -> Bool
$c/= :: CompatibleImage -> CompatibleImage -> Bool
== :: CompatibleImage -> CompatibleImage -> Bool
$c== :: CompatibleImage -> CompatibleImage -> Bool
Prelude.Eq, ReadPrec [CompatibleImage]
ReadPrec CompatibleImage
Int -> ReadS CompatibleImage
ReadS [CompatibleImage]
(Int -> ReadS CompatibleImage)
-> ReadS [CompatibleImage]
-> ReadPrec CompatibleImage
-> ReadPrec [CompatibleImage]
-> Read CompatibleImage
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CompatibleImage]
$creadListPrec :: ReadPrec [CompatibleImage]
readPrec :: ReadPrec CompatibleImage
$creadPrec :: ReadPrec CompatibleImage
readList :: ReadS [CompatibleImage]
$creadList :: ReadS [CompatibleImage]
readsPrec :: Int -> ReadS CompatibleImage
$creadsPrec :: Int -> ReadS CompatibleImage
Prelude.Read, Int -> CompatibleImage -> ShowS
[CompatibleImage] -> ShowS
CompatibleImage -> String
(Int -> CompatibleImage -> ShowS)
-> (CompatibleImage -> String)
-> ([CompatibleImage] -> ShowS)
-> Show CompatibleImage
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CompatibleImage] -> ShowS
$cshowList :: [CompatibleImage] -> ShowS
show :: CompatibleImage -> String
$cshow :: CompatibleImage -> String
showsPrec :: Int -> CompatibleImage -> ShowS
$cshowsPrec :: Int -> CompatibleImage -> ShowS
Prelude.Show, (forall x. CompatibleImage -> Rep CompatibleImage x)
-> (forall x. Rep CompatibleImage x -> CompatibleImage)
-> Generic CompatibleImage
forall x. Rep CompatibleImage x -> CompatibleImage
forall x. CompatibleImage -> Rep CompatibleImage x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CompatibleImage x -> CompatibleImage
$cfrom :: forall x. CompatibleImage -> Rep CompatibleImage x
Prelude.Generic)
newCompatibleImage ::
CompatibleImage
newCompatibleImage :: CompatibleImage
newCompatibleImage =
CompatibleImage' :: Maybe Text -> Maybe Text -> CompatibleImage
CompatibleImage'
{ $sel:name:CompatibleImage' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:amiId:CompatibleImage' :: Maybe Text
amiId = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
compatibleImage_name :: Lens.Lens' CompatibleImage (Prelude.Maybe Prelude.Text)
compatibleImage_name :: (Maybe Text -> f (Maybe Text))
-> CompatibleImage -> f CompatibleImage
compatibleImage_name = (CompatibleImage -> Maybe Text)
-> (CompatibleImage -> Maybe Text -> CompatibleImage)
-> Lens CompatibleImage CompatibleImage (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CompatibleImage' {Maybe Text
name :: Maybe Text
$sel:name:CompatibleImage' :: CompatibleImage -> Maybe Text
name} -> Maybe Text
name) (\s :: CompatibleImage
s@CompatibleImage' {} Maybe Text
a -> CompatibleImage
s {$sel:name:CompatibleImage' :: Maybe Text
name = Maybe Text
a} :: CompatibleImage)
compatibleImage_amiId :: Lens.Lens' CompatibleImage (Prelude.Maybe Prelude.Text)
compatibleImage_amiId :: (Maybe Text -> f (Maybe Text))
-> CompatibleImage -> f CompatibleImage
compatibleImage_amiId = (CompatibleImage -> Maybe Text)
-> (CompatibleImage -> Maybe Text -> CompatibleImage)
-> Lens CompatibleImage CompatibleImage (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CompatibleImage' {Maybe Text
amiId :: Maybe Text
$sel:amiId:CompatibleImage' :: CompatibleImage -> Maybe Text
amiId} -> Maybe Text
amiId) (\s :: CompatibleImage
s@CompatibleImage' {} Maybe Text
a -> CompatibleImage
s {$sel:amiId:CompatibleImage' :: Maybe Text
amiId = Maybe Text
a} :: CompatibleImage)
instance Core.FromJSON CompatibleImage where
parseJSON :: Value -> Parser CompatibleImage
parseJSON =
String
-> (Object -> Parser CompatibleImage)
-> Value
-> Parser CompatibleImage
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"CompatibleImage"
( \Object
x ->
Maybe Text -> Maybe Text -> CompatibleImage
CompatibleImage'
(Maybe Text -> Maybe Text -> CompatibleImage)
-> Parser (Maybe Text) -> Parser (Maybe Text -> CompatibleImage)
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
"Name") Parser (Maybe Text -> CompatibleImage)
-> Parser (Maybe Text) -> Parser CompatibleImage
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
"AmiId")
)
instance Prelude.Hashable CompatibleImage
instance Prelude.NFData CompatibleImage