Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GET /punishments/{id} #3

Open
acrylic-style opened this issue Jul 13, 2022 · 0 comments
Open

GET /punishments/{id} #3

acrylic-style opened this issue Jul 13, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@acrylic-style
Copy link
Member

GET /punishments/4845

The request will return 200 OK if:

  • API key holder (player) has sufficient punishment-related permissions
  • ???
{
  "id": 4845,
  "type": "CAUTION", // possible values are defined here: https://github.com/AzisabaNetwork/SpicyAzisaBan/blob/d90cef8ab2d216307b197403c5f58b5eae1d3cbb/common/src/main/kotlin/net/azisaba/spicyAzisaBan/punishment/PunishmentType.kt#L14-L25
  "target": {
    "uuid": "58becc44-c5b7-420f-8800-15ba88820973",
    "name": "ledlaggazi" // at the time of punishment - 処罰が執行された地点の名前
  },
  "actor": {
    "uuid": "1865ab8c-700b-478b-9b52-a8c58739df1a",
    "name": "KotlinLove" // at the time of the request - リクエストが送信された地点の名前
  },
  "reason": "多数のプレイヤーをサーバーに強制的に転送させてプレイヤーを混乱させた罪",
  "proofs": {
    "id": 146,
    "text": "https://messageviewer.azisaba.net/attachments/951067298964340736/unknown.png",
    "public": false
  },
  "start": 1657699502631, // the time which the punishment was issued - 処罰が執行された時間
  "end": -1, // the time which the punishment becomes no longer effective (-1 means permanent) - 処罰が期限切れになる時間(-1は永久)
  "server": "global", // server where the punishment is effective (global is a unique token which means the punishment is effective globally, regardless of the server) - 処罰が有効なサーバー (globalは処罰が全サーバーで有効なことを示す)
  "active": true, // true if punishment is effective at the time of the request. false if the punishment has expired, unpunished, or been removed from the table for any reason. - 処罰がリクエストの地点で有効な場合はtrue。処罰が期限切れ、解除、もしくは何らかの理由でテーブルから削除された場合はfalse。
  "extra": "SEEN", // SEEN means that the target has viewed the punishment (SEEN is used only if the type is CAUTION or WARNING, otherwise it will be empty) - targetが処罰を見たらSEENが記録される。SEENはtypeがCAUTIONかWARNINGの場合のみ使用され、それ以外の場合は空っぽになる。
  "unpunish": { // present (non-null) if the unpunish record is present in the table, so this property may be present even if unpunished is `false`, and this property might be absent even if unpunished is `true`. - unpunishの記録がテーブルに存在する場合はnull以外のオブジェクトが返される。unpunishedがtrueでもこれがnullの場合もあるし、unpunishedがfalseでもこれがnullではない場合もある。
    "id": 666,
    "actor": {
      "uuid": "1865ab8c-700b-478b-9b52-a8c58739df1a",
      "name": "KotlinLove"
    },
    "reason": "※実際には解除されてません",
    "timestamp": 666
  },
  "unpunished": true // true if punishment is removed from the table (this does not necessarily mean "unpunish" is present) - テーブルから処罰の記録が削除されている場合はtrueになる。
}

404 Not Found if:

  • Punishment does not exist

403 Forbidden if:

  • the player does not have sufficient permissions

401 Unauthorized if:

  • Authorization header is absent, or an API key is invalid.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant