{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "#/components/schemas/GoalMetricBase",
  "title": "GoalMetricBase",
  "description": "A generic Asana Resource, containing a globally unique identifier.",
  "type": "object",
  "properties": {
    "gid": {
      "description": "Globally unique identifier of the resource, as a string.",
      "type": "string",
      "readOnly": true,
      "example": "12345",
      "x-insert-after": false
    },
    "resource_type": {
      "description": "The base type of this resource.",
      "type": "string",
      "readOnly": true,
      "example": "task",
      "x-insert-after": "gid"
    },
    "resource_subtype": {
      "description": "The subtype of this resource. Different subtypes retain many of the same fields and behavior, but may render differently in Asana or represent resources with different semantic meaning.",
      "type": "string",
      "readOnly": true,
      "example": "number",
      "enum": [
        "number"
      ]
    },
    "precision": {
      "description": "*Conditional*. Only relevant for goal metrics of type \u2018Number\u2019. This field dictates the number of places after the decimal to round to, i.e. 0 is integer values, 1 rounds to the nearest tenth, and so on. Must be between 0 and 6, inclusive.\nFor percentage format, this may be unintuitive, as a value of 0.25 has a precision of 0, while a value of 0.251 has a precision of 1. This is due to 0.25 being displayed as 25%.",
      "type": "integer",
      "example": 2
    },
    "unit": {
      "description": "A supported unit of measure for the goal metric, or none.",
      "type": "string",
      "enum": [
        "none",
        "currency",
        "percentage"
      ]
    },
    "currency_code": {
      "description": "ISO 4217 currency code to format this custom field. This will be null if the `unit` is not `currency`.",
      "type": "string",
      "nullable": true,
      "example": "EUR"
    },
    "initial_number_value": {
      "description": "This number is the start value of a goal metric of type number.",
      "type": "number",
      "example": 5.2
    },
    "target_number_value": {
      "description": "This number is the end value of a goal metric of type number. This number cannot equal `initial_number_value`.",
      "type": "number",
      "example": 10.2
    },
    "current_number_value": {
      "description": "This number is the current value of a goal metric of type number.",
      "type": "number",
      "example": 8.12
    },
    "current_display_value": {
      "description": "This string is the current value of a goal metric of type string.",
      "type": "string",
      "readOnly": true,
      "example": "8.12"
    },
    "progress_source": {
      "description": "This field defines how the progress value of a goal metric is being calculated. A goal's progress can be provided manually by the user, calculated automatically from contributing subgoals, projects, or tasks, or managed by an integration with an external data source, such as Salesforce.",
      "type": "string",
      "enum": [
        "manual",
        "subgoal_progress",
        "project_task_completion",
        "project_milestone_completion",
        "task_completion",
        "external"
      ],
      "example": "manual"
    },
    "is_custom_weight": {
      "description": "*Conditional*. Only relevant if `metric.progress_source` is one of `subgoal_progress`, `project_task_completion`, `project_milestone_completion`, or `task_completion`. If true, we use the supporting object's custom weight to calculate the goal's progress. If false, we treat all supporting objects as equally weighted",
      "type": "boolean",
      "example": false
    }
  }
}