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