{-# 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.TimeStreamQuery.Types.Endpoint 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 Endpoint = Endpoint'
{
Endpoint -> Text
address :: Prelude.Text,
Endpoint -> Integer
cachePeriodInMinutes :: Prelude.Integer
}
deriving (Endpoint -> Endpoint -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Endpoint -> Endpoint -> Bool
$c/= :: Endpoint -> Endpoint -> Bool
== :: Endpoint -> Endpoint -> Bool
$c== :: Endpoint -> Endpoint -> Bool
Prelude.Eq, ReadPrec [Endpoint]
ReadPrec Endpoint
Int -> ReadS Endpoint
ReadS [Endpoint]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Endpoint]
$creadListPrec :: ReadPrec [Endpoint]
readPrec :: ReadPrec Endpoint
$creadPrec :: ReadPrec Endpoint
readList :: ReadS [Endpoint]
$creadList :: ReadS [Endpoint]
readsPrec :: Int -> ReadS Endpoint
$creadsPrec :: Int -> ReadS Endpoint
Prelude.Read, Int -> Endpoint -> ShowS
[Endpoint] -> ShowS
Endpoint -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Endpoint] -> ShowS
$cshowList :: [Endpoint] -> ShowS
show :: Endpoint -> String
$cshow :: Endpoint -> String
showsPrec :: Int -> Endpoint -> ShowS
$cshowsPrec :: Int -> Endpoint -> ShowS
Prelude.Show, forall x. Rep Endpoint x -> Endpoint
forall x. Endpoint -> Rep Endpoint x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Endpoint x -> Endpoint
$cfrom :: forall x. Endpoint -> Rep Endpoint x
Prelude.Generic)
newEndpoint ::
Prelude.Text ->
Prelude.Integer ->
Endpoint
newEndpoint :: Text -> Integer -> Endpoint
newEndpoint Text
pAddress_ Integer
pCachePeriodInMinutes_ =
Endpoint'
{ $sel:address:Endpoint' :: Text
address = Text
pAddress_,
$sel:cachePeriodInMinutes:Endpoint' :: Integer
cachePeriodInMinutes = Integer
pCachePeriodInMinutes_
}
endpoint_address :: Lens.Lens' Endpoint Prelude.Text
endpoint_address :: Lens' Endpoint Text
endpoint_address = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Endpoint' {Text
address :: Text
$sel:address:Endpoint' :: Endpoint -> Text
address} -> Text
address) (\s :: Endpoint
s@Endpoint' {} Text
a -> Endpoint
s {$sel:address:Endpoint' :: Text
address = Text
a} :: Endpoint)
endpoint_cachePeriodInMinutes :: Lens.Lens' Endpoint Prelude.Integer
endpoint_cachePeriodInMinutes :: Lens' Endpoint Integer
endpoint_cachePeriodInMinutes = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Endpoint' {Integer
cachePeriodInMinutes :: Integer
$sel:cachePeriodInMinutes:Endpoint' :: Endpoint -> Integer
cachePeriodInMinutes} -> Integer
cachePeriodInMinutes) (\s :: Endpoint
s@Endpoint' {} Integer
a -> Endpoint
s {$sel:cachePeriodInMinutes:Endpoint' :: Integer
cachePeriodInMinutes = Integer
a} :: Endpoint)
instance Data.FromJSON Endpoint where
parseJSON :: Value -> Parser Endpoint
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"Endpoint"
( \Object
x ->
Text -> Integer -> Endpoint
Endpoint'
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
"Address")
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
"CachePeriodInMinutes")
)
instance Prelude.Hashable Endpoint where
hashWithSalt :: Int -> Endpoint -> Int
hashWithSalt Int
_salt Endpoint' {Integer
Text
cachePeriodInMinutes :: Integer
address :: Text
$sel:cachePeriodInMinutes:Endpoint' :: Endpoint -> Integer
$sel:address:Endpoint' :: Endpoint -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
address
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Integer
cachePeriodInMinutes
instance Prelude.NFData Endpoint where
rnf :: Endpoint -> ()
rnf Endpoint' {Integer
Text
cachePeriodInMinutes :: Integer
address :: Text
$sel:cachePeriodInMinutes:Endpoint' :: Endpoint -> Integer
$sel:address:Endpoint' :: Endpoint -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
address
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Integer
cachePeriodInMinutes