{-# 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.ChimeSDKIdentity.Types.EndpointAttributes 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 EndpointAttributes = EndpointAttributes'
{
EndpointAttributes -> Maybe (Sensitive Text)
voipDeviceToken :: Prelude.Maybe (Data.Sensitive Prelude.Text),
EndpointAttributes -> Sensitive Text
deviceToken :: Data.Sensitive Prelude.Text
}
deriving (EndpointAttributes -> EndpointAttributes -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EndpointAttributes -> EndpointAttributes -> Bool
$c/= :: EndpointAttributes -> EndpointAttributes -> Bool
== :: EndpointAttributes -> EndpointAttributes -> Bool
$c== :: EndpointAttributes -> EndpointAttributes -> Bool
Prelude.Eq, Int -> EndpointAttributes -> ShowS
[EndpointAttributes] -> ShowS
EndpointAttributes -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EndpointAttributes] -> ShowS
$cshowList :: [EndpointAttributes] -> ShowS
show :: EndpointAttributes -> String
$cshow :: EndpointAttributes -> String
showsPrec :: Int -> EndpointAttributes -> ShowS
$cshowsPrec :: Int -> EndpointAttributes -> ShowS
Prelude.Show, forall x. Rep EndpointAttributes x -> EndpointAttributes
forall x. EndpointAttributes -> Rep EndpointAttributes x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep EndpointAttributes x -> EndpointAttributes
$cfrom :: forall x. EndpointAttributes -> Rep EndpointAttributes x
Prelude.Generic)
newEndpointAttributes ::
Prelude.Text ->
EndpointAttributes
newEndpointAttributes :: Text -> EndpointAttributes
newEndpointAttributes Text
pDeviceToken_ =
EndpointAttributes'
{ $sel:voipDeviceToken:EndpointAttributes' :: Maybe (Sensitive Text)
voipDeviceToken =
forall a. Maybe a
Prelude.Nothing,
$sel:deviceToken:EndpointAttributes' :: Sensitive Text
deviceToken = forall a. Iso' (Sensitive a) a
Data._Sensitive forall t b. AReview t b -> b -> t
Lens.# Text
pDeviceToken_
}
endpointAttributes_voipDeviceToken :: Lens.Lens' EndpointAttributes (Prelude.Maybe Prelude.Text)
endpointAttributes_voipDeviceToken :: Lens' EndpointAttributes (Maybe Text)
endpointAttributes_voipDeviceToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EndpointAttributes' {Maybe (Sensitive Text)
voipDeviceToken :: Maybe (Sensitive Text)
$sel:voipDeviceToken:EndpointAttributes' :: EndpointAttributes -> Maybe (Sensitive Text)
voipDeviceToken} -> Maybe (Sensitive Text)
voipDeviceToken) (\s :: EndpointAttributes
s@EndpointAttributes' {} Maybe (Sensitive Text)
a -> EndpointAttributes
s {$sel:voipDeviceToken:EndpointAttributes' :: Maybe (Sensitive Text)
voipDeviceToken = Maybe (Sensitive Text)
a} :: EndpointAttributes) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall a. Iso' (Sensitive a) a
Data._Sensitive
endpointAttributes_deviceToken :: Lens.Lens' EndpointAttributes Prelude.Text
endpointAttributes_deviceToken :: Lens' EndpointAttributes Text
endpointAttributes_deviceToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EndpointAttributes' {Sensitive Text
deviceToken :: Sensitive Text
$sel:deviceToken:EndpointAttributes' :: EndpointAttributes -> Sensitive Text
deviceToken} -> Sensitive Text
deviceToken) (\s :: EndpointAttributes
s@EndpointAttributes' {} Sensitive Text
a -> EndpointAttributes
s {$sel:deviceToken:EndpointAttributes' :: Sensitive Text
deviceToken = Sensitive Text
a} :: EndpointAttributes) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a. Iso' (Sensitive a) a
Data._Sensitive
instance Data.FromJSON EndpointAttributes where
parseJSON :: Value -> Parser EndpointAttributes
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"EndpointAttributes"
( \Object
x ->
Maybe (Sensitive Text) -> Sensitive Text -> EndpointAttributes
EndpointAttributes'
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
"VoipDeviceToken")
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
"DeviceToken")
)
instance Prelude.Hashable EndpointAttributes where
hashWithSalt :: Int -> EndpointAttributes -> Int
hashWithSalt Int
_salt EndpointAttributes' {Maybe (Sensitive Text)
Sensitive Text
deviceToken :: Sensitive Text
voipDeviceToken :: Maybe (Sensitive Text)
$sel:deviceToken:EndpointAttributes' :: EndpointAttributes -> Sensitive Text
$sel:voipDeviceToken:EndpointAttributes' :: EndpointAttributes -> Maybe (Sensitive Text)
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (Sensitive Text)
voipDeviceToken
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Sensitive Text
deviceToken
instance Prelude.NFData EndpointAttributes where
rnf :: EndpointAttributes -> ()
rnf EndpointAttributes' {Maybe (Sensitive Text)
Sensitive Text
deviceToken :: Sensitive Text
voipDeviceToken :: Maybe (Sensitive Text)
$sel:deviceToken:EndpointAttributes' :: EndpointAttributes -> Sensitive Text
$sel:voipDeviceToken:EndpointAttributes' :: EndpointAttributes -> Maybe (Sensitive Text)
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe (Sensitive Text)
voipDeviceToken
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Sensitive Text
deviceToken
instance Data.ToJSON EndpointAttributes where
toJSON :: EndpointAttributes -> Value
toJSON EndpointAttributes' {Maybe (Sensitive Text)
Sensitive Text
deviceToken :: Sensitive Text
voipDeviceToken :: Maybe (Sensitive Text)
$sel:deviceToken:EndpointAttributes' :: EndpointAttributes -> Sensitive Text
$sel:voipDeviceToken:EndpointAttributes' :: EndpointAttributes -> Maybe (Sensitive Text)
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"VoipDeviceToken" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Sensitive Text)
voipDeviceToken,
forall a. a -> Maybe a
Prelude.Just (Key
"DeviceToken" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Sensitive Text
deviceToken)
]
)