{-# 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.IoTFleetWise.Types.IamRegistrationResponse where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.IoTFleetWise.Types.RegistrationStatus
import qualified Amazonka.Prelude as Prelude
data IamRegistrationResponse = IamRegistrationResponse'
{
IamRegistrationResponse -> Maybe Text
errorMessage :: Prelude.Maybe Prelude.Text,
IamRegistrationResponse -> Text
roleArn :: Prelude.Text,
IamRegistrationResponse -> RegistrationStatus
registrationStatus :: RegistrationStatus
}
deriving (IamRegistrationResponse -> IamRegistrationResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: IamRegistrationResponse -> IamRegistrationResponse -> Bool
$c/= :: IamRegistrationResponse -> IamRegistrationResponse -> Bool
== :: IamRegistrationResponse -> IamRegistrationResponse -> Bool
$c== :: IamRegistrationResponse -> IamRegistrationResponse -> Bool
Prelude.Eq, ReadPrec [IamRegistrationResponse]
ReadPrec IamRegistrationResponse
Int -> ReadS IamRegistrationResponse
ReadS [IamRegistrationResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [IamRegistrationResponse]
$creadListPrec :: ReadPrec [IamRegistrationResponse]
readPrec :: ReadPrec IamRegistrationResponse
$creadPrec :: ReadPrec IamRegistrationResponse
readList :: ReadS [IamRegistrationResponse]
$creadList :: ReadS [IamRegistrationResponse]
readsPrec :: Int -> ReadS IamRegistrationResponse
$creadsPrec :: Int -> ReadS IamRegistrationResponse
Prelude.Read, Int -> IamRegistrationResponse -> ShowS
[IamRegistrationResponse] -> ShowS
IamRegistrationResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [IamRegistrationResponse] -> ShowS
$cshowList :: [IamRegistrationResponse] -> ShowS
show :: IamRegistrationResponse -> String
$cshow :: IamRegistrationResponse -> String
showsPrec :: Int -> IamRegistrationResponse -> ShowS
$cshowsPrec :: Int -> IamRegistrationResponse -> ShowS
Prelude.Show, forall x. Rep IamRegistrationResponse x -> IamRegistrationResponse
forall x. IamRegistrationResponse -> Rep IamRegistrationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep IamRegistrationResponse x -> IamRegistrationResponse
$cfrom :: forall x. IamRegistrationResponse -> Rep IamRegistrationResponse x
Prelude.Generic)
newIamRegistrationResponse ::
Prelude.Text ->
RegistrationStatus ->
IamRegistrationResponse
newIamRegistrationResponse :: Text -> RegistrationStatus -> IamRegistrationResponse
newIamRegistrationResponse
Text
pRoleArn_
RegistrationStatus
pRegistrationStatus_ =
IamRegistrationResponse'
{ $sel:errorMessage:IamRegistrationResponse' :: Maybe Text
errorMessage =
forall a. Maybe a
Prelude.Nothing,
$sel:roleArn:IamRegistrationResponse' :: Text
roleArn = Text
pRoleArn_,
$sel:registrationStatus:IamRegistrationResponse' :: RegistrationStatus
registrationStatus = RegistrationStatus
pRegistrationStatus_
}
iamRegistrationResponse_errorMessage :: Lens.Lens' IamRegistrationResponse (Prelude.Maybe Prelude.Text)
iamRegistrationResponse_errorMessage :: Lens' IamRegistrationResponse (Maybe Text)
iamRegistrationResponse_errorMessage = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IamRegistrationResponse' {Maybe Text
errorMessage :: Maybe Text
$sel:errorMessage:IamRegistrationResponse' :: IamRegistrationResponse -> Maybe Text
errorMessage} -> Maybe Text
errorMessage) (\s :: IamRegistrationResponse
s@IamRegistrationResponse' {} Maybe Text
a -> IamRegistrationResponse
s {$sel:errorMessage:IamRegistrationResponse' :: Maybe Text
errorMessage = Maybe Text
a} :: IamRegistrationResponse)
iamRegistrationResponse_roleArn :: Lens.Lens' IamRegistrationResponse Prelude.Text
iamRegistrationResponse_roleArn :: Lens' IamRegistrationResponse Text
iamRegistrationResponse_roleArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IamRegistrationResponse' {Text
roleArn :: Text
$sel:roleArn:IamRegistrationResponse' :: IamRegistrationResponse -> Text
roleArn} -> Text
roleArn) (\s :: IamRegistrationResponse
s@IamRegistrationResponse' {} Text
a -> IamRegistrationResponse
s {$sel:roleArn:IamRegistrationResponse' :: Text
roleArn = Text
a} :: IamRegistrationResponse)
iamRegistrationResponse_registrationStatus :: Lens.Lens' IamRegistrationResponse RegistrationStatus
iamRegistrationResponse_registrationStatus :: Lens' IamRegistrationResponse RegistrationStatus
iamRegistrationResponse_registrationStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IamRegistrationResponse' {RegistrationStatus
registrationStatus :: RegistrationStatus
$sel:registrationStatus:IamRegistrationResponse' :: IamRegistrationResponse -> RegistrationStatus
registrationStatus} -> RegistrationStatus
registrationStatus) (\s :: IamRegistrationResponse
s@IamRegistrationResponse' {} RegistrationStatus
a -> IamRegistrationResponse
s {$sel:registrationStatus:IamRegistrationResponse' :: RegistrationStatus
registrationStatus = RegistrationStatus
a} :: IamRegistrationResponse)
instance Data.FromJSON IamRegistrationResponse where
parseJSON :: Value -> Parser IamRegistrationResponse
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"IamRegistrationResponse"
( \Object
x ->
Maybe Text -> Text -> RegistrationStatus -> IamRegistrationResponse
IamRegistrationResponse'
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
"errorMessage")
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
"roleArn")
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
"registrationStatus")
)
instance Prelude.Hashable IamRegistrationResponse where
hashWithSalt :: Int -> IamRegistrationResponse -> Int
hashWithSalt Int
_salt IamRegistrationResponse' {Maybe Text
Text
RegistrationStatus
registrationStatus :: RegistrationStatus
roleArn :: Text
errorMessage :: Maybe Text
$sel:registrationStatus:IamRegistrationResponse' :: IamRegistrationResponse -> RegistrationStatus
$sel:roleArn:IamRegistrationResponse' :: IamRegistrationResponse -> Text
$sel:errorMessage:IamRegistrationResponse' :: IamRegistrationResponse -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
errorMessage
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
roleArn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` RegistrationStatus
registrationStatus
instance Prelude.NFData IamRegistrationResponse where
rnf :: IamRegistrationResponse -> ()
rnf IamRegistrationResponse' {Maybe Text
Text
RegistrationStatus
registrationStatus :: RegistrationStatus
roleArn :: Text
errorMessage :: Maybe Text
$sel:registrationStatus:IamRegistrationResponse' :: IamRegistrationResponse -> RegistrationStatus
$sel:roleArn:IamRegistrationResponse' :: IamRegistrationResponse -> Text
$sel:errorMessage:IamRegistrationResponse' :: IamRegistrationResponse -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
errorMessage
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
roleArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf RegistrationStatus
registrationStatus