packages feed

stratosphere-0.34.0: library-gen/Stratosphere/ResourceProperties/GreengrassFunctionDefinitionFunctionConfiguration.hs

{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TupleSections #-}

-- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-greengrass-functiondefinition-functionconfiguration.html

module Stratosphere.ResourceProperties.GreengrassFunctionDefinitionFunctionConfiguration where

import Stratosphere.ResourceImports
import Stratosphere.ResourceProperties.GreengrassFunctionDefinitionEnvironment

-- | Full data type definition for
-- GreengrassFunctionDefinitionFunctionConfiguration. See
-- 'greengrassFunctionDefinitionFunctionConfiguration' for a more convenient
-- constructor.
data GreengrassFunctionDefinitionFunctionConfiguration =
  GreengrassFunctionDefinitionFunctionConfiguration
  { _greengrassFunctionDefinitionFunctionConfigurationEncodingType :: Maybe (Val Text)
  , _greengrassFunctionDefinitionFunctionConfigurationEnvironment :: Maybe GreengrassFunctionDefinitionEnvironment
  , _greengrassFunctionDefinitionFunctionConfigurationExecArgs :: Maybe (Val Text)
  , _greengrassFunctionDefinitionFunctionConfigurationExecutable :: Maybe (Val Text)
  , _greengrassFunctionDefinitionFunctionConfigurationMemorySize :: Val Integer
  , _greengrassFunctionDefinitionFunctionConfigurationPinned :: Maybe (Val Bool)
  , _greengrassFunctionDefinitionFunctionConfigurationTimeout :: Val Integer
  } deriving (Show, Eq)

instance ToJSON GreengrassFunctionDefinitionFunctionConfiguration where
  toJSON GreengrassFunctionDefinitionFunctionConfiguration{..} =
    object $
    catMaybes
    [ fmap (("EncodingType",) . toJSON) _greengrassFunctionDefinitionFunctionConfigurationEncodingType
    , fmap (("Environment",) . toJSON) _greengrassFunctionDefinitionFunctionConfigurationEnvironment
    , fmap (("ExecArgs",) . toJSON) _greengrassFunctionDefinitionFunctionConfigurationExecArgs
    , fmap (("Executable",) . toJSON) _greengrassFunctionDefinitionFunctionConfigurationExecutable
    , (Just . ("MemorySize",) . toJSON) _greengrassFunctionDefinitionFunctionConfigurationMemorySize
    , fmap (("Pinned",) . toJSON) _greengrassFunctionDefinitionFunctionConfigurationPinned
    , (Just . ("Timeout",) . toJSON) _greengrassFunctionDefinitionFunctionConfigurationTimeout
    ]

-- | Constructor for 'GreengrassFunctionDefinitionFunctionConfiguration'
-- containing required fields as arguments.
greengrassFunctionDefinitionFunctionConfiguration
  :: Val Integer -- ^ 'gfdfcMemorySize'
  -> Val Integer -- ^ 'gfdfcTimeout'
  -> GreengrassFunctionDefinitionFunctionConfiguration
greengrassFunctionDefinitionFunctionConfiguration memorySizearg timeoutarg =
  GreengrassFunctionDefinitionFunctionConfiguration
  { _greengrassFunctionDefinitionFunctionConfigurationEncodingType = Nothing
  , _greengrassFunctionDefinitionFunctionConfigurationEnvironment = Nothing
  , _greengrassFunctionDefinitionFunctionConfigurationExecArgs = Nothing
  , _greengrassFunctionDefinitionFunctionConfigurationExecutable = Nothing
  , _greengrassFunctionDefinitionFunctionConfigurationMemorySize = memorySizearg
  , _greengrassFunctionDefinitionFunctionConfigurationPinned = Nothing
  , _greengrassFunctionDefinitionFunctionConfigurationTimeout = timeoutarg
  }

-- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-greengrass-functiondefinition-functionconfiguration.html#cfn-greengrass-functiondefinition-functionconfiguration-encodingtype
gfdfcEncodingType :: Lens' GreengrassFunctionDefinitionFunctionConfiguration (Maybe (Val Text))
gfdfcEncodingType = lens _greengrassFunctionDefinitionFunctionConfigurationEncodingType (\s a -> s { _greengrassFunctionDefinitionFunctionConfigurationEncodingType = a })

-- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-greengrass-functiondefinition-functionconfiguration.html#cfn-greengrass-functiondefinition-functionconfiguration-environment
gfdfcEnvironment :: Lens' GreengrassFunctionDefinitionFunctionConfiguration (Maybe GreengrassFunctionDefinitionEnvironment)
gfdfcEnvironment = lens _greengrassFunctionDefinitionFunctionConfigurationEnvironment (\s a -> s { _greengrassFunctionDefinitionFunctionConfigurationEnvironment = a })

-- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-greengrass-functiondefinition-functionconfiguration.html#cfn-greengrass-functiondefinition-functionconfiguration-execargs
gfdfcExecArgs :: Lens' GreengrassFunctionDefinitionFunctionConfiguration (Maybe (Val Text))
gfdfcExecArgs = lens _greengrassFunctionDefinitionFunctionConfigurationExecArgs (\s a -> s { _greengrassFunctionDefinitionFunctionConfigurationExecArgs = a })

-- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-greengrass-functiondefinition-functionconfiguration.html#cfn-greengrass-functiondefinition-functionconfiguration-executable
gfdfcExecutable :: Lens' GreengrassFunctionDefinitionFunctionConfiguration (Maybe (Val Text))
gfdfcExecutable = lens _greengrassFunctionDefinitionFunctionConfigurationExecutable (\s a -> s { _greengrassFunctionDefinitionFunctionConfigurationExecutable = a })

-- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-greengrass-functiondefinition-functionconfiguration.html#cfn-greengrass-functiondefinition-functionconfiguration-memorysize
gfdfcMemorySize :: Lens' GreengrassFunctionDefinitionFunctionConfiguration (Val Integer)
gfdfcMemorySize = lens _greengrassFunctionDefinitionFunctionConfigurationMemorySize (\s a -> s { _greengrassFunctionDefinitionFunctionConfigurationMemorySize = a })

-- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-greengrass-functiondefinition-functionconfiguration.html#cfn-greengrass-functiondefinition-functionconfiguration-pinned
gfdfcPinned :: Lens' GreengrassFunctionDefinitionFunctionConfiguration (Maybe (Val Bool))
gfdfcPinned = lens _greengrassFunctionDefinitionFunctionConfigurationPinned (\s a -> s { _greengrassFunctionDefinitionFunctionConfigurationPinned = a })

-- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-greengrass-functiondefinition-functionconfiguration.html#cfn-greengrass-functiondefinition-functionconfiguration-timeout
gfdfcTimeout :: Lens' GreengrassFunctionDefinitionFunctionConfiguration (Val Integer)
gfdfcTimeout = lens _greengrassFunctionDefinitionFunctionConfigurationTimeout (\s a -> s { _greengrassFunctionDefinitionFunctionConfigurationTimeout = a })