{
  "openapi": "3.0.1",
  "info": {
    "title": "Business Audits",
    "description": "Provide access to a business audits.",
    "version": "9.1.20.0",
    "x-introduced": "9.1.0.0"
  },
  "servers": [
    {
      "url": "https://{hostname}:{port}/rest/admin/v2",
      "variables": {
        "port": {
          "default": "443",
          "enum": [
            "443",
            "8000"
          ]
        },
        "hostname": {
          "default": "localhost",
          "enum": [
            "localhost",
            "test.hcl.com"
          ]
        }
      }
    }
  ],
  "tags": [
    {
      "name": "Business Audits",
      "description": "Provide RESTful services to Business Audits resources."
    }
  ],
  "paths": {
    "/business-audits": {
      "get": {
        "tags": [
          "Business Audits"
        ],
        "summary": "Get the business audits.",
        "description": "Get the business audits for user, commands, or both of them.",
        "operationId": "findBusinessAuditRecordsBetweenTime",
        "parameters": [
          {
            "name": "user",
            "in": "query",
            "description": "The user for query.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "commandType",
            "in": "query",
            "description": "The command type for query.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "storeId",
            "in": "query",
            "description": "The store id, if no store id passed, then use the default store id 0.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "startTime",
            "in": "query",
            "description": "The start time to show the business audit.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "endTime",
            "in": "query",
            "description": "The end time to show the business audit.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "description": "The index of the first item to be returned.",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "The maximum number of items to be returned.",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Get business audits successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessAudits"
                }
              }
            }
          }
        }
      }
    },
    "/business-audits/{id}": {
      "get": {
        "tags": [
          "Business Audits"
        ],
        "summary": "Get the business audit for a particular id.",
        "description": "Get the business audits for a particular id, if no attributes returns but do exist in DB, it means the user does not have authority to view the details of the attributes.",
        "operationId": "findBusinessAuditById",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The business audit id.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Get business audit successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessAuditDetails"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "BusinessAudit": {
        "type": "object",
        "properties": {
          "businessAuditId": {
            "type": "integer",
            "format": "int64"
          },
          "user": {
            "type": "string"
          },
          "forUserId": {
            "type": "string"
          },
          "auditTime": {
            "type": "string",
            "format": "date-time"
          },
          "action": {
            "type": "string"
          },
          "commandType": {
            "type": "string"
          },
          "commandName": {
            "type": "string"
          }
        }
      },
      "BusinessAudits": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BusinessAudit"
            }
          }
        }
      },
      "BusinessAuditDetails": {
        "type": "object",
        "properties": {
          "auditSessionId": {
            "type": "string"
          },
          "auditId": {
            "type": "string"
          },
          "sequence": {
            "type": "string"
          },
          "userId": {
            "type": "string"
          },
          "forUserId": {
            "type": "string"
          },
          "occurence": {
            "type": "string"
          },
          "storeId": {
            "type": "string"
          },
          "action": {
            "type": "string"
          },
          "workspace": {
            "type": "string"
          },
          "taskGroup": {
            "type": "string"
          },
          "task": {
            "type": "string"
          },
          "commandName": {
            "type": "string"
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          },
          "events": {
            "type": "string"
          },
          "attributes": {
            "$ref": "#/components/schemas/BusinessAuditParameterDataBean"
          }
        }
      },
      "BusinessAuditParameterDataBean": {
        "type": "object",
        "properties": {
          "parameterNames": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "parameterValues": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      }
    },
    "securitySchemes": {
      "basicAuth": {
        "type": "http",
        "scheme": "basic"
      }
    }
  },
  "security": [
    {
      "basicAuth": []
    }
  ]
}
