{
  "swagger": "2.0",
  "info": {
    "version": "v1",
    "title": "Access Risk Management Cloud Agent API"
  },
  "paths": {
    "/api/Extracts/RunSecurityExtract": {
      "post": {
        "tags": [
          "Extracts"
        ],
        "summary": "Schedules a security extract to run. Returns the task ID which references that extract.",
        "operationId": "RunSecurityExtract",
        "consumes": [
          "application/json;odata.metadata=minimal;odata.streaming=true",
          "application/json;odata.metadata=minimal;odata.streaming=false",
          "application/json;odata.metadata=minimal",
          "application/json;odata.metadata=full;odata.streaming=true",
          "application/json;odata.metadata=full;odata.streaming=false",
          "application/json;odata.metadata=full",
          "application/json;odata.metadata=none;odata.streaming=true",
          "application/json;odata.metadata=none;odata.streaming=false",
          "application/json;odata.metadata=none",
          "application/json;odata.streaming=true",
          "application/json;odata.streaming=false",
          "application/json",
          "application/xml",
          "application/prs.odatatestxx-odata",
          "application/json-patch+json",
          "application/json",
          "text/json",
          "application/*+json"
        ],
        "produces": [
          "application/json;odata.metadata=minimal;odata.streaming=true",
          "application/json;odata.metadata=minimal;odata.streaming=false",
          "application/json;odata.metadata=minimal",
          "application/json;odata.metadata=full;odata.streaming=true",
          "application/json;odata.metadata=full;odata.streaming=false",
          "application/json;odata.metadata=full",
          "application/json;odata.metadata=none;odata.streaming=true",
          "application/json;odata.metadata=none;odata.streaming=false",
          "application/json;odata.metadata=none",
          "application/json;odata.streaming=true",
          "application/json;odata.streaming=false",
          "application/json",
          "application/xml",
          "application/prs.odatatestxx-odata",
          "text/plain",
          "text/json"
        ],
        "parameters": [
          {
            "name": "model",
            "in": "body",
            "description": "",
            "required": false,
            "schema": {
              "$ref": "#/definitions/RunSecurityExtractRequest"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Success",
            "schema": {
              "format": "int32",
              "type": "integer"
            }
          },
          "404": {
            "description": "Not Found",
            "schema": {
              "format": "int32",
              "type": "integer"
            }
          },
          "500": {
            "description": "Server Error",
            "schema": {
              "format": "int32",
              "type": "integer"
            }
          }
        }
      }
    },
    "/api/Extracts/ReRunSecurityExtract": {
      "post": {
        "tags": [
          "Extracts"
        ],
        "summary": "Schedules a security extract for a repeated run. Returns the task ID which references that extract.",
        "operationId": "ReRunSecurityExtract",
        "consumes": [
          "application/json;odata.metadata=minimal;odata.streaming=true",
          "application/json;odata.metadata=minimal;odata.streaming=false",
          "application/json;odata.metadata=minimal",
          "application/json;odata.metadata=full;odata.streaming=true",
          "application/json;odata.metadata=full;odata.streaming=false",
          "application/json;odata.metadata=full",
          "application/json;odata.metadata=none;odata.streaming=true",
          "application/json;odata.metadata=none;odata.streaming=false",
          "application/json;odata.metadata=none",
          "application/json;odata.streaming=true",
          "application/json;odata.streaming=false",
          "application/json",
          "application/xml",
          "application/prs.odatatestxx-odata",
          "application/json-patch+json",
          "application/json",
          "text/json",
          "application/*+json"
        ],
        "produces": [
          "application/json;odata.metadata=minimal;odata.streaming=true",
          "application/json;odata.metadata=minimal;odata.streaming=false",
          "application/json;odata.metadata=minimal",
          "application/json;odata.metadata=full;odata.streaming=true",
          "application/json;odata.metadata=full;odata.streaming=false",
          "application/json;odata.metadata=full",
          "application/json;odata.metadata=none;odata.streaming=true",
          "application/json;odata.metadata=none;odata.streaming=false",
          "application/json;odata.metadata=none",
          "application/json;odata.streaming=true",
          "application/json;odata.streaming=false",
          "application/json",
          "application/xml",
          "application/prs.odatatestxx-odata",
          "text/plain",
          "text/json"
        ],
        "parameters": [
          {
            "name": "model",
            "in": "body",
            "description": "",
            "required": false,
            "schema": {
              "$ref": "#/definitions/ReRunSecurityExtractRequest"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Success",
            "schema": {
              "format": "int32",
              "type": "integer"
            }
          },
          "404": {
            "description": "Not Found",
            "schema": {
              "format": "int32",
              "type": "integer"
            }
          },
          "500": {
            "description": "Server Error",
            "schema": {
              "format": "int32",
              "type": "integer"
            }
          }
        }
      }
    },
    "/api/System/ValidateConnectionInformation": {
      "post": {
        "tags": [
          "System"
        ],
        "summary": "Validates connection information for ERP system.",
        "operationId": "ValidateConnectionInformation",
        "consumes": [
          "application/json;odata.metadata=minimal;odata.streaming=true",
          "application/json;odata.metadata=minimal;odata.streaming=false",
          "application/json;odata.metadata=minimal",
          "application/json;odata.metadata=full;odata.streaming=true",
          "application/json;odata.metadata=full;odata.streaming=false",
          "application/json;odata.metadata=full",
          "application/json;odata.metadata=none;odata.streaming=true",
          "application/json;odata.metadata=none;odata.streaming=false",
          "application/json;odata.metadata=none",
          "application/json;odata.streaming=true",
          "application/json;odata.streaming=false",
          "application/json",
          "application/xml",
          "application/prs.odatatestxx-odata",
          "application/json-patch+json",
          "application/json",
          "text/json",
          "application/*+json"
        ],
        "produces": [
          "application/json;odata.metadata=minimal;odata.streaming=true",
          "application/json;odata.metadata=minimal;odata.streaming=false",
          "application/json;odata.metadata=minimal",
          "application/json;odata.metadata=full;odata.streaming=true",
          "application/json;odata.metadata=full;odata.streaming=false",
          "application/json;odata.metadata=full",
          "application/json;odata.metadata=none;odata.streaming=true",
          "application/json;odata.metadata=none;odata.streaming=false",
          "application/json;odata.metadata=none",
          "application/json;odata.streaming=true",
          "application/json;odata.streaming=false",
          "application/json",
          "application/xml",
          "application/prs.odatatestxx-odata",
          "text/plain",
          "text/json"
        ],
        "parameters": [
          {
            "name": "request",
            "in": "body",
            "description": "",
            "required": false,
            "schema": {
              "$ref": "#/definitions/ValidateConnectionInfoRequest"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "schema": {
              "format": "int32",
              "type": "integer"
            }
          },
          "500": {
            "description": "Server Error",
            "schema": {
              "format": "int32",
              "type": "integer"
            }
          }
        }
      }
    },
    "/api/TaskAuditTrails": {
      "get": {
        "tags": [
          "TaskAuditTrails"
        ],
        "summary": "OData endpoint to get a collection of Task Audit Trail.",
        "operationId": "Get",
        "consumes": [],
        "produces": [],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success"
          }
        }
      }
    },
    "/api/TaskAuditTrails/{id}": {
      "get": {
        "tags": [
          "TaskAuditTrails"
        ],
        "summary": "OData endpoint to get a Task Audit Trail by its ID.",
        "operationId": "Get",
        "consumes": [],
        "produces": [],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "ID of the Task Audit Trail.",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          }
        }
      }
    },
    "/api/Tasks/completed": {
      "post": {
        "tags": [
          "Tasks"
        ],
        "summary": "Creates an audit trail record which indicates a task has been \"Completed\". A FileOutput record is also created.",
        "operationId": "SetTaskToCompleted",
        "consumes": [
          "application/json;odata.metadata=minimal;odata.streaming=true",
          "application/json;odata.metadata=minimal;odata.streaming=false",
          "application/json;odata.metadata=minimal",
          "application/json;odata.metadata=full;odata.streaming=true",
          "application/json;odata.metadata=full;odata.streaming=false",
          "application/json;odata.metadata=full",
          "application/json;odata.metadata=none;odata.streaming=true",
          "application/json;odata.metadata=none;odata.streaming=false",
          "application/json;odata.metadata=none",
          "application/json;odata.streaming=true",
          "application/json;odata.streaming=false",
          "application/json",
          "application/xml",
          "application/prs.odatatestxx-odata",
          "application/json-patch+json",
          "application/json",
          "text/json",
          "application/*+json"
        ],
        "produces": [],
        "parameters": [
          {
            "name": "securityExtractModel",
            "in": "body",
            "description": "Represents the security extract model that contains the metadata used to set the status to completed.",
            "required": false,
            "schema": {
              "$ref": "#/definitions/SecurityExtractModel"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          }
        }
      }
    },
    "/api/Tasks/{id}/Errored": {
      "post": {
        "tags": [
          "Tasks"
        ],
        "summary": "Creates an audit trail record which indicates a task has errored.",
        "operationId": "SetTaskToErrored",
        "consumes": [],
        "produces": [],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "",
            "required": true,
            "type": "integer",
            "format": "int32",
            "maximum": 2147483647.0,
            "minimum": 1.0
          },
          {
            "name": "errorMessage",
            "in": "query",
            "description": "",
            "required": false,
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          }
        }
      }
    },
    "/api/Tasks/{referenceId}": {
      "get": {
        "tags": [
          "Tasks"
        ],
        "summary": "Returns current status of the task.",
        "operationId": "GetTaskStatus",
        "consumes": [],
        "produces": [],
        "parameters": [
          {
            "name": "referenceId",
            "in": "path",
            "description": "",
            "required": true,
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "404": {
            "description": "Not Found"
          }
        }
      }
    },
    "/api/Tasks/{referenceId}/OutputFile": {
      "get": {
        "tags": [
          "Tasks"
        ],
        "summary": "Returns output file for the specified task.",
        "operationId": "GetOutputFile",
        "consumes": [],
        "produces": [],
        "parameters": [
          {
            "name": "referenceId",
            "in": "path",
            "description": "",
            "required": true,
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "404": {
            "description": "Not Found"
          }
        }
      }
    },
    "/api/Tasks/{systemId}/OutputFiles": {
      "get": {
        "tags": [
          "Tasks"
        ],
        "summary": "Returns output files for the specified system of specified type.",
        "operationId": "GetOutputFiles",
        "consumes": [],
        "produces": [],
        "parameters": [
          {
            "name": "systemId",
            "in": "path",
            "description": "",
            "required": true,
            "type": "integer",
            "format": "int32",
            "maximum": 2147483647.0,
            "minimum": 1.0
          },
          {
            "name": "taskType",
            "in": "query",
            "description": "",
            "required": false,
            "type": "integer",
            "format": "int32",
            "enum": [
              0,
              1
            ]
          },
          {
            "name": "afterDate",
            "in": "query",
            "description": "",
            "required": false,
            "type": "string",
            "format": "date-time"
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "404": {
            "description": "Not Found"
          }
        }
      }
    }
  },
  "definitions": {
    "RunSecurityExtractRequest": {
      "required": [
        "systemId",
        "createdBy"
      ],
      "type": "object",
      "properties": {
        "systemId": {
          "format": "int32",
          "type": "integer"
        },
        "referenceId": {
          "maxLength": 500,
          "minLength": 0,
          "type": "string"
        },
        "callbackUrl": {
          "maxLength": 200,
          "minLength": 0,
          "type": "string"
        },
        "createdBy": {
          "maxLength": 255,
          "minLength": 0,
          "type": "string"
        },
        "jobRequestId": {
          "format": "int32",
          "type": "integer"
        },
        "customerId": {
          "format": "uuid",
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "rulebookId": {
          "format": "int32",
          "type": "integer"
        },
        "useLiveExtract": {
          "type": "boolean"
        },
        "taskId": {
          "format": "int32",
          "type": "integer"
        },
        "serializedConnectionInfo": {
          "type": "string"
        },
        "resultFilePath": {
          "type": "string"
        }
      }
    },
    "ReRunSecurityExtractRequest": {
      "type": "object",
      "properties": {
        "referenceId": {
          "maxLength": 500,
          "minLength": 0,
          "type": "string"
        }
      }
    },
    "ValidateConnectionInfoRequest": {
      "type": "object",
      "properties": {
        "systemType": {
          "enum": [
            "Undefined",
            "Sap",
            "SuccessFactors",
            "Ariba",
            "Concur",
            "UConnect",
            "SystemGroup"
          ],
          "type": "string"
        },
        "encryptedConnectionInfo": {
          "type": "string"
        }
      }
    },
    "SecurityExtractModel": {
      "type": "object",
      "properties": {
        "createdBy": {
          "type": "string"
        },
        "customerId": {
          "format": "uuid",
          "type": "string"
        },
        "jobRequestId": {
          "format": "int32",
          "type": "integer"
        },
        "name": {
          "type": "string"
        },
        "pathToExtractDb": {
          "type": "string"
        },
        "referenceId": {
          "type": "string"
        },
        "rulebookId": {
          "format": "int32",
          "type": "integer"
        },
        "systemId": {
          "format": "int32",
          "type": "integer"
        },
        "useLiveExtract": {
          "type": "boolean"
        },
        "taskId": {
          "format": "int32",
          "type": "integer"
        }
      }
    }
  }
}