/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #pragma once #include #include #include #include #include #include #include #include namespace Aws { namespace Utils { namespace Json { class JsonValue; class JsonView; } // namespace Json } // namespace Utils namespace GreengrassV2 { namespace Model { /** *

Contains parameters for a Lambda function that runs on IoT * Greengrass.

See Also:

AWS * API Reference

*/ class LambdaExecutionParameters { public: AWS_GREENGRASSV2_API LambdaExecutionParameters(); AWS_GREENGRASSV2_API LambdaExecutionParameters(Aws::Utils::Json::JsonView jsonValue); AWS_GREENGRASSV2_API LambdaExecutionParameters& operator=(Aws::Utils::Json::JsonView jsonValue); AWS_GREENGRASSV2_API Aws::Utils::Json::JsonValue Jsonize() const; /** *

The list of event sources to which to subscribe to receive work messages. The * Lambda function runs when it receives a message from an event source. You can * subscribe this function to local publish/subscribe messages and Amazon Web * Services IoT Core MQTT messages.

*/ inline const Aws::Vector& GetEventSources() const{ return m_eventSources; } /** *

The list of event sources to which to subscribe to receive work messages. The * Lambda function runs when it receives a message from an event source. You can * subscribe this function to local publish/subscribe messages and Amazon Web * Services IoT Core MQTT messages.

*/ inline bool EventSourcesHasBeenSet() const { return m_eventSourcesHasBeenSet; } /** *

The list of event sources to which to subscribe to receive work messages. The * Lambda function runs when it receives a message from an event source. You can * subscribe this function to local publish/subscribe messages and Amazon Web * Services IoT Core MQTT messages.

*/ inline void SetEventSources(const Aws::Vector& value) { m_eventSourcesHasBeenSet = true; m_eventSources = value; } /** *

The list of event sources to which to subscribe to receive work messages. The * Lambda function runs when it receives a message from an event source. You can * subscribe this function to local publish/subscribe messages and Amazon Web * Services IoT Core MQTT messages.

*/ inline void SetEventSources(Aws::Vector&& value) { m_eventSourcesHasBeenSet = true; m_eventSources = std::move(value); } /** *

The list of event sources to which to subscribe to receive work messages. The * Lambda function runs when it receives a message from an event source. You can * subscribe this function to local publish/subscribe messages and Amazon Web * Services IoT Core MQTT messages.

*/ inline LambdaExecutionParameters& WithEventSources(const Aws::Vector& value) { SetEventSources(value); return *this;} /** *

The list of event sources to which to subscribe to receive work messages. The * Lambda function runs when it receives a message from an event source. You can * subscribe this function to local publish/subscribe messages and Amazon Web * Services IoT Core MQTT messages.

*/ inline LambdaExecutionParameters& WithEventSources(Aws::Vector&& value) { SetEventSources(std::move(value)); return *this;} /** *

The list of event sources to which to subscribe to receive work messages. The * Lambda function runs when it receives a message from an event source. You can * subscribe this function to local publish/subscribe messages and Amazon Web * Services IoT Core MQTT messages.

*/ inline LambdaExecutionParameters& AddEventSources(const LambdaEventSource& value) { m_eventSourcesHasBeenSet = true; m_eventSources.push_back(value); return *this; } /** *

The list of event sources to which to subscribe to receive work messages. The * Lambda function runs when it receives a message from an event source. You can * subscribe this function to local publish/subscribe messages and Amazon Web * Services IoT Core MQTT messages.

*/ inline LambdaExecutionParameters& AddEventSources(LambdaEventSource&& value) { m_eventSourcesHasBeenSet = true; m_eventSources.push_back(std::move(value)); return *this; } /** *

The maximum size of the message queue for the Lambda function component. The * IoT Greengrass core stores messages in a FIFO (first-in-first-out) queue until * it can run the Lambda function to consume each message.

*/ inline int GetMaxQueueSize() const{ return m_maxQueueSize; } /** *

The maximum size of the message queue for the Lambda function component. The * IoT Greengrass core stores messages in a FIFO (first-in-first-out) queue until * it can run the Lambda function to consume each message.

*/ inline bool MaxQueueSizeHasBeenSet() const { return m_maxQueueSizeHasBeenSet; } /** *

The maximum size of the message queue for the Lambda function component. The * IoT Greengrass core stores messages in a FIFO (first-in-first-out) queue until * it can run the Lambda function to consume each message.

*/ inline void SetMaxQueueSize(int value) { m_maxQueueSizeHasBeenSet = true; m_maxQueueSize = value; } /** *

The maximum size of the message queue for the Lambda function component. The * IoT Greengrass core stores messages in a FIFO (first-in-first-out) queue until * it can run the Lambda function to consume each message.

*/ inline LambdaExecutionParameters& WithMaxQueueSize(int value) { SetMaxQueueSize(value); return *this;} /** *

The maximum number of instances that a non-pinned Lambda function can run at * the same time.

*/ inline int GetMaxInstancesCount() const{ return m_maxInstancesCount; } /** *

The maximum number of instances that a non-pinned Lambda function can run at * the same time.

*/ inline bool MaxInstancesCountHasBeenSet() const { return m_maxInstancesCountHasBeenSet; } /** *

The maximum number of instances that a non-pinned Lambda function can run at * the same time.

*/ inline void SetMaxInstancesCount(int value) { m_maxInstancesCountHasBeenSet = true; m_maxInstancesCount = value; } /** *

The maximum number of instances that a non-pinned Lambda function can run at * the same time.

*/ inline LambdaExecutionParameters& WithMaxInstancesCount(int value) { SetMaxInstancesCount(value); return *this;} /** *

The maximum amount of time in seconds that a non-pinned Lambda function can * idle before the IoT Greengrass Core software stops its process.

*/ inline int GetMaxIdleTimeInSeconds() const{ return m_maxIdleTimeInSeconds; } /** *

The maximum amount of time in seconds that a non-pinned Lambda function can * idle before the IoT Greengrass Core software stops its process.

*/ inline bool MaxIdleTimeInSecondsHasBeenSet() const { return m_maxIdleTimeInSecondsHasBeenSet; } /** *

The maximum amount of time in seconds that a non-pinned Lambda function can * idle before the IoT Greengrass Core software stops its process.

*/ inline void SetMaxIdleTimeInSeconds(int value) { m_maxIdleTimeInSecondsHasBeenSet = true; m_maxIdleTimeInSeconds = value; } /** *

The maximum amount of time in seconds that a non-pinned Lambda function can * idle before the IoT Greengrass Core software stops its process.

*/ inline LambdaExecutionParameters& WithMaxIdleTimeInSeconds(int value) { SetMaxIdleTimeInSeconds(value); return *this;} /** *

The maximum amount of time in seconds that the Lambda function can process a * work item.

*/ inline int GetTimeoutInSeconds() const{ return m_timeoutInSeconds; } /** *

The maximum amount of time in seconds that the Lambda function can process a * work item.

*/ inline bool TimeoutInSecondsHasBeenSet() const { return m_timeoutInSecondsHasBeenSet; } /** *

The maximum amount of time in seconds that the Lambda function can process a * work item.

*/ inline void SetTimeoutInSeconds(int value) { m_timeoutInSecondsHasBeenSet = true; m_timeoutInSeconds = value; } /** *

The maximum amount of time in seconds that the Lambda function can process a * work item.

*/ inline LambdaExecutionParameters& WithTimeoutInSeconds(int value) { SetTimeoutInSeconds(value); return *this;} /** *

The interval in seconds at which a pinned (also known as long-lived) Lambda * function component sends status updates to the Lambda manager component.

*/ inline int GetStatusTimeoutInSeconds() const{ return m_statusTimeoutInSeconds; } /** *

The interval in seconds at which a pinned (also known as long-lived) Lambda * function component sends status updates to the Lambda manager component.

*/ inline bool StatusTimeoutInSecondsHasBeenSet() const { return m_statusTimeoutInSecondsHasBeenSet; } /** *

The interval in seconds at which a pinned (also known as long-lived) Lambda * function component sends status updates to the Lambda manager component.

*/ inline void SetStatusTimeoutInSeconds(int value) { m_statusTimeoutInSecondsHasBeenSet = true; m_statusTimeoutInSeconds = value; } /** *

The interval in seconds at which a pinned (also known as long-lived) Lambda * function component sends status updates to the Lambda manager component.

*/ inline LambdaExecutionParameters& WithStatusTimeoutInSeconds(int value) { SetStatusTimeoutInSeconds(value); return *this;} /** *

Whether or not the Lambda function is pinned, or long-lived.

  • *

    A pinned Lambda function starts when IoT Greengrass starts and keeps running * in its own container.

  • A non-pinned Lambda function starts only * when it receives a work item and exists after it idles for * maxIdleTimeInSeconds. If the function has multiple work items, the * IoT Greengrass Core software creates multiple instances of the function.

    *

Default: true

*/ inline bool GetPinned() const{ return m_pinned; } /** *

Whether or not the Lambda function is pinned, or long-lived.

  • *

    A pinned Lambda function starts when IoT Greengrass starts and keeps running * in its own container.

  • A non-pinned Lambda function starts only * when it receives a work item and exists after it idles for * maxIdleTimeInSeconds. If the function has multiple work items, the * IoT Greengrass Core software creates multiple instances of the function.

    *

Default: true

*/ inline bool PinnedHasBeenSet() const { return m_pinnedHasBeenSet; } /** *

Whether or not the Lambda function is pinned, or long-lived.

  • *

    A pinned Lambda function starts when IoT Greengrass starts and keeps running * in its own container.

  • A non-pinned Lambda function starts only * when it receives a work item and exists after it idles for * maxIdleTimeInSeconds. If the function has multiple work items, the * IoT Greengrass Core software creates multiple instances of the function.

    *

Default: true

*/ inline void SetPinned(bool value) { m_pinnedHasBeenSet = true; m_pinned = value; } /** *

Whether or not the Lambda function is pinned, or long-lived.

  • *

    A pinned Lambda function starts when IoT Greengrass starts and keeps running * in its own container.

  • A non-pinned Lambda function starts only * when it receives a work item and exists after it idles for * maxIdleTimeInSeconds. If the function has multiple work items, the * IoT Greengrass Core software creates multiple instances of the function.

    *

Default: true

*/ inline LambdaExecutionParameters& WithPinned(bool value) { SetPinned(value); return *this;} /** *

The encoding type that the Lambda function supports.

Default: * json

*/ inline const LambdaInputPayloadEncodingType& GetInputPayloadEncodingType() const{ return m_inputPayloadEncodingType; } /** *

The encoding type that the Lambda function supports.

Default: * json

*/ inline bool InputPayloadEncodingTypeHasBeenSet() const { return m_inputPayloadEncodingTypeHasBeenSet; } /** *

The encoding type that the Lambda function supports.

Default: * json

*/ inline void SetInputPayloadEncodingType(const LambdaInputPayloadEncodingType& value) { m_inputPayloadEncodingTypeHasBeenSet = true; m_inputPayloadEncodingType = value; } /** *

The encoding type that the Lambda function supports.

Default: * json

*/ inline void SetInputPayloadEncodingType(LambdaInputPayloadEncodingType&& value) { m_inputPayloadEncodingTypeHasBeenSet = true; m_inputPayloadEncodingType = std::move(value); } /** *

The encoding type that the Lambda function supports.

Default: * json

*/ inline LambdaExecutionParameters& WithInputPayloadEncodingType(const LambdaInputPayloadEncodingType& value) { SetInputPayloadEncodingType(value); return *this;} /** *

The encoding type that the Lambda function supports.

Default: * json

*/ inline LambdaExecutionParameters& WithInputPayloadEncodingType(LambdaInputPayloadEncodingType&& value) { SetInputPayloadEncodingType(std::move(value)); return *this;} /** *

The list of arguments to pass to the Lambda function when it runs.

*/ inline const Aws::Vector& GetExecArgs() const{ return m_execArgs; } /** *

The list of arguments to pass to the Lambda function when it runs.

*/ inline bool ExecArgsHasBeenSet() const { return m_execArgsHasBeenSet; } /** *

The list of arguments to pass to the Lambda function when it runs.

*/ inline void SetExecArgs(const Aws::Vector& value) { m_execArgsHasBeenSet = true; m_execArgs = value; } /** *

The list of arguments to pass to the Lambda function when it runs.

*/ inline void SetExecArgs(Aws::Vector&& value) { m_execArgsHasBeenSet = true; m_execArgs = std::move(value); } /** *

The list of arguments to pass to the Lambda function when it runs.

*/ inline LambdaExecutionParameters& WithExecArgs(const Aws::Vector& value) { SetExecArgs(value); return *this;} /** *

The list of arguments to pass to the Lambda function when it runs.

*/ inline LambdaExecutionParameters& WithExecArgs(Aws::Vector&& value) { SetExecArgs(std::move(value)); return *this;} /** *

The list of arguments to pass to the Lambda function when it runs.

*/ inline LambdaExecutionParameters& AddExecArgs(const Aws::String& value) { m_execArgsHasBeenSet = true; m_execArgs.push_back(value); return *this; } /** *

The list of arguments to pass to the Lambda function when it runs.

*/ inline LambdaExecutionParameters& AddExecArgs(Aws::String&& value) { m_execArgsHasBeenSet = true; m_execArgs.push_back(std::move(value)); return *this; } /** *

The list of arguments to pass to the Lambda function when it runs.

*/ inline LambdaExecutionParameters& AddExecArgs(const char* value) { m_execArgsHasBeenSet = true; m_execArgs.push_back(value); return *this; } /** *

The map of environment variables that are available to the Lambda function * when it runs.

*/ inline const Aws::Map& GetEnvironmentVariables() const{ return m_environmentVariables; } /** *

The map of environment variables that are available to the Lambda function * when it runs.

*/ inline bool EnvironmentVariablesHasBeenSet() const { return m_environmentVariablesHasBeenSet; } /** *

The map of environment variables that are available to the Lambda function * when it runs.

*/ inline void SetEnvironmentVariables(const Aws::Map& value) { m_environmentVariablesHasBeenSet = true; m_environmentVariables = value; } /** *

The map of environment variables that are available to the Lambda function * when it runs.

*/ inline void SetEnvironmentVariables(Aws::Map&& value) { m_environmentVariablesHasBeenSet = true; m_environmentVariables = std::move(value); } /** *

The map of environment variables that are available to the Lambda function * when it runs.

*/ inline LambdaExecutionParameters& WithEnvironmentVariables(const Aws::Map& value) { SetEnvironmentVariables(value); return *this;} /** *

The map of environment variables that are available to the Lambda function * when it runs.

*/ inline LambdaExecutionParameters& WithEnvironmentVariables(Aws::Map&& value) { SetEnvironmentVariables(std::move(value)); return *this;} /** *

The map of environment variables that are available to the Lambda function * when it runs.

*/ inline LambdaExecutionParameters& AddEnvironmentVariables(const Aws::String& key, const Aws::String& value) { m_environmentVariablesHasBeenSet = true; m_environmentVariables.emplace(key, value); return *this; } /** *

The map of environment variables that are available to the Lambda function * when it runs.

*/ inline LambdaExecutionParameters& AddEnvironmentVariables(Aws::String&& key, const Aws::String& value) { m_environmentVariablesHasBeenSet = true; m_environmentVariables.emplace(std::move(key), value); return *this; } /** *

The map of environment variables that are available to the Lambda function * when it runs.

*/ inline LambdaExecutionParameters& AddEnvironmentVariables(const Aws::String& key, Aws::String&& value) { m_environmentVariablesHasBeenSet = true; m_environmentVariables.emplace(key, std::move(value)); return *this; } /** *

The map of environment variables that are available to the Lambda function * when it runs.

*/ inline LambdaExecutionParameters& AddEnvironmentVariables(Aws::String&& key, Aws::String&& value) { m_environmentVariablesHasBeenSet = true; m_environmentVariables.emplace(std::move(key), std::move(value)); return *this; } /** *

The map of environment variables that are available to the Lambda function * when it runs.

*/ inline LambdaExecutionParameters& AddEnvironmentVariables(const char* key, Aws::String&& value) { m_environmentVariablesHasBeenSet = true; m_environmentVariables.emplace(key, std::move(value)); return *this; } /** *

The map of environment variables that are available to the Lambda function * when it runs.

*/ inline LambdaExecutionParameters& AddEnvironmentVariables(Aws::String&& key, const char* value) { m_environmentVariablesHasBeenSet = true; m_environmentVariables.emplace(std::move(key), value); return *this; } /** *

The map of environment variables that are available to the Lambda function * when it runs.

*/ inline LambdaExecutionParameters& AddEnvironmentVariables(const char* key, const char* value) { m_environmentVariablesHasBeenSet = true; m_environmentVariables.emplace(key, value); return *this; } /** *

The parameters for the Linux process that contains the Lambda function.

*/ inline const LambdaLinuxProcessParams& GetLinuxProcessParams() const{ return m_linuxProcessParams; } /** *

The parameters for the Linux process that contains the Lambda function.

*/ inline bool LinuxProcessParamsHasBeenSet() const { return m_linuxProcessParamsHasBeenSet; } /** *

The parameters for the Linux process that contains the Lambda function.

*/ inline void SetLinuxProcessParams(const LambdaLinuxProcessParams& value) { m_linuxProcessParamsHasBeenSet = true; m_linuxProcessParams = value; } /** *

The parameters for the Linux process that contains the Lambda function.

*/ inline void SetLinuxProcessParams(LambdaLinuxProcessParams&& value) { m_linuxProcessParamsHasBeenSet = true; m_linuxProcessParams = std::move(value); } /** *

The parameters for the Linux process that contains the Lambda function.

*/ inline LambdaExecutionParameters& WithLinuxProcessParams(const LambdaLinuxProcessParams& value) { SetLinuxProcessParams(value); return *this;} /** *

The parameters for the Linux process that contains the Lambda function.

*/ inline LambdaExecutionParameters& WithLinuxProcessParams(LambdaLinuxProcessParams&& value) { SetLinuxProcessParams(std::move(value)); return *this;} private: Aws::Vector m_eventSources; bool m_eventSourcesHasBeenSet = false; int m_maxQueueSize; bool m_maxQueueSizeHasBeenSet = false; int m_maxInstancesCount; bool m_maxInstancesCountHasBeenSet = false; int m_maxIdleTimeInSeconds; bool m_maxIdleTimeInSecondsHasBeenSet = false; int m_timeoutInSeconds; bool m_timeoutInSecondsHasBeenSet = false; int m_statusTimeoutInSeconds; bool m_statusTimeoutInSecondsHasBeenSet = false; bool m_pinned; bool m_pinnedHasBeenSet = false; LambdaInputPayloadEncodingType m_inputPayloadEncodingType; bool m_inputPayloadEncodingTypeHasBeenSet = false; Aws::Vector m_execArgs; bool m_execArgsHasBeenSet = false; Aws::Map m_environmentVariables; bool m_environmentVariablesHasBeenSet = false; LambdaLinuxProcessParams m_linuxProcessParams; bool m_linuxProcessParamsHasBeenSet = false; }; } // namespace Model } // namespace GreengrassV2 } // namespace Aws