{
  "swagger": "2.0",
  "info": {
    "title": "Branch APIs for TiDB Cloud",
    "version": "alpha"
  },
  "tags": [
    {
      "name": "BranchService"
    }
  ],
  "schemes": ["https"],
  "consumes": ["application/json"],
  "produces": ["application/json"],
  "paths": {
    "/tenants/{tenant_id}/notifications/{query_type}/page/{page}/page_size/{page_size}": {
      "get": {
        "operationId": "ListNotifications",
        "consumes": ["application/json"],
        "produces": ["application/json"],
        "summary": "Get  Notifications",
        "parameters": [
          {
            "type": "string",
            "description": "tenant_id",
            "name": "tenant_id",
            "in": "path",
            "required": true
          },
          {
            "type": "string",
            "description": "query_type",
            "name": "query_type",
            "in": "path",
            "required": true
          },
          {
            "type": "integer",
            "description": "page",
            "name": "page",
            "in": "path",
            "required": true
          },
          {
            "type": "integer",
            "description": "page_size",
            "name": "page_size",
            "in": "path",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/forms.Notifications"
            }
          }
        }
      }
    },
    "/tenants/{tenant_id}/notifications/{type}/notification_id/{notification_id}": {
      "post": {
        "operationId": "MarkNotificationAsSeen",
        "consumes": ["application/json"],
        "produces": ["application/json"],
        "summary": "Mark User Notifications As Seen",
        "parameters": [
          {
            "type": "string",
            "description": "tenant_id",
            "name": "tenant_id",
            "in": "path",
            "required": true
          },
          {
            "type": "string",
            "description": "type",
            "name": "type",
            "in": "path",
            "required": true
          },
          {
            "type": "string",
            "description": "notification_id",
            "name": "notification_id",
            "in": "path",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/forms.Notifications"
            }
          }
        }
      }
    },
    "/tenants/{tenant_id}/notifications/notification_id/{notification_id}": {
      "get": {
        "operationId": "getNotificationDetail",
        "consumes": ["application/json"],
        "produces": ["application/json"],
        "summary": "Get Notifications by Notification_id",
        "parameters": [
          {
            "type": "string",
            "description": "tenant_id",
            "name": "tenant_id",
            "in": "path",
            "required": true
          },
          {
            "type": "string",
            "description": "notification_id",
            "name": "notification_id",
            "in": "path",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/forms.Notification"
            }
          }
        }
      },
      "post": {
        "consumes": ["application/json"],
        "produces": ["application/json"],
        "summary": "Mark User Notifications As Read",
        "parameters": [
          {
            "type": "string",
            "description": "tenant_id",
            "name": "tenant_id",
            "in": "path",
            "required": true
          },
          {
            "type": "string",
            "description": "notification_id",
            "name": "notification_id",
            "in": "path",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/forms.Notifications"
            }
          }
        }
      }
    }
  },
  "definitions": {
    "forms.Notifications": {
      "type": "object",
      "properties": {
        "count": {
          "type": "integer"
        },
        "data": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/forms.Notification"
          }
        },
        "has_more": {
          "type": "boolean"
        },
        "page_query": {
          "$ref": "#/definitions/forms.PageQuery"
        }
      }
    },
    "forms.Notification": {
      "type": "object",
      "properties": {
        "in_app_content": {
          "type": "string"
        },
        "is_read": {
          "type": "boolean"
        },
        "mark_as_id": {
          "type": "string"
        },
        "notification_group": {
          "type": "string"
        },
        "notification_id": {
          "type": "string"
        },
        "send_at": {
          "type": "string"
        },
        "send_by": {
          "type": "string"
        },
        "status": {
          "type": "string"
        },
        "subject": {
          "type": "string"
        },
        "subscriber_id": {
          "type": "string"
        },
        "transaction_id": {
          "type": "string"
        },
        "worker_flow_name": {
          "type": "string"
        }
      }
    },
    "forms.PageQuery": {
      "type": "object",
      "properties": {
        "page": {
          "type": "integer"
        },
        "page_size": {
          "type": "integer"
        }
      }
    }
  }
}
