{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/amazon-audit-manager/json-schema/amazon-audit-manager-batch-create-delegation-by-assessment-response-schema.json",
  "title": "BatchCreateDelegationByAssessmentResponse",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/amazon-audit-manager-delegations-api-openapi.yml#/components/schemas/BatchCreateDelegationByAssessmentResponse",
  "type": "object",
  "properties": {
    "delegations": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Delegation"
      },
      "description": "The delegations that are associated with the assessment."
    },
    "errors": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/BatchCreateDelegationByAssessmentError"
      },
      "description": "A list of errors that the BatchCreateDelegationByAssessment API returned."
    }
  },
  "$defs": {
    "BatchCreateDelegationByAssessmentError": {
      "type": "object",
      "properties": {
        "createDelegationRequest": {
          "$ref": "#/$defs/CreateDelegationRequest"
        },
        "errorCode": {
          "type": "string",
          "description": "The error code that the BatchCreateDelegationByAssessment API returned."
        },
        "errorMessage": {
          "type": "string",
          "description": "The error message that the BatchCreateDelegationByAssessment API returned."
        }
      }
    },
    "CreateDelegationRequest": {
      "type": "object",
      "properties": {
        "comment": {
          "type": "string",
          "description": "A comment that's related to the delegation request."
        },
        "controlSetId": {
          "type": "string",
          "description": "The unique identifier for the control set."
        },
        "roleArn": {
          "type": "string",
          "description": "The Amazon Resource Name (ARN) of the IAM role."
        },
        "roleType": {
          "type": "string",
          "enum": [
            "PROCESS_OWNER",
            "RESOURCE_OWNER"
          ],
          "description": "The type of customer persona. In CreateAssessment, roleType can only be PROCESS_OWNER. In UpdateSettings, roleType can only be PROCESS_OWNER. In BatchCreateDelegationByAssessment, roleType can only be RESOURCE_OWNER."
        }
      }
    },
    "Delegation": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "The unique identifier for the delegation."
        },
        "assessmentName": {
          "type": "string",
          "description": "The name of the assessment that's associated with the delegation."
        },
        "assessmentId": {
          "type": "string",
          "description": "The identifier for the assessment that's associated with the delegation."
        },
        "status": {
          "type": "string",
          "enum": [
            "IN_PROGRESS",
            "UNDER_REVIEW",
            "COMPLETE"
          ],
          "description": "The status of the delegation."
        },
        "roleArn": {
          "type": "string",
          "description": "The Amazon Resource Name (ARN) of the IAM role."
        },
        "roleType": {
          "type": "string",
          "enum": [
            "PROCESS_OWNER",
            "RESOURCE_OWNER"
          ],
          "description": "The type of customer persona. In CreateAssessment, roleType can only be PROCESS_OWNER. In UpdateSettings, roleType can only be PROCESS_OWNER. In BatchCreateDelegationByAssessment, roleType can only be RESOURCE_OWNER."
        },
        "creationTime": {
          "type": "string",
          "format": "date-time",
          "description": "Specifies when the delegation was created."
        },
        "lastUpdated": {
          "type": "string",
          "format": "date-time",
          "description": "Specifies when the delegation was last updated."
        },
        "controlSetId": {
          "type": "string",
          "description": "The identifier for the control set that's associated with the delegation."
        },
        "comment": {
          "type": "string",
          "description": "The comment that's related to the delegation."
        },
        "createdBy": {
          "type": "string",
          "description": "The user or role that created the delegation."
        }
      }
    }
  }
}