Skip to content

Instantly share code, notes, and snippets.

@aik0aaac
Created June 2, 2023 12:14
Show Gist options
  • Save aik0aaac/8e66612927cb3307e264335736a26913 to your computer and use it in GitHub Desktop.
Save aik0aaac/8e66612927cb3307e264335736a26913 to your computer and use it in GitHub Desktop.
Youtube Reporting API > jobs.createのRequest/Response内容。(TypeScript-Interface)
/**
* Youtube Reporting API > `jobs.create`のリクエスト。
* 公式Docs: https://developers.google.com/youtube/reporting/v1/reference/rest/v1/jobs/create?hl=ja
*/
export interface IJobsCreateRequestParameter {
/**
* コンテンツ所有者ID。
* 未指定の場合ユーザーに紐づくチャンネルのレポート種別が取得される。
*/
onBehalfOfContentOwner?: string;
}
/**
* Youtube Reporting API > `jobs.create`のリクエスト本文。
* 公式Docs: https://developers.google.com/youtube/reporting/v1/reference/rest/v1/jobs/create?hl=ja
*/
export interface IJobsCreateBodyRequest {
/**
* レポート種別ID。
*/
reportTypeId: string;
/**
* ジョブ名。100文字以内で指定。
*/
name: string;
}
/**
* Youtube Reporting API > `jobs.create`のレスポンス。
* 公式Docs: https://developers.google.com/youtube/reporting/v1/reference/rest/v1/jobs/create?hl=ja
*/
export interface IJobsCreateResponse {
/**
* ジョブID。
*/
id: string;
/**
* レポート種別ID。
*/
reportTypeId: string;
/**
* ジョブ名。100文字以内となる。
*/
name: string;
/**
* ジョブ作成日。
* タイムスタンプ形式で、RFC3339 UTC「Zulu」形式を採用。μ秒単位の精度となっている。
* 例: `2015-10-02T15:01:23.045678Z`
*/
createTime: number;
/**
* ジョブの有効期限が切れる日時。
* これ以降の日時では、Youtube側はレポートを生成しなくなる。
* タイムスタンプ形式で、RFC3339 UTC「Zulu」形式を採用。μ秒単位の精度となっている。
* 例: `2015-10-02T15:01:23.045678Z`
*
* 有効期限が切れる条件:
* - Youtube側が対象レポート種別をサポートしなくなった(非推奨となった)時
* - 生成されたCSVデータが長期間ダウンロードされてない時
*/
expireTime: number;
/**
* コンテンツ所有者向けプロパティ。
* この値が`true`の場合は、ジョブ登録されなくても自動的にレポートが集計される。
*/
systemManaged: boolean;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment