﻿{
  "openapi": "3.0.1",
  "info": {
    "title": "Relativity Transfer Service"
  },
  "paths": {
    "/v2/transfer/jobs": {
      "post": {
        "tags": [
          "TransferControllerV2"
        ],
        "parameters": [
          {
            "name": "correlation-id",
            "in": "header",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateTransferRequestV2"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateTransferRequestV2"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateTransferRequestV2"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success"
          }
        }
      }
    },
    "/v2/transfer/jobs/{jobId}": {
      "get": {
        "tags": [
          "TransferControllerV2"
        ],
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "correlation-id",
            "in": "header",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/GetJobResultV2"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetJobResultV2"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetJobResultV2"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "TransferControllerV2"
        ],
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "correlation-id",
            "in": "header",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          }
        }
      }
    },
    "/v2/transfer/jobs/{jobId}/qc": {
      "get": {
        "tags": [
          "TransferControllerV2"
        ],
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "correlation-id",
            "in": "header",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/GetTokenResult"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetTokenResult"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetTokenResult"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "CreateTransferRequestV2": {
        "type": "object",
        "properties": {
          "destinationPath": {
            "type": "string",
            "nullable": true
          },
          "sourcePath": {
            "type": "string",
            "nullable": true
          },
          "tags": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "nullable": true
          },
          "transferType": {
            "type": "string",
            "nullable": true
          },
          "transferJobID": {
            "type": "string",
            "format": "uuid"
          }
        },
        "additionalProperties": false
      },
      "EnumerationStatistics": {
        "type": "object",
        "properties": {
          "totalFiles": {
            "type": "integer",
            "format": "int64"
          },
          "totalSize": {
            "type": "integer",
            "format": "int64"
          },
          "totalEmptyDirectories": {
            "type": "integer",
            "format": "int64"
          },
          "status": {
            "type": "string",
            "nullable": true
          },
          "error": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "GetJobResultV2": {
        "type": "object",
        "properties": {
          "transferStatus": {
            "type": "string",
            "nullable": true
          },
          "transferJobID": {
            "type": "string",
            "format": "uuid"
          },
          "destinationFullPath": {
            "type": "string",
            "nullable": true
          },
          "sourceFullPath": {
            "type": "string",
            "nullable": true
          },
          "tags": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "nullable": true
          },
          "eta": {
            "$ref": "#/components/schemas/TimeSpan"
          },
          "transferStatistics": {
            "$ref": "#/components/schemas/TransferStatistics"
          },
          "enumerationStatistics": {
            "$ref": "#/components/schemas/EnumerationStatistics"
          },
          "transferType": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "GetTokenResult": {
        "type": "object",
        "properties": {
          "sasUrl": {
            "type": "string",
            "format": "uri",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "TimeSpan": {
        "type": "object",
        "properties": {
          "ticks": {
            "type": "integer",
            "format": "int64"
          },
          "days": {
            "type": "integer",
            "format": "int32",
            "readOnly": true
          },
          "hours": {
            "type": "integer",
            "format": "int32",
            "readOnly": true
          },
          "milliseconds": {
            "type": "integer",
            "format": "int32",
            "readOnly": true
          },
          "microseconds": {
            "type": "integer",
            "format": "int32",
            "readOnly": true
          },
          "nanoseconds": {
            "type": "integer",
            "format": "int32",
            "readOnly": true
          },
          "minutes": {
            "type": "integer",
            "format": "int32",
            "readOnly": true
          },
          "seconds": {
            "type": "integer",
            "format": "int32",
            "readOnly": true
          },
          "totalDays": {
            "type": "number",
            "format": "double",
            "readOnly": true
          },
          "totalHours": {
            "type": "number",
            "format": "double",
            "readOnly": true
          },
          "totalMilliseconds": {
            "type": "number",
            "format": "double",
            "readOnly": true
          },
          "totalMicroseconds": {
            "type": "number",
            "format": "double",
            "readOnly": true
          },
          "totalNanoseconds": {
            "type": "number",
            "format": "double",
            "readOnly": true
          },
          "totalMinutes": {
            "type": "number",
            "format": "double",
            "readOnly": true
          },
          "totalSeconds": {
            "type": "number",
            "format": "double",
            "readOnly": true
          }
        },
        "additionalProperties": false
      },
      "TransferStatistics": {
        "type": "object",
        "properties": {
          "successfulFiles": {
            "type": "integer",
            "format": "int64"
          },
          "failedFiles": {
            "type": "integer",
            "format": "int64"
          },
          "skippedFiles": {
            "type": "integer",
            "format": "int64"
          },
          "successfulBytes": {
            "type": "integer",
            "format": "int64"
          },
          "failedBytes": {
            "type": "integer",
            "format": "int64"
          },
          "skippedBytes": {
            "type": "integer",
            "format": "int64"
          },
          "successfulEmptyDirectories": {
            "type": "integer",
            "format": "int64"
          },
          "failedEmptyDirectories": {
            "type": "integer",
            "format": "int64"
          },
          "skippedEmptyDirectories": {
            "type": "integer",
            "format": "int64"
          }
        },
        "additionalProperties": false
      }
    },
    "securitySchemes": {
      "Bearer": {
        "type": "http",
        "description": "Standard Authorization header using the Bearer scheme. Example: \"bearer {token}\"",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      }
    }
  },
  "security": [
    {
      "Bearer": [ ]
    }
  ]
}