]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS-Labs/Source/FreeRTOS-IoT-Libraries/c_sdk/aws/jobs/include/types/aws_iot_jobs_types.h
Add the Labs projects provided in the V10.2.1_191129 zip file.
[freertos] / FreeRTOS-Labs / Source / FreeRTOS-IoT-Libraries / c_sdk / aws / jobs / include / types / aws_iot_jobs_types.h
diff --git a/FreeRTOS-Labs/Source/FreeRTOS-IoT-Libraries/c_sdk/aws/jobs/include/types/aws_iot_jobs_types.h b/FreeRTOS-Labs/Source/FreeRTOS-IoT-Libraries/c_sdk/aws/jobs/include/types/aws_iot_jobs_types.h
new file mode 100644 (file)
index 0000000..dbeebb7
--- /dev/null
@@ -0,0 +1,1011 @@
+/*\r
+ * AWS IoT Jobs V1.0.0\r
+ * Copyright (C) 2019 Amazon.com, Inc. or its affiliates.  All Rights Reserved.\r
+ *\r
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of\r
+ * this software and associated documentation files (the "Software"), to deal in\r
+ * the Software without restriction, including without limitation the rights to\r
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\r
+ * the Software, and to permit persons to whom the Software is furnished to do so,\r
+ * subject to the following conditions:\r
+ *\r
+ * The above copyright notice and this permission notice shall be included in all\r
+ * copies or substantial portions of the Software.\r
+ *\r
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\r
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\r
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\r
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\r
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
+ */\r
+\r
+/**\r
+ * @file aws_iot_jobs_types.h\r
+ * @brief Types of the Jobs library.\r
+ */\r
+\r
+#ifndef AWS_IOT_JOBS_TYPES_H_\r
+#define AWS_IOT_JOBS_TYPES_H_\r
+\r
+/* The config header is always included first. */\r
+#include "iot_config.h"\r
+\r
+/* MQTT types include. */\r
+#include "types/iot_mqtt_types.h"\r
+\r
+/*---------------------------- Jobs handle types ----------------------------*/\r
+\r
+/**\r
+ * @handles{jobs,Jobs library}\r
+ */\r
+\r
+/**\r
+ * @ingroup jobs_datatypes_handles\r
+ * @brief Opaque handle that references an in-progress Jobs operation.\r
+ *\r
+ * Set as an output parameter of @ref jobs_function_getpendingasync, @ref jobs_function_startnextasync,\r
+ * @ref jobs_function_describeasync, and @ref jobs_function_updateasync. These functions send a\r
+ * message to the Jobs service requesting a Jobs operation; the result of this operation\r
+ * is unknown until the Jobs service sends a response. Therefore, this handle serves as a\r
+ * reference to Jobs operations awaiting a response from the Jobs service.\r
+ *\r
+ * This reference will be valid from the successful return of @ref jobs_function_getpendingasync,\r
+ * @ref jobs_function_startnextasync, @ref jobs_function_describeasync, and @ref jobs_function_updateasync.\r
+ * The reference becomes invalid once the [completion callback](@ref AwsIotJobsCallbackInfo_t)\r
+ * is invoked, or @ref jobs_function_wait returns.\r
+ *\r
+ * @initializer{AwsIotJobsOperation_t,AWS_IOT_JOBS_OPERATION_INITIALIZER}\r
+ *\r
+ * @see @ref jobs_function_wait and #AWS_IOT_JOBS_FLAG_WAITABLE for waiting on\r
+ * a reference; or #AwsIotJobsCallbackInfo_t and #AwsIotJobsCallbackParam_t for an\r
+ * asynchronous notification of completion.\r
+ */\r
+typedef struct _jobsOperation * AwsIotJobsOperation_t;\r
+\r
+/*-------------------------- Jobs enumerated types --------------------------*/\r
+\r
+/**\r
+ * @enums{jobs,Jobs library}\r
+ */\r
+\r
+/**\r
+ * @ingroup jobs_datatypes_enums\r
+ * @brief Return codes of [Jobs functions](@ref jobs_functions).\r
+ *\r
+ * The function @ref jobs_function_strerror can be used to get a return code's\r
+ * description.\r
+ *\r
+ * The values between #AWS_IOT_JOBS_INVALID_TOPIC and #AWS_IOT_JOBS_TERMINAL_STATE\r
+ * may be returned by the Jobs service upon failure of a Jobs operation. See [this page]\r
+ * (https://docs.aws.amazon.com/iot/latest/developerguide/jobs-api.html#jobs-mqtt-error-response)\r
+ * for more information.\r
+ */\r
+typedef enum AwsIotJobsError\r
+{\r
+    /**\r
+     * @brief Jobs operation completed successfully.\r
+     *\r
+     * Functions that may return this value:\r
+     * - @ref jobs_function_init\r
+     * - @ref jobs_function_wait\r
+     * - @ref jobs_function_getpendingsync\r
+     * - @ref jobs_function_startnextsync\r
+     * - @ref jobs_function_describesync\r
+     * - @ref jobs_function_updatesync\r
+     * - @ref jobs_function_setnotifypendingcallback\r
+     * - @ref jobs_function_setnotifynextcallback\r
+     * - @ref jobs_function_removepersistentsubscriptions\r
+     *\r
+     * Will also be the value of a Jobs operation completion callback's<br>\r
+     * [AwsIotJobsCallbackParam_t.operation.result](@ref AwsIotJobsCallbackParam_t.result)\r
+     * when successful.\r
+     */\r
+    AWS_IOT_JOBS_SUCCESS = 0,\r
+\r
+    /**\r
+     * @brief Jobs operation queued, awaiting result.\r
+     *\r
+     * Functions that may return this value:\r
+     * - @ref jobs_function_getpendingasync\r
+     * - @ref jobs_function_startnextasync\r
+     * - @ref jobs_function_describeasync\r
+     * - @ref jobs_function_updateasync\r
+     */\r
+    AWS_IOT_JOBS_STATUS_PENDING = 1,\r
+\r
+    /**\r
+     * @brief Initialization failed.\r
+     *\r
+     * Functions that may return this value:\r
+     * - @ref jobs_function_init\r
+     */\r
+    AWS_IOT_JOBS_INIT_FAILED = 2,\r
+\r
+    /**\r
+     * @brief At least one parameter is invalid.\r
+     *\r
+     * Functions that may return this value:\r
+     * - @ref jobs_function_getpendingasync and @ref jobs_function_getpendingsync\r
+     * - @ref jobs_function_startnextasync and @ref jobs_function_startnextsync\r
+     * - @ref jobs_function_describeasync and @ref jobs_function_describesync\r
+     * - @ref jobs_function_updateasync and @ref jobs_function_updatesync\r
+     * - @ref jobs_function_wait\r
+     * - @ref jobs_function_setnotifypendingcallback\r
+     * - @ref jobs_function_setnotifynextcallback\r
+     * - @ref jobs_function_removepersistentsubscriptions\r
+     */\r
+    AWS_IOT_JOBS_BAD_PARAMETER = 3,\r
+\r
+    /**\r
+     * @brief Jobs operation failed because of memory allocation failure.\r
+     *\r
+     * Functions that may return this value:\r
+     * - @ref jobs_function_getpendingasync and @ref jobs_function_getpendingsync\r
+     * - @ref jobs_function_startnextasync and @ref jobs_function_startnextsync\r
+     * - @ref jobs_function_describeasync and @ref jobs_function_describesync\r
+     * - @ref jobs_function_updateasync and @ref jobs_function_updatesync\r
+     * - @ref jobs_function_setnotifypendingcallback\r
+     * - @ref jobs_function_setnotifynextcallback\r
+     */\r
+    AWS_IOT_JOBS_NO_MEMORY = 4,\r
+\r
+    /**\r
+     * @brief Jobs operation failed because of failure in MQTT library.\r
+     *\r
+     * Functions that may return this value:\r
+     * - @ref jobs_function_getpendingasync and @ref jobs_function_getpendingsync\r
+     * - @ref jobs_function_startnextasync and @ref jobs_function_startnextsync\r
+     * - @ref jobs_function_describeasync and @ref jobs_function_describesync\r
+     * - @ref jobs_function_updateasync and @ref jobs_function_updatesync\r
+     * - @ref jobs_function_setnotifypendingcallback\r
+     * - @ref jobs_function_setnotifynextcallback\r
+     * - @ref jobs_function_removepersistentsubscriptions\r
+     */\r
+    AWS_IOT_JOBS_MQTT_ERROR = 5,\r
+\r
+    /**\r
+     * @brief Response received from Jobs service not understood.\r
+     *\r
+     * Functions that may return this value:\r
+     * - @ref jobs_function_getpendingsync\r
+     * - @ref jobs_function_startnextsync\r
+     * - @ref jobs_function_describesync\r
+     * - @ref jobs_function_updatesync\r
+     * - @ref jobs_function_wait\r
+     *\r
+     * May also be the value of a Jobs operation completion callback's<br>\r
+     * [AwsIotJobsCallbackParam_t.operation.result](@ref AwsIotJobsCallbackParam_t.result).\r
+     */\r
+    AWS_IOT_JOBS_BAD_RESPONSE = 7,\r
+\r
+    /**\r
+     * @brief A blocking Jobs operation timed out.\r
+     *\r
+     * Functions that may return this value:\r
+     * - @ref jobs_function_getpendingsync\r
+     * - @ref jobs_function_startnextsync\r
+     * - @ref jobs_function_describesync\r
+     * - @ref jobs_function_updatesync\r
+     * - @ref jobs_function_wait\r
+     * - @ref jobs_function_setnotifypendingcallback\r
+     * - @ref jobs_function_setnotifynextcallback\r
+     */\r
+    AWS_IOT_JOBS_TIMEOUT = 8,\r
+\r
+    /**\r
+     * @brief An API function was called before @ref jobs_function_init.\r
+     *\r
+     * Functions that may return this value:\r
+     * - @ref jobs_function_getpendingasync and @ref jobs_function_getpendingsync\r
+     * - @ref jobs_function_startnextasync and @ref jobs_function_startnextsync\r
+     * - @ref jobs_function_describeasync and @ref jobs_function_describesync\r
+     * - @ref jobs_function_updateasync and @ref jobs_function_updatesync\r
+     * - @ref jobs_function_wait\r
+     * - @ref jobs_function_setnotifypendingcallback\r
+     * - @ref jobs_function_setnotifynextcallback\r
+     */\r
+    AWS_IOT_JOBS_NOT_INITIALIZED = 11,\r
+\r
+    /**\r
+     * @brief Jobs operation failed: A request was sent to an unknown topic.\r
+     *\r
+     * Functions that may return this value:\r
+     * - @ref jobs_function_getpendingsync\r
+     * - @ref jobs_function_startnextsync\r
+     * - @ref jobs_function_describesync\r
+     * - @ref jobs_function_updatesync\r
+     * - @ref jobs_function_wait\r
+     *\r
+     * May also be the value of a Jobs operation completion callback's<br>\r
+     * [AwsIotJobsCallbackParam_t.operation.result](@ref AwsIotJobsCallbackParam_t.result).\r
+     */\r
+    AWS_IOT_JOBS_INVALID_TOPIC = 12,\r
+\r
+    /**\r
+     * @brief Jobs operation failed: The contents of the request were not understood.\r
+     *\r
+     * Jobs requests must be UTF-8 encoded JSON documents.\r
+     *\r
+     * Functions that may return this value:\r
+     * - @ref jobs_function_getpendingsync\r
+     * - @ref jobs_function_startnextsync\r
+     * - @ref jobs_function_describesync\r
+     * - @ref jobs_function_updatesync\r
+     * - @ref jobs_function_wait\r
+     *\r
+     * May also be the value of a Jobs operation completion callback's<br>\r
+     * [AwsIotJobsCallbackParam_t.operation.result](@ref AwsIotJobsCallbackParam_t.result).\r
+     */\r
+    AWS_IOT_JOBS_INVALID_JSON = 13,\r
+\r
+    /**\r
+     * @brief Jobs operation failed: The contents of the request were invalid.\r
+     *\r
+     * Functions that may return this value:\r
+     * - @ref jobs_function_getpendingsync\r
+     * - @ref jobs_function_startnextsync\r
+     * - @ref jobs_function_describesync\r
+     * - @ref jobs_function_updatesync\r
+     * - @ref jobs_function_wait\r
+     *\r
+     * May also be the value of a Jobs operation completion callback's<br>\r
+     * [AwsIotJobsCallbackParam_t.operation.result](@ref AwsIotJobsCallbackParam_t.result).\r
+     */\r
+    AWS_IOT_JOBS_INVALID_REQUEST = 14,\r
+\r
+    /**\r
+     * @brief Jobs operation failed: An update attempted to change the job execution\r
+     * to an invalid state.\r
+     *\r
+     * Functions that may return this value:\r
+     * - @ref jobs_function_startnextsync\r
+     * - @ref jobs_function_updatesync\r
+     * - @ref jobs_function_wait\r
+     *\r
+     * May also be the value of a Jobs operation completion callback's<br>\r
+     * [AwsIotJobsCallbackParam_t.operation.result](@ref AwsIotJobsCallbackParam_t.result)\r
+     * following a call to @ref jobs_function_startnextasync or @ref jobs_function_updateasync.\r
+     */\r
+    AWS_IOT_JOBS_INVALID_STATE = 15,\r
+\r
+    /**\r
+     * @brief Jobs operation failed: The specified job execution does not exist.\r
+     *\r
+     * * Functions that may return this value:\r
+     * - @ref jobs_function_describesync\r
+     * - @ref jobs_function_updatesync\r
+     * - @ref jobs_function_wait\r
+     *\r
+     * May also be the value of a Jobs operation completion callback's<br>\r
+     * [AwsIotJobsCallbackParam_t.operation.result](@ref AwsIotJobsCallbackParam_t.result)\r
+     * following a call to @ref jobs_function_describeasync or @ref jobs_function_updateasync.\r
+     */\r
+    AWS_IOT_JOBS_NOT_FOUND = 16,\r
+\r
+    /**\r
+     * @brief Jobs operation failed: The Jobs service expected a version that did\r
+     * not match what was in the request.\r
+     *\r
+     * * Functions that may return this value:\r
+     * - @ref jobs_function_updatesync\r
+     * - @ref jobs_function_wait\r
+     *\r
+     * May also be the value of a Jobs operation completion callback's<br>\r
+     * [AwsIotJobsCallbackParam_t.operation.result](@ref AwsIotJobsCallbackParam_t.result)\r
+     * following a call to @ref jobs_function_updateasync.\r
+     */\r
+    AWS_IOT_JOBS_VERSION_MISMATCH = 17,\r
+\r
+    /**\r
+     * @brief Jobs operation failed: The Jobs service encountered an internal error.\r
+     *\r
+     * Functions that may return this value:\r
+     * - @ref jobs_function_getpendingsync\r
+     * - @ref jobs_function_startnextsync\r
+     * - @ref jobs_function_describesync\r
+     * - @ref jobs_function_updatesync\r
+     * - @ref jobs_function_wait\r
+     *\r
+     * May also be the value of a Jobs operation completion callback's<br>\r
+     * [AwsIotJobsCallbackParam_t.operation.result](@ref AwsIotJobsCallbackParam_t.result).\r
+     */\r
+    AWS_IOT_JOBS_INTERNAL_ERROR = 18,\r
+\r
+    /**\r
+     * @brief Jobs operation failed: The request was throttled.\r
+     *\r
+     * Functions that may return this value:\r
+     * - @ref jobs_function_getpendingsync\r
+     * - @ref jobs_function_startnextsync\r
+     * - @ref jobs_function_describesync\r
+     * - @ref jobs_function_updatesync\r
+     * - @ref jobs_function_wait\r
+     *\r
+     * May also be the value of a Jobs operation completion callback's<br>\r
+     * [AwsIotJobsCallbackParam_t.operation.result](@ref AwsIotJobsCallbackParam_t.result).\r
+     */\r
+    AWS_IOT_JOBS_THROTTLED = 19,\r
+\r
+    /**\r
+     * @brief Jobs operation failed: Attempt to describe a Job in a terminal state.\r
+     *\r
+     * Functions that may return this value:\r
+     * - @ref jobs_function_describesync\r
+     * - @ref jobs_function_wait\r
+     *\r
+     * May also be the value of a Jobs operation completion callback's<br>\r
+     * [AwsIotJobsCallbackParam_t.operation.result](@ref AwsIotJobsCallbackParam_t.result)\r
+     * following a call to @ref jobs_function_describeasync.\r
+     */\r
+    AWS_IOT_JOBS_TERMINAL_STATE = 20\r
+} AwsIotJobsError_t;\r
+\r
+/**\r
+ * @ingroup jobs_datatypes_enums\r
+ * @brief Possible states of jobs.\r
+ *\r
+ * The function @ref jobs_function_statename can be used to get a state's\r
+ * description.\r
+ *\r
+ * See [this page]\r
+ * (https://docs.aws.amazon.com/iot/latest/apireference/API_iot-jobs-data_JobExecutionState.html)\r
+ * for more information on Job states.\r
+ */\r
+typedef enum AwsIotJobState\r
+{\r
+    /**\r
+     * @brief A Job is queued and awaiting execution.\r
+     */\r
+    AWS_IOT_JOB_STATE_QUEUED,\r
+\r
+    /**\r
+     * @brief A Job is currently executing.\r
+     */\r
+    AWS_IOT_JOB_STATE_IN_PROGRESS,\r
+\r
+    /**\r
+     * @brief A Job has failed. This is a terminal state.\r
+     */\r
+    AWS_IOT_JOB_STATE_FAILED,\r
+\r
+    /**\r
+     * @brief A Job has succeeded. This is a terminal state.\r
+     */\r
+    AWS_IOT_JOB_STATE_SUCCEEDED,\r
+\r
+    /**\r
+     * @brief A Job was canceled. This is a terminal state.\r
+     */\r
+    AWS_IOT_JOB_STATE_CANCELED,\r
+\r
+    /**\r
+     * @brief A Job's timer has expired. This is a terminal state.\r
+     *\r
+     * Jobs are considered timed out if they remain [IN_PROGRESS]\r
+     * (@ref AWS_IOT_JOB_STATE_IN_PROGRESS) for more than their\r
+     * `inProgressTimeoutInMinutes` property or a [Job update](@ref jobs_function_updateasync)\r
+     * was not sent within [stepTimeoutInMinutes](@ref AwsIotJobsUpdateInfo_t.stepTimeoutInMinutes).\r
+     */\r
+    AWS_IOT_JOB_STATE_TIMED_OUT,\r
+\r
+    /**\r
+     * @brief A Job was rejected by the device. This is a terminal state.\r
+     */\r
+    AWS_IOT_JOB_STATE_REJECTED,\r
+\r
+    /**\r
+     * @brief A Job was removed. This is a terminal state.\r
+     */\r
+    AWS_IOT_JOB_STATE_REMOVED\r
+} AwsIotJobState_t;\r
+\r
+/**\r
+ * @ingroup jobs_datatypes_enums\r
+ * @brief Types of Jobs library callbacks.\r
+ *\r
+ * One of these values will be placed in #AwsIotJobsCallbackParam_t.callbackType\r
+ * to identify the reason for invoking a callback function.\r
+ */\r
+typedef enum AwsIotJobsCallbackType\r
+{\r
+    AWS_IOT_JOBS_GET_PENDING_COMPLETE = 0,    /**< Callback invoked because a [Jobs get pending](@ref jobs_function_getpendingasync) completed. */\r
+    AWS_IOT_JOBS_START_NEXT_COMPLETE = 1,     /**< Callback invoked because a [Jobs start next](@ref jobs_function_startnextasync) completed. */\r
+    AWS_IOT_JOBS_DESCRIBE_COMPLETE = 2,       /**< Callback invoked because a [Jobs describe](@ref jobs_function_describeasync) completed. */\r
+    AWS_IOT_JOBS_UPDATE_COMPLETE = 3,         /**< Callback invoked because a [Jobs update](@ref jobs_function_updateasync) completed. */\r
+    AWS_IOT_JOBS_NOTIFY_PENDING_CALLBACK = 4, /**< Callback invoked for an incoming message on a [Jobs notify-pending](@ref jobs_function_setnotifypendingcallback) topic. */\r
+    AWS_IOT_JOBS_NOTIFY_NEXT_CALLBACK = 5     /**< Callback invoked for an incoming message on a [Jobs notify-next](@ref jobs_function_setnotifynextcallback) topic. */\r
+} AwsIotJobsCallbackType_t;\r
+\r
+/*-------------------------- Jobs parameter structs -------------------------*/\r
+\r
+/**\r
+ * @paramstructs{jobs,Jobs library}\r
+ */\r
+\r
+/**\r
+ * @ingroup jobs_datatypes_paramstructs\r
+ * @brief Parameter to a Jobs callback function.\r
+ *\r
+ * @paramfor Jobs callback functions\r
+ *\r
+ * The Jobs library passes this struct to a callback function whenever a\r
+ * Jobs operation completes or a message is received on a Jobs notify-pending\r
+ * or notify-next topic.\r
+ *\r
+ * The valid members of this struct are different based on\r
+ * #AwsIotJobsCallbackParam_t.callbackType. If the callback type is\r
+ * #AWS_IOT_JOBS_GET_PENDING_COMPLETE, #AWS_IOT_JOBS_START_NEXT_COMPLETE,\r
+ * #AWS_IOT_JOBS_DESCRIBE_COMPLETE, or #AWS_IOT_JOBS_UPDATE_COMPLETE, then\r
+ * #AwsIotJobsCallbackParam_t.operation is valid. Otherwise, if the callback type\r
+ * is #AWS_IOT_JOBS_NOTIFY_PENDING_CALLBACK or #AWS_IOT_JOBS_NOTIFY_NEXT_CALLBACK,\r
+ * then #AwsIotJobsCallbackParam_t.callback is valid.\r
+ *\r
+ * @attention Any pointers in this callback parameter may be freed as soon as the\r
+ * [callback function](@ref AwsIotJobsCallbackInfo_t.function) returns. Therefore,\r
+ * data must be copied if it is needed after the callback function returns.\r
+ * @attention The Jobs library may set strings that are not NULL-terminated.\r
+ *\r
+ * @see #AwsIotJobsCallbackInfo_t for the signature of a callback function.\r
+ */\r
+typedef struct AwsIotJobsCallbackParam\r
+{\r
+    AwsIotJobsCallbackType_t callbackType; /**< @brief Reason for invoking the Jobs callback function to provide context. */\r
+\r
+    const char * pThingName;               /**< @brief The Thing Name associated with this Jobs callback. */\r
+    size_t thingNameLength;                /**< @brief Length of #AwsIotJobsCallbackParam_t.pThingName. */\r
+\r
+    IotMqttConnection_t mqttConnection;    /**< @brief The MQTT connection associated with the Jobs callback. */\r
+\r
+    union\r
+    {\r
+        /* Valid for completed Jobs operations. */\r
+        struct\r
+        {\r
+            AwsIotJobsError_t result;        /**< @brief Result of Jobs operation, e.g. succeeded or failed. */\r
+            AwsIotJobsOperation_t reference; /**< @brief Reference to the Jobs operation that completed. */\r
+\r
+            const char * pResponse;          /**< @brief Response retrieved from the Jobs service. */\r
+            size_t responseLength;           /**< @brief Length of retrieved response. */\r
+        } operation;                         /**< @brief Information on a completed Jobs operation. */\r
+\r
+        /* Valid for a message on a Jobs notify-pending or notify-next topic. */\r
+        struct\r
+        {\r
+            const char * pDocument; /**< @brief Job execution document received on callback. */\r
+            size_t documentLength;  /**< @brief Length of job execution document. */\r
+        } callback;                 /**< @brief Jobs document from an incoming delta or updated topic. */\r
+    } u;                            /**< @brief Valid member depends on callback type. */\r
+} AwsIotJobsCallbackParam_t;\r
+\r
+/**\r
+ * @ingroup jobs_datatypes_paramstructs\r
+ * @brief Information on a user-provided Jobs callback function.\r
+ *\r
+ * @paramfor @ref jobs_function_getpendingasync, @ref jobs_function_startnextasync,\r
+ * @ref jobs_function_describeasync, @ref jobs_function_updateasync,\r
+ * @ref jobs_function_setnotifypendingcallback, @ref jobs_function_setnotifynextcallback\r
+ *\r
+ * Provides a function to be invoked when a Jobs operation completes or when a\r
+ * Jobs document is received on a callback topic (notify-pending or notify-next).\r
+ *\r
+ * @initializer{AwsIotJobsCallbackInfo_t,AWS_IOT_JOBS_CALLBACK_INFO_INITIALIZER}\r
+ */\r
+typedef struct AwsIotJobsCallbackInfo\r
+{\r
+    void * pCallbackContext; /**< @brief The first parameter to pass to the callback function. */\r
+\r
+    /**\r
+     * @brief User-provided callback function signature.\r
+     *\r
+     * @param[in] void* #AwsIotJobsCallbackInfo_t.pCallbackContext\r
+     * @param[in] AwsIotJobsCallbackParam_t* Details on the outcome of the Jobs\r
+     * operation or an incoming Job document.\r
+     *\r
+     * @see #AwsIotJobsCallbackParam_t for more information on the second parameter.\r
+     */\r
+    void ( * function )( void *,\r
+                         AwsIotJobsCallbackParam_t * );\r
+\r
+    /**\r
+     * @brief Callback function to replace when passed to @ref jobs_function_setnotifynextcallback\r
+     * or @ref jobs_function_setnotifypendingcallback.\r
+     *\r
+     * This member is ignored by Jobs operation functions.\r
+     *\r
+     * The number of callbacks of each type that may be registered for each Thing\r
+     * is limited by @ref AWS_IOT_JOBS_NOTIFY_CALLBACKS. If @ref AWS_IOT_JOBS_NOTIFY_CALLBACKS\r
+     * is `2`, that means that a maximum of `2` NOTIFY PENDING and `2` NOTIFY NEXT callbacks\r
+     * (`4` total callbacks) may be set. This member is used to replace an existing callback\r
+     * with a new one.\r
+     *\r
+     * To add a new callback:\r
+     * @code{c}\r
+     * AwsIotJobsCallbackInfo_t callbackInfo = AWS_IOT_JOBS_CALLBACK_INFO_INITIALIZER;\r
+     *\r
+     * callbackInfo.function = _newCallback;\r
+     * callbackInfo.oldFunction = NULL;\r
+     * @endcode\r
+     *\r
+     * For example, if the function `_oldCallback()` is currently registered:\r
+     * - To replace `_oldCallback()` with a new callback function `_newCallback()`:\r
+     * @code{c}\r
+     * AwsIotJobsCallbackInfo_t callbackInfo = AWS_IOT_JOBS_CALLBACK_INFO_INITIALIZER;\r
+     *\r
+     * callbackInfo.function = _newCallback;\r
+     * callbackInfo.oldFunction = _oldCallback;\r
+     * @endcode\r
+     * - To remove `_oldCallback()`:\r
+     * @code{c}\r
+     * AwsIotJobsCallbackInfo_t callbackInfo = AWS_IOT_JOBS_CALLBACK_INFO_INITIALIZER;\r
+     *\r
+     * callbackInfo.function = NULL;\r
+     * callbackInfo.oldFunction = _oldCallback;\r
+     * @endcode\r
+     */\r
+    void ( * oldFunction )( void *,\r
+                            AwsIotJobsCallbackParam_t * );\r
+} AwsIotJobsCallbackInfo_t;\r
+\r
+/**\r
+ * @ingroup jobs_datatypes_paramstructs\r
+ * @brief Common information provided to Jobs requests.\r
+ *\r
+ * @paramfor @ref jobs_function_getpendingasync, @ref jobs_function_getpendingsync,\r
+ * @ref jobs_function_startnextasync, @ref jobs_function_startnextsync\r
+ * @ref jobs_function_describeasync, @ref jobs_function_describesync,\r
+ * @ref jobs_function_updateasync, @ref jobs_function_updatesync\r
+ *\r
+ * @initializer{AwsIotJobsRequestInfo_t,AWS_IOT_JOBS_REQUEST_INFO_INITIALIZER}\r
+ */\r
+typedef struct AwsIotJobsRequestInfo\r
+{\r
+    /**\r
+     * @brief The MQTT connection to use for the Jobs request.\r
+     */\r
+    IotMqttConnection_t mqttConnection;\r
+\r
+    /* These members allow Jobs commands to be retried. Be careful that duplicate\r
+     * commands do no cause unexpected application behavior. Use of QoS 0 is recommended. */\r
+    IotMqttQos_t qos;        /**< @brief QoS when sending the Jobs command. See #IotMqttPublishInfo_t.qos. */\r
+    uint32_t retryLimit;     /**< @brief Maximum number of retries for the Jobs command. See #IotMqttPublishInfo_t.retryLimit. */\r
+    uint32_t retryMs;        /**< @brief First retry time for the Jobs command. See IotMqttPublishInfo_t.retryMs. */\r
+\r
+    /**\r
+     * @brief Function to allocate memory for an incoming response.\r
+     *\r
+     * This only needs to be set if #AWS_IOT_JOBS_FLAG_WAITABLE is passed.\r
+     */\r
+    void * ( *mallocResponse )( size_t );\r
+\r
+    /**\r
+     * @brief The Thing Name associated with the Job.\r
+     */\r
+    const char * pThingName;\r
+\r
+    /**\r
+     * @brief Length of #AwsIotJobsRequestInfo_t.pThingName.\r
+     */\r
+    size_t thingNameLength;\r
+\r
+    /**\r
+     * @brief The Job ID to update.\r
+     *\r
+     * This may be set to #AWS_IOT_JOBS_NEXT_JOB to update the next pending Job.\r
+     * When using #AWS_IOT_JOBS_NEXT_JOB, #AwsIotJobsRequestInfo_t.jobIdLength\r
+     * should be set to #AWS_IOT_JOBS_NEXT_JOB_LENGTH.\r
+     *\r
+     * This parameter is ignored for calls to @ref jobs_function_getpendingasync,\r
+     * @ref jobs_function_getpendingsync, @ref jobs_function_startnextasync,\r
+     * and @ref jobs_function_startnextsync.\r
+     */\r
+    const char * pJobId;\r
+\r
+    /**\r
+     * @brief Length of #AwsIotJobsRequestInfo_t.pJobId.\r
+     *\r
+     * This parameter is ignored for calls to @ref jobs_function_getpendingasync,\r
+     * @ref jobs_function_getpendingsync, @ref jobs_function_startnextasync,\r
+     * and @ref jobs_function_startnextsync.\r
+     */\r
+    size_t jobIdLength;\r
+\r
+    /**\r
+     * @brief An arbitrary string that identifies this Job update to the Jobs\r
+     * service.\r
+     *\r
+     * The recommended value is #AWS_IOT_JOBS_CLIENT_TOKEN_AUTOGENERATE.\r
+     */\r
+    const char * pClientToken;\r
+\r
+    /**\r
+     * @brief Length of #AwsIotJobsRequestInfo_t.pClientToken.\r
+     */\r
+    size_t clientTokenLength;\r
+} AwsIotJobsRequestInfo_t;\r
+\r
+/**\r
+ * @ingroup jobs_datatypes_paramstructs\r
+ * @brief Output parameter of blocking Jobs API functions.\r
+ *\r
+ * @paramfor @ref jobs_function_getpendingsync, @ref jobs_function_startnextsync,\r
+ * @ref jobs_function_describesync, @ref jobs_function_updatesync,\r
+ * @ref jobs_function_wait\r
+ *\r
+ * Provides the response received from the Jobs service. The buffer for the\r
+ * response is allocated with #AwsIotJobsRequestInfo_t.mallocResponse.\r
+ *\r
+ * @initializer{AwsIotJobsResponse_t,AWS_IOT_JOBS_RESPONSE_INITIALIZER}\r
+ */\r
+typedef struct AwsIotJobsResponse\r
+{\r
+    const char * pJobsResponse; /**< @brief JSON response received from the Jobs service. */\r
+    size_t jobsResponseLength;  /**< @brief Length of #AwsIotJobsResponse_t.pJobsResponse. */\r
+} AwsIotJobsResponse_t;\r
+\r
+/**\r
+ * @ingroup jobs_datatypes_paramstructs\r
+ * @brief Information on a Job update for @ref jobs_function_startnextasync and\r
+ * @ref jobs_function_updateasync. These functions modify a Job's state.\r
+ *\r
+ * @paramfor @ref jobs_function_startnextasync, @ref jobs_function_startnextsync,\r
+ * @ref jobs_function_updateasync, and @ref jobs_function_updatesync.\r
+ *\r
+ * @initializer{AwsIotJobsUpdateInfo_t,AWS_IOT_JOBS_UPDATE_INFO_INITIALIZER}\r
+ */\r
+typedef struct AwsIotJobsUpdateInfo\r
+{\r
+    /**\r
+     * @brief The new status to report as a Job execution update.\r
+     *\r
+     * Valid values are:\r
+     * - #AWS_IOT_JOB_STATE_IN_PROGRESS\r
+     * - #AWS_IOT_JOB_STATE_FAILED\r
+     * - #AWS_IOT_JOB_STATE_SUCCEEDED\r
+     * - #AWS_IOT_JOB_STATE_REJECTED\r
+     *\r
+     * This parameter is ignored for calls to @ref jobs_function_startnextasync and\r
+     * @ref jobs_function_startnextsync. These functions always set the state\r
+     * to #AWS_IOT_JOB_STATE_IN_PROGRESS.\r
+     */\r
+    AwsIotJobState_t newStatus;\r
+\r
+    /**\r
+     * @brief The expected current version of job execution.\r
+     *\r
+     * Each time a Job update is sent (for the same `JobId`), the version stored\r
+     * on the AWS IoT Jobs service is updated. If this value does not match the\r
+     * value stored by the Jobs service, the Job update is rejected with the code\r
+     * #AWS_IOT_JOBS_VERSION_MISMATCH.\r
+     *\r
+     * This value is useful for ensuring the order of Job updates, i.e. that the\r
+     * Jobs service does not overwrite a later update with a previous one. If not\r
+     * needed, it can be set to #AWS_IOT_JOBS_NO_VERSION.\r
+     *\r
+     * This parameter is ignored for calls to @ref jobs_function_startnextasync and\r
+     * @ref jobs_function_startnextsync.\r
+     */\r
+    uint32_t expectedVersion;\r
+\r
+    /**\r
+     * @brief An application-defined value that identifies a Job execution on a\r
+     * specific device.\r
+     *\r
+     * The Jobs service provides commands for tracking the status of Job execution\r
+     * on a specific target. Therefore, this value is used to provide a unique\r
+     * identifier of a specific Job execution on a specific target.\r
+     *\r
+     * This value is optional. It may be set to #AWS_IOT_JOBS_NO_EXECUTION_NUMBER\r
+     * if not needed.\r
+     *\r
+     * This parameter is ignored for calls to @ref jobs_function_startnextasync and\r
+     * @ref jobs_function_startnextsync.\r
+     */\r
+    int32_t executionNumber;\r
+\r
+    /**\r
+     * @brief The amount of time (in minutes) before a new Job update must be reported.\r
+     *\r
+     * If this timeout expires without a new Job update being reported (for the same\r
+     * `jobId`), the Job's status is set to #AWS_IOT_JOB_STATE_TIMED_OUT. Sending a\r
+     * new Job update will reset this step timeout; a value of #AWS_IOT_JOBS_NO_TIMEOUT\r
+     * will clear any previous step timeout.\r
+     *\r
+     * Valid values are between 1 and 10,080 (7 days). This value is optional. It may\r
+     * be set to #AWS_IOT_JOBS_NO_TIMEOUT if not needed.\r
+     */\r
+    int32_t stepTimeoutInMinutes;\r
+\r
+    /**\r
+     * @brief Whether the Job response document should contain the `JobExecutionState`.\r
+     *\r
+     * The default value is `false`.\r
+     *\r
+     * This parameter is ignored for calls to @ref jobs_function_startnextasync and\r
+     * @ref jobs_function_startnextsync.\r
+     */\r
+    bool includeJobExecutionState;\r
+\r
+    /**\r
+     * @brief Whether the Job response document should contain the `JobDocument`.\r
+     *\r
+     * The default value is `false`.\r
+     *\r
+     * This parameter is ignored for calls to @ref jobs_function_startnextasync and\r
+     * @ref jobs_function_startnextsync.\r
+     */\r
+    bool includeJobDocument;\r
+\r
+    /**\r
+     * @brief An application-defined set of JSON name-value pairs that describe\r
+     * the status of Job execution.\r
+     *\r
+     * This value is optional. It may be set to #AWS_IOT_JOBS_NO_STATUS_DETAILS\r
+     * if not needed.\r
+     */\r
+    const char * pStatusDetails;\r
+\r
+    /**\r
+     * @brief Length of #AwsIotJobsUpdateInfo_t.pStatusDetails.\r
+     */\r
+    size_t statusDetailsLength;\r
+} AwsIotJobsUpdateInfo_t;\r
+\r
+/*------------------------- Jobs defined constants --------------------------*/\r
+\r
+/**\r
+ * @brief Set #AwsIotJobsRequestInfo_t.pJobId to this value to use the next pending\r
+ * Job as the Job ID.\r
+ *\r
+ * @note The value of this constant may change at any time in future versions, but\r
+ * its name will remain the same.\r
+ */\r
+#define AWS_IOT_JOBS_NEXT_JOB                     ( "$next" )\r
+\r
+/**\r
+ * @brief Length of #AWS_IOT_JOBS_NEXT_JOB.\r
+ *\r
+ * Set #AwsIotJobsRequestInfo_t.jobIdLength to this value when using\r
+ * #AWS_IOT_JOBS_NEXT_JOB.\r
+ *\r
+ * @note The value of this constant may change at any time in future versions, but\r
+ * its name will remain the same.\r
+ */\r
+#define AWS_IOT_JOBS_NEXT_JOB_LENGTH              ( sizeof( AWS_IOT_JOBS_NEXT_JOB ) - 1 )\r
+\r
+/**\r
+ * @brief Set #AwsIotJobsRequestInfo_t.pClientToken to this value to automatically\r
+ * generate a client token for the Jobs request.\r
+ *\r
+ * @note The value of this constant may change at any time in future versions, but\r
+ * its name will remain the same.\r
+ */\r
+#define AWS_IOT_JOBS_CLIENT_TOKEN_AUTOGENERATE    ( NULL )\r
+\r
+/**\r
+ * @brief Set #AwsIotJobsUpdateInfo_t.expectedVersion to this value to omit the\r
+ * version in the Jobs request.\r
+ *\r
+ * @note The value of this constant may change at any time in future versions, but\r
+ * its name will remain the same.\r
+ */\r
+#define AWS_IOT_JOBS_NO_VERSION                   ( 0 )\r
+\r
+/**\r
+ * @brief Set #AwsIotJobsUpdateInfo_t.executionNumber to this value or pass it to\r
+ * @ref jobs_function_describeasync to omit the execution number in the Jobs request.\r
+ *\r
+ * @note The value of this constant may change at any time in future versions, but\r
+ * its name will remain the same.\r
+ */\r
+#define AWS_IOT_JOBS_NO_EXECUTION_NUMBER          ( -1 )\r
+\r
+/**\r
+ * @brief Set #AwsIotJobsUpdateInfo_t.stepTimeoutInMinutes to this value to omit the\r
+ * step timeout in the Jobs request.\r
+ *\r
+ * @note The value of this constant may change at any time in future versions, but\r
+ * its name will remain the same.\r
+ */\r
+#define AWS_IOT_JOBS_NO_TIMEOUT                   ( 0 )\r
+\r
+/**\r
+ * @brief Set #AwsIotJobsUpdateInfo_t.stepTimeoutInMinutes to this value to cancel\r
+ * any previously set step timeout.\r
+ *\r
+ * The Jobs service will return an (InvalidRequest)[@ref AWS_IOT_JOBS_INVALID_REQUEST]\r
+ * error if this value is used without an existing step timeout.\r
+ *\r
+ * @note The value of this constant may change at any time in future versions, but\r
+ * its name will remain the same.\r
+ */\r
+#define AWS_IOT_JOBS_CANCEL_TIMEOUT               ( -1 )\r
+\r
+/**\r
+ * @brief Set #AwsIotJobsUpdateInfo_t.pStatusDetails to this value to omit the\r
+ * status details in the Jobs request.\r
+ *\r
+ * @note The value of this constant may change at any time in future versions, but\r
+ * its name will remain the same.\r
+ */\r
+#define AWS_IOT_JOBS_NO_STATUS_DETAILS            ( NULL )\r
+\r
+/**\r
+ * @constantspage{jobs,Jobs library}\r
+ *\r
+ * @section jobs_constants_initializers Jobs Initializers\r
+ * @brief Provides default values for the data types of the Jobs library.\r
+ *\r
+ * @snippet this define_jobs_initializers\r
+ *\r
+ * All user-facing data types of the Jobs library should be initialized\r
+ * using one of the following.\r
+ *\r
+ * @warning Failing to initialize a Jobs data type with the appropriate\r
+ * initializer may result in undefined behavior!\r
+ * @note The initializers may change at any time in future versions, but their\r
+ * names will remain the same.\r
+ *\r
+ * <b>Example</b>\r
+ * @code{c}\r
+ * AwsIotJobsCallbackInfo_t callbackInfo = AWS_IOT_JOBS_CALLBACK_INFO_INITIALIZER;\r
+ * AwsIotJobsRequestInfo_t requestInfo = AWS_IOT_JOBS_REQUEST_INFO_INITIALIZER;\r
+ * AwsIotJobsUpdateInfo_t updateInfo = AWS_IOT_JOBS_UPDATE_INFO_INITIALIZER;\r
+ * AwsIotJobsOperation_t operation = AWS_IOT_JOBS_OPERATION_INITIALIZER;\r
+ * AwsIotJobsResponse_t response = AWS_IOT_JOBS_RESPONSE_INITIALIZER;\r
+ * @endcode\r
+ *\r
+ * @section jobs_constants_flags Jobs Function Flags\r
+ * @brief Flags that modify the behavior of Jobs library functions.\r
+ *\r
+ * Flags should be bitwise-ORed with each other to change the behavior of\r
+ * Jobs library functions.\r
+ *\r
+ * The following flags are valid for the Jobs operation functions:\r
+ * @ref jobs_function_getpendingasync, @ref jobs_function_startnextasync,\r
+ * @ref jobs_function_describeasync, @ref jobs_function_updateasync,\r
+ * and their blocking versions.\r
+ * - #AWS_IOT_JOBS_FLAG_WAITABLE <br>\r
+ *   @copybrief AWS_IOT_JOBS_FLAG_WAITABLE\r
+ * - #AWS_IOT_JOBS_FLAG_KEEP_SUBSCRIPTIONS <br>\r
+ *   @copybrief AWS_IOT_JOBS_FLAG_KEEP_SUBSCRIPTIONS\r
+ *\r
+ * The following flags are valid for @ref jobs_function_removepersistentsubscriptions.\r
+ * These flags are not valid for the Jobs operation functions.\r
+ * - #AWS_IOT_JOBS_FLAG_REMOVE_GET_PENDING_SUBSCRIPTIONS <br>\r
+ *   @copybrief AWS_IOT_JOBS_FLAG_REMOVE_GET_PENDING_SUBSCRIPTIONS\r
+ * - #AWS_IOT_JOBS_FLAG_REMOVE_START_NEXT_SUBSCRIPTIONS <br>\r
+ *   @copybrief AWS_IOT_JOBS_FLAG_REMOVE_START_NEXT_SUBSCRIPTIONS\r
+ * - #AWS_IOT_JOBS_FLAG_REMOVE_DESCRIBE_SUBSCRIPTIONS <br>\r
+ *   @copybrief AWS_IOT_JOBS_FLAG_REMOVE_DESCRIBE_SUBSCRIPTIONS\r
+ * - #AWS_IOT_JOBS_FLAG_REMOVE_UPDATE_SUBSCRIPTIONS <br>\r
+ *   @copybrief AWS_IOT_JOBS_FLAG_REMOVE_UPDATE_SUBSCRIPTIONS\r
+ *\r
+ * @note The values of the flags may change at any time in future versions, but\r
+ * their names will remain the same. Additionally, flags which may be used at\r
+ * the same time will be bitwise-exclusive of each other.\r
+ */\r
+\r
+/* @[define_jobs_initializers] */\r
+#define AWS_IOT_JOBS_CALLBACK_INFO_INITIALIZER    { 0 } /**< @brief Initializer for #AwsIotJobsCallbackInfo_t. */\r
+/** @brief Initializer for #AwsIotJobsRequestInfo_t. */\r
+#define AWS_IOT_JOBS_REQUEST_INFO_INITIALIZER \\r
+    { .pClientToken = AWS_IOT_JOBS_CLIENT_TOKEN_AUTOGENERATE }\r
+/** @brief Initializer for #AwsIotJobsUpdateInfo_t. */\r
+#define AWS_IOT_JOBS_UPDATE_INFO_INITIALIZER               \\r
+    { .newStatus = AWS_IOT_JOB_STATE_IN_PROGRESS,          \\r
+      .expectedVersion = AWS_IOT_JOBS_NO_VERSION,          \\r
+      .executionNumber = AWS_IOT_JOBS_NO_EXECUTION_NUMBER, \\r
+      .stepTimeoutInMinutes = AWS_IOT_JOBS_NO_TIMEOUT,     \\r
+      .includeJobExecutionState = false,                   \\r
+      .includeJobDocument = false,                         \\r
+      .pStatusDetails = AWS_IOT_JOBS_NO_STATUS_DETAILS }\r
+#define AWS_IOT_JOBS_OPERATION_INITIALIZER    NULL  /**< @brief Initializer for #AwsIotJobsOperation_t. */\r
+#define AWS_IOT_JOBS_RESPONSE_INITIALIZER     { 0 } /**< @brief Initializer for #AwsIotJobsResponse_t. */\r
+/* @[define_jobs_initializers] */\r
+\r
+/**\r
+ * @brief Allows the use of @ref jobs_function_wait for blocking until completion.\r
+ *\r
+ * This flag is only valid if passed to the functions @ref jobs_function_getpendingasync,\r
+ * @ref jobs_function_startnextasync, @ref jobs_function_describeasync, or @ref jobs_function_updateasync.\r
+ *\r
+ * An #AwsIotJobsOperation_t <b>MUST</b> be provided if this flag is set.\r
+ * Additionally, an #AwsIotJobsCallbackInfo_t <b>MUST NOT</b> be provided.\r
+ *\r
+ * When this flag is set, #AwsIotJobsRequestInfo_t.mallocResponse must be set\r
+ * to a function that can be used to allocate memory to hold an incoming response.\r
+ *\r
+ * @note If this flag is set, @ref jobs_function_wait <b>MUST</b> be called to\r
+ * clean up resources.\r
+ */\r
+#define AWS_IOT_JOBS_FLAG_WAITABLE                            ( 0x00000001 )\r
+\r
+/**\r
+ * @brief Maintain the subscriptions for the Jobs operation topics, even after\r
+ * this function returns.\r
+ *\r
+ * This flag is only valid if passed to the functions @ref jobs_function_getpendingasync,\r
+ * @ref jobs_function_startnextasync, @ref jobs_function_describeasync, or @ref jobs_function_updateasync,\r
+ * and their blocking versions.\r
+ *\r
+ * The Jobs service reports results of Jobs operations by publishing\r
+ * messages to MQTT topics. By default, the Job operation functions subscribe to the\r
+ * necessary topics, wait for the Jobs service to publish the result of the\r
+ * Jobs operation, then unsubscribe from those topics. This workflow is suitable\r
+ * for infrequent Jobs operations, but is inefficient for frequent, periodic\r
+ * Jobs operations (where subscriptions for the Jobs operation topics would be\r
+ * constantly added and removed).\r
+ *\r
+ * This flag causes the Jobs operation functions to maintain Jobs operation\r
+ * topic subscriptions, even after the function returns. These subscriptions\r
+ * may then be used by a future call to the same function.\r
+ *\r
+ * This flags only needs to be set once, after which subscriptions are maintained\r
+ * and reused for a specific Thing Name and Jobs function. The function @ref\r
+ * jobs_function_removepersistentsubscriptions may be used to remove\r
+ * subscriptions maintained by this flag.\r
+ */\r
+#define AWS_IOT_JOBS_FLAG_KEEP_SUBSCRIPTIONS                  ( 0x00000002 )\r
+\r
+/**\r
+ * @brief Remove the persistent subscriptions from a Jobs get pending operation.\r
+ *\r
+ * This flag is only valid if passed to the function @ref\r
+ * jobs_function_removepersistentsubscriptions.\r
+ *\r
+ * This flag may be passed to @ref jobs_function_removepersistentsubscriptions\r
+ * to remove any subscriptions for a specific Thing Name maintained by a previous\r
+ * call to @ref jobs_function_getpendingasync or @ref jobs_function_getpendingsync.\r
+ *\r
+ * @warning Do not call @ref jobs_function_removepersistentsubscriptions with\r
+ * this flag for Thing Names with any in-progress Jobs get pending operations.\r
+ */\r
+#define AWS_IOT_JOBS_FLAG_REMOVE_GET_PENDING_SUBSCRIPTIONS    ( 0x00000001 )\r
+\r
+/**\r
+ * @brief Remove the persistent subscriptions from a Jobs start next operation.\r
+ *\r
+ * This flag is only valid if passed to the function @ref\r
+ * jobs_function_removepersistentsubscriptions.\r
+ *\r
+ * This flag may be passed to @ref jobs_function_removepersistentsubscriptions\r
+ * to remove any subscriptions for a specific Thing Name maintained by a previous\r
+ * call to @ref jobs_function_startnextasync or @ref jobs_function_startnextsync.\r
+ *\r
+ * @warning Do not call @ref jobs_function_removepersistentsubscriptions with\r
+ * this flag for Thing Names with any in-progress Jobs start next operations.\r
+ */\r
+#define AWS_IOT_JOBS_FLAG_REMOVE_START_NEXT_SUBSCRIPTIONS     ( 0x00000002 )\r
+\r
+/**\r
+ * @brief Remove the persistent subscriptions from a Jobs describe operation.\r
+ *\r
+ * This flag is only valid if passed to the function @ref\r
+ * jobs_function_removepersistentsubscriptions.\r
+ *\r
+ * This flag may be passed to @ref jobs_function_removepersistentsubscriptions\r
+ * to remove any subscriptions for a specific Thing Name maintained by a previous\r
+ * call to @ref jobs_function_describeasync or @ref jobs_function_describesync.\r
+ *\r
+ * @warning Do not call @ref jobs_function_removepersistentsubscriptions with\r
+ * this flag for Thing Names with any in-progress Jobs describe operations.\r
+ */\r
+#define AWS_IOT_JOBS_FLAG_REMOVE_DESCRIBE_SUBSCRIPTIONS       ( 0x00000004 )\r
+\r
+/**\r
+ * @brief Remove the persistent subscriptions from a Jobs update operation.\r
+ *\r
+ * This flag is only valid if passed to the function @ref\r
+ * jobs_function_removepersistentsubscriptions.\r
+ *\r
+ * This flag may be passed to @ref jobs_function_removepersistentsubscriptions\r
+ * to remove any subscriptions for a specific Thing Name maintained by a previous\r
+ * call to @ref jobs_function_updateasync or @ref jobs_function_updatesync.\r
+ *\r
+ * @warning Do not call @ref jobs_function_removepersistentsubscriptions with\r
+ * this flag for Thing Names with any in-progress Jobs update operations.\r
+ */\r
+#define AWS_IOT_JOBS_FLAG_REMOVE_UPDATE_SUBSCRIPTIONS         ( 0x00000008 )\r
+\r
+#endif /* ifndef AWS_IOT_JOBS_TYPES_H_ */\r