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