{-# 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.DeviceFarm.Types.OfferingPromotion 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
data OfferingPromotion = OfferingPromotion'
{
OfferingPromotion -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
OfferingPromotion -> Maybe Text
id :: Prelude.Maybe Prelude.Text
}
deriving (OfferingPromotion -> OfferingPromotion -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: OfferingPromotion -> OfferingPromotion -> Bool
$c/= :: OfferingPromotion -> OfferingPromotion -> Bool
== :: OfferingPromotion -> OfferingPromotion -> Bool
$c== :: OfferingPromotion -> OfferingPromotion -> Bool
Prelude.Eq, ReadPrec [OfferingPromotion]
ReadPrec OfferingPromotion
Int -> ReadS OfferingPromotion
ReadS [OfferingPromotion]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [OfferingPromotion]
$creadListPrec :: ReadPrec [OfferingPromotion]
readPrec :: ReadPrec OfferingPromotion
$creadPrec :: ReadPrec OfferingPromotion
readList :: ReadS [OfferingPromotion]
$creadList :: ReadS [OfferingPromotion]
readsPrec :: Int -> ReadS OfferingPromotion
$creadsPrec :: Int -> ReadS OfferingPromotion
Prelude.Read, Int -> OfferingPromotion -> ShowS
[OfferingPromotion] -> ShowS
OfferingPromotion -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [OfferingPromotion] -> ShowS
$cshowList :: [OfferingPromotion] -> ShowS
show :: OfferingPromotion -> String
$cshow :: OfferingPromotion -> String
showsPrec :: Int -> OfferingPromotion -> ShowS
$cshowsPrec :: Int -> OfferingPromotion -> ShowS
Prelude.Show, forall x. Rep OfferingPromotion x -> OfferingPromotion
forall x. OfferingPromotion -> Rep OfferingPromotion x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep OfferingPromotion x -> OfferingPromotion
$cfrom :: forall x. OfferingPromotion -> Rep OfferingPromotion x
Prelude.Generic)
newOfferingPromotion ::
OfferingPromotion
newOfferingPromotion :: OfferingPromotion
newOfferingPromotion =
OfferingPromotion'
{ $sel:description:OfferingPromotion' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
$sel:id:OfferingPromotion' :: Maybe Text
id = forall a. Maybe a
Prelude.Nothing
}
offeringPromotion_description :: Lens.Lens' OfferingPromotion (Prelude.Maybe Prelude.Text)
offeringPromotion_description :: Lens' OfferingPromotion (Maybe Text)
offeringPromotion_description = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OfferingPromotion' {Maybe Text
description :: Maybe Text
$sel:description:OfferingPromotion' :: OfferingPromotion -> Maybe Text
description} -> Maybe Text
description) (\s :: OfferingPromotion
s@OfferingPromotion' {} Maybe Text
a -> OfferingPromotion
s {$sel:description:OfferingPromotion' :: Maybe Text
description = Maybe Text
a} :: OfferingPromotion)
offeringPromotion_id :: Lens.Lens' OfferingPromotion (Prelude.Maybe Prelude.Text)
offeringPromotion_id :: Lens' OfferingPromotion (Maybe Text)
offeringPromotion_id = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OfferingPromotion' {Maybe Text
id :: Maybe Text
$sel:id:OfferingPromotion' :: OfferingPromotion -> Maybe Text
id} -> Maybe Text
id) (\s :: OfferingPromotion
s@OfferingPromotion' {} Maybe Text
a -> OfferingPromotion
s {$sel:id:OfferingPromotion' :: Maybe Text
id = Maybe Text
a} :: OfferingPromotion)
instance Data.FromJSON OfferingPromotion where
parseJSON :: Value -> Parser OfferingPromotion
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"OfferingPromotion"
( \Object
x ->
Maybe Text -> Maybe Text -> OfferingPromotion
OfferingPromotion'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"description")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"id")
)
instance Prelude.Hashable OfferingPromotion where
hashWithSalt :: Int -> OfferingPromotion -> Int
hashWithSalt Int
_salt OfferingPromotion' {Maybe Text
id :: Maybe Text
description :: Maybe Text
$sel:id:OfferingPromotion' :: OfferingPromotion -> Maybe Text
$sel:description:OfferingPromotion' :: OfferingPromotion -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
id
instance Prelude.NFData OfferingPromotion where
rnf :: OfferingPromotion -> ()
rnf OfferingPromotion' {Maybe Text
id :: Maybe Text
description :: Maybe Text
$sel:id:OfferingPromotion' :: OfferingPromotion -> Maybe Text
$sel:description:OfferingPromotion' :: OfferingPromotion -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
description
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
id