{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "object_import input",
  "description": "object_import input: draft, apply.",
  "oneOf": [
    {
      "type": "object",
      "required": [
        "action",
        "source"
      ],
      "properties": {
        "action": {
          "type": "string",
          "const": "draft"
        },
        "source": {
          "type": "object",
          "properties": {
            "path": {
              "type": "string",
              "minLength": 1,
              "description": "Local file or folder. References must stay inside the source folder. Aggregate limit 128 MiB."
            },
            "content": {
              "type": "string",
              "minLength": 1,
              "description": "Inline schema text, at most 1 MiB. Set format for SQL, Prisma, OData XML or GraphQL SDL."
            },
            "name": {
              "type": "string",
              "minLength": 1,
              "description": "File name for inline provenance; no directories."
            },
            "format": {
              "type": "string",
              "enum": [
                "openapi",
                "json-schema",
                "sql",
                "prisma",
                "dbt",
                "odata",
                "graphql"
              ],
              "description": "Explicit source format; inferred from file extension or document when omitted."
            }
          },
          "oneOf": [
            {
              "required": [
                "path"
              ],
              "not": {
                "required": [
                  "content"
                ]
              }
            },
            {
              "required": [
                "content"
              ],
              "not": {
                "required": [
                  "path"
                ]
              }
            }
          ],
          "additionalProperties": false,
          "description": "Local file/folder or inline schema. Used only by draft."
        }
      },
      "additionalProperties": false
    },
    {
      "type": "object",
      "required": [
        "action",
        "importId",
        "objects"
      ],
      "properties": {
        "action": {
          "type": "string",
          "const": "apply"
        },
        "importId": {
          "type": "string",
          "minLength": 1,
          "description": "Content-addressed import id from draft. Required by show and apply."
        },
        "objects": {
          "type": "array",
          "minItems": 1,
          "items": {
            "type": "object",
            "required": [
              "name"
            ],
            "properties": {
              "name": {
                "type": "string",
                "minLength": 1
              },
              "proposals": {
                "type": "array",
                "uniqueItems": true,
                "items": {
                  "type": "string",
                  "minLength": 1
                },
                "description": "Explicitly accepted proposal ids from show; omitted means no traits."
              },
              "currencies": {
                "type": "object",
                "description": "Explicit money declarations by numeric field. Values name a string currency field and optional minorUnits (for example 100 for cents). No field name implies money.",
                "additionalProperties": {
                  "type": "object",
                  "required": [
                    "field"
                  ],
                  "properties": {
                    "field": {
                      "type": "string",
                      "minLength": 1,
                      "description": "Declared currency-code field on this object."
                    },
                    "minorUnits": {
                      "type": "integer",
                      "minimum": 1,
                      "description": "Divisor converting minor to major units."
                    }
                  },
                  "additionalProperties": false
                }
              }
            },
            "additionalProperties": false
          },
          "description": "Explicit accepted object names and optional proposal ids for apply."
        },
        "overwrite": {
          "type": "boolean",
          "default": false,
          "description": "Allow replacing existing team objects."
        },
        "confirmShipped": {
          "type": "array",
          "uniqueItems": true,
          "items": {
            "type": "string",
            "minLength": 1
          },
          "description": "Each shipped object name whose replacement is explicitly confirmed."
        }
      },
      "additionalProperties": false
    }
  ],
  "type": "object",
  "required": [
    "action"
  ],
  "properties": {
    "action": {
      "type": "string",
      "enum": [
        "draft",
        "apply"
      ],
      "description": "Choose draft, apply."
    },
    "source": {
      "type": "object",
      "properties": {
        "path": {
          "type": "string",
          "minLength": 1,
          "description": "Local file or folder. References must stay inside the source folder. Aggregate limit 128 MiB."
        },
        "content": {
          "type": "string",
          "minLength": 1,
          "description": "Inline schema text, at most 1 MiB. Set format for SQL, Prisma, OData XML or GraphQL SDL."
        },
        "name": {
          "type": "string",
          "minLength": 1,
          "description": "File name for inline provenance; no directories."
        },
        "format": {
          "type": "string",
          "enum": [
            "openapi",
            "json-schema",
            "sql",
            "prisma",
            "dbt",
            "odata",
            "graphql"
          ],
          "description": "Explicit source format; inferred from file extension or document when omitted."
        }
      },
      "oneOf": [
        {
          "required": [
            "path"
          ],
          "not": {
            "required": [
              "content"
            ]
          }
        },
        {
          "required": [
            "content"
          ],
          "not": {
            "required": [
              "path"
            ]
          }
        }
      ],
      "additionalProperties": false,
      "description": "Local file/folder or inline schema. Used only by draft."
    },
    "importId": {
      "type": "string",
      "minLength": 1,
      "description": "Content-addressed import id from draft. Required by show and apply."
    },
    "objects": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "object",
        "required": [
          "name"
        ],
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1
          },
          "proposals": {
            "type": "array",
            "uniqueItems": true,
            "items": {
              "type": "string",
              "minLength": 1
            },
            "description": "Explicitly accepted proposal ids from show; omitted means no traits."
          },
          "currencies": {
            "type": "object",
            "description": "Explicit money declarations by numeric field. Values name a string currency field and optional minorUnits (for example 100 for cents). No field name implies money.",
            "additionalProperties": {
              "type": "object",
              "required": [
                "field"
              ],
              "properties": {
                "field": {
                  "type": "string",
                  "minLength": 1,
                  "description": "Declared currency-code field on this object."
                },
                "minorUnits": {
                  "type": "integer",
                  "minimum": 1,
                  "description": "Divisor converting minor to major units."
                }
              },
              "additionalProperties": false
            }
          }
        },
        "additionalProperties": false
      },
      "description": "Explicit accepted object names and optional proposal ids for apply."
    },
    "overwrite": {
      "type": "boolean",
      "default": false,
      "description": "Allow replacing existing team objects."
    },
    "confirmShipped": {
      "type": "array",
      "uniqueItems": true,
      "items": {
        "type": "string",
        "minLength": 1
      },
      "description": "Each shipped object name whose replacement is explicitly confirmed."
    }
  }
}
