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