Skip to content

Instantly share code, notes, and snippets.

View aik0aaac's full-sized avatar
🏠
Working from home

Aik aik0aaac

🏠
Working from home
View GitHub Profile
@aik0aaac
aik0aaac / IFileRequest.ts
Created May 26, 2024 14:57
OpenAI API - File APIのRequest/Response内容。(TypeScript-Interface)
/**
* OpenAIへファイルをアップロードするAPIのPOSTリクエスト。
* エンドポイント:
https://api.openai.com/v1/files
* Docs: https://platform.openai.com/docs/api-reference/files/create
*/
export interface IFileUploadRequest {
/**
* アップロード対象のファイルオブジェクト。
*/
@aik0aaac
aik0aaac / IChatMessage.ts
Last active May 27, 2024 14:22
OpenAI API - ChatのRequest/Response内容。(TypeScript-Interface)
/**
* Chat形式でやり取りするメッセージの型。
* Docs: https://platform.openai.com/docs/api-reference/chat/create
*/
export interface IChatMessage {
/**
* 話者の役割。
* `system``user``assistant`のどれかを指定。
* - `system`: どんな返答をしてもらうかを指定するのに使用。
* - `user`: 質問を行うユーザーのこと。
@aik0aaac
aik0aaac / IJobsReportsListRequest.ts
Created June 2, 2023 12:39
Youtube Reporting API > jobs.reports.listのRequest/Response内容。(TypeScript-Interface)
/**
* Youtube Reporting API > `jobs.reports.list`のリクエスト。
* 公式Docs: https://developers.google.com/youtube/reporting/v1/reference/rest/v1/jobs.reports/list?hl=ja
*/
export interface IJobsReportsListRequest {
/**
* 「レポートの作成日が」このタイムスタンプ以降のデータしかレスポンスに含めないようにする。(FROM)
* タイムスタンプ形式で、RFC3339 UTC「Zulu」形式を採用。
* 例: `2015-10-02T15:01:23.045678Z`
*/
@aik0aaac
aik0aaac / IJobsCreateRequest.ts
Created June 2, 2023 12:14
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;
@aik0aaac
aik0aaac / IReportTypeRequest.ts
Created June 2, 2023 12:05
Youtube Reporting API > reportTypes.listのRequest/Response内容。(TypeScript-Interface)
/**
* Youtube Reporting API > `reportTypes.list`のリクエスト。
* 公式Docs: https://developers.google.com/youtube/reporting/v1/reference/rest/v1/reportTypes/list?hl=ja
*/
export interface IReportTypeRequest {
/**
* コンテンツ所有者ID。
* 未指定の場合ユーザーに紐づくチャンネルのレポート種別が取得される。
*/
onBehalfOfContentOwner?: string;
@aik0aaac
aik0aaac / filterMaster.ts
Last active June 1, 2023 16:59
Youtube Analytics APIで定義されている全ての`filter`内容。(TypeScript)
import { DimensionMaster } from "./dimensionMaster";
/**
* Youtube Analytics API > `query`内で指定可能なフィルター一覧。
* 公式Docs: https://developers.google.com/youtube/analytics/dimensions
*
* ディメンションの値をそのまま使用可能。
* さらにフィルターでしか使用できない値があり、当ファイルにて定義。
*/
export const FilterMaster = {
@aik0aaac
aik0aaac / dimensionMaster.ts
Last active June 1, 2023 16:59
Youtube Analytics APIで定義されている全ての`dimension`内容。(TypeScript)
/**
* Youtube Analytics API > `query`内で指定可能なディメンション一覧。
* 公式Docs: https://developers.google.com/youtube/analytics/dimensions
*/
export const DimensionMaster = {
core: {
/**
* Youtubeの動画ID。
*/
video: "video",
@aik0aaac
aik0aaac / metricsMaster.ts
Created May 31, 2023 16:54
Youtube Analytics APIで定義されている全ての`metrics`内容。(TypeScript)
/**
* Youtube Analytics API > `query`内で指定可能なメトリクス一覧。
* 公式Docs: https://developers.google.com/youtube/analytics/metrics?hl=ja
*/
export const MetricsMaster = {
viewVideo: {
/**
* 動画の閲覧回数。
* プレイリストが対象のレポートの場合「プレイリスト内部から再生された回数」に絞り込まれた回数となる。
* ※これ以降の指標も、特に断りなければ「プレイリストが対象のレポートの場合、プレイリスト内部から再生された回数に絞り込まれた回数を示す
@aik0aaac
aik0aaac / IQueryResponse.ts
Created May 31, 2023 15:06
Youtube Analytics APIの`query`APIのResponse内容。(TypeScript-Interface)
/**
* 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";
@aik0aaac
aik0aaac / IQueryRequest.ts
Created May 31, 2023 14:58
Youtube Analytics APIの`query`APIのRequest内容。(TypeScript-Interface)
/**
* Youtube Analytics API > `query`のリクエスト。
* 公式Docs: https://developers.google.com/youtube/analytics/reference/reports/query?hl=ja
*/
export interface IQueryRequest {
/**
* Youtubeチャンネルorコンテンツ所有者を指定。
* 以下の3パターンで指定可能。
* - `channel==MINE`: OAuth認証ユーザーのチャンネル指定
* - `channel==[OAuth認証ユーザーが保有するチャンネルID]`: チャンネルID指定