{-# 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.Lightsail.Types.AddOnRequest where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.Lightsail.Types.AddOnType
import Amazonka.Lightsail.Types.AutoSnapshotAddOnRequest
import qualified Amazonka.Prelude as Prelude
data AddOnRequest = AddOnRequest'
{
AddOnRequest -> Maybe AutoSnapshotAddOnRequest
autoSnapshotAddOnRequest :: Prelude.Maybe AutoSnapshotAddOnRequest,
AddOnRequest -> AddOnType
addOnType :: AddOnType
}
deriving (AddOnRequest -> AddOnRequest -> Bool
(AddOnRequest -> AddOnRequest -> Bool)
-> (AddOnRequest -> AddOnRequest -> Bool) -> Eq AddOnRequest
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AddOnRequest -> AddOnRequest -> Bool
$c/= :: AddOnRequest -> AddOnRequest -> Bool
== :: AddOnRequest -> AddOnRequest -> Bool
$c== :: AddOnRequest -> AddOnRequest -> Bool
Prelude.Eq, ReadPrec [AddOnRequest]
ReadPrec AddOnRequest
Int -> ReadS AddOnRequest
ReadS [AddOnRequest]
(Int -> ReadS AddOnRequest)
-> ReadS [AddOnRequest]
-> ReadPrec AddOnRequest
-> ReadPrec [AddOnRequest]
-> Read AddOnRequest
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AddOnRequest]
$creadListPrec :: ReadPrec [AddOnRequest]
readPrec :: ReadPrec AddOnRequest
$creadPrec :: ReadPrec AddOnRequest
readList :: ReadS [AddOnRequest]
$creadList :: ReadS [AddOnRequest]
readsPrec :: Int -> ReadS AddOnRequest
$creadsPrec :: Int -> ReadS AddOnRequest
Prelude.Read, Int -> AddOnRequest -> ShowS
[AddOnRequest] -> ShowS
AddOnRequest -> String
(Int -> AddOnRequest -> ShowS)
-> (AddOnRequest -> String)
-> ([AddOnRequest] -> ShowS)
-> Show AddOnRequest
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AddOnRequest] -> ShowS
$cshowList :: [AddOnRequest] -> ShowS
show :: AddOnRequest -> String
$cshow :: AddOnRequest -> String
showsPrec :: Int -> AddOnRequest -> ShowS
$cshowsPrec :: Int -> AddOnRequest -> ShowS
Prelude.Show, (forall x. AddOnRequest -> Rep AddOnRequest x)
-> (forall x. Rep AddOnRequest x -> AddOnRequest)
-> Generic AddOnRequest
forall x. Rep AddOnRequest x -> AddOnRequest
forall x. AddOnRequest -> Rep AddOnRequest x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AddOnRequest x -> AddOnRequest
$cfrom :: forall x. AddOnRequest -> Rep AddOnRequest x
Prelude.Generic)
newAddOnRequest ::
AddOnType ->
AddOnRequest
newAddOnRequest :: AddOnType -> AddOnRequest
newAddOnRequest AddOnType
pAddOnType_ =
AddOnRequest' :: Maybe AutoSnapshotAddOnRequest -> AddOnType -> AddOnRequest
AddOnRequest'
{ $sel:autoSnapshotAddOnRequest:AddOnRequest' :: Maybe AutoSnapshotAddOnRequest
autoSnapshotAddOnRequest =
Maybe AutoSnapshotAddOnRequest
forall a. Maybe a
Prelude.Nothing,
$sel:addOnType:AddOnRequest' :: AddOnType
addOnType = AddOnType
pAddOnType_
}
addOnRequest_autoSnapshotAddOnRequest :: Lens.Lens' AddOnRequest (Prelude.Maybe AutoSnapshotAddOnRequest)
addOnRequest_autoSnapshotAddOnRequest :: (Maybe AutoSnapshotAddOnRequest
-> f (Maybe AutoSnapshotAddOnRequest))
-> AddOnRequest -> f AddOnRequest
addOnRequest_autoSnapshotAddOnRequest = (AddOnRequest -> Maybe AutoSnapshotAddOnRequest)
-> (AddOnRequest -> Maybe AutoSnapshotAddOnRequest -> AddOnRequest)
-> Lens
AddOnRequest
AddOnRequest
(Maybe AutoSnapshotAddOnRequest)
(Maybe AutoSnapshotAddOnRequest)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AddOnRequest' {Maybe AutoSnapshotAddOnRequest
autoSnapshotAddOnRequest :: Maybe AutoSnapshotAddOnRequest
$sel:autoSnapshotAddOnRequest:AddOnRequest' :: AddOnRequest -> Maybe AutoSnapshotAddOnRequest
autoSnapshotAddOnRequest} -> Maybe AutoSnapshotAddOnRequest
autoSnapshotAddOnRequest) (\s :: AddOnRequest
s@AddOnRequest' {} Maybe AutoSnapshotAddOnRequest
a -> AddOnRequest
s {$sel:autoSnapshotAddOnRequest:AddOnRequest' :: Maybe AutoSnapshotAddOnRequest
autoSnapshotAddOnRequest = Maybe AutoSnapshotAddOnRequest
a} :: AddOnRequest)
addOnRequest_addOnType :: Lens.Lens' AddOnRequest AddOnType
addOnRequest_addOnType :: (AddOnType -> f AddOnType) -> AddOnRequest -> f AddOnRequest
addOnRequest_addOnType = (AddOnRequest -> AddOnType)
-> (AddOnRequest -> AddOnType -> AddOnRequest)
-> Lens AddOnRequest AddOnRequest AddOnType AddOnType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AddOnRequest' {AddOnType
addOnType :: AddOnType
$sel:addOnType:AddOnRequest' :: AddOnRequest -> AddOnType
addOnType} -> AddOnType
addOnType) (\s :: AddOnRequest
s@AddOnRequest' {} AddOnType
a -> AddOnRequest
s {$sel:addOnType:AddOnRequest' :: AddOnType
addOnType = AddOnType
a} :: AddOnRequest)
instance Prelude.Hashable AddOnRequest
instance Prelude.NFData AddOnRequest
instance Core.ToJSON AddOnRequest where
toJSON :: AddOnRequest -> Value
toJSON AddOnRequest' {Maybe AutoSnapshotAddOnRequest
AddOnType
addOnType :: AddOnType
autoSnapshotAddOnRequest :: Maybe AutoSnapshotAddOnRequest
$sel:addOnType:AddOnRequest' :: AddOnRequest -> AddOnType
$sel:autoSnapshotAddOnRequest:AddOnRequest' :: AddOnRequest -> Maybe AutoSnapshotAddOnRequest
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"autoSnapshotAddOnRequest" Text -> AutoSnapshotAddOnRequest -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(AutoSnapshotAddOnRequest -> Pair)
-> Maybe AutoSnapshotAddOnRequest -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AutoSnapshotAddOnRequest
autoSnapshotAddOnRequest,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"addOnType" Text -> AddOnType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= AddOnType
addOnType)
]
)