{-# 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.Backup.Types.AdvancedBackupSetting where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data AdvancedBackupSetting = AdvancedBackupSetting'
{
AdvancedBackupSetting -> Maybe Text
resourceType :: Prelude.Maybe Prelude.Text,
AdvancedBackupSetting -> Maybe (HashMap Text Text)
backupOptions :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text)
}
deriving (AdvancedBackupSetting -> AdvancedBackupSetting -> Bool
(AdvancedBackupSetting -> AdvancedBackupSetting -> Bool)
-> (AdvancedBackupSetting -> AdvancedBackupSetting -> Bool)
-> Eq AdvancedBackupSetting
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AdvancedBackupSetting -> AdvancedBackupSetting -> Bool
$c/= :: AdvancedBackupSetting -> AdvancedBackupSetting -> Bool
== :: AdvancedBackupSetting -> AdvancedBackupSetting -> Bool
$c== :: AdvancedBackupSetting -> AdvancedBackupSetting -> Bool
Prelude.Eq, ReadPrec [AdvancedBackupSetting]
ReadPrec AdvancedBackupSetting
Int -> ReadS AdvancedBackupSetting
ReadS [AdvancedBackupSetting]
(Int -> ReadS AdvancedBackupSetting)
-> ReadS [AdvancedBackupSetting]
-> ReadPrec AdvancedBackupSetting
-> ReadPrec [AdvancedBackupSetting]
-> Read AdvancedBackupSetting
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AdvancedBackupSetting]
$creadListPrec :: ReadPrec [AdvancedBackupSetting]
readPrec :: ReadPrec AdvancedBackupSetting
$creadPrec :: ReadPrec AdvancedBackupSetting
readList :: ReadS [AdvancedBackupSetting]
$creadList :: ReadS [AdvancedBackupSetting]
readsPrec :: Int -> ReadS AdvancedBackupSetting
$creadsPrec :: Int -> ReadS AdvancedBackupSetting
Prelude.Read, Int -> AdvancedBackupSetting -> ShowS
[AdvancedBackupSetting] -> ShowS
AdvancedBackupSetting -> String
(Int -> AdvancedBackupSetting -> ShowS)
-> (AdvancedBackupSetting -> String)
-> ([AdvancedBackupSetting] -> ShowS)
-> Show AdvancedBackupSetting
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AdvancedBackupSetting] -> ShowS
$cshowList :: [AdvancedBackupSetting] -> ShowS
show :: AdvancedBackupSetting -> String
$cshow :: AdvancedBackupSetting -> String
showsPrec :: Int -> AdvancedBackupSetting -> ShowS
$cshowsPrec :: Int -> AdvancedBackupSetting -> ShowS
Prelude.Show, (forall x. AdvancedBackupSetting -> Rep AdvancedBackupSetting x)
-> (forall x. Rep AdvancedBackupSetting x -> AdvancedBackupSetting)
-> Generic AdvancedBackupSetting
forall x. Rep AdvancedBackupSetting x -> AdvancedBackupSetting
forall x. AdvancedBackupSetting -> Rep AdvancedBackupSetting x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AdvancedBackupSetting x -> AdvancedBackupSetting
$cfrom :: forall x. AdvancedBackupSetting -> Rep AdvancedBackupSetting x
Prelude.Generic)
newAdvancedBackupSetting ::
AdvancedBackupSetting
newAdvancedBackupSetting :: AdvancedBackupSetting
newAdvancedBackupSetting =
AdvancedBackupSetting' :: Maybe Text -> Maybe (HashMap Text Text) -> AdvancedBackupSetting
AdvancedBackupSetting'
{ $sel:resourceType:AdvancedBackupSetting' :: Maybe Text
resourceType =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:backupOptions:AdvancedBackupSetting' :: Maybe (HashMap Text Text)
backupOptions = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing
}
advancedBackupSetting_resourceType :: Lens.Lens' AdvancedBackupSetting (Prelude.Maybe Prelude.Text)
advancedBackupSetting_resourceType :: (Maybe Text -> f (Maybe Text))
-> AdvancedBackupSetting -> f AdvancedBackupSetting
advancedBackupSetting_resourceType = (AdvancedBackupSetting -> Maybe Text)
-> (AdvancedBackupSetting -> Maybe Text -> AdvancedBackupSetting)
-> Lens
AdvancedBackupSetting
AdvancedBackupSetting
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AdvancedBackupSetting' {Maybe Text
resourceType :: Maybe Text
$sel:resourceType:AdvancedBackupSetting' :: AdvancedBackupSetting -> Maybe Text
resourceType} -> Maybe Text
resourceType) (\s :: AdvancedBackupSetting
s@AdvancedBackupSetting' {} Maybe Text
a -> AdvancedBackupSetting
s {$sel:resourceType:AdvancedBackupSetting' :: Maybe Text
resourceType = Maybe Text
a} :: AdvancedBackupSetting)
advancedBackupSetting_backupOptions :: Lens.Lens' AdvancedBackupSetting (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
advancedBackupSetting_backupOptions :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> AdvancedBackupSetting -> f AdvancedBackupSetting
advancedBackupSetting_backupOptions = (AdvancedBackupSetting -> Maybe (HashMap Text Text))
-> (AdvancedBackupSetting
-> Maybe (HashMap Text Text) -> AdvancedBackupSetting)
-> Lens
AdvancedBackupSetting
AdvancedBackupSetting
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AdvancedBackupSetting' {Maybe (HashMap Text Text)
backupOptions :: Maybe (HashMap Text Text)
$sel:backupOptions:AdvancedBackupSetting' :: AdvancedBackupSetting -> Maybe (HashMap Text Text)
backupOptions} -> Maybe (HashMap Text Text)
backupOptions) (\s :: AdvancedBackupSetting
s@AdvancedBackupSetting' {} Maybe (HashMap Text Text)
a -> AdvancedBackupSetting
s {$sel:backupOptions:AdvancedBackupSetting' :: Maybe (HashMap Text Text)
backupOptions = Maybe (HashMap Text Text)
a} :: AdvancedBackupSetting) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> AdvancedBackupSetting -> f AdvancedBackupSetting)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> AdvancedBackupSetting
-> f AdvancedBackupSetting
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
-> Iso
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.FromJSON AdvancedBackupSetting where
parseJSON :: Value -> Parser AdvancedBackupSetting
parseJSON =
String
-> (Object -> Parser AdvancedBackupSetting)
-> Value
-> Parser AdvancedBackupSetting
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"AdvancedBackupSetting"
( \Object
x ->
Maybe Text -> Maybe (HashMap Text Text) -> AdvancedBackupSetting
AdvancedBackupSetting'
(Maybe Text -> Maybe (HashMap Text Text) -> AdvancedBackupSetting)
-> Parser (Maybe Text)
-> Parser (Maybe (HashMap Text Text) -> AdvancedBackupSetting)
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
"ResourceType")
Parser (Maybe (HashMap Text Text) -> AdvancedBackupSetting)
-> Parser (Maybe (HashMap Text Text))
-> Parser AdvancedBackupSetting
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe (HashMap Text Text)))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"BackupOptions" Parser (Maybe (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> Parser (Maybe (HashMap Text Text))
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe (HashMap Text Text)
forall a. Monoid a => a
Prelude.mempty)
)
instance Prelude.Hashable AdvancedBackupSetting
instance Prelude.NFData AdvancedBackupSetting
instance Core.ToJSON AdvancedBackupSetting where
toJSON :: AdvancedBackupSetting -> Value
toJSON AdvancedBackupSetting' {Maybe Text
Maybe (HashMap Text Text)
backupOptions :: Maybe (HashMap Text Text)
resourceType :: Maybe Text
$sel:backupOptions:AdvancedBackupSetting' :: AdvancedBackupSetting -> Maybe (HashMap Text Text)
$sel:resourceType:AdvancedBackupSetting' :: AdvancedBackupSetting -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"ResourceType" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
resourceType,
(Text
"BackupOptions" Text -> HashMap Text Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (HashMap Text Text -> Pair)
-> Maybe (HashMap Text Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
backupOptions
]
)