{-# 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.Panorama.Types.PackageObject where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data PackageObject = PackageObject'
{
PackageObject -> Text
name :: Prelude.Text,
PackageObject -> Text
packageVersion :: Prelude.Text,
PackageObject -> Text
patchVersion :: Prelude.Text
}
deriving (PackageObject -> PackageObject -> Bool
(PackageObject -> PackageObject -> Bool)
-> (PackageObject -> PackageObject -> Bool) -> Eq PackageObject
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PackageObject -> PackageObject -> Bool
$c/= :: PackageObject -> PackageObject -> Bool
== :: PackageObject -> PackageObject -> Bool
$c== :: PackageObject -> PackageObject -> Bool
Prelude.Eq, ReadPrec [PackageObject]
ReadPrec PackageObject
Int -> ReadS PackageObject
ReadS [PackageObject]
(Int -> ReadS PackageObject)
-> ReadS [PackageObject]
-> ReadPrec PackageObject
-> ReadPrec [PackageObject]
-> Read PackageObject
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PackageObject]
$creadListPrec :: ReadPrec [PackageObject]
readPrec :: ReadPrec PackageObject
$creadPrec :: ReadPrec PackageObject
readList :: ReadS [PackageObject]
$creadList :: ReadS [PackageObject]
readsPrec :: Int -> ReadS PackageObject
$creadsPrec :: Int -> ReadS PackageObject
Prelude.Read, Int -> PackageObject -> ShowS
[PackageObject] -> ShowS
PackageObject -> String
(Int -> PackageObject -> ShowS)
-> (PackageObject -> String)
-> ([PackageObject] -> ShowS)
-> Show PackageObject
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PackageObject] -> ShowS
$cshowList :: [PackageObject] -> ShowS
show :: PackageObject -> String
$cshow :: PackageObject -> String
showsPrec :: Int -> PackageObject -> ShowS
$cshowsPrec :: Int -> PackageObject -> ShowS
Prelude.Show, (forall x. PackageObject -> Rep PackageObject x)
-> (forall x. Rep PackageObject x -> PackageObject)
-> Generic PackageObject
forall x. Rep PackageObject x -> PackageObject
forall x. PackageObject -> Rep PackageObject x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PackageObject x -> PackageObject
$cfrom :: forall x. PackageObject -> Rep PackageObject x
Prelude.Generic)
newPackageObject ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
PackageObject
newPackageObject :: Text -> Text -> Text -> PackageObject
newPackageObject
Text
pName_
Text
pPackageVersion_
Text
pPatchVersion_ =
PackageObject' :: Text -> Text -> Text -> PackageObject
PackageObject'
{ $sel:name:PackageObject' :: Text
name = Text
pName_,
$sel:packageVersion:PackageObject' :: Text
packageVersion = Text
pPackageVersion_,
$sel:patchVersion:PackageObject' :: Text
patchVersion = Text
pPatchVersion_
}
packageObject_name :: Lens.Lens' PackageObject Prelude.Text
packageObject_name :: (Text -> f Text) -> PackageObject -> f PackageObject
packageObject_name = (PackageObject -> Text)
-> (PackageObject -> Text -> PackageObject)
-> Lens PackageObject PackageObject Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PackageObject' {Text
name :: Text
$sel:name:PackageObject' :: PackageObject -> Text
name} -> Text
name) (\s :: PackageObject
s@PackageObject' {} Text
a -> PackageObject
s {$sel:name:PackageObject' :: Text
name = Text
a} :: PackageObject)
packageObject_packageVersion :: Lens.Lens' PackageObject Prelude.Text
packageObject_packageVersion :: (Text -> f Text) -> PackageObject -> f PackageObject
packageObject_packageVersion = (PackageObject -> Text)
-> (PackageObject -> Text -> PackageObject)
-> Lens PackageObject PackageObject Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PackageObject' {Text
packageVersion :: Text
$sel:packageVersion:PackageObject' :: PackageObject -> Text
packageVersion} -> Text
packageVersion) (\s :: PackageObject
s@PackageObject' {} Text
a -> PackageObject
s {$sel:packageVersion:PackageObject' :: Text
packageVersion = Text
a} :: PackageObject)
packageObject_patchVersion :: Lens.Lens' PackageObject Prelude.Text
packageObject_patchVersion :: (Text -> f Text) -> PackageObject -> f PackageObject
packageObject_patchVersion = (PackageObject -> Text)
-> (PackageObject -> Text -> PackageObject)
-> Lens PackageObject PackageObject Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PackageObject' {Text
patchVersion :: Text
$sel:patchVersion:PackageObject' :: PackageObject -> Text
patchVersion} -> Text
patchVersion) (\s :: PackageObject
s@PackageObject' {} Text
a -> PackageObject
s {$sel:patchVersion:PackageObject' :: Text
patchVersion = Text
a} :: PackageObject)
instance Core.FromJSON PackageObject where
parseJSON :: Value -> Parser PackageObject
parseJSON =
String
-> (Object -> Parser PackageObject)
-> Value
-> Parser PackageObject
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"PackageObject"
( \Object
x ->
Text -> Text -> Text -> PackageObject
PackageObject'
(Text -> Text -> Text -> PackageObject)
-> Parser Text -> Parser (Text -> Text -> PackageObject)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"Name")
Parser (Text -> Text -> PackageObject)
-> Parser Text -> Parser (Text -> PackageObject)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"PackageVersion")
Parser (Text -> PackageObject)
-> Parser Text -> Parser PackageObject
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"PatchVersion")
)
instance Prelude.Hashable PackageObject
instance Prelude.NFData PackageObject