{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "id": "drillplan://aea/staticwellboregeometry/4.0.0",
  "title": "StaticWellboreGeometry (wbg-v4)",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "comments": {
      "type": [
        "null",
        "string"
      ],
      "description": ""
    },
    "name": {
      "type": [
        "null",
        "string"
      ],
      "description": ""
    },
    "is_customer_data": {
      "type": "boolean",
      "description": ""
    },
    "template_id": {
      "type": [
        "null",
        "string"
      ],
      "description": ""
    },
    "vertical_reference": {
      "description": "",
      "oneOf": [
        {
          "type": "null"
        },
        {
          "$ref": "#/definitions/VerticalReference"
        }
      ]
    },
    "section_geometries": {
      "type": [
        "array",
        "null"
      ],
      "description": "",
      "items": {
        "$ref": "#/definitions/StaticWellboreSectionGeometry"
      }
    },
    "is_last_section_locked_to_trajectory": {
      "type": "boolean",
      "description": ""
    },
    "wellhead": {
      "description": "",
      "oneOf": [
        {
          "type": "null"
        },
        {
          "$ref": "#/definitions/Wellhead"
        }
      ]
    },
    "__relation__": {
      "description": "",
      "oneOf": [
        {
          "type": "null"
        },
        {
          "$ref": "#/definitions/ContractRelation"
        }
      ]
    },
    "id": {
      "type": [
        "null",
        "string"
      ],
      "description": ""
    },
    "create_date_time": {
      "type": "string",
      "description": "",
      "format": "date-time"
    },
    "update_date_time": {
      "type": "string",
      "description": "",
      "format": "date-time"
    },
    "unused_sections": {
      "type": [
        "array",
        "null"
      ],
      "description": "",
      "items": {
        "$ref": "#/definitions/StaticWellboreSectionGeometry"
      }
    },
    "hole_segments": {
      "type": [
        "array",
        "null"
      ],
      "description": "",
      "items": {
        "$ref": "#/definitions/HoleSegment"
      }
    }
  },
  "definitions": {
    "VerticalReference": {
      "type": "object",
      "additionalProperties": { "type" : "null"},
      "properties": {
        "elevation_datum": {
          "type": [
            "null",
            "string"
          ]
        },
        "depth_reference": {
          "type": [
            "null",
            "string"
          ]
        },
        "depth_reference_elevation": {
          "type": "number",
          "description": "Depth Reference Elevation (StandardDepthIndex,meter,m).",
          "format": "double"
        }
      }
    },
    "StaticWellboreSectionGeometry": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "anchor_formation_top": {
          "type": [
            "null",
            "string"
          ]
        },
        "offset_from_formation_top": {
          "type": [
            "null",
            "number"
          ],
          "description": "Offset from formation top (StandardDepthIndex,meter,m).",
          "format": "double"
        },
        "is_inherited": {
          "type": "boolean"
        },
        "section_comments": {
          "type": [
            "null",
            "string"
          ]
        },
        "section_id": {
          "type": [
            "null",
            "string"
          ]
        },
        "with_casingstring": {
          "type": "boolean"
        },
        "component_type": {
          "$ref": "#/definitions/SectionComponentType"
        },
        "endDepthLockType": {
          "$ref": "#/definitions/DepthLockType"
        },
        "end_md": {
          "type": [
            "null",
            "number"
          ],
          "description": "end md (StandardDepthIndex,meter,m).",
          "format": "double"
        },
        "end_tvd": {
          "type": [
            "null",
            "number"
          ],
          "description": "end tvd (StandardDepthIndex,meter,m).",
          "format": "double"
        },
        "hole_size": {
          "type": [
            "null",
            "number"
          ],
          "description": "hole size (CylinderDiameter,meter,m).",
          "format": "double"
        },
        "startDepthLockType": {
          "$ref": "#/definitions/DepthLockType"
        },
        "start_md": {
          "type": [
            "null",
            "number"
          ],
          "description": "start md (StandardDepthIndex,meter,m).",
          "format": "double"
        },
        "start_tvd": {
          "type": [
            "null",
            "number"
          ],
          "description": "start tvd (StandardDepthIndex,meter,m).",
          "format": "double"
        },
        "top_of_cement": {
          "type": [
            "null",
            "number"
          ],
          "description": "top of cement (StandardDepthIndex,meter,m).",
          "format": "double"
        },
        "tapered": {
          "type": [
            "boolean",
            "null"
          ]
        },
        "component": {
          "oneOf": [
            {
              "type": "null"
            },
            {
              "$ref": "#/definitions/CasingStringComponent"
            }
          ]
        },
        "links": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "$ref": "#/definitions/Link"
          }
        },
        "inside_diameter": {
          "type": [
            "null",
            "number"
          ],
          "description": "inside diameter (CylinderDiameter,meter,m).",
          "format": "double"
        },
        "outside_diameter": {
          "type": [
            "null",
            "number"
          ],
          "description": "outside diameter (CylinderDiameter,meter,m).",
          "format": "double"
        },
        "component_id": {
          "type": [
            "null",
            "string"
          ]
        },
        "description": {
          "type": [
            "null",
            "string"
          ]
        }
      }
    },
    "SectionComponentType": {
      "type": "string",
      "description": "",
      "x-enumNames": [
        "Casing",
        "Conductor",
        "Liner",
        "OpenHole",
        "Riser",
        "ProductionCasing",
        "ProductionLiner",
        "TieBack",
        "ProductionTieBack",
        "SurfaceCasing"
      ],
      "enum": [
        "Casing",
        "Conductor",
        "Liner",
        "OpenHole",
        "Riser",
        "ProductionCasing",
        "ProductionLiner",
        "TieBack",
        "ProductionTieBack",
        "SurfaceCasing"
      ]
    },
    "DepthLockType": {
      "type": "string",
      "description": "",
      "x-enumNames": [
        "MD",
        "TVD",
        "FormationTop"
      ],
      "enum": [
        "MD",
        "TVD",
        "FormationTop"
      ]
    },
    "CasingStringComponent": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "version": {
          "type": "integer",
          "format": "int32"
        },
        "modified": {
          "type": "boolean"
        },
        "properties": {
          "oneOf": [
            {},
            {
              "type": "null"
            }
          ]
        }
      }
    },
    "Link": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "rel": {
          "type": [
            "null",
            "string"
          ]
        },
        "href": {
          "type": [
            "null",
            "string"
          ]
        }
      }
    },
    "Wellhead": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "description": {
          "type": [
            "null",
            "string"
          ]
        },
        "wellhead_type": {
          "oneOf": [
            {
              "type": "null"
            },
            {
              "$ref": "#/definitions/WellheadType"
            }
          ]
        }
      }
    },
    "WellheadType": {
      "type": "string",
      "description": "",
      "x-enumNames": [
        "Unihead",
        "Spool",
        "Other",
        "PlatformUnihead",
        "PlatformSpool",
        "SubseaForVerticalXmasTree",
        "SubseaForHorizontalXmasTree",
        "SubseaMudlineSuspension"
      ],
      "enum": [
        "Unihead",
        "Spool",
        "Other",
        "PlatformUnihead",
        "PlatformSpool",
        "SubseaForVerticalXmasTree",
        "SubseaForHorizontalXmasTree",
        "SubseaMudlineSuspension"
      ]
    },
    "ContractRelation": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "id": {
          "type": [
            "null",
            "string"
          ]
        },
        "parent_id": {
          "type": [
            "null",
            "string"
          ]
        },
        "run_id": {
          "type": [
            "null",
            "string"
          ]
        },
        "section_id": {
          "type": [
            "null",
            "string"
          ]
        },
        "wellbore_id": {
          "type": [
            "null",
            "string"
          ]
        },
        "well_id": {
          "type": [
            "null",
            "string"
          ]
        }
      }
    },
    "HoleSegment": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "end_md": {
          "type": [
            "null",
            "number"
          ],
          "description": "end md (StandardDepthIndex,meter,m).",
          "format": "double"
        },
        "hole_size": {
          "type": "number",
          "description": "hole size (CylinderDiameter,meter,m).",
          "format": "double"
        },
        "is_inherited": {
          "type": "boolean"
        }
      }
    }
  }
}