{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/amazon-iot-core/json-schema/amazon-iot-core-describe-audit-mitigation-actions-task-response-schema.json",
  "title": "DescribeAuditMitigationActionsTaskResponse",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/amazon-iot-core-audit-api-openapi.yml#/components/schemas/DescribeAuditMitigationActionsTaskResponse",
  "type": "object",
  "properties": {
    "taskStatus": {
      "type": "string",
      "enum": [
        "IN_PROGRESS",
        "COMPLETED",
        "FAILED",
        "CANCELED"
      ],
      "description": "The current status of the task."
    },
    "startTime": {
      "type": "string",
      "format": "date-time",
      "description": "The date and time when the task was started."
    },
    "endTime": {
      "type": "string",
      "format": "date-time",
      "description": "The date and time when the task was completed or canceled."
    },
    "taskStatistics": {
      "type": "object",
      "additionalProperties": {
        "$ref": "#/$defs/TaskStatisticsForAuditCheck"
      },
      "description": "Aggregate counts of the results when the mitigation tasks were applied to the findings for this audit mitigation actions task."
    },
    "target": {
      "$ref": "#/$defs/AuditMitigationActionsTaskTarget"
    },
    "auditCheckToActionsMapping": {
      "type": "object",
      "additionalProperties": {
        "type": "array",
        "items": {
          "type": "string"
        }
      },
      "description": "Specifies the mitigation actions that should be applied to specific audit checks."
    },
    "actionsDefinition": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/MitigationAction"
      },
      "description": "Specifies the mitigation actions and their parameters that are applied as part of this task."
    }
  },
  "$defs": {
    "AddThingsToThingGroupParams": {
      "type": "object",
      "properties": {
        "thingGroupNames": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "The list of groups to which you want to add the things that triggered the mitigation action. You can add a thing to a maximum of 10 groups, but you can't add a thing to more than one group in the same hierarchy."
        },
        "overrideDynamicGroups": {
          "type": "boolean",
          "description": "Specifies if this mitigation action can move the things that triggered the mitigation action even if they are part of one or more dynamic thing groups."
        }
      },
      "required": [
        "thingGroupNames"
      ]
    },
    "AuditMitigationActionsTaskTarget": {
      "type": "object",
      "properties": {
        "auditTaskId": {
          "type": "string",
          "description": "If the task will apply a mitigation action to findings from a specific audit, this value uniquely identifies the audit."
        },
        "findingIds": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "If the task will apply a mitigation action to one or more listed findings, this value uniquely identifies those findings."
        },
        "auditCheckToReasonCodeFilter": {
          "type": "object",
          "additionalProperties": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "description": "Specifies a filter in the form of an audit check and set of reason codes that identify the findings from the audit to which the audit mitigation actions task apply."
        }
      }
    },
    "EnableIoTLoggingParams": {
      "type": "object",
      "properties": {
        "roleArnForLogging": {
          "type": "string",
          "description": "The Amazon Resource Name (ARN) of the IAM role used for logging."
        },
        "logLevel": {
          "type": "string",
          "enum": [
            "DEBUG",
            "INFO",
            "ERROR",
            "WARN",
            "DISABLED"
          ],
          "description": "Specifies the type of information to be logged."
        }
      },
      "required": [
        "roleArnForLogging",
        "logLevel"
      ]
    },
    "MitigationAction": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "A user-friendly name for the mitigation action."
        },
        "id": {
          "type": "string",
          "description": "A unique identifier for the mitigation action."
        },
        "roleArn": {
          "type": "string",
          "description": "The IAM role ARN used to apply this mitigation action."
        },
        "actionParams": {
          "$ref": "#/$defs/MitigationActionParams"
        }
      }
    },
    "MitigationActionParams": {
      "type": "object",
      "properties": {
        "updateDeviceCertificateParams": {
          "$ref": "#/$defs/UpdateDeviceCertificateParams"
        },
        "updateCACertificateParams": {
          "$ref": "#/$defs/UpdateCACertificateParams"
        },
        "addThingsToThingGroupParams": {
          "$ref": "#/$defs/AddThingsToThingGroupParams"
        },
        "replaceDefaultPolicyVersionParams": {
          "$ref": "#/$defs/ReplaceDefaultPolicyVersionParams"
        },
        "enableIoTLoggingParams": {
          "$ref": "#/$defs/EnableIoTLoggingParams"
        },
        "publishFindingToSnsParams": {
          "$ref": "#/$defs/PublishFindingToSnsParams"
        }
      }
    },
    "PublishFindingToSnsParams": {
      "type": "object",
      "properties": {
        "topicArn": {
          "type": "string",
          "description": "The ARN of the topic to which you want to publish the findings."
        }
      },
      "required": [
        "topicArn"
      ]
    },
    "ReplaceDefaultPolicyVersionParams": {
      "type": "object",
      "properties": {
        "templateName": {
          "type": "string",
          "enum": [
            "BLANK_POLICY"
          ],
          "description": "The name of the template to be applied. The only supported value is BLANK_POLICY."
        }
      },
      "required": [
        "templateName"
      ]
    },
    "TaskStatisticsForAuditCheck": {
      "type": "object",
      "properties": {
        "totalFindingsCount": {
          "type": "integer",
          "description": "The total number of findings to which a task is being applied."
        },
        "failedFindingsCount": {
          "type": "integer",
          "description": "The number of findings for which at least one of the actions failed when applied."
        },
        "succeededFindingsCount": {
          "type": "integer",
          "description": "The number of findings for which all mitigation actions succeeded when applied."
        },
        "skippedFindingsCount": {
          "type": "integer",
          "description": "The number of findings skipped because of filter conditions provided in the parameters to the command."
        },
        "canceledFindingsCount": {
          "type": "integer",
          "description": "The number of findings to which the mitigation action task was canceled when applied."
        }
      }
    },
    "UpdateCACertificateParams": {
      "type": "object",
      "properties": {
        "action": {
          "type": "string",
          "enum": [
            "DEACTIVATE"
          ],
          "description": "The action that you want to apply to the CA certificate. The only supported value is DEACTIVATE."
        }
      },
      "required": [
        "action"
      ]
    },
    "UpdateDeviceCertificateParams": {
      "type": "object",
      "properties": {
        "action": {
          "type": "string",
          "enum": [
            "DEACTIVATE"
          ],
          "description": "The action that you want to apply to the device certificate. The only supported value is DEACTIVATE."
        }
      },
      "required": [
        "action"
      ]
    }
  }
}