{-# 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.ConnectParticipant.Types.ConnectionCredentials where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ConnectionCredentials = ConnectionCredentials'
{
ConnectionCredentials -> Maybe Text
expiry :: Prelude.Maybe Prelude.Text,
ConnectionCredentials -> Maybe Text
connectionToken :: Prelude.Maybe Prelude.Text
}
deriving (ConnectionCredentials -> ConnectionCredentials -> Bool
(ConnectionCredentials -> ConnectionCredentials -> Bool)
-> (ConnectionCredentials -> ConnectionCredentials -> Bool)
-> Eq ConnectionCredentials
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ConnectionCredentials -> ConnectionCredentials -> Bool
$c/= :: ConnectionCredentials -> ConnectionCredentials -> Bool
== :: ConnectionCredentials -> ConnectionCredentials -> Bool
$c== :: ConnectionCredentials -> ConnectionCredentials -> Bool
Prelude.Eq, ReadPrec [ConnectionCredentials]
ReadPrec ConnectionCredentials
Int -> ReadS ConnectionCredentials
ReadS [ConnectionCredentials]
(Int -> ReadS ConnectionCredentials)
-> ReadS [ConnectionCredentials]
-> ReadPrec ConnectionCredentials
-> ReadPrec [ConnectionCredentials]
-> Read ConnectionCredentials
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ConnectionCredentials]
$creadListPrec :: ReadPrec [ConnectionCredentials]
readPrec :: ReadPrec ConnectionCredentials
$creadPrec :: ReadPrec ConnectionCredentials
readList :: ReadS [ConnectionCredentials]
$creadList :: ReadS [ConnectionCredentials]
readsPrec :: Int -> ReadS ConnectionCredentials
$creadsPrec :: Int -> ReadS ConnectionCredentials
Prelude.Read, Int -> ConnectionCredentials -> ShowS
[ConnectionCredentials] -> ShowS
ConnectionCredentials -> String
(Int -> ConnectionCredentials -> ShowS)
-> (ConnectionCredentials -> String)
-> ([ConnectionCredentials] -> ShowS)
-> Show ConnectionCredentials
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ConnectionCredentials] -> ShowS
$cshowList :: [ConnectionCredentials] -> ShowS
show :: ConnectionCredentials -> String
$cshow :: ConnectionCredentials -> String
showsPrec :: Int -> ConnectionCredentials -> ShowS
$cshowsPrec :: Int -> ConnectionCredentials -> ShowS
Prelude.Show, (forall x. ConnectionCredentials -> Rep ConnectionCredentials x)
-> (forall x. Rep ConnectionCredentials x -> ConnectionCredentials)
-> Generic ConnectionCredentials
forall x. Rep ConnectionCredentials x -> ConnectionCredentials
forall x. ConnectionCredentials -> Rep ConnectionCredentials x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ConnectionCredentials x -> ConnectionCredentials
$cfrom :: forall x. ConnectionCredentials -> Rep ConnectionCredentials x
Prelude.Generic)
newConnectionCredentials ::
ConnectionCredentials
newConnectionCredentials :: ConnectionCredentials
newConnectionCredentials =
ConnectionCredentials' :: Maybe Text -> Maybe Text -> ConnectionCredentials
ConnectionCredentials'
{ $sel:expiry:ConnectionCredentials' :: Maybe Text
expiry = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:connectionToken:ConnectionCredentials' :: Maybe Text
connectionToken = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
connectionCredentials_expiry :: Lens.Lens' ConnectionCredentials (Prelude.Maybe Prelude.Text)
connectionCredentials_expiry :: (Maybe Text -> f (Maybe Text))
-> ConnectionCredentials -> f ConnectionCredentials
connectionCredentials_expiry = (ConnectionCredentials -> Maybe Text)
-> (ConnectionCredentials -> Maybe Text -> ConnectionCredentials)
-> Lens
ConnectionCredentials
ConnectionCredentials
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConnectionCredentials' {Maybe Text
expiry :: Maybe Text
$sel:expiry:ConnectionCredentials' :: ConnectionCredentials -> Maybe Text
expiry} -> Maybe Text
expiry) (\s :: ConnectionCredentials
s@ConnectionCredentials' {} Maybe Text
a -> ConnectionCredentials
s {$sel:expiry:ConnectionCredentials' :: Maybe Text
expiry = Maybe Text
a} :: ConnectionCredentials)
connectionCredentials_connectionToken :: Lens.Lens' ConnectionCredentials (Prelude.Maybe Prelude.Text)
connectionCredentials_connectionToken :: (Maybe Text -> f (Maybe Text))
-> ConnectionCredentials -> f ConnectionCredentials
connectionCredentials_connectionToken = (ConnectionCredentials -> Maybe Text)
-> (ConnectionCredentials -> Maybe Text -> ConnectionCredentials)
-> Lens
ConnectionCredentials
ConnectionCredentials
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConnectionCredentials' {Maybe Text
connectionToken :: Maybe Text
$sel:connectionToken:ConnectionCredentials' :: ConnectionCredentials -> Maybe Text
connectionToken} -> Maybe Text
connectionToken) (\s :: ConnectionCredentials
s@ConnectionCredentials' {} Maybe Text
a -> ConnectionCredentials
s {$sel:connectionToken:ConnectionCredentials' :: Maybe Text
connectionToken = Maybe Text
a} :: ConnectionCredentials)
instance Core.FromJSON ConnectionCredentials where
parseJSON :: Value -> Parser ConnectionCredentials
parseJSON =
String
-> (Object -> Parser ConnectionCredentials)
-> Value
-> Parser ConnectionCredentials
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ConnectionCredentials"
( \Object
x ->
Maybe Text -> Maybe Text -> ConnectionCredentials
ConnectionCredentials'
(Maybe Text -> Maybe Text -> ConnectionCredentials)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> ConnectionCredentials)
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
"Expiry")
Parser (Maybe Text -> ConnectionCredentials)
-> Parser (Maybe Text) -> Parser ConnectionCredentials
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
"ConnectionToken")
)
instance Prelude.Hashable ConnectionCredentials
instance Prelude.NFData ConnectionCredentials