Created
May 31, 2023 15:06
-
-
Save aik0aaac/550fdd9391c8b3f318ba15757a6f34ff to your computer and use it in GitHub Desktop.
Youtube Analytics APIの`query`APIのResponse内容。(TypeScript-Interface)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Youtube Analytics API > `query`のレスポンス。 | |
* 公式Docs: https://developers.google.com/youtube/analytics/reference/reports/query?hl=ja | |
*/ | |
export interface IQueryResponse { | |
/** | |
* リソース種別。 | |
* `query`のレスポンスなら`youtubeAnalytics#resultTable`の固定値が返却。 | |
*/ | |
kind: "youtubeAnalytics#resultTable"; | |
/** | |
* カラムヘッダー群。 | |
* ディメンションが先頭要素に配置され、メトリクスはその後の要素として配置される。 | |
*/ | |
columnHeaders: { | |
/** | |
* カラム名。ディメンションやメトリクスの値が入る。 | |
* 例: `views`, `deviceType` | |
*/ | |
name: string; | |
/** | |
* カラムがディメンションかメトリクスのどちらか。 | |
*/ | |
columnType: "DIMENSION" | "METRIC"; | |
/** | |
* カラムのデータ型。 | |
* ↓に示したパターン以外にもあるかも。 | |
*/ | |
dataType: `STRING` | `INTEGER` | `FLOAT`; | |
}[]; | |
/** | |
* カラム群。(データ) | |
* ディメンションとメトリクスのパターンによって、構造がかなり異なるのでany型で定義。 | |
* `query`の該当結果がない場合、空配列ではなくプロパティごとなくなる。 | |
*/ | |
// eslint-disable-next-line @typescript-eslint/no-explicit-any | |
rows?: any[]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment