{-# 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.OpenSearch.Types.PackageDetails where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.OpenSearch.Types.ErrorDetails
import Amazonka.OpenSearch.Types.PackageStatus
import Amazonka.OpenSearch.Types.PackageType
import qualified Amazonka.Prelude as Prelude
data PackageDetails = PackageDetails'
{
PackageDetails -> Maybe Text
packageID :: Prelude.Maybe Prelude.Text,
PackageDetails -> Maybe PackageType
packageType :: Prelude.Maybe PackageType,
PackageDetails -> Maybe POSIX
lastUpdatedAt :: Prelude.Maybe Core.POSIX,
PackageDetails -> Maybe POSIX
createdAt :: Prelude.Maybe Core.POSIX,
PackageDetails -> Maybe Text
packageName :: Prelude.Maybe Prelude.Text,
PackageDetails -> Maybe PackageStatus
packageStatus :: Prelude.Maybe PackageStatus,
PackageDetails -> Maybe Text
packageDescription :: Prelude.Maybe Prelude.Text,
PackageDetails -> Maybe ErrorDetails
errorDetails :: Prelude.Maybe ErrorDetails,
PackageDetails -> Maybe Text
availablePackageVersion :: Prelude.Maybe Prelude.Text
}
deriving (PackageDetails -> PackageDetails -> Bool
(PackageDetails -> PackageDetails -> Bool)
-> (PackageDetails -> PackageDetails -> Bool) -> Eq PackageDetails
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PackageDetails -> PackageDetails -> Bool
$c/= :: PackageDetails -> PackageDetails -> Bool
== :: PackageDetails -> PackageDetails -> Bool
$c== :: PackageDetails -> PackageDetails -> Bool
Prelude.Eq, ReadPrec [PackageDetails]
ReadPrec PackageDetails
Int -> ReadS PackageDetails
ReadS [PackageDetails]
(Int -> ReadS PackageDetails)
-> ReadS [PackageDetails]
-> ReadPrec PackageDetails
-> ReadPrec [PackageDetails]
-> Read PackageDetails
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PackageDetails]
$creadListPrec :: ReadPrec [PackageDetails]
readPrec :: ReadPrec PackageDetails
$creadPrec :: ReadPrec PackageDetails
readList :: ReadS [PackageDetails]
$creadList :: ReadS [PackageDetails]
readsPrec :: Int -> ReadS PackageDetails
$creadsPrec :: Int -> ReadS PackageDetails
Prelude.Read, Int -> PackageDetails -> ShowS
[PackageDetails] -> ShowS
PackageDetails -> String
(Int -> PackageDetails -> ShowS)
-> (PackageDetails -> String)
-> ([PackageDetails] -> ShowS)
-> Show PackageDetails
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PackageDetails] -> ShowS
$cshowList :: [PackageDetails] -> ShowS
show :: PackageDetails -> String
$cshow :: PackageDetails -> String
showsPrec :: Int -> PackageDetails -> ShowS
$cshowsPrec :: Int -> PackageDetails -> ShowS
Prelude.Show, (forall x. PackageDetails -> Rep PackageDetails x)
-> (forall x. Rep PackageDetails x -> PackageDetails)
-> Generic PackageDetails
forall x. Rep PackageDetails x -> PackageDetails
forall x. PackageDetails -> Rep PackageDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PackageDetails x -> PackageDetails
$cfrom :: forall x. PackageDetails -> Rep PackageDetails x
Prelude.Generic)
newPackageDetails ::
PackageDetails
newPackageDetails :: PackageDetails
newPackageDetails =
PackageDetails' :: Maybe Text
-> Maybe PackageType
-> Maybe POSIX
-> Maybe POSIX
-> Maybe Text
-> Maybe PackageStatus
-> Maybe Text
-> Maybe ErrorDetails
-> Maybe Text
-> PackageDetails
PackageDetails'
{ $sel:packageID:PackageDetails' :: Maybe Text
packageID = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:packageType:PackageDetails' :: Maybe PackageType
packageType = Maybe PackageType
forall a. Maybe a
Prelude.Nothing,
$sel:lastUpdatedAt:PackageDetails' :: Maybe POSIX
lastUpdatedAt = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:createdAt:PackageDetails' :: Maybe POSIX
createdAt = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:packageName:PackageDetails' :: Maybe Text
packageName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:packageStatus:PackageDetails' :: Maybe PackageStatus
packageStatus = Maybe PackageStatus
forall a. Maybe a
Prelude.Nothing,
$sel:packageDescription:PackageDetails' :: Maybe Text
packageDescription = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:errorDetails:PackageDetails' :: Maybe ErrorDetails
errorDetails = Maybe ErrorDetails
forall a. Maybe a
Prelude.Nothing,
$sel:availablePackageVersion:PackageDetails' :: Maybe Text
availablePackageVersion = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
packageDetails_packageID :: Lens.Lens' PackageDetails (Prelude.Maybe Prelude.Text)
packageDetails_packageID :: (Maybe Text -> f (Maybe Text))
-> PackageDetails -> f PackageDetails
packageDetails_packageID = (PackageDetails -> Maybe Text)
-> (PackageDetails -> Maybe Text -> PackageDetails)
-> Lens PackageDetails PackageDetails (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PackageDetails' {Maybe Text
packageID :: Maybe Text
$sel:packageID:PackageDetails' :: PackageDetails -> Maybe Text
packageID} -> Maybe Text
packageID) (\s :: PackageDetails
s@PackageDetails' {} Maybe Text
a -> PackageDetails
s {$sel:packageID:PackageDetails' :: Maybe Text
packageID = Maybe Text
a} :: PackageDetails)
packageDetails_packageType :: Lens.Lens' PackageDetails (Prelude.Maybe PackageType)
packageDetails_packageType :: (Maybe PackageType -> f (Maybe PackageType))
-> PackageDetails -> f PackageDetails
packageDetails_packageType = (PackageDetails -> Maybe PackageType)
-> (PackageDetails -> Maybe PackageType -> PackageDetails)
-> Lens
PackageDetails
PackageDetails
(Maybe PackageType)
(Maybe PackageType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PackageDetails' {Maybe PackageType
packageType :: Maybe PackageType
$sel:packageType:PackageDetails' :: PackageDetails -> Maybe PackageType
packageType} -> Maybe PackageType
packageType) (\s :: PackageDetails
s@PackageDetails' {} Maybe PackageType
a -> PackageDetails
s {$sel:packageType:PackageDetails' :: Maybe PackageType
packageType = Maybe PackageType
a} :: PackageDetails)
packageDetails_lastUpdatedAt :: Lens.Lens' PackageDetails (Prelude.Maybe Prelude.UTCTime)
packageDetails_lastUpdatedAt :: (Maybe UTCTime -> f (Maybe UTCTime))
-> PackageDetails -> f PackageDetails
packageDetails_lastUpdatedAt = (PackageDetails -> Maybe POSIX)
-> (PackageDetails -> Maybe POSIX -> PackageDetails)
-> Lens PackageDetails PackageDetails (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PackageDetails' {Maybe POSIX
lastUpdatedAt :: Maybe POSIX
$sel:lastUpdatedAt:PackageDetails' :: PackageDetails -> Maybe POSIX
lastUpdatedAt} -> Maybe POSIX
lastUpdatedAt) (\s :: PackageDetails
s@PackageDetails' {} Maybe POSIX
a -> PackageDetails
s {$sel:lastUpdatedAt:PackageDetails' :: Maybe POSIX
lastUpdatedAt = Maybe POSIX
a} :: PackageDetails) ((Maybe POSIX -> f (Maybe POSIX))
-> PackageDetails -> f PackageDetails)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> PackageDetails
-> f PackageDetails
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
packageDetails_createdAt :: Lens.Lens' PackageDetails (Prelude.Maybe Prelude.UTCTime)
packageDetails_createdAt :: (Maybe UTCTime -> f (Maybe UTCTime))
-> PackageDetails -> f PackageDetails
packageDetails_createdAt = (PackageDetails -> Maybe POSIX)
-> (PackageDetails -> Maybe POSIX -> PackageDetails)
-> Lens PackageDetails PackageDetails (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PackageDetails' {Maybe POSIX
createdAt :: Maybe POSIX
$sel:createdAt:PackageDetails' :: PackageDetails -> Maybe POSIX
createdAt} -> Maybe POSIX
createdAt) (\s :: PackageDetails
s@PackageDetails' {} Maybe POSIX
a -> PackageDetails
s {$sel:createdAt:PackageDetails' :: Maybe POSIX
createdAt = Maybe POSIX
a} :: PackageDetails) ((Maybe POSIX -> f (Maybe POSIX))
-> PackageDetails -> f PackageDetails)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> PackageDetails
-> f PackageDetails
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
packageDetails_packageName :: Lens.Lens' PackageDetails (Prelude.Maybe Prelude.Text)
packageDetails_packageName :: (Maybe Text -> f (Maybe Text))
-> PackageDetails -> f PackageDetails
packageDetails_packageName = (PackageDetails -> Maybe Text)
-> (PackageDetails -> Maybe Text -> PackageDetails)
-> Lens PackageDetails PackageDetails (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PackageDetails' {Maybe Text
packageName :: Maybe Text
$sel:packageName:PackageDetails' :: PackageDetails -> Maybe Text
packageName} -> Maybe Text
packageName) (\s :: PackageDetails
s@PackageDetails' {} Maybe Text
a -> PackageDetails
s {$sel:packageName:PackageDetails' :: Maybe Text
packageName = Maybe Text
a} :: PackageDetails)
packageDetails_packageStatus :: Lens.Lens' PackageDetails (Prelude.Maybe PackageStatus)
packageDetails_packageStatus :: (Maybe PackageStatus -> f (Maybe PackageStatus))
-> PackageDetails -> f PackageDetails
packageDetails_packageStatus = (PackageDetails -> Maybe PackageStatus)
-> (PackageDetails -> Maybe PackageStatus -> PackageDetails)
-> Lens
PackageDetails
PackageDetails
(Maybe PackageStatus)
(Maybe PackageStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PackageDetails' {Maybe PackageStatus
packageStatus :: Maybe PackageStatus
$sel:packageStatus:PackageDetails' :: PackageDetails -> Maybe PackageStatus
packageStatus} -> Maybe PackageStatus
packageStatus) (\s :: PackageDetails
s@PackageDetails' {} Maybe PackageStatus
a -> PackageDetails
s {$sel:packageStatus:PackageDetails' :: Maybe PackageStatus
packageStatus = Maybe PackageStatus
a} :: PackageDetails)
packageDetails_packageDescription :: Lens.Lens' PackageDetails (Prelude.Maybe Prelude.Text)
packageDetails_packageDescription :: (Maybe Text -> f (Maybe Text))
-> PackageDetails -> f PackageDetails
packageDetails_packageDescription = (PackageDetails -> Maybe Text)
-> (PackageDetails -> Maybe Text -> PackageDetails)
-> Lens PackageDetails PackageDetails (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PackageDetails' {Maybe Text
packageDescription :: Maybe Text
$sel:packageDescription:PackageDetails' :: PackageDetails -> Maybe Text
packageDescription} -> Maybe Text
packageDescription) (\s :: PackageDetails
s@PackageDetails' {} Maybe Text
a -> PackageDetails
s {$sel:packageDescription:PackageDetails' :: Maybe Text
packageDescription = Maybe Text
a} :: PackageDetails)
packageDetails_errorDetails :: Lens.Lens' PackageDetails (Prelude.Maybe ErrorDetails)
packageDetails_errorDetails :: (Maybe ErrorDetails -> f (Maybe ErrorDetails))
-> PackageDetails -> f PackageDetails
packageDetails_errorDetails = (PackageDetails -> Maybe ErrorDetails)
-> (PackageDetails -> Maybe ErrorDetails -> PackageDetails)
-> Lens
PackageDetails
PackageDetails
(Maybe ErrorDetails)
(Maybe ErrorDetails)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PackageDetails' {Maybe ErrorDetails
errorDetails :: Maybe ErrorDetails
$sel:errorDetails:PackageDetails' :: PackageDetails -> Maybe ErrorDetails
errorDetails} -> Maybe ErrorDetails
errorDetails) (\s :: PackageDetails
s@PackageDetails' {} Maybe ErrorDetails
a -> PackageDetails
s {$sel:errorDetails:PackageDetails' :: Maybe ErrorDetails
errorDetails = Maybe ErrorDetails
a} :: PackageDetails)
packageDetails_availablePackageVersion :: Lens.Lens' PackageDetails (Prelude.Maybe Prelude.Text)
packageDetails_availablePackageVersion :: (Maybe Text -> f (Maybe Text))
-> PackageDetails -> f PackageDetails
packageDetails_availablePackageVersion = (PackageDetails -> Maybe Text)
-> (PackageDetails -> Maybe Text -> PackageDetails)
-> Lens PackageDetails PackageDetails (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PackageDetails' {Maybe Text
availablePackageVersion :: Maybe Text
$sel:availablePackageVersion:PackageDetails' :: PackageDetails -> Maybe Text
availablePackageVersion} -> Maybe Text
availablePackageVersion) (\s :: PackageDetails
s@PackageDetails' {} Maybe Text
a -> PackageDetails
s {$sel:availablePackageVersion:PackageDetails' :: Maybe Text
availablePackageVersion = Maybe Text
a} :: PackageDetails)
instance Core.FromJSON PackageDetails where
parseJSON :: Value -> Parser PackageDetails
parseJSON =
String
-> (Object -> Parser PackageDetails)
-> Value
-> Parser PackageDetails
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"PackageDetails"
( \Object
x ->
Maybe Text
-> Maybe PackageType
-> Maybe POSIX
-> Maybe POSIX
-> Maybe Text
-> Maybe PackageStatus
-> Maybe Text
-> Maybe ErrorDetails
-> Maybe Text
-> PackageDetails
PackageDetails'
(Maybe Text
-> Maybe PackageType
-> Maybe POSIX
-> Maybe POSIX
-> Maybe Text
-> Maybe PackageStatus
-> Maybe Text
-> Maybe ErrorDetails
-> Maybe Text
-> PackageDetails)
-> Parser (Maybe Text)
-> Parser
(Maybe PackageType
-> Maybe POSIX
-> Maybe POSIX
-> Maybe Text
-> Maybe PackageStatus
-> Maybe Text
-> Maybe ErrorDetails
-> Maybe Text
-> PackageDetails)
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
"PackageID")
Parser
(Maybe PackageType
-> Maybe POSIX
-> Maybe POSIX
-> Maybe Text
-> Maybe PackageStatus
-> Maybe Text
-> Maybe ErrorDetails
-> Maybe Text
-> PackageDetails)
-> Parser (Maybe PackageType)
-> Parser
(Maybe POSIX
-> Maybe POSIX
-> Maybe Text
-> Maybe PackageStatus
-> Maybe Text
-> Maybe ErrorDetails
-> Maybe Text
-> PackageDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe PackageType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"PackageType")
Parser
(Maybe POSIX
-> Maybe POSIX
-> Maybe Text
-> Maybe PackageStatus
-> Maybe Text
-> Maybe ErrorDetails
-> Maybe Text
-> PackageDetails)
-> Parser (Maybe POSIX)
-> Parser
(Maybe POSIX
-> Maybe Text
-> Maybe PackageStatus
-> Maybe Text
-> Maybe ErrorDetails
-> Maybe Text
-> PackageDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"LastUpdatedAt")
Parser
(Maybe POSIX
-> Maybe Text
-> Maybe PackageStatus
-> Maybe Text
-> Maybe ErrorDetails
-> Maybe Text
-> PackageDetails)
-> Parser (Maybe POSIX)
-> Parser
(Maybe Text
-> Maybe PackageStatus
-> Maybe Text
-> Maybe ErrorDetails
-> Maybe Text
-> PackageDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CreatedAt")
Parser
(Maybe Text
-> Maybe PackageStatus
-> Maybe Text
-> Maybe ErrorDetails
-> Maybe Text
-> PackageDetails)
-> Parser (Maybe Text)
-> Parser
(Maybe PackageStatus
-> Maybe Text
-> Maybe ErrorDetails
-> Maybe Text
-> PackageDetails)
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
"PackageName")
Parser
(Maybe PackageStatus
-> Maybe Text
-> Maybe ErrorDetails
-> Maybe Text
-> PackageDetails)
-> Parser (Maybe PackageStatus)
-> Parser
(Maybe Text -> Maybe ErrorDetails -> Maybe Text -> PackageDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe PackageStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"PackageStatus")
Parser
(Maybe Text -> Maybe ErrorDetails -> Maybe Text -> PackageDetails)
-> Parser (Maybe Text)
-> Parser (Maybe ErrorDetails -> Maybe Text -> PackageDetails)
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
"PackageDescription")
Parser (Maybe ErrorDetails -> Maybe Text -> PackageDetails)
-> Parser (Maybe ErrorDetails)
-> Parser (Maybe Text -> PackageDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ErrorDetails)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ErrorDetails")
Parser (Maybe Text -> PackageDetails)
-> Parser (Maybe Text) -> Parser PackageDetails
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
"AvailablePackageVersion")
)
instance Prelude.Hashable PackageDetails
instance Prelude.NFData PackageDetails