{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/ovh/json-schema/ovh-metrics-api-service-with-iam-schema.json",
  "title": "metrics.api.ServiceWithIAM",
  "description": "Structure holding the elements about a service",
  "x-generated": "2026-11-24",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/ovh-v1-metrics-openapi.yml#/components/schemas/metrics.api.ServiceWithIAM",
  "type": "object",
  "properties": {
    "description": {
      "type": "string",
      "description": "Description of a service",
      "readOnly": true
    },
    "iam": {
      "allOf": [
        {
          "$ref": "#/$defs/iam.ResourceMetadata"
        }
      ],
      "description": "IAM resource metadata",
      "nullable": true,
      "readOnly": true
    },
    "name": {
      "type": "string",
      "description": "Name of a service",
      "readOnly": true
    },
    "offer": {
      "type": "string",
      "description": "Offer used for the service",
      "readOnly": true
    },
    "quota": {
      "allOf": [
        {
          "$ref": "#/$defs/metrics.api.Option"
        }
      ],
      "description": "Quota used for the service",
      "readOnly": true
    },
    "region": {
      "allOf": [
        {
          "$ref": "#/$defs/metrics.api.Region"
        }
      ],
      "description": "Region holding the service",
      "readOnly": true
    },
    "shouldUpgrade": {
      "type": "boolean",
      "description": "Indicator if the service should be upgraded based on current quota and offer",
      "readOnly": true
    },
    "status": {
      "allOf": [
        {
          "$ref": "#/$defs/metrics.api.ServiceStatusEnum"
        }
      ],
      "description": "Status of a service",
      "readOnly": true
    },
    "type": {
      "allOf": [
        {
          "$ref": "#/$defs/metrics.api.OfferTypeEnum"
        }
      ],
      "description": "Type of the service: cloud or live",
      "readOnly": true
    }
  },
  "$defs": {
    "iam.ResourceMetadata": {
      "type": "object",
      "description": "IAM resource metadata embedded in services models",
      "properties": {
        "displayName": {
          "type": [
            "string",
            "null"
          ],
          "description": "Resource display name",
          "readOnly": true
        },
        "id": {
          "type": "string",
          "description": "Unique identifier of the resource",
          "format": "uuid",
          "readOnly": true
        },
        "state": {
          "allOf": [
            {
              "$ref": "#/$defs/iam.ResourceMetadata.StateEnum"
            }
          ],
          "description": "Resource state",
          "nullable": true,
          "readOnly": true
        },
        "tags": {
          "type": [
            "object",
            "null"
          ],
          "description": "Resource tags. Tags that were internally computed are prefixed with ovh:",
          "additionalProperties": {
            "type": "string"
          },
          "readOnly": true
        },
        "urn": {
          "type": "string",
          "description": "Unique resource name used in policies",
          "readOnly": true
        }
      }
    },
    "iam.ResourceMetadata.StateEnum": {
      "type": "string",
      "description": "Resource state",
      "enum": [
        "EXPIRED",
        "IN_CREATION",
        "OK",
        "SUSPENDED"
      ]
    },
    "metrics.api.OfferTypeEnum": {
      "type": "string",
      "description": "Type of the service",
      "enum": [
        "cloud",
        "live"
      ]
    },
    "metrics.api.Option": {
      "type": "object",
      "description": "Structure holding the options for a service",
      "properties": {
        "ddp": {
          "type": "integer",
          "description": "Daily data points",
          "readOnly": true
        },
        "lastModification": {
          "type": "string",
          "description": "Time of last modification",
          "format": "date-time",
          "readOnly": true
        },
        "mads": {
          "type": "integer",
          "description": "Monthly active device streams",
          "readOnly": true
        }
      }
    },
    "metrics.api.Region": {
      "type": "object",
      "description": "Structure holding the elements about a region",
      "properties": {
        "description": {
          "type": "string",
          "description": "Description of a region",
          "readOnly": true
        },
        "name": {
          "type": "string",
          "description": "Name of a region",
          "readOnly": true
        }
      }
    },
    "metrics.api.ServiceStatusEnum": {
      "type": "string",
      "description": "Status of of the service",
      "enum": [
        "alive",
        "dead",
        "disabled",
        "new"
      ]
    }
  }
}