{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/adobe/json-schema/adobe-segments-save-request-data-schema.json",
  "title": "segmentsSaveRequestData",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/adobe-analytics-1-4-openapi.yml#/components/schemas/segmentsSaveRequestData",
  "type": "object",
  "properties": {
    "definition": {
      "$ref": "#/$defs/segment_definition"
    },
    "description": {
      "type": "string"
    },
    "favorite": {
      "type": "boolean"
    },
    "id": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "owner": {
      "type": "string"
    },
    "reportSuiteID": {
      "type": "string"
    },
    "shares": {
      "$ref": "#/$defs/segment_share_array"
    },
    "tags": {
      "$ref": "#/$defs/string_array"
    }
  },
  "$defs": {
    "segment_container": {
      "required": [
        "exclude",
        "name",
        "operator"
      ],
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "type": {
          "type": "string"
        },
        "operator": {
          "type": "string"
        },
        "rules": {
          "$ref": "#/$defs/segment_rule_array"
        },
        "exclude": {
          "type": "boolean"
        }
      }
    },
    "segment_definition": {
      "type": "object",
      "properties": {
        "container": {
          "$ref": "#/$defs/segment_container"
        }
      }
    },
    "segment_rule": {
      "required": [
        "after",
        "classification",
        "container",
        "element",
        "exclude",
        "metric",
        "name",
        "operator",
        "value",
        "within"
      ],
      "type": "object",
      "properties": {
        "container": {
          "$ref": "#/$defs/segment_container"
        },
        "name": {
          "type": "string"
        },
        "metric": {
          "type": "string"
        },
        "element": {
          "type": "string"
        },
        "classification": {
          "type": "string"
        },
        "operator": {
          "type": "string"
        },
        "value": {
          "type": "string"
        },
        "after": {
          "$ref": "#/$defs/segment_rule_restriction"
        },
        "within": {
          "$ref": "#/$defs/segment_rule_restriction"
        },
        "exclude": {
          "type": "boolean"
        }
      }
    },
    "segment_rule_array": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/segment_rule"
      }
    },
    "segment_rule_restriction": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "value": {
          "type": "string"
        }
      }
    },
    "segment_share": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string"
        },
        "name": {
          "type": "string"
        }
      }
    },
    "segment_share_array": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/segment_share"
      }
    },
    "string_array": {
      "type": "array",
      "items": {
        "type": "string"
      }
    }
  }
}