{-# 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.Location.Types.RouteMatrixEntryError where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Location.Types.RouteMatrixErrorCode
import qualified Amazonka.Prelude as Prelude
data RouteMatrixEntryError = RouteMatrixEntryError'
{
RouteMatrixEntryError -> Maybe Text
message :: Prelude.Maybe Prelude.Text,
RouteMatrixEntryError -> RouteMatrixErrorCode
code :: RouteMatrixErrorCode
}
deriving (RouteMatrixEntryError -> RouteMatrixEntryError -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RouteMatrixEntryError -> RouteMatrixEntryError -> Bool
$c/= :: RouteMatrixEntryError -> RouteMatrixEntryError -> Bool
== :: RouteMatrixEntryError -> RouteMatrixEntryError -> Bool
$c== :: RouteMatrixEntryError -> RouteMatrixEntryError -> Bool
Prelude.Eq, ReadPrec [RouteMatrixEntryError]
ReadPrec RouteMatrixEntryError
Int -> ReadS RouteMatrixEntryError
ReadS [RouteMatrixEntryError]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RouteMatrixEntryError]
$creadListPrec :: ReadPrec [RouteMatrixEntryError]
readPrec :: ReadPrec RouteMatrixEntryError
$creadPrec :: ReadPrec RouteMatrixEntryError
readList :: ReadS [RouteMatrixEntryError]
$creadList :: ReadS [RouteMatrixEntryError]
readsPrec :: Int -> ReadS RouteMatrixEntryError
$creadsPrec :: Int -> ReadS RouteMatrixEntryError
Prelude.Read, Int -> RouteMatrixEntryError -> ShowS
[RouteMatrixEntryError] -> ShowS
RouteMatrixEntryError -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RouteMatrixEntryError] -> ShowS
$cshowList :: [RouteMatrixEntryError] -> ShowS
show :: RouteMatrixEntryError -> String
$cshow :: RouteMatrixEntryError -> String
showsPrec :: Int -> RouteMatrixEntryError -> ShowS
$cshowsPrec :: Int -> RouteMatrixEntryError -> ShowS
Prelude.Show, forall x. Rep RouteMatrixEntryError x -> RouteMatrixEntryError
forall x. RouteMatrixEntryError -> Rep RouteMatrixEntryError x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RouteMatrixEntryError x -> RouteMatrixEntryError
$cfrom :: forall x. RouteMatrixEntryError -> Rep RouteMatrixEntryError x
Prelude.Generic)
newRouteMatrixEntryError ::
RouteMatrixErrorCode ->
RouteMatrixEntryError
newRouteMatrixEntryError :: RouteMatrixErrorCode -> RouteMatrixEntryError
newRouteMatrixEntryError RouteMatrixErrorCode
pCode_ =
RouteMatrixEntryError'
{ $sel:message:RouteMatrixEntryError' :: Maybe Text
message = forall a. Maybe a
Prelude.Nothing,
$sel:code:RouteMatrixEntryError' :: RouteMatrixErrorCode
code = RouteMatrixErrorCode
pCode_
}
routeMatrixEntryError_message :: Lens.Lens' RouteMatrixEntryError (Prelude.Maybe Prelude.Text)
routeMatrixEntryError_message :: Lens' RouteMatrixEntryError (Maybe Text)
routeMatrixEntryError_message = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RouteMatrixEntryError' {Maybe Text
message :: Maybe Text
$sel:message:RouteMatrixEntryError' :: RouteMatrixEntryError -> Maybe Text
message} -> Maybe Text
message) (\s :: RouteMatrixEntryError
s@RouteMatrixEntryError' {} Maybe Text
a -> RouteMatrixEntryError
s {$sel:message:RouteMatrixEntryError' :: Maybe Text
message = Maybe Text
a} :: RouteMatrixEntryError)
routeMatrixEntryError_code :: Lens.Lens' RouteMatrixEntryError RouteMatrixErrorCode
routeMatrixEntryError_code :: Lens' RouteMatrixEntryError RouteMatrixErrorCode
routeMatrixEntryError_code = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RouteMatrixEntryError' {RouteMatrixErrorCode
code :: RouteMatrixErrorCode
$sel:code:RouteMatrixEntryError' :: RouteMatrixEntryError -> RouteMatrixErrorCode
code} -> RouteMatrixErrorCode
code) (\s :: RouteMatrixEntryError
s@RouteMatrixEntryError' {} RouteMatrixErrorCode
a -> RouteMatrixEntryError
s {$sel:code:RouteMatrixEntryError' :: RouteMatrixErrorCode
code = RouteMatrixErrorCode
a} :: RouteMatrixEntryError)
instance Data.FromJSON RouteMatrixEntryError where
parseJSON :: Value -> Parser RouteMatrixEntryError
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"RouteMatrixEntryError"
( \Object
x ->
Maybe Text -> RouteMatrixErrorCode -> RouteMatrixEntryError
RouteMatrixEntryError'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Message")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"Code")
)
instance Prelude.Hashable RouteMatrixEntryError where
hashWithSalt :: Int -> RouteMatrixEntryError -> Int
hashWithSalt Int
_salt RouteMatrixEntryError' {Maybe Text
RouteMatrixErrorCode
code :: RouteMatrixErrorCode
message :: Maybe Text
$sel:code:RouteMatrixEntryError' :: RouteMatrixEntryError -> RouteMatrixErrorCode
$sel:message:RouteMatrixEntryError' :: RouteMatrixEntryError -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
message
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` RouteMatrixErrorCode
code
instance Prelude.NFData RouteMatrixEntryError where
rnf :: RouteMatrixEntryError -> ()
rnf RouteMatrixEntryError' {Maybe Text
RouteMatrixErrorCode
code :: RouteMatrixErrorCode
message :: Maybe Text
$sel:code:RouteMatrixEntryError' :: RouteMatrixEntryError -> RouteMatrixErrorCode
$sel:message:RouteMatrixEntryError' :: RouteMatrixEntryError -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
message seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf RouteMatrixErrorCode
code