{
  "asyncapi": "3.0.0",
  "info": {
    "title": "environments",
    "version": ""
  },
  "channels": {
    "systemEventsSpaces": {
      "address": "system-events.spaces",
      "messages": {
        "environmentCreated": {
          "$ref": "#/components/messages/spaces.environmentCreated"
        },
        "environmentDeleted": {
          "$ref": "#/components/messages/spaces.environmentDeleted"
        },
        "environmentUpdated": {
          "$ref": "#/components/messages/spaces.environmentUpdated"
        }
      }
    }
  },
  "operations": {
    "environmentCreated": {
      "action": "send",
      "channel": {
        "$ref": "#/channels/systemEventsSpaces"
      },
      "messages": [
        {
          "$ref": "#/channels/systemEventsSpaces/messages/environmentCreated"
        }
      ]
    },
    "environmentDeleted": {
      "action": "send",
      "channel": {
        "$ref": "#/channels/systemEventsSpaces"
      },
      "messages": [
        {
          "$ref": "#/channels/systemEventsSpaces/messages/environmentDeleted"
        }
      ]
    },
    "environmentUpdated": {
      "action": "send",
      "channel": {
        "$ref": "#/channels/systemEventsSpaces"
      },
      "messages": [
        {
          "$ref": "#/channels/systemEventsSpaces/messages/environmentUpdated"
        }
      ]
    }
  },
  "components": {
    "messages": {
      "spaces.environmentCreated": {
        "name": "com.qlik.v1.environment.created",
        "tags": [
          {
            "name": "environments"
          }
        ],
        "title": "Environment created",
        "payload": {
          "type": "object",
          "allOf": [
            {
              "$ref": "#/components/schemas/cloudEventsContextAttributes"
            },
            {
              "$ref": "#/components/schemas/cloudEventsQlikExtensionsAttributes"
            },
            {
              "type": "object",
              "properties": {
                "data": {
                  "type": "object",
                  "examples": [],
                  "required": [
                    "id",
                    "tenantId",
                    "createdAt"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "example": "00000000-0000-0000-0000-000000000000",
                      "description": "Identifier of the environment."
                    },
                    "name": {
                      "type": "string",
                      "example": "Default environment",
                      "description": "Name of the environment."
                    },
                    "tenantId": {
                      "type": "string",
                      "example": "00000000-0000-0000-0000-000000000000",
                      "description": "Identifier of the tenant the environment belongs to."
                    },
                    "createdAt": {
                      "type": "string",
                      "format": "date-time",
                      "example": "2025-03-07T23:47:53Z",
                      "description": "Timestamp when the environment was created."
                    },
                    "createdBy": {
                      "type": "string",
                      "example": "00000000-0000-0000-0000-000000000000",
                      "description": "Identifier of the user who created the environment."
                    },
                    "variables": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/variable"
                      },
                      "description": "Key-value pairs."
                    },
                    "description": {
                      "type": "string",
                      "example": "Default environment",
                      "description": "Description of the environment."
                    }
                  },
                  "description": "Details of the created environment."
                },
                "type": {
                  "type": "string",
                  "default": "com.qlik.v1.environment.created",
                  "description": "Unique identifier for the event type."
                }
              }
            }
          ]
        },
        "description": "Published when an environment is created in the tenant.",
        "x-qlik-deprecated": true,
        "x-qlik-deprecated-sunset": "2027-04",
        "x-qlik-deprecated-version": "2026-04",
        "x-qlik-deprecated-description": "The `com.qlik.v1.environment.created` event has been replaced by the `com.qlik.core.environment.created` event to follow the latest guidelines.\n",
        "x-qlik-stability": "stable",
        "x-qlik-visibility": "public"
      },
      "spaces.environmentDeleted": {
        "name": "com.qlik.v1.environment.deleted",
        "tags": [
          {
            "name": "environment"
          }
        ],
        "title": "Environment deleted",
        "payload": {
          "type": "object",
          "allOf": [
            {
              "$ref": "#/components/schemas/cloudEventsContextAttributes"
            },
            {
              "$ref": "#/components/schemas/cloudEventsQlikExtensionsAttributes"
            },
            {
              "type": "object",
              "properties": {
                "data": {
                  "type": "object",
                  "examples": [],
                  "required": [
                    "id"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "example": "00000000-0000-0000-0000-000000000000",
                      "description": "Identifier of the deleted environment."
                    },
                    "name": {
                      "type": "string"
                    }
                  },
                  "description": "Details of the deleted environment."
                },
                "type": {
                  "type": "string",
                  "default": "com.qlik.v1.environment.deleted",
                  "description": "Unique identifier for the event type."
                }
              }
            }
          ]
        },
        "description": "Published when an environment is deleted from the tenant.",
        "x-qlik-deprecated": true,
        "x-qlik-deprecated-sunset": "2027-04",
        "x-qlik-deprecated-version": "2026-04",
        "x-qlik-deprecated-description": "The `com.qlik.v1.environment.deleted` event has been replaced by the `com.qlik.core.environment.deleted` event to follow the latest guidelines.\n",
        "x-qlik-stability": "stable",
        "x-qlik-visibility": "public"
      },
      "spaces.environmentUpdated": {
        "name": "com.qlik.v1.environment.updated",
        "tags": [
          {
            "name": "environments"
          }
        ],
        "title": "Environment updated",
        "payload": {
          "type": "object",
          "allOf": [
            {
              "$ref": "#/components/schemas/cloudEventsContextAttributes"
            },
            {
              "$ref": "#/components/schemas/cloudEventsQlikExtensionsAttributes"
            },
            {
              "type": "object",
              "properties": {
                "data": {
                  "type": "object",
                  "examples": [],
                  "required": [
                    "id",
                    "updatedAt"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "example": "00000000-0000-0000-0000-000000000000",
                      "description": "Identifier of the environment."
                    },
                    "name": {
                      "type": "string",
                      "example": "Default environment",
                      "description": "Name of the environment."
                    },
                    "createdAt": {
                      "type": "string",
                      "format": "date-time",
                      "example": "2025-03-07T23:47:53Z",
                      "description": "Timestamp when the environment was created."
                    },
                    "updatedAt": {
                      "type": "string",
                      "format": "date-time",
                      "example": "2025-03-07T23:47:53Z",
                      "description": "Timestamp when the environment was updated."
                    },
                    "updatedBy": {
                      "type": "string",
                      "example": "00000000-0000-0000-0000-000000000000",
                      "description": "Identifier of the user who updated the environment."
                    },
                    "variables": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/variable"
                      },
                      "description": "Key-value pairs."
                    },
                    "description": {
                      "type": "string",
                      "example": "Default environment",
                      "description": "Description of the environment."
                    }
                  },
                  "description": "Details of the updated environment."
                },
                "type": {
                  "type": "string",
                  "default": "com.qlik.v1.environment.updated",
                  "description": "Unique identifier for the event type."
                }
              }
            }
          ]
        },
        "description": "Published when an environment is updated.",
        "x-qlik-deprecated": true,
        "x-qlik-deprecated-sunset": "2027-04",
        "x-qlik-deprecated-version": "2026-04",
        "x-qlik-deprecated-description": "The `com.qlik.v1.environment.updated` event has been replaced by the `com.qlik.core.environment.updated` event to follow the latest guidelines.\n",
        "x-qlik-stability": "stable",
        "x-qlik-visibility": "public"
      }
    },
    "schemas": {
      "cloudEventsContextAttributes": {
        "type": "object",
        "required": [
          "id",
          "source",
          "specversion",
          "type"
        ],
        "properties": {
          "id": {
            "type": "string",
            "examples": [
              "A234-1234-1234"
            ],
            "minLength": 1,
            "description": "Identifies the event."
          },
          "time": {
            "type": "string",
            "format": "date-time",
            "examples": [
              "2026-04-05T17:31:00Z"
            ],
            "minLength": 1,
            "description": "Timestamp of when the occurrence happened. Must adhere to RFC 3339."
          },
          "type": {
            "type": "string",
            "examples": [
              "com.qlik.v1.space.created"
            ],
            "minLength": 1,
            "description": "Describes the type of event related to the originating occurrence."
          },
          "source": {
            "type": "string",
            "format": "uri-reference",
            "examples": [
              "com.qlik/my-service"
            ],
            "minLength": 1,
            "description": "Identifies the context in which an event happened."
          },
          "specversion": {
            "type": "string",
            "examples": [
              "1.0"
            ],
            "minLength": 1,
            "description": "The version of the CloudEvents specification which the event uses."
          },
          "datacontenttype": {
            "type": "string",
            "examples": [
              "application/json"
            ],
            "minLength": 1,
            "description": "Content type of the data value. Must adhere to RFC 2046 format."
          }
        },
        "description": "CloudEvents Specification JSON Schema"
      },
      "cloudEventsQlikExtensionsAttributes": {
        "type": "object",
        "required": [
          "tenantid"
        ],
        "properties": {
          "userid": {
            "type": "string",
            "examples": [
              "605a18af2ab08cdbfad09259"
            ],
            "description": "Unique identifier for the user related to the event."
          },
          "tenantid": {
            "type": "string",
            "examples": [
              "TiQ8GPVr8qI714Lp5ChAAFFaU24MJy69"
            ],
            "description": "Unique identifier for the tenant related to the event."
          }
        },
        "description": "Additional metadata and custom fields"
      },
      "variable": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string",
            "readOnly": true,
            "description": "Variable key."
          },
          "value": {
            "type": "string",
            "readOnly": true,
            "description": "Variable value."
          }
        }
      }
    }
  }
}