{-# 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.M2.Types.Definition where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data Definition = Definition'
{
Definition -> Maybe Text
content :: Prelude.Maybe Prelude.Text,
Definition -> Maybe Text
s3Location :: Prelude.Maybe Prelude.Text
}
deriving (Definition -> Definition -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Definition -> Definition -> Bool
$c/= :: Definition -> Definition -> Bool
== :: Definition -> Definition -> Bool
$c== :: Definition -> Definition -> Bool
Prelude.Eq, ReadPrec [Definition]
ReadPrec Definition
Int -> ReadS Definition
ReadS [Definition]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Definition]
$creadListPrec :: ReadPrec [Definition]
readPrec :: ReadPrec Definition
$creadPrec :: ReadPrec Definition
readList :: ReadS [Definition]
$creadList :: ReadS [Definition]
readsPrec :: Int -> ReadS Definition
$creadsPrec :: Int -> ReadS Definition
Prelude.Read, Int -> Definition -> ShowS
[Definition] -> ShowS
Definition -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Definition] -> ShowS
$cshowList :: [Definition] -> ShowS
show :: Definition -> String
$cshow :: Definition -> String
showsPrec :: Int -> Definition -> ShowS
$cshowsPrec :: Int -> Definition -> ShowS
Prelude.Show, forall x. Rep Definition x -> Definition
forall x. Definition -> Rep Definition x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Definition x -> Definition
$cfrom :: forall x. Definition -> Rep Definition x
Prelude.Generic)
newDefinition ::
Definition
newDefinition :: Definition
newDefinition =
Definition'
{ $sel:content:Definition' :: Maybe Text
content = forall a. Maybe a
Prelude.Nothing,
$sel:s3Location:Definition' :: Maybe Text
s3Location = forall a. Maybe a
Prelude.Nothing
}
definition_content :: Lens.Lens' Definition (Prelude.Maybe Prelude.Text)
definition_content :: Lens' Definition (Maybe Text)
definition_content = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Definition' {Maybe Text
content :: Maybe Text
$sel:content:Definition' :: Definition -> Maybe Text
content} -> Maybe Text
content) (\s :: Definition
s@Definition' {} Maybe Text
a -> Definition
s {$sel:content:Definition' :: Maybe Text
content = Maybe Text
a} :: Definition)
definition_s3Location :: Lens.Lens' Definition (Prelude.Maybe Prelude.Text)
definition_s3Location :: Lens' Definition (Maybe Text)
definition_s3Location = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Definition' {Maybe Text
s3Location :: Maybe Text
$sel:s3Location:Definition' :: Definition -> Maybe Text
s3Location} -> Maybe Text
s3Location) (\s :: Definition
s@Definition' {} Maybe Text
a -> Definition
s {$sel:s3Location:Definition' :: Maybe Text
s3Location = Maybe Text
a} :: Definition)
instance Prelude.Hashable Definition where
hashWithSalt :: Int -> Definition -> Int
hashWithSalt Int
_salt Definition' {Maybe Text
s3Location :: Maybe Text
content :: Maybe Text
$sel:s3Location:Definition' :: Definition -> Maybe Text
$sel:content:Definition' :: Definition -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
content
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
s3Location
instance Prelude.NFData Definition where
rnf :: Definition -> ()
rnf Definition' {Maybe Text
s3Location :: Maybe Text
content :: Maybe Text
$sel:s3Location:Definition' :: Definition -> Maybe Text
$sel:content:Definition' :: Definition -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
content
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
s3Location
instance Data.ToJSON Definition where
toJSON :: Definition -> Value
toJSON Definition' {Maybe Text
s3Location :: Maybe Text
content :: Maybe Text
$sel:s3Location:Definition' :: Definition -> Maybe Text
$sel:content:Definition' :: Definition -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"content" 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
content,
(Key
"s3Location" 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
s3Location
]
)