{-# 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.Greengrass.Types.LocalVolumeResourceData where
import qualified Amazonka.Core as Core
import Amazonka.Greengrass.Types.GroupOwnerSetting
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data LocalVolumeResourceData = LocalVolumeResourceData'
{
LocalVolumeResourceData -> Maybe GroupOwnerSetting
groupOwnerSetting :: Prelude.Maybe GroupOwnerSetting,
LocalVolumeResourceData -> Maybe Text
destinationPath :: Prelude.Maybe Prelude.Text,
LocalVolumeResourceData -> Maybe Text
sourcePath :: Prelude.Maybe Prelude.Text
}
deriving (LocalVolumeResourceData -> LocalVolumeResourceData -> Bool
(LocalVolumeResourceData -> LocalVolumeResourceData -> Bool)
-> (LocalVolumeResourceData -> LocalVolumeResourceData -> Bool)
-> Eq LocalVolumeResourceData
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LocalVolumeResourceData -> LocalVolumeResourceData -> Bool
$c/= :: LocalVolumeResourceData -> LocalVolumeResourceData -> Bool
== :: LocalVolumeResourceData -> LocalVolumeResourceData -> Bool
$c== :: LocalVolumeResourceData -> LocalVolumeResourceData -> Bool
Prelude.Eq, ReadPrec [LocalVolumeResourceData]
ReadPrec LocalVolumeResourceData
Int -> ReadS LocalVolumeResourceData
ReadS [LocalVolumeResourceData]
(Int -> ReadS LocalVolumeResourceData)
-> ReadS [LocalVolumeResourceData]
-> ReadPrec LocalVolumeResourceData
-> ReadPrec [LocalVolumeResourceData]
-> Read LocalVolumeResourceData
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [LocalVolumeResourceData]
$creadListPrec :: ReadPrec [LocalVolumeResourceData]
readPrec :: ReadPrec LocalVolumeResourceData
$creadPrec :: ReadPrec LocalVolumeResourceData
readList :: ReadS [LocalVolumeResourceData]
$creadList :: ReadS [LocalVolumeResourceData]
readsPrec :: Int -> ReadS LocalVolumeResourceData
$creadsPrec :: Int -> ReadS LocalVolumeResourceData
Prelude.Read, Int -> LocalVolumeResourceData -> ShowS
[LocalVolumeResourceData] -> ShowS
LocalVolumeResourceData -> String
(Int -> LocalVolumeResourceData -> ShowS)
-> (LocalVolumeResourceData -> String)
-> ([LocalVolumeResourceData] -> ShowS)
-> Show LocalVolumeResourceData
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LocalVolumeResourceData] -> ShowS
$cshowList :: [LocalVolumeResourceData] -> ShowS
show :: LocalVolumeResourceData -> String
$cshow :: LocalVolumeResourceData -> String
showsPrec :: Int -> LocalVolumeResourceData -> ShowS
$cshowsPrec :: Int -> LocalVolumeResourceData -> ShowS
Prelude.Show, (forall x.
LocalVolumeResourceData -> Rep LocalVolumeResourceData x)
-> (forall x.
Rep LocalVolumeResourceData x -> LocalVolumeResourceData)
-> Generic LocalVolumeResourceData
forall x. Rep LocalVolumeResourceData x -> LocalVolumeResourceData
forall x. LocalVolumeResourceData -> Rep LocalVolumeResourceData x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep LocalVolumeResourceData x -> LocalVolumeResourceData
$cfrom :: forall x. LocalVolumeResourceData -> Rep LocalVolumeResourceData x
Prelude.Generic)
newLocalVolumeResourceData ::
LocalVolumeResourceData
newLocalVolumeResourceData :: LocalVolumeResourceData
newLocalVolumeResourceData =
LocalVolumeResourceData' :: Maybe GroupOwnerSetting
-> Maybe Text -> Maybe Text -> LocalVolumeResourceData
LocalVolumeResourceData'
{ $sel:groupOwnerSetting:LocalVolumeResourceData' :: Maybe GroupOwnerSetting
groupOwnerSetting =
Maybe GroupOwnerSetting
forall a. Maybe a
Prelude.Nothing,
$sel:destinationPath:LocalVolumeResourceData' :: Maybe Text
destinationPath = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:sourcePath:LocalVolumeResourceData' :: Maybe Text
sourcePath = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
localVolumeResourceData_groupOwnerSetting :: Lens.Lens' LocalVolumeResourceData (Prelude.Maybe GroupOwnerSetting)
localVolumeResourceData_groupOwnerSetting :: (Maybe GroupOwnerSetting -> f (Maybe GroupOwnerSetting))
-> LocalVolumeResourceData -> f LocalVolumeResourceData
localVolumeResourceData_groupOwnerSetting = (LocalVolumeResourceData -> Maybe GroupOwnerSetting)
-> (LocalVolumeResourceData
-> Maybe GroupOwnerSetting -> LocalVolumeResourceData)
-> Lens
LocalVolumeResourceData
LocalVolumeResourceData
(Maybe GroupOwnerSetting)
(Maybe GroupOwnerSetting)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LocalVolumeResourceData' {Maybe GroupOwnerSetting
groupOwnerSetting :: Maybe GroupOwnerSetting
$sel:groupOwnerSetting:LocalVolumeResourceData' :: LocalVolumeResourceData -> Maybe GroupOwnerSetting
groupOwnerSetting} -> Maybe GroupOwnerSetting
groupOwnerSetting) (\s :: LocalVolumeResourceData
s@LocalVolumeResourceData' {} Maybe GroupOwnerSetting
a -> LocalVolumeResourceData
s {$sel:groupOwnerSetting:LocalVolumeResourceData' :: Maybe GroupOwnerSetting
groupOwnerSetting = Maybe GroupOwnerSetting
a} :: LocalVolumeResourceData)
localVolumeResourceData_destinationPath :: Lens.Lens' LocalVolumeResourceData (Prelude.Maybe Prelude.Text)
localVolumeResourceData_destinationPath :: (Maybe Text -> f (Maybe Text))
-> LocalVolumeResourceData -> f LocalVolumeResourceData
localVolumeResourceData_destinationPath = (LocalVolumeResourceData -> Maybe Text)
-> (LocalVolumeResourceData
-> Maybe Text -> LocalVolumeResourceData)
-> Lens
LocalVolumeResourceData
LocalVolumeResourceData
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LocalVolumeResourceData' {Maybe Text
destinationPath :: Maybe Text
$sel:destinationPath:LocalVolumeResourceData' :: LocalVolumeResourceData -> Maybe Text
destinationPath} -> Maybe Text
destinationPath) (\s :: LocalVolumeResourceData
s@LocalVolumeResourceData' {} Maybe Text
a -> LocalVolumeResourceData
s {$sel:destinationPath:LocalVolumeResourceData' :: Maybe Text
destinationPath = Maybe Text
a} :: LocalVolumeResourceData)
localVolumeResourceData_sourcePath :: Lens.Lens' LocalVolumeResourceData (Prelude.Maybe Prelude.Text)
localVolumeResourceData_sourcePath :: (Maybe Text -> f (Maybe Text))
-> LocalVolumeResourceData -> f LocalVolumeResourceData
localVolumeResourceData_sourcePath = (LocalVolumeResourceData -> Maybe Text)
-> (LocalVolumeResourceData
-> Maybe Text -> LocalVolumeResourceData)
-> Lens
LocalVolumeResourceData
LocalVolumeResourceData
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LocalVolumeResourceData' {Maybe Text
sourcePath :: Maybe Text
$sel:sourcePath:LocalVolumeResourceData' :: LocalVolumeResourceData -> Maybe Text
sourcePath} -> Maybe Text
sourcePath) (\s :: LocalVolumeResourceData
s@LocalVolumeResourceData' {} Maybe Text
a -> LocalVolumeResourceData
s {$sel:sourcePath:LocalVolumeResourceData' :: Maybe Text
sourcePath = Maybe Text
a} :: LocalVolumeResourceData)
instance Core.FromJSON LocalVolumeResourceData where
parseJSON :: Value -> Parser LocalVolumeResourceData
parseJSON =
String
-> (Object -> Parser LocalVolumeResourceData)
-> Value
-> Parser LocalVolumeResourceData
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"LocalVolumeResourceData"
( \Object
x ->
Maybe GroupOwnerSetting
-> Maybe Text -> Maybe Text -> LocalVolumeResourceData
LocalVolumeResourceData'
(Maybe GroupOwnerSetting
-> Maybe Text -> Maybe Text -> LocalVolumeResourceData)
-> Parser (Maybe GroupOwnerSetting)
-> Parser (Maybe Text -> Maybe Text -> LocalVolumeResourceData)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe GroupOwnerSetting)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"GroupOwnerSetting")
Parser (Maybe Text -> Maybe Text -> LocalVolumeResourceData)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> LocalVolumeResourceData)
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
"DestinationPath")
Parser (Maybe Text -> LocalVolumeResourceData)
-> Parser (Maybe Text) -> Parser LocalVolumeResourceData
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
"SourcePath")
)
instance Prelude.Hashable LocalVolumeResourceData
instance Prelude.NFData LocalVolumeResourceData
instance Core.ToJSON LocalVolumeResourceData where
toJSON :: LocalVolumeResourceData -> Value
toJSON LocalVolumeResourceData' {Maybe Text
Maybe GroupOwnerSetting
sourcePath :: Maybe Text
destinationPath :: Maybe Text
groupOwnerSetting :: Maybe GroupOwnerSetting
$sel:sourcePath:LocalVolumeResourceData' :: LocalVolumeResourceData -> Maybe Text
$sel:destinationPath:LocalVolumeResourceData' :: LocalVolumeResourceData -> Maybe Text
$sel:groupOwnerSetting:LocalVolumeResourceData' :: LocalVolumeResourceData -> Maybe GroupOwnerSetting
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"GroupOwnerSetting" Text -> GroupOwnerSetting -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(GroupOwnerSetting -> Pair)
-> Maybe GroupOwnerSetting -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe GroupOwnerSetting
groupOwnerSetting,
(Text
"DestinationPath" 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
destinationPath,
(Text
"SourcePath" 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
sourcePath
]
)