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