module Stratosphere.RedshiftServerless.Workgroup.EndpointProperty (
        module Exports, EndpointProperty(..), mkEndpointProperty
    ) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import {-# SOURCE #-} Stratosphere.RedshiftServerless.Workgroup.VpcEndpointProperty as Exports
import Stratosphere.ResourceProperties
import Stratosphere.Value
data EndpointProperty
  = -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-redshiftserverless-workgroup-endpoint.html>
    EndpointProperty {EndpointProperty -> ()
haddock_workaround_ :: (),
                      -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-redshiftserverless-workgroup-endpoint.html#cfn-redshiftserverless-workgroup-endpoint-address>
                      EndpointProperty -> Maybe (Value Text)
address :: (Prelude.Maybe (Value Prelude.Text)),
                      -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-redshiftserverless-workgroup-endpoint.html#cfn-redshiftserverless-workgroup-endpoint-port>
                      EndpointProperty -> Maybe (Value Integer)
port :: (Prelude.Maybe (Value Prelude.Integer)),
                      -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-redshiftserverless-workgroup-endpoint.html#cfn-redshiftserverless-workgroup-endpoint-vpcendpoints>
                      EndpointProperty -> Maybe [VpcEndpointProperty]
vpcEndpoints :: (Prelude.Maybe [VpcEndpointProperty])}
  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 Integer)
port = Maybe (Value Integer)
forall a. Maybe a
Prelude.Nothing, vpcEndpoints :: Maybe [VpcEndpointProperty]
vpcEndpoints = Maybe [VpcEndpointProperty]
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties EndpointProperty where
  toResourceProperties :: EndpointProperty -> ResourceProperties
toResourceProperties EndpointProperty {Maybe [VpcEndpointProperty]
Maybe (Value Integer)
Maybe (Value Text)
()
haddock_workaround_ :: EndpointProperty -> ()
address :: EndpointProperty -> Maybe (Value Text)
port :: EndpointProperty -> Maybe (Value Integer)
vpcEndpoints :: EndpointProperty -> Maybe [VpcEndpointProperty]
haddock_workaround_ :: ()
address :: Maybe (Value Text)
port :: Maybe (Value Integer)
vpcEndpoints :: Maybe [VpcEndpointProperty]
..}
    = ResourceProperties
        {awsType :: Text
awsType = Text
"AWS::RedshiftServerless::Workgroup.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 Integer -> (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 Integer -> (Key, Value))
-> Maybe (Value Integer) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Value Integer)
port,
                            Key -> [VpcEndpointProperty] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"VpcEndpoints" ([VpcEndpointProperty] -> (Key, Value))
-> Maybe [VpcEndpointProperty] -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [VpcEndpointProperty]
vpcEndpoints])}
instance JSON.ToJSON EndpointProperty where
  toJSON :: EndpointProperty -> Value
toJSON EndpointProperty {Maybe [VpcEndpointProperty]
Maybe (Value Integer)
Maybe (Value Text)
()
haddock_workaround_ :: EndpointProperty -> ()
address :: EndpointProperty -> Maybe (Value Text)
port :: EndpointProperty -> Maybe (Value Integer)
vpcEndpoints :: EndpointProperty -> Maybe [VpcEndpointProperty]
haddock_workaround_ :: ()
address :: Maybe (Value Text)
port :: Maybe (Value Integer)
vpcEndpoints :: Maybe [VpcEndpointProperty]
..}
    = [(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 Integer -> (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 Integer -> (Key, Value))
-> Maybe (Value Integer) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Value Integer)
port,
               Key -> [VpcEndpointProperty] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"VpcEndpoints" ([VpcEndpointProperty] -> (Key, Value))
-> Maybe [VpcEndpointProperty] -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [VpcEndpointProperty]
vpcEndpoints]))
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 [VpcEndpointProperty]
Maybe (Value Integer)
Maybe (Value Text)
()
haddock_workaround_ :: EndpointProperty -> ()
address :: EndpointProperty -> Maybe (Value Text)
port :: EndpointProperty -> Maybe (Value Integer)
vpcEndpoints :: EndpointProperty -> Maybe [VpcEndpointProperty]
haddock_workaround_ :: ()
address :: Maybe (Value Text)
port :: Maybe (Value Integer)
vpcEndpoints :: Maybe [VpcEndpointProperty]
..}
    = 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 [VpcEndpointProperty]
Maybe (Value Integer)
()
haddock_workaround_ :: ()
port :: Maybe (Value Integer)
vpcEndpoints :: Maybe [VpcEndpointProperty]
haddock_workaround_ :: ()
port :: Maybe (Value Integer)
vpcEndpoints :: Maybe [VpcEndpointProperty]
..}
instance Property "Port" EndpointProperty where
  type PropertyType "Port" EndpointProperty = Value Prelude.Integer
  set :: PropertyType "Port" EndpointProperty
-> EndpointProperty -> EndpointProperty
set PropertyType "Port" EndpointProperty
newValue EndpointProperty {Maybe [VpcEndpointProperty]
Maybe (Value Integer)
Maybe (Value Text)
()
haddock_workaround_ :: EndpointProperty -> ()
address :: EndpointProperty -> Maybe (Value Text)
port :: EndpointProperty -> Maybe (Value Integer)
vpcEndpoints :: EndpointProperty -> Maybe [VpcEndpointProperty]
haddock_workaround_ :: ()
address :: Maybe (Value Text)
port :: Maybe (Value Integer)
vpcEndpoints :: Maybe [VpcEndpointProperty]
..}
    = EndpointProperty {port :: Maybe (Value Integer)
port = Value Integer -> Maybe (Value Integer)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "Port" EndpointProperty
Value Integer
newValue, Maybe [VpcEndpointProperty]
Maybe (Value Text)
()
haddock_workaround_ :: ()
address :: Maybe (Value Text)
vpcEndpoints :: Maybe [VpcEndpointProperty]
haddock_workaround_ :: ()
address :: Maybe (Value Text)
vpcEndpoints :: Maybe [VpcEndpointProperty]
..}
instance Property "VpcEndpoints" EndpointProperty where
  type PropertyType "VpcEndpoints" EndpointProperty = [VpcEndpointProperty]
  set :: PropertyType "VpcEndpoints" EndpointProperty
-> EndpointProperty -> EndpointProperty
set PropertyType "VpcEndpoints" EndpointProperty
newValue EndpointProperty {Maybe [VpcEndpointProperty]
Maybe (Value Integer)
Maybe (Value Text)
()
haddock_workaround_ :: EndpointProperty -> ()
address :: EndpointProperty -> Maybe (Value Text)
port :: EndpointProperty -> Maybe (Value Integer)
vpcEndpoints :: EndpointProperty -> Maybe [VpcEndpointProperty]
haddock_workaround_ :: ()
address :: Maybe (Value Text)
port :: Maybe (Value Integer)
vpcEndpoints :: Maybe [VpcEndpointProperty]
..}
    = EndpointProperty {vpcEndpoints :: Maybe [VpcEndpointProperty]
vpcEndpoints = [VpcEndpointProperty] -> Maybe [VpcEndpointProperty]
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure [VpcEndpointProperty]
PropertyType "VpcEndpoints" EndpointProperty
newValue, Maybe (Value Integer)
Maybe (Value Text)
()
haddock_workaround_ :: ()
address :: Maybe (Value Text)
port :: Maybe (Value Integer)
haddock_workaround_ :: ()
address :: Maybe (Value Text)
port :: Maybe (Value Integer)
..}