{-# 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.PackageVersionSummary where
import Amazonka.CodeArtifact.Types.PackageVersionStatus
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data PackageVersionSummary = PackageVersionSummary'
{
PackageVersionSummary -> Maybe Text
revision :: Prelude.Maybe Prelude.Text,
PackageVersionSummary -> Text
version :: Prelude.Text,
PackageVersionSummary -> PackageVersionStatus
status :: PackageVersionStatus
}
deriving (PackageVersionSummary -> PackageVersionSummary -> Bool
(PackageVersionSummary -> PackageVersionSummary -> Bool)
-> (PackageVersionSummary -> PackageVersionSummary -> Bool)
-> Eq PackageVersionSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PackageVersionSummary -> PackageVersionSummary -> Bool
$c/= :: PackageVersionSummary -> PackageVersionSummary -> Bool
== :: PackageVersionSummary -> PackageVersionSummary -> Bool
$c== :: PackageVersionSummary -> PackageVersionSummary -> Bool
Prelude.Eq, ReadPrec [PackageVersionSummary]
ReadPrec PackageVersionSummary
Int -> ReadS PackageVersionSummary
ReadS [PackageVersionSummary]
(Int -> ReadS PackageVersionSummary)
-> ReadS [PackageVersionSummary]
-> ReadPrec PackageVersionSummary
-> ReadPrec [PackageVersionSummary]
-> Read PackageVersionSummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PackageVersionSummary]
$creadListPrec :: ReadPrec [PackageVersionSummary]
readPrec :: ReadPrec PackageVersionSummary
$creadPrec :: ReadPrec PackageVersionSummary
readList :: ReadS [PackageVersionSummary]
$creadList :: ReadS [PackageVersionSummary]
readsPrec :: Int -> ReadS PackageVersionSummary
$creadsPrec :: Int -> ReadS PackageVersionSummary
Prelude.Read, Int -> PackageVersionSummary -> ShowS
[PackageVersionSummary] -> ShowS
PackageVersionSummary -> String
(Int -> PackageVersionSummary -> ShowS)
-> (PackageVersionSummary -> String)
-> ([PackageVersionSummary] -> ShowS)
-> Show PackageVersionSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PackageVersionSummary] -> ShowS
$cshowList :: [PackageVersionSummary] -> ShowS
show :: PackageVersionSummary -> String
$cshow :: PackageVersionSummary -> String
showsPrec :: Int -> PackageVersionSummary -> ShowS
$cshowsPrec :: Int -> PackageVersionSummary -> ShowS
Prelude.Show, (forall x. PackageVersionSummary -> Rep PackageVersionSummary x)
-> (forall x. Rep PackageVersionSummary x -> PackageVersionSummary)
-> Generic PackageVersionSummary
forall x. Rep PackageVersionSummary x -> PackageVersionSummary
forall x. PackageVersionSummary -> Rep PackageVersionSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PackageVersionSummary x -> PackageVersionSummary
$cfrom :: forall x. PackageVersionSummary -> Rep PackageVersionSummary x
Prelude.Generic)
newPackageVersionSummary ::
Prelude.Text ->
PackageVersionStatus ->
PackageVersionSummary
newPackageVersionSummary :: Text -> PackageVersionStatus -> PackageVersionSummary
newPackageVersionSummary Text
pVersion_ PackageVersionStatus
pStatus_ =
PackageVersionSummary' :: Maybe Text -> Text -> PackageVersionStatus -> PackageVersionSummary
PackageVersionSummary'
{ $sel:revision:PackageVersionSummary' :: Maybe Text
revision = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:version:PackageVersionSummary' :: Text
version = Text
pVersion_,
$sel:status:PackageVersionSummary' :: PackageVersionStatus
status = PackageVersionStatus
pStatus_
}
packageVersionSummary_revision :: Lens.Lens' PackageVersionSummary (Prelude.Maybe Prelude.Text)
packageVersionSummary_revision :: (Maybe Text -> f (Maybe Text))
-> PackageVersionSummary -> f PackageVersionSummary
packageVersionSummary_revision = (PackageVersionSummary -> Maybe Text)
-> (PackageVersionSummary -> Maybe Text -> PackageVersionSummary)
-> Lens
PackageVersionSummary
PackageVersionSummary
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PackageVersionSummary' {Maybe Text
revision :: Maybe Text
$sel:revision:PackageVersionSummary' :: PackageVersionSummary -> Maybe Text
revision} -> Maybe Text
revision) (\s :: PackageVersionSummary
s@PackageVersionSummary' {} Maybe Text
a -> PackageVersionSummary
s {$sel:revision:PackageVersionSummary' :: Maybe Text
revision = Maybe Text
a} :: PackageVersionSummary)
packageVersionSummary_version :: Lens.Lens' PackageVersionSummary Prelude.Text
packageVersionSummary_version :: (Text -> f Text)
-> PackageVersionSummary -> f PackageVersionSummary
packageVersionSummary_version = (PackageVersionSummary -> Text)
-> (PackageVersionSummary -> Text -> PackageVersionSummary)
-> Lens PackageVersionSummary PackageVersionSummary Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PackageVersionSummary' {Text
version :: Text
$sel:version:PackageVersionSummary' :: PackageVersionSummary -> Text
version} -> Text
version) (\s :: PackageVersionSummary
s@PackageVersionSummary' {} Text
a -> PackageVersionSummary
s {$sel:version:PackageVersionSummary' :: Text
version = Text
a} :: PackageVersionSummary)
packageVersionSummary_status :: Lens.Lens' PackageVersionSummary PackageVersionStatus
packageVersionSummary_status :: (PackageVersionStatus -> f PackageVersionStatus)
-> PackageVersionSummary -> f PackageVersionSummary
packageVersionSummary_status = (PackageVersionSummary -> PackageVersionStatus)
-> (PackageVersionSummary
-> PackageVersionStatus -> PackageVersionSummary)
-> Lens
PackageVersionSummary
PackageVersionSummary
PackageVersionStatus
PackageVersionStatus
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PackageVersionSummary' {PackageVersionStatus
status :: PackageVersionStatus
$sel:status:PackageVersionSummary' :: PackageVersionSummary -> PackageVersionStatus
status} -> PackageVersionStatus
status) (\s :: PackageVersionSummary
s@PackageVersionSummary' {} PackageVersionStatus
a -> PackageVersionSummary
s {$sel:status:PackageVersionSummary' :: PackageVersionStatus
status = PackageVersionStatus
a} :: PackageVersionSummary)
instance Core.FromJSON PackageVersionSummary where
parseJSON :: Value -> Parser PackageVersionSummary
parseJSON =
String
-> (Object -> Parser PackageVersionSummary)
-> Value
-> Parser PackageVersionSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"PackageVersionSummary"
( \Object
x ->
Maybe Text -> Text -> PackageVersionStatus -> PackageVersionSummary
PackageVersionSummary'
(Maybe Text
-> Text -> PackageVersionStatus -> PackageVersionSummary)
-> Parser (Maybe Text)
-> Parser (Text -> PackageVersionStatus -> PackageVersionSummary)
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
"revision")
Parser (Text -> PackageVersionStatus -> PackageVersionSummary)
-> Parser Text
-> Parser (PackageVersionStatus -> PackageVersionSummary)
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
"version")
Parser (PackageVersionStatus -> PackageVersionSummary)
-> Parser PackageVersionStatus -> Parser PackageVersionSummary
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser PackageVersionStatus
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"status")
)
instance Prelude.Hashable PackageVersionSummary
instance Prelude.NFData PackageVersionSummary