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