{-# 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.CodeArtifact.Types.PackageDependency where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data PackageDependency = PackageDependency'
{
PackageDependency -> Maybe Text
dependencyType :: Prelude.Maybe Prelude.Text,
PackageDependency -> Maybe Text
namespace :: Prelude.Maybe Prelude.Text,
PackageDependency -> Maybe Text
package :: Prelude.Maybe Prelude.Text,
PackageDependency -> Maybe Text
versionRequirement :: Prelude.Maybe Prelude.Text
}
deriving (PackageDependency -> PackageDependency -> Bool
(PackageDependency -> PackageDependency -> Bool)
-> (PackageDependency -> PackageDependency -> Bool)
-> Eq PackageDependency
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PackageDependency -> PackageDependency -> Bool
$c/= :: PackageDependency -> PackageDependency -> Bool
== :: PackageDependency -> PackageDependency -> Bool
$c== :: PackageDependency -> PackageDependency -> Bool
Prelude.Eq, ReadPrec [PackageDependency]
ReadPrec PackageDependency
Int -> ReadS PackageDependency
ReadS [PackageDependency]
(Int -> ReadS PackageDependency)
-> ReadS [PackageDependency]
-> ReadPrec PackageDependency
-> ReadPrec [PackageDependency]
-> Read PackageDependency
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PackageDependency]
$creadListPrec :: ReadPrec [PackageDependency]
readPrec :: ReadPrec PackageDependency
$creadPrec :: ReadPrec PackageDependency
readList :: ReadS [PackageDependency]
$creadList :: ReadS [PackageDependency]
readsPrec :: Int -> ReadS PackageDependency
$creadsPrec :: Int -> ReadS PackageDependency
Prelude.Read, Int -> PackageDependency -> ShowS
[PackageDependency] -> ShowS
PackageDependency -> String
(Int -> PackageDependency -> ShowS)
-> (PackageDependency -> String)
-> ([PackageDependency] -> ShowS)
-> Show PackageDependency
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PackageDependency] -> ShowS
$cshowList :: [PackageDependency] -> ShowS
show :: PackageDependency -> String
$cshow :: PackageDependency -> String
showsPrec :: Int -> PackageDependency -> ShowS
$cshowsPrec :: Int -> PackageDependency -> ShowS
Prelude.Show, (forall x. PackageDependency -> Rep PackageDependency x)
-> (forall x. Rep PackageDependency x -> PackageDependency)
-> Generic PackageDependency
forall x. Rep PackageDependency x -> PackageDependency
forall x. PackageDependency -> Rep PackageDependency x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PackageDependency x -> PackageDependency
$cfrom :: forall x. PackageDependency -> Rep PackageDependency x
Prelude.Generic)
newPackageDependency ::
PackageDependency
newPackageDependency :: PackageDependency
newPackageDependency =
PackageDependency' :: Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Text -> PackageDependency
PackageDependency'
{ $sel:dependencyType:PackageDependency' :: Maybe Text
dependencyType =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:namespace:PackageDependency' :: Maybe Text
namespace = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:package:PackageDependency' :: Maybe Text
package = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:versionRequirement:PackageDependency' :: Maybe Text
versionRequirement = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
packageDependency_dependencyType :: Lens.Lens' PackageDependency (Prelude.Maybe Prelude.Text)
packageDependency_dependencyType :: (Maybe Text -> f (Maybe Text))
-> PackageDependency -> f PackageDependency
packageDependency_dependencyType = (PackageDependency -> Maybe Text)
-> (PackageDependency -> Maybe Text -> PackageDependency)
-> Lens
PackageDependency PackageDependency (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PackageDependency' {Maybe Text
dependencyType :: Maybe Text
$sel:dependencyType:PackageDependency' :: PackageDependency -> Maybe Text
dependencyType} -> Maybe Text
dependencyType) (\s :: PackageDependency
s@PackageDependency' {} Maybe Text
a -> PackageDependency
s {$sel:dependencyType:PackageDependency' :: Maybe Text
dependencyType = Maybe Text
a} :: PackageDependency)
packageDependency_namespace :: Lens.Lens' PackageDependency (Prelude.Maybe Prelude.Text)
packageDependency_namespace :: (Maybe Text -> f (Maybe Text))
-> PackageDependency -> f PackageDependency
packageDependency_namespace = (PackageDependency -> Maybe Text)
-> (PackageDependency -> Maybe Text -> PackageDependency)
-> Lens
PackageDependency PackageDependency (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PackageDependency' {Maybe Text
namespace :: Maybe Text
$sel:namespace:PackageDependency' :: PackageDependency -> Maybe Text
namespace} -> Maybe Text
namespace) (\s :: PackageDependency
s@PackageDependency' {} Maybe Text
a -> PackageDependency
s {$sel:namespace:PackageDependency' :: Maybe Text
namespace = Maybe Text
a} :: PackageDependency)
packageDependency_package :: Lens.Lens' PackageDependency (Prelude.Maybe Prelude.Text)
packageDependency_package :: (Maybe Text -> f (Maybe Text))
-> PackageDependency -> f PackageDependency
packageDependency_package = (PackageDependency -> Maybe Text)
-> (PackageDependency -> Maybe Text -> PackageDependency)
-> Lens
PackageDependency PackageDependency (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PackageDependency' {Maybe Text
package :: Maybe Text
$sel:package:PackageDependency' :: PackageDependency -> Maybe Text
package} -> Maybe Text
package) (\s :: PackageDependency
s@PackageDependency' {} Maybe Text
a -> PackageDependency
s {$sel:package:PackageDependency' :: Maybe Text
package = Maybe Text
a} :: PackageDependency)
packageDependency_versionRequirement :: Lens.Lens' PackageDependency (Prelude.Maybe Prelude.Text)
packageDependency_versionRequirement :: (Maybe Text -> f (Maybe Text))
-> PackageDependency -> f PackageDependency
packageDependency_versionRequirement = (PackageDependency -> Maybe Text)
-> (PackageDependency -> Maybe Text -> PackageDependency)
-> Lens
PackageDependency PackageDependency (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PackageDependency' {Maybe Text
versionRequirement :: Maybe Text
$sel:versionRequirement:PackageDependency' :: PackageDependency -> Maybe Text
versionRequirement} -> Maybe Text
versionRequirement) (\s :: PackageDependency
s@PackageDependency' {} Maybe Text
a -> PackageDependency
s {$sel:versionRequirement:PackageDependency' :: Maybe Text
versionRequirement = Maybe Text
a} :: PackageDependency)
instance Core.FromJSON PackageDependency where
parseJSON :: Value -> Parser PackageDependency
parseJSON =
String
-> (Object -> Parser PackageDependency)
-> Value
-> Parser PackageDependency
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"PackageDependency"
( \Object
x ->
Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Text -> PackageDependency
PackageDependency'
(Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Text -> PackageDependency)
-> Parser (Maybe Text)
-> Parser
(Maybe Text -> Maybe Text -> Maybe Text -> PackageDependency)
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
"dependencyType")
Parser
(Maybe Text -> Maybe Text -> Maybe Text -> PackageDependency)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> PackageDependency)
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
"namespace")
Parser (Maybe Text -> Maybe Text -> PackageDependency)
-> Parser (Maybe Text) -> Parser (Maybe Text -> PackageDependency)
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
"package")
Parser (Maybe Text -> PackageDependency)
-> Parser (Maybe Text) -> Parser PackageDependency
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
"versionRequirement")
)
instance Prelude.Hashable PackageDependency
instance Prelude.NFData PackageDependency