{-# 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.FSx.Types.CompletionReport where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.FSx.Types.ReportFormat
import Amazonka.FSx.Types.ReportScope
import qualified Amazonka.Prelude as Prelude
data CompletionReport = CompletionReport'
{
CompletionReport -> Maybe ReportFormat
format :: Prelude.Maybe ReportFormat,
CompletionReport -> Maybe Text
path :: Prelude.Maybe Prelude.Text,
CompletionReport -> Maybe ReportScope
scope :: Prelude.Maybe ReportScope,
CompletionReport -> Bool
enabled :: Prelude.Bool
}
deriving (CompletionReport -> CompletionReport -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CompletionReport -> CompletionReport -> Bool
$c/= :: CompletionReport -> CompletionReport -> Bool
== :: CompletionReport -> CompletionReport -> Bool
$c== :: CompletionReport -> CompletionReport -> Bool
Prelude.Eq, ReadPrec [CompletionReport]
ReadPrec CompletionReport
Int -> ReadS CompletionReport
ReadS [CompletionReport]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CompletionReport]
$creadListPrec :: ReadPrec [CompletionReport]
readPrec :: ReadPrec CompletionReport
$creadPrec :: ReadPrec CompletionReport
readList :: ReadS [CompletionReport]
$creadList :: ReadS [CompletionReport]
readsPrec :: Int -> ReadS CompletionReport
$creadsPrec :: Int -> ReadS CompletionReport
Prelude.Read, Int -> CompletionReport -> ShowS
[CompletionReport] -> ShowS
CompletionReport -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CompletionReport] -> ShowS
$cshowList :: [CompletionReport] -> ShowS
show :: CompletionReport -> String
$cshow :: CompletionReport -> String
showsPrec :: Int -> CompletionReport -> ShowS
$cshowsPrec :: Int -> CompletionReport -> ShowS
Prelude.Show, forall x. Rep CompletionReport x -> CompletionReport
forall x. CompletionReport -> Rep CompletionReport x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CompletionReport x -> CompletionReport
$cfrom :: forall x. CompletionReport -> Rep CompletionReport x
Prelude.Generic)
newCompletionReport ::
Prelude.Bool ->
CompletionReport
newCompletionReport :: Bool -> CompletionReport
newCompletionReport Bool
pEnabled_ =
CompletionReport'
{ $sel:format:CompletionReport' :: Maybe ReportFormat
format = forall a. Maybe a
Prelude.Nothing,
$sel:path:CompletionReport' :: Maybe Text
path = forall a. Maybe a
Prelude.Nothing,
$sel:scope:CompletionReport' :: Maybe ReportScope
scope = forall a. Maybe a
Prelude.Nothing,
$sel:enabled:CompletionReport' :: Bool
enabled = Bool
pEnabled_
}
completionReport_format :: Lens.Lens' CompletionReport (Prelude.Maybe ReportFormat)
completionReport_format :: Lens' CompletionReport (Maybe ReportFormat)
completionReport_format = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CompletionReport' {Maybe ReportFormat
format :: Maybe ReportFormat
$sel:format:CompletionReport' :: CompletionReport -> Maybe ReportFormat
format} -> Maybe ReportFormat
format) (\s :: CompletionReport
s@CompletionReport' {} Maybe ReportFormat
a -> CompletionReport
s {$sel:format:CompletionReport' :: Maybe ReportFormat
format = Maybe ReportFormat
a} :: CompletionReport)
completionReport_path :: Lens.Lens' CompletionReport (Prelude.Maybe Prelude.Text)
completionReport_path :: Lens' CompletionReport (Maybe Text)
completionReport_path = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CompletionReport' {Maybe Text
path :: Maybe Text
$sel:path:CompletionReport' :: CompletionReport -> Maybe Text
path} -> Maybe Text
path) (\s :: CompletionReport
s@CompletionReport' {} Maybe Text
a -> CompletionReport
s {$sel:path:CompletionReport' :: Maybe Text
path = Maybe Text
a} :: CompletionReport)
completionReport_scope :: Lens.Lens' CompletionReport (Prelude.Maybe ReportScope)
completionReport_scope :: Lens' CompletionReport (Maybe ReportScope)
completionReport_scope = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CompletionReport' {Maybe ReportScope
scope :: Maybe ReportScope
$sel:scope:CompletionReport' :: CompletionReport -> Maybe ReportScope
scope} -> Maybe ReportScope
scope) (\s :: CompletionReport
s@CompletionReport' {} Maybe ReportScope
a -> CompletionReport
s {$sel:scope:CompletionReport' :: Maybe ReportScope
scope = Maybe ReportScope
a} :: CompletionReport)
completionReport_enabled :: Lens.Lens' CompletionReport Prelude.Bool
completionReport_enabled :: Lens' CompletionReport Bool
completionReport_enabled = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CompletionReport' {Bool
enabled :: Bool
$sel:enabled:CompletionReport' :: CompletionReport -> Bool
enabled} -> Bool
enabled) (\s :: CompletionReport
s@CompletionReport' {} Bool
a -> CompletionReport
s {$sel:enabled:CompletionReport' :: Bool
enabled = Bool
a} :: CompletionReport)
instance Data.FromJSON CompletionReport where
parseJSON :: Value -> Parser CompletionReport
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"CompletionReport"
( \Object
x ->
Maybe ReportFormat
-> Maybe Text -> Maybe ReportScope -> Bool -> CompletionReport
CompletionReport'
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
"Format")
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
"Path")
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
"Scope")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"Enabled")
)
instance Prelude.Hashable CompletionReport where
hashWithSalt :: Int -> CompletionReport -> Int
hashWithSalt Int
_salt CompletionReport' {Bool
Maybe Text
Maybe ReportFormat
Maybe ReportScope
enabled :: Bool
scope :: Maybe ReportScope
path :: Maybe Text
format :: Maybe ReportFormat
$sel:enabled:CompletionReport' :: CompletionReport -> Bool
$sel:scope:CompletionReport' :: CompletionReport -> Maybe ReportScope
$sel:path:CompletionReport' :: CompletionReport -> Maybe Text
$sel:format:CompletionReport' :: CompletionReport -> Maybe ReportFormat
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ReportFormat
format
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
path
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ReportScope
scope
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Bool
enabled
instance Prelude.NFData CompletionReport where
rnf :: CompletionReport -> ()
rnf CompletionReport' {Bool
Maybe Text
Maybe ReportFormat
Maybe ReportScope
enabled :: Bool
scope :: Maybe ReportScope
path :: Maybe Text
format :: Maybe ReportFormat
$sel:enabled:CompletionReport' :: CompletionReport -> Bool
$sel:scope:CompletionReport' :: CompletionReport -> Maybe ReportScope
$sel:path:CompletionReport' :: CompletionReport -> Maybe Text
$sel:format:CompletionReport' :: CompletionReport -> Maybe ReportFormat
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe ReportFormat
format
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
path
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ReportScope
scope
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Bool
enabled
instance Data.ToJSON CompletionReport where
toJSON :: CompletionReport -> Value
toJSON CompletionReport' {Bool
Maybe Text
Maybe ReportFormat
Maybe ReportScope
enabled :: Bool
scope :: Maybe ReportScope
path :: Maybe Text
format :: Maybe ReportFormat
$sel:enabled:CompletionReport' :: CompletionReport -> Bool
$sel:scope:CompletionReport' :: CompletionReport -> Maybe ReportScope
$sel:path:CompletionReport' :: CompletionReport -> Maybe Text
$sel:format:CompletionReport' :: CompletionReport -> Maybe ReportFormat
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"Format" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ReportFormat
format,
(Key
"Path" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
path,
(Key
"Scope" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ReportScope
scope,
forall a. a -> Maybe a
Prelude.Just (Key
"Enabled" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Bool
enabled)
]
)