module Stratosphere.Redshift.Cluster.EndpointProperty (
EndpointProperty(..), mkEndpointProperty
) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import Stratosphere.ResourceProperties
import Stratosphere.Value
data EndpointProperty
=
EndpointProperty {EndpointProperty -> ()
haddock_workaround_ :: (),
EndpointProperty -> Maybe (Value Text)
address :: (Prelude.Maybe (Value Prelude.Text)),
EndpointProperty -> Maybe (Value Text)
port :: (Prelude.Maybe (Value Prelude.Text))}
deriving stock (EndpointProperty -> EndpointProperty -> Bool
(EndpointProperty -> EndpointProperty -> Bool)
-> (EndpointProperty -> EndpointProperty -> Bool)
-> Eq EndpointProperty
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: EndpointProperty -> EndpointProperty -> Bool
== :: EndpointProperty -> EndpointProperty -> Bool
$c/= :: EndpointProperty -> EndpointProperty -> Bool
/= :: EndpointProperty -> EndpointProperty -> Bool
Prelude.Eq, Int -> EndpointProperty -> ShowS
[EndpointProperty] -> ShowS
EndpointProperty -> String
(Int -> EndpointProperty -> ShowS)
-> (EndpointProperty -> String)
-> ([EndpointProperty] -> ShowS)
-> Show EndpointProperty
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> EndpointProperty -> ShowS
showsPrec :: Int -> EndpointProperty -> ShowS
$cshow :: EndpointProperty -> String
show :: EndpointProperty -> String
$cshowList :: [EndpointProperty] -> ShowS
showList :: [EndpointProperty] -> ShowS
Prelude.Show)
mkEndpointProperty :: EndpointProperty
mkEndpointProperty :: EndpointProperty
mkEndpointProperty
= EndpointProperty
{haddock_workaround_ :: ()
haddock_workaround_ = (), address :: Maybe (Value Text)
address = Maybe (Value Text)
forall a. Maybe a
Prelude.Nothing,
port :: Maybe (Value Text)
port = Maybe (Value Text)
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties EndpointProperty where
toResourceProperties :: EndpointProperty -> ResourceProperties
toResourceProperties EndpointProperty {Maybe (Value Text)
()
haddock_workaround_ :: EndpointProperty -> ()
address :: EndpointProperty -> Maybe (Value Text)
port :: EndpointProperty -> Maybe (Value Text)
haddock_workaround_ :: ()
address :: Maybe (Value Text)
port :: Maybe (Value Text)
..}
= ResourceProperties
{awsType :: Text
awsType = Text
"AWS::Redshift::Cluster.Endpoint",
supportsTags :: Bool
supportsTags = Bool
Prelude.False,
properties :: Object
properties = [Item Object] -> Object
forall l. IsList l => [Item l] -> l
Prelude.fromList
([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[Key -> Value Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"Address" (Value Text -> (Key, Value))
-> Maybe (Value Text) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Value Text)
address,
Key -> Value Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"Port" (Value Text -> (Key, Value))
-> Maybe (Value Text) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Value Text)
port])}
instance JSON.ToJSON EndpointProperty where
toJSON :: EndpointProperty -> Value
toJSON EndpointProperty {Maybe (Value Text)
()
haddock_workaround_ :: EndpointProperty -> ()
address :: EndpointProperty -> Maybe (Value Text)
port :: EndpointProperty -> Maybe (Value Text)
haddock_workaround_ :: ()
address :: Maybe (Value Text)
port :: Maybe (Value Text)
..}
= [(Key, Value)] -> Value
JSON.object
([Item [(Key, Value)]] -> [(Key, Value)]
forall l. IsList l => [Item l] -> l
Prelude.fromList
([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[Key -> Value Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"Address" (Value Text -> (Key, Value))
-> Maybe (Value Text) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Value Text)
address,
Key -> Value Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"Port" (Value Text -> (Key, Value))
-> Maybe (Value Text) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Value Text)
port]))
instance Property "Address" EndpointProperty where
type PropertyType "Address" EndpointProperty = Value Prelude.Text
set :: PropertyType "Address" EndpointProperty
-> EndpointProperty -> EndpointProperty
set PropertyType "Address" EndpointProperty
newValue EndpointProperty {Maybe (Value Text)
()
haddock_workaround_ :: EndpointProperty -> ()
address :: EndpointProperty -> Maybe (Value Text)
port :: EndpointProperty -> Maybe (Value Text)
haddock_workaround_ :: ()
address :: Maybe (Value Text)
port :: Maybe (Value Text)
..}
= EndpointProperty {address :: Maybe (Value Text)
address = Value Text -> Maybe (Value Text)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "Address" EndpointProperty
Value Text
newValue, Maybe (Value Text)
()
haddock_workaround_ :: ()
port :: Maybe (Value Text)
haddock_workaround_ :: ()
port :: Maybe (Value Text)
..}
instance Property "Port" EndpointProperty where
type PropertyType "Port" EndpointProperty = Value Prelude.Text
set :: PropertyType "Port" EndpointProperty
-> EndpointProperty -> EndpointProperty
set PropertyType "Port" EndpointProperty
newValue EndpointProperty {Maybe (Value Text)
()
haddock_workaround_ :: EndpointProperty -> ()
address :: EndpointProperty -> Maybe (Value Text)
port :: EndpointProperty -> Maybe (Value Text)
haddock_workaround_ :: ()
address :: Maybe (Value Text)
port :: Maybe (Value Text)
..}
= EndpointProperty {port :: Maybe (Value Text)
port = Value Text -> Maybe (Value Text)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "Port" EndpointProperty
Value Text
newValue, Maybe (Value Text)
()
haddock_workaround_ :: ()
address :: Maybe (Value Text)
haddock_workaround_ :: ()
address :: Maybe (Value Text)
..}