{-# 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.CertificateManagerPCA.Types.OtherName where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data OtherName = OtherName'
{
OtherName -> Text
typeId :: Prelude.Text,
OtherName -> Text
value :: Prelude.Text
}
deriving (OtherName -> OtherName -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: OtherName -> OtherName -> Bool
$c/= :: OtherName -> OtherName -> Bool
== :: OtherName -> OtherName -> Bool
$c== :: OtherName -> OtherName -> Bool
Prelude.Eq, ReadPrec [OtherName]
ReadPrec OtherName
Int -> ReadS OtherName
ReadS [OtherName]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [OtherName]
$creadListPrec :: ReadPrec [OtherName]
readPrec :: ReadPrec OtherName
$creadPrec :: ReadPrec OtherName
readList :: ReadS [OtherName]
$creadList :: ReadS [OtherName]
readsPrec :: Int -> ReadS OtherName
$creadsPrec :: Int -> ReadS OtherName
Prelude.Read, Int -> OtherName -> ShowS
[OtherName] -> ShowS
OtherName -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [OtherName] -> ShowS
$cshowList :: [OtherName] -> ShowS
show :: OtherName -> String
$cshow :: OtherName -> String
showsPrec :: Int -> OtherName -> ShowS
$cshowsPrec :: Int -> OtherName -> ShowS
Prelude.Show, forall x. Rep OtherName x -> OtherName
forall x. OtherName -> Rep OtherName x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep OtherName x -> OtherName
$cfrom :: forall x. OtherName -> Rep OtherName x
Prelude.Generic)
newOtherName ::
Prelude.Text ->
Prelude.Text ->
OtherName
newOtherName :: Text -> Text -> OtherName
newOtherName Text
pTypeId_ Text
pValue_ =
OtherName' {$sel:typeId:OtherName' :: Text
typeId = Text
pTypeId_, $sel:value:OtherName' :: Text
value = Text
pValue_}
otherName_typeId :: Lens.Lens' OtherName Prelude.Text
otherName_typeId :: Lens' OtherName Text
otherName_typeId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OtherName' {Text
typeId :: Text
$sel:typeId:OtherName' :: OtherName -> Text
typeId} -> Text
typeId) (\s :: OtherName
s@OtherName' {} Text
a -> OtherName
s {$sel:typeId:OtherName' :: Text
typeId = Text
a} :: OtherName)
otherName_value :: Lens.Lens' OtherName Prelude.Text
otherName_value :: Lens' OtherName Text
otherName_value = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OtherName' {Text
value :: Text
$sel:value:OtherName' :: OtherName -> Text
value} -> Text
value) (\s :: OtherName
s@OtherName' {} Text
a -> OtherName
s {$sel:value:OtherName' :: Text
value = Text
a} :: OtherName)
instance Data.FromJSON OtherName where
parseJSON :: Value -> Parser OtherName
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"OtherName"
( \Object
x ->
Text -> Text -> OtherName
OtherName'
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
"TypeId")
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
"Value")
)
instance Prelude.Hashable OtherName where
hashWithSalt :: Int -> OtherName -> Int
hashWithSalt Int
_salt OtherName' {Text
value :: Text
typeId :: Text
$sel:value:OtherName' :: OtherName -> Text
$sel:typeId:OtherName' :: OtherName -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
typeId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
value
instance Prelude.NFData OtherName where
rnf :: OtherName -> ()
rnf OtherName' {Text
value :: Text
typeId :: Text
$sel:value:OtherName' :: OtherName -> Text
$sel:typeId:OtherName' :: OtherName -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
typeId seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
value
instance Data.ToJSON OtherName where
toJSON :: OtherName -> Value
toJSON OtherName' {Text
value :: Text
typeId :: Text
$sel:value:OtherName' :: OtherName -> Text
$sel:typeId:OtherName' :: OtherName -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just (Key
"TypeId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
typeId),
forall a. a -> Maybe a
Prelude.Just (Key
"Value" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
value)
]
)