{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/oracle-transportation-management/json-schema/oracle-transportation-management-export-requests-schema.json",
  "title": "exportRequests",
  "x-generated": "2026-11-25",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/oracle-transportation-management-data-export-openapi.yml#/components/schemas/exportRequests",
  "allOf": [
    {
      "$ref": "#/$defs/configOptionsType"
    },
    {
      "type": "object",
      "properties": {
        "schema": {
          "description": "Used to specify the database schema which owns the tables to be extracted. Defaults to PRIMARY.",
          "type": "string"
        },
        "excludePublic": {
          "description": "If true, PUBLIC data will not be included in exported content. Defaults to true.",
          "type": "boolean"
        },
        "targetSystem": {
          "description": "Specifies where content should be sent.",
          "allOf": [
            {
              "$ref": "#/$defs/targetSystemType"
            }
          ]
        },
        "contentType": {
          "description": "Specifies media type for the content. Defaults to text/plain (currently only text/plain is supported).",
          "type": "string"
        },
        "externalRef": {
          "description": "Specifies an external reference that can be used to correlate requests.",
          "type": "string"
        },
        "rangeAfter": {
          "description": "Only include records that were inserted or updated after this date/time.",
          "allOf": [
            {
              "$ref": "#/$defs/dateTimeType"
            }
          ]
        },
        "rangeBefore": {
          "description": "Only include records that were inserted or updated before this date/time.",
          "allOf": [
            {
              "$ref": "#/$defs/dateTimeType"
            }
          ]
        },
        "objects": {
          "description": "Describes content to be exported based on individally declared object names.",
          "allOf": [
            {
              "type": "object",
              "properties": {
                "resourceName": {
                  "description": "Name of resource to provide export records.",
                  "type": "string"
                },
                "partSize": {
                  "description": "Specifies a limit to the number of records included in one physical message part.",
                  "type": "integer"
                },
                "offset": {
                  "description": "Used if multiple requests are needed which can occur if row limits are exceeded.",
                  "type": "integer"
                },
                "filterCriteria": {
                  "description": "Alternative criteria used to select records in preference to rangeAfter & rangeBefore.",
                  "type": "object",
                  "properties": {
                    "copiedFrom": {
                      "description": "Saved Query GID to be executed to identify primary keys of target records.",
                      "type": "string"
                    }
                  }
                }
              }
            }
          ]
        },
        "tables": {
          "description": "Describes content to be exported based on individally declared table names.",
          "allOf": [
            {
              "$ref": "#/$defs/requestItemType"
            },
            {
              "type": "object",
              "properties": {
                "schema": {
                  "description": "Used to specify the database schema which owns the table to be extracted. Defaults to schema specified at root level or PRIMARY.",
                  "type": "string"
                },
                "tableName": {
                  "description": "Name of table to provide export records.",
                  "type": "string"
                },
                "selectList": {
                  "description": "Comma-separated list of columns to override all columns if not specified.",
                  "type": "string"
                },
                "filterCriteria": {
                  "description": "Alternative criteria used to select records in preference to rangeAfter & rangeBefore.",
                  "type": "object",
                  "properties": {
                    "copiedFrom": {
                      "description": "Saved Query GID to be executed to identify primary keys of target records.",
                      "type": "string"
                    }
                  }
                }
              }
            }
          ]
        },
        "deletes": {
          "description": "Used to export the list of primary keys deleted from a table within in a given time period.",
          "allOf": [
            {
              "$ref": "#/$defs/requestItemType"
            },
            {
              "type": "object",
              "properties": {
                "schema": {
                  "description": "Used to specify the database schema which owns the table to be extracted. Currently only PRIMARY is supported.",
                  "type": "string"
                },
                "tableName": {
                  "description": "Name of table.",
                  "type": "string"
                }
              }
            }
          ]
        }
      }
    }
  ],
  "$defs": {
    "configOptionsType": {
      "description": "Specifies various configuration options that control the output of data replication content.",
      "properties": {
        "contentCompression": {
          "description": "Specifies if content should be compressed. Supported options are zip and gzip. Default is 'gzip'.",
          "type": "string"
        },
        "contentDigest": {
          "description": "Specifies algorithm to be used to calculate the checksum for each part. Only 'md5' is supported.",
          "type": "string"
        },
        "contentDateTimeFormat": {
          "description": "Specifies how date/times should be formatted in output content. Valid patterns are defined by java.time.format.DataTimeFormatter. Defaults to ISO_OFFSET_DATE_TIME",
          "type": "string"
        },
        "contentDateFormat": {
          "description": "Specifies how dates should be formatted in output content. Valid patterns are defined by java.time.format.DataTimeFormatter. Defaults to ISO_LOCAL_DATE",
          "type": "string"
        },
        "contentTimeZone": {
          "description": "Specifies time zone for date/times. Valid names are defined by java.time.ZoneId. Defaults to 'UTC'",
          "type": "string"
        },
        "contentSendEmptyFile": {
          "description": "Specifies if an empty file should be sent if no records match query criteria. Default is false.",
          "type": "boolean"
        },
        "contentFilePrefix": {
          "description": "Specifies prefix to be pre-pended to filenames. Default is 'DATA_'.",
          "type": "string"
        }
      }
    },
    "dateTimeType": {
      "properties": {
        "value": {
          "description": "Date in ISO 8601 format",
          "type": "string",
          "format": "date-time"
        },
        "timezone": {
          "description": "Timezone in Olson database format",
          "type": "string"
        }
      }
    },
    "requestItemType": {
      "description": "Describes properties common to all item types. Many will override the corresponding value at the request level, if present.",
      "allOf": [
        {
          "$ref": "#/$defs/configOptionsType"
        },
        {
          "type": "object",
          "properties": {
            "excludePublic": {
              "description": "If true, PUBLIC data will not be included in exported content. Defaults to true.",
              "type": "boolean"
            },
            "targetSystem": {
              "description": "Specifies where content should be sent.",
              "allOf": [
                {
                  "$ref": "#/$defs/targetSystemType"
                }
              ]
            },
            "externalRef": {
              "description": "Specifies an external reference that can be used to correlate request items.",
              "type": "string"
            },
            "rangeAfter": {
              "description": "Only include records that were inserted or updated after this date/time.",
              "allOf": [
                {
                  "$ref": "#/$defs/dateTimeType"
                }
              ]
            },
            "rangeBefore": {
              "description": "Only include records that were inserted or updated before this date/time.",
              "allOf": [
                {
                  "$ref": "#/$defs/dateTimeType"
                }
              ]
            },
            "partSize": {
              "description": "Specifies a limit to the number of records included in one physical message part.",
              "type": "integer"
            },
            "offset": {
              "description": "Used if multiple requests are needed which can occur if row limits are exceeded.",
              "type": "integer"
            }
          }
        }
      ]
    },
    "targetSystemType": {
      "description": "Specifies target system details for destination of data replication content.",
      "properties": {
        "targetURL": {
          "description": "Specifies target system URL e.g. Object Storage PAR.",
          "type": "string"
        },
        "httpMethod": {
          "description": "Specifies HTTP method to be used - POST, PUT etc. Defaults to POST",
          "type": "string"
        },
        "externalSystem": {
          "description": "Specifies External System GID where target details are configured.",
          "type": "string"
        },
        "comMethod": {
          "description": "Specifies transport method to be used to send content. Defaults to REST (currently only REST is supported).",
          "type": "string"
        },
        "path": {
          "description": "Specifies any additional path element that should be appended to target system URL. Note: this would be before any additional part name is also appended.",
          "type": "string"
        },
        "appendName": {
          "description": "If true, the part name will be appended as an additional path element to the target system URL. Defaults to false.",
          "type": "boolean"
        }
      }
    }
  }
}