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