{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/amazon-ground-station/json-schema/amazon-ground-station-create-ephemeris-request-schema.json",
  "title": "CreateEphemerisRequest",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/amazon-ground-station-ephemeris-api-openapi.yml#/components/schemas/CreateEphemerisRequest",
  "type": "object",
  "properties": {
    "satelliteId": {
      "type": "string",
      "description": "The satellite ID that associates this ephemeris with a satellite in AWS Ground Station."
    },
    "enabled": {
      "type": "boolean",
      "description": "Set to true to enable the ephemeris after validation. Set to false to keep it disabled."
    },
    "priority": {
      "type": "integer",
      "description": "A priority score that determines which ephemeris to use when multiple ephemerides overlap. Higher numbers take precedence. The default is 1. Must be 1 or greater."
    },
    "expirationTime": {
      "type": "string",
      "description": "An overall expiration time for the ephemeris in UTC, after which it will become EXPIRED."
    },
    "name": {
      "type": "string",
      "description": "A name that you can use to identify the ephemeris."
    },
    "kmsKeyArn": {
      "type": "string",
      "description": "The ARN of the KMS key to use for encrypting the ephemeris."
    },
    "ephemeris": {
      "$ref": "#/$defs/EphemerisData"
    },
    "tags": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      },
      "description": "Tags assigned to an ephemeris."
    }
  },
  "required": [
    "name"
  ],
  "$defs": {
    "AzElEphemeris": {
      "type": "object",
      "properties": {
        "groundStation": {
          "type": "string",
          "description": "The ground station name for which you're providing azimuth elevation data. This ephemeris is specific to this ground station and can't be used at other locations."
        },
        "data": {
          "$ref": "#/$defs/AzElSegmentsData"
        }
      },
      "required": [
        "groundStation",
        "data"
      ]
    },
    "AzElSegment": {
      "type": "object",
      "properties": {
        "referenceEpoch": {
          "type": "string",
          "description": "The reference time for this segment in ISO 8601 format in Coordinated Universal Time (UTC). All time values within the segment's AzElSegment$azElList are specified as offsets in atomic seconds from this reference epoch. Example: 2024-01-15T12:00:00.000Z"
        },
        "validTimeRange": {
          "$ref": "#/$defs/ISO8601TimeRange"
        },
        "azElList": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/TimeAzEl"
          },
          "description": "List of time-tagged azimuth elevation data points. Must contain at least five points to support 4th order Lagrange interpolation. Points must be in chronological order with no duplicates."
        }
      },
      "required": [
        "referenceEpoch",
        "validTimeRange",
        "azElList"
      ]
    },
    "AzElSegments": {
      "type": "object",
      "properties": {
        "angleUnit": {
          "type": "string",
          "enum": [
            "DEGREE_ANGLE",
            "RADIAN"
          ],
          "description": "The unit of measure for azimuth and elevation angles. All angles in all segments must use the same unit."
        },
        "azElSegmentList": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/AzElSegment"
          },
          "description": "List of azimuth elevation segments. Must contain between 1 and 100 segments. Segments must be in chronological order with no overlaps."
        }
      },
      "required": [
        "angleUnit",
        "azElSegmentList"
      ]
    },
    "AzElSegmentsData": {
      "type": "object",
      "properties": {
        "s3Object": {
          "$ref": "#/$defs/S3Object"
        },
        "azElData": {
          "$ref": "#/$defs/AzElSegments"
        }
      },
      "description": "Exactly one member is set."
    },
    "EphemerisData": {
      "type": "object",
      "properties": {
        "tle": {
          "$ref": "#/$defs/TLEEphemeris"
        },
        "oem": {
          "$ref": "#/$defs/OEMEphemeris"
        },
        "azEl": {
          "$ref": "#/$defs/AzElEphemeris"
        }
      },
      "description": "Exactly one member is set."
    },
    "ISO8601TimeRange": {
      "type": "object",
      "properties": {
        "startTime": {
          "type": "string",
          "description": "Start time in ISO 8601 format in Coordinated Universal Time (UTC). Example: 2026-11-15T10:28:48.000Z"
        },
        "endTime": {
          "type": "string",
          "description": "End time in ISO 8601 format in Coordinated Universal Time (UTC). Example: 2024-01-15T12:00:00.000Z"
        }
      },
      "required": [
        "startTime",
        "endTime"
      ]
    },
    "OEMEphemeris": {
      "type": "object",
      "properties": {
        "s3Object": {
          "$ref": "#/$defs/S3Object"
        },
        "oemData": {
          "type": "string",
          "description": "OEM data that you provide directly instead of using an Amazon S3 object."
        }
      }
    },
    "S3Object": {
      "type": "object",
      "properties": {
        "bucket": {
          "type": "string",
          "description": "An Amazon S3 Bucket name."
        },
        "key": {
          "type": "string",
          "description": "An Amazon S3 key for the ephemeris."
        },
        "version": {
          "type": "string",
          "description": "For versioned Amazon S3 objects, the version to use for the ephemeris."
        }
      }
    },
    "TLEData": {
      "type": "object",
      "properties": {
        "tleLine1": {
          "type": "string",
          "description": "First line of two-line element set (TLE) data."
        },
        "tleLine2": {
          "type": "string",
          "description": "Second line of two-line element set (TLE) data."
        },
        "validTimeRange": {
          "$ref": "#/$defs/TimeRange"
        }
      },
      "required": [
        "tleLine1",
        "tleLine2",
        "validTimeRange"
      ]
    },
    "TLEEphemeris": {
      "type": "object",
      "properties": {
        "s3Object": {
          "$ref": "#/$defs/S3Object"
        },
        "tleData": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/TLEData"
          },
          "description": "TLE data that you provide directly instead of using an Amazon S3 object."
        }
      }
    },
    "TimeAzEl": {
      "type": "object",
      "properties": {
        "dt": {
          "type": "number",
          "description": "Time offset in atomic seconds from the segment's reference epoch. All dt values within a segment must be in ascending order with no duplicates. dt values may be: negative expressed as fractions of a second expressed in scientific notation"
        },
        "az": {
          "type": "number",
          "description": "Azimuth angle at the specified time. Valid ranges by unit: DEGREE_ANGLE: -180 to 360 degrees, measured clockwise from true north RADIAN: -π to 2π radians, measured clockwise from true north"
        },
        "el": {
          "type": "number",
          "description": "Elevation angle at the specified time. Valid ranges by unit: DEGREE_ANGLE: -90 to 90 degrees, where 0 is the horizon, 90 is zenith, and negative values are below the horizon RADIAN: -π/2 to π/2 radians, where 0 is the horizon, π/2 is zenith, and negative values are below the horizon"
        }
      },
      "required": [
        "dt",
        "az",
        "el"
      ]
    },
    "TimeRange": {
      "type": "object",
      "properties": {
        "startTime": {
          "type": "string",
          "description": "Unix epoch timestamp in UTC at which the time range starts."
        },
        "endTime": {
          "type": "string",
          "description": "Unix epoch timestamp in UTC at which the time range ends."
        }
      },
      "required": [
        "startTime",
        "endTime"
      ]
    }
  }
}