Skip to content

Comments

feat: add getAppStatistics api#68

Merged
nameless-mc merged 3 commits intomasterfrom
feat/add-get-apps-statistics-api
Nov 26, 2025
Merged

feat: add getAppStatistics api#68
nameless-mc merged 3 commits intomasterfrom
feat/add-get-apps-statistics-api

Conversation

@nameless-mc
Copy link
Contributor

Why

kintone REST APIに2024年8月15日に追加された「アプリの使用状況を取得する」API (GET /k/v1/apps/statistics.json) をJava Clientでサポートするため。

ref: https://cybozu.dev/ja/kintone/docs/rest-api/apps/get-apps-statistics/

このAPIにより、アプリのレコード数、フィールド数、API呼び出し数、ストレージ使用量などの使用状況統計情報を取得できるようになります。

What

以下のクラスとメソッドを追加しました:

新規クラス:

  • GetAppsStatisticsRequest - リクエストパラメータ(offset、limit)
  • GetAppsStatisticsResponseBody - レスポンスボディ
  • AppStatistics - アプリ使用状況統計情報のモデル
    • App ID、名前、スペース情報、ステータス、レコード更新日時、レコード数、フィールド数、日次API呼び出し数、ストレージ使用量、カスタマイズ有無、作成者/
      作成日時、更新者/更新日時
  • AppStatisticsStatus - アプリステータスのenum(CHANGED、NOT_ACTIVATED、ACTIVATED)
  • AppSpace - スペース情報のモデル(ID、名前)

変更:

  • KintoneApi - GET_APPS_STATISTICSエンドポイントを追加
  • AppClient - 以下の2つのメソッドを追加
    • getStatistics(GetAppsStatisticsRequest request) - パラメータ付きでアプリ統計情報を取得
    • getStatistics() - アプリの統計情報を取得(パラメータなし)

How to test

Checklist

  • Read CONTRIBUTING.md at the repository.
  • Updated documentation if it is required.
  • Added/updated tests if it is required. (or tested manually)

@nameless-mc nameless-mc self-assigned this Nov 12, 2025
Copilot AI review requested due to automatic review settings November 12, 2025 06:40
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds support for the kintone REST API's "Get Apps Statistics" endpoint (GET /k/v1/apps/statistics.json) that was added on August 15, 2024. This API allows retrieval of app usage statistics including record counts, field counts, API call counts, and storage usage.

Key changes:

  • Added new model classes for app statistics data structures
  • Added request/response classes for the new API endpoint
  • Extended AppClient with two new methods to retrieve app statistics
  • Added comprehensive unit tests for the new functionality

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
AppClient.java Added getStatistics() methods with and without parameters to retrieve app usage statistics
KintoneApi.java Added GET_APPS_STATISTICS enum constant for the new API endpoint
GetAppsStatisticsRequest.java New request class with offset and limit parameters for pagination
GetAppsStatisticsResponseBody.java New response class containing list of app statistics
AppStatistics.java New model class representing detailed app usage statistics
AppStatisticsStatus.java New enum defining app status values (CHANGED, NOT_ACTIVATED, ACTIVATED)
AppSpace.java New model class for space information (ID and name)
AppClientTest.java Added unit tests for the new statistics methods

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@nameless-mc nameless-mc merged commit 9d2211d into master Nov 26, 2025
2 checks passed
@nameless-mc nameless-mc deleted the feat/add-get-apps-statistics-api branch November 26, 2025 00:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants