{-# 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.EC2.Types.ProductCode where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.EC2.Internal
import Amazonka.EC2.Types.ProductCodeValues
import qualified Amazonka.Prelude as Prelude
data ProductCode = ProductCode'
{
ProductCode -> Maybe Text
productCodeId :: Prelude.Maybe Prelude.Text,
ProductCode -> Maybe ProductCodeValues
productCodeType :: Prelude.Maybe ProductCodeValues
}
deriving (ProductCode -> ProductCode -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ProductCode -> ProductCode -> Bool
$c/= :: ProductCode -> ProductCode -> Bool
== :: ProductCode -> ProductCode -> Bool
$c== :: ProductCode -> ProductCode -> Bool
Prelude.Eq, ReadPrec [ProductCode]
ReadPrec ProductCode
Int -> ReadS ProductCode
ReadS [ProductCode]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ProductCode]
$creadListPrec :: ReadPrec [ProductCode]
readPrec :: ReadPrec ProductCode
$creadPrec :: ReadPrec ProductCode
readList :: ReadS [ProductCode]
$creadList :: ReadS [ProductCode]
readsPrec :: Int -> ReadS ProductCode
$creadsPrec :: Int -> ReadS ProductCode
Prelude.Read, Int -> ProductCode -> ShowS
[ProductCode] -> ShowS
ProductCode -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ProductCode] -> ShowS
$cshowList :: [ProductCode] -> ShowS
show :: ProductCode -> String
$cshow :: ProductCode -> String
showsPrec :: Int -> ProductCode -> ShowS
$cshowsPrec :: Int -> ProductCode -> ShowS
Prelude.Show, forall x. Rep ProductCode x -> ProductCode
forall x. ProductCode -> Rep ProductCode x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ProductCode x -> ProductCode
$cfrom :: forall x. ProductCode -> Rep ProductCode x
Prelude.Generic)
newProductCode ::
ProductCode
newProductCode :: ProductCode
newProductCode =
ProductCode'
{ $sel:productCodeId:ProductCode' :: Maybe Text
productCodeId = forall a. Maybe a
Prelude.Nothing,
$sel:productCodeType:ProductCode' :: Maybe ProductCodeValues
productCodeType = forall a. Maybe a
Prelude.Nothing
}
productCode_productCodeId :: Lens.Lens' ProductCode (Prelude.Maybe Prelude.Text)
productCode_productCodeId :: Lens' ProductCode (Maybe Text)
productCode_productCodeId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProductCode' {Maybe Text
productCodeId :: Maybe Text
$sel:productCodeId:ProductCode' :: ProductCode -> Maybe Text
productCodeId} -> Maybe Text
productCodeId) (\s :: ProductCode
s@ProductCode' {} Maybe Text
a -> ProductCode
s {$sel:productCodeId:ProductCode' :: Maybe Text
productCodeId = Maybe Text
a} :: ProductCode)
productCode_productCodeType :: Lens.Lens' ProductCode (Prelude.Maybe ProductCodeValues)
productCode_productCodeType :: Lens' ProductCode (Maybe ProductCodeValues)
productCode_productCodeType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProductCode' {Maybe ProductCodeValues
productCodeType :: Maybe ProductCodeValues
$sel:productCodeType:ProductCode' :: ProductCode -> Maybe ProductCodeValues
productCodeType} -> Maybe ProductCodeValues
productCodeType) (\s :: ProductCode
s@ProductCode' {} Maybe ProductCodeValues
a -> ProductCode
s {$sel:productCodeType:ProductCode' :: Maybe ProductCodeValues
productCodeType = Maybe ProductCodeValues
a} :: ProductCode)
instance Data.FromXML ProductCode where
parseXML :: [Node] -> Either String ProductCode
parseXML [Node]
x =
Maybe Text -> Maybe ProductCodeValues -> ProductCode
ProductCode'
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
"productCode")
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
"type")
instance Prelude.Hashable ProductCode where
hashWithSalt :: Int -> ProductCode -> Int
hashWithSalt Int
_salt ProductCode' {Maybe Text
Maybe ProductCodeValues
productCodeType :: Maybe ProductCodeValues
productCodeId :: Maybe Text
$sel:productCodeType:ProductCode' :: ProductCode -> Maybe ProductCodeValues
$sel:productCodeId:ProductCode' :: ProductCode -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
productCodeId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ProductCodeValues
productCodeType
instance Prelude.NFData ProductCode where
rnf :: ProductCode -> ()
rnf ProductCode' {Maybe Text
Maybe ProductCodeValues
productCodeType :: Maybe ProductCodeValues
productCodeId :: Maybe Text
$sel:productCodeType:ProductCode' :: ProductCode -> Maybe ProductCodeValues
$sel:productCodeId:ProductCode' :: ProductCode -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
productCodeId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ProductCodeValues
productCodeType