@suin/esa-api
Version:
esa.io APIクライアント
1,205 lines (1,130 loc) • 36.5 kB
text/typescript
/* tslint:disable */
/* eslint-disable */
/**
* esa API v1
* チームのナレッジ共有サービス[esa.io](https://esa.io/)のAPI v1の仕様書
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import globalAxios, { AxiosPromise, AxiosInstance } from "axios";
import { Configuration } from "../configuration";
// Some imports not used depending on template conditions
// @ts-ignore
import {
DUMMY_BASE_URL,
assertParamExists,
setApiKeyToObject,
setBasicAuthToObject,
setBearerAuthToObject,
setOAuthToObject,
setSearchParams,
serializeDataIfNeeded,
toPathString,
createRequestFunction,
} from "../common";
// @ts-ignore
import {
BASE_PATH,
COLLECTION_FORMATS,
RequestArgs,
BaseAPI,
RequiredError,
} from "../base";
// @ts-ignore
import { Comment } from "../models";
// @ts-ignore
import { CreateCommentBody } from "../models";
// @ts-ignore
import { PaginatedComments } from "../models";
// @ts-ignore
import { UpdateCommentBody } from "../models";
/**
* CommentApi - axios parameter creator
* @export
*/
export const CommentApiAxiosParamCreator = function (
configuration?: Configuration,
) {
return {
/**
* 記事に新しいコメントを作成します。
* @summary コメントを投稿する
* @param {string} teamName チーム名
* @param {number} postNumber 記事ID
* @param {CreateCommentBody} createCommentBody
* @param {number} [page] ページ番号
* @param {number} [perPage] 1ページあたりに含まれる要素数
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
createComment: async (
teamName: string,
postNumber: number,
createCommentBody: CreateCommentBody,
page?: number,
perPage?: number,
options: any = {},
): Promise<RequestArgs> => {
// verify required parameter 'teamName' is not null or undefined
assertParamExists("createComment", "teamName", teamName);
// verify required parameter 'postNumber' is not null or undefined
assertParamExists("createComment", "postNumber", postNumber);
// verify required parameter 'createCommentBody' is not null or undefined
assertParamExists(
"createComment",
"createCommentBody",
createCommentBody,
);
const localVarPath = `/teams/{team_name}/posts/{post_number}/comments`
.replace(`{${"team_name"}}`, encodeURIComponent(String(teamName)))
.replace(`{${"post_number"}}`, encodeURIComponent(String(postNumber)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = {
method: "POST",
...baseOptions,
...options,
};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
// authentication AccessTokenHeader required
// http bearer authentication required
await setBearerAuthToObject(localVarHeaderParameter, configuration);
// authentication AccessTokenQueryParam required
await setApiKeyToObject(
localVarQueryParameter,
"access_token",
configuration,
);
// authentication OAuth2 required
// oauth required
await setOAuthToObject(
localVarHeaderParameter,
"OAuth2",
["write"],
configuration,
);
if (page !== undefined) {
localVarQueryParameter["page"] = page;
}
if (perPage !== undefined) {
localVarQueryParameter["per_page"] = perPage;
}
localVarHeaderParameter["Content-Type"] = "application/json";
setSearchParams(localVarUrlObj, localVarQueryParameter, options.query);
let headersFromBaseOptions =
baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {
...localVarHeaderParameter,
...headersFromBaseOptions,
...options.headers,
};
localVarRequestOptions.data = serializeDataIfNeeded(
createCommentBody,
localVarRequestOptions,
configuration,
);
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* 指定されたコメントを削除します。
* @summary コメントを削除する
* @param {string} teamName チーム名
* @param {number} commentId コメントID
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
deleteComment: async (
teamName: string,
commentId: number,
options: any = {},
): Promise<RequestArgs> => {
// verify required parameter 'teamName' is not null or undefined
assertParamExists("deleteComment", "teamName", teamName);
// verify required parameter 'commentId' is not null or undefined
assertParamExists("deleteComment", "commentId", commentId);
const localVarPath = `/teams/{team_name}/comments/{comment_id}`
.replace(`{${"team_name"}}`, encodeURIComponent(String(teamName)))
.replace(`{${"comment_id"}}`, encodeURIComponent(String(commentId)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = {
method: "DELETE",
...baseOptions,
...options,
};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
// authentication AccessTokenHeader required
// http bearer authentication required
await setBearerAuthToObject(localVarHeaderParameter, configuration);
// authentication AccessTokenQueryParam required
await setApiKeyToObject(
localVarQueryParameter,
"access_token",
configuration,
);
// authentication OAuth2 required
// oauth required
await setOAuthToObject(
localVarHeaderParameter,
"OAuth2",
["write"],
configuration,
);
setSearchParams(localVarUrlObj, localVarQueryParameter, options.query);
let headersFromBaseOptions =
baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {
...localVarHeaderParameter,
...headersFromBaseOptions,
...options.headers,
};
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* 指定されたコメントを取得します。
* @summary コメントを取得する
* @param {string} teamName チーム名
* @param {number} commentId コメントID
* @param {'stargazers'} [include] `stargazers`を指定するとStarの配列を含んだレスポンスを返します。
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getComment: async (
teamName: string,
commentId: number,
include?: "stargazers",
options: any = {},
): Promise<RequestArgs> => {
// verify required parameter 'teamName' is not null or undefined
assertParamExists("getComment", "teamName", teamName);
// verify required parameter 'commentId' is not null or undefined
assertParamExists("getComment", "commentId", commentId);
const localVarPath = `/teams/{team_name}/comments/{comment_id}`
.replace(`{${"team_name"}}`, encodeURIComponent(String(teamName)))
.replace(`{${"comment_id"}}`, encodeURIComponent(String(commentId)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = {
method: "GET",
...baseOptions,
...options,
};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
// authentication AccessTokenHeader required
// http bearer authentication required
await setBearerAuthToObject(localVarHeaderParameter, configuration);
// authentication AccessTokenQueryParam required
await setApiKeyToObject(
localVarQueryParameter,
"access_token",
configuration,
);
// authentication OAuth2 required
// oauth required
await setOAuthToObject(
localVarHeaderParameter,
"OAuth2",
["read"],
configuration,
);
if (include !== undefined) {
localVarQueryParameter["include"] = include;
}
setSearchParams(localVarUrlObj, localVarQueryParameter, options.query);
let headersFromBaseOptions =
baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {
...localVarHeaderParameter,
...headersFromBaseOptions,
...options.headers,
};
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* チーム全体のコメント一覧を作成日の降順で返却します。
* @summary コメント一覧を取得する
* @param {string} teamName チーム名
* @param {number} [page] ページ番号
* @param {number} [perPage] 1ページあたりに含まれる要素数
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getComments: async (
teamName: string,
page?: number,
perPage?: number,
options: any = {},
): Promise<RequestArgs> => {
// verify required parameter 'teamName' is not null or undefined
assertParamExists("getComments", "teamName", teamName);
const localVarPath = `/teams/{team_name}/comments`.replace(
`{${"team_name"}}`,
encodeURIComponent(String(teamName)),
);
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = {
method: "GET",
...baseOptions,
...options,
};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
// authentication AccessTokenHeader required
// http bearer authentication required
await setBearerAuthToObject(localVarHeaderParameter, configuration);
// authentication AccessTokenQueryParam required
await setApiKeyToObject(
localVarQueryParameter,
"access_token",
configuration,
);
// authentication OAuth2 required
// oauth required
await setOAuthToObject(
localVarHeaderParameter,
"OAuth2",
["read"],
configuration,
);
if (page !== undefined) {
localVarQueryParameter["page"] = page;
}
if (perPage !== undefined) {
localVarQueryParameter["per_page"] = perPage;
}
setSearchParams(localVarUrlObj, localVarQueryParameter, options.query);
let headersFromBaseOptions =
baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {
...localVarHeaderParameter,
...headersFromBaseOptions,
...options.headers,
};
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* 記事のコメント一覧を更新日の降順で返却します。
* @summary 記事のコメント一覧を取得する
* @param {string} teamName チーム名
* @param {number} postNumber 記事ID
* @param {number} [page] ページ番号
* @param {number} [perPage] 1ページあたりに含まれる要素数
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getPostComments: async (
teamName: string,
postNumber: number,
page?: number,
perPage?: number,
options: any = {},
): Promise<RequestArgs> => {
// verify required parameter 'teamName' is not null or undefined
assertParamExists("getPostComments", "teamName", teamName);
// verify required parameter 'postNumber' is not null or undefined
assertParamExists("getPostComments", "postNumber", postNumber);
const localVarPath = `/teams/{team_name}/posts/{post_number}/comments`
.replace(`{${"team_name"}}`, encodeURIComponent(String(teamName)))
.replace(`{${"post_number"}}`, encodeURIComponent(String(postNumber)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = {
method: "GET",
...baseOptions,
...options,
};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
// authentication AccessTokenHeader required
// http bearer authentication required
await setBearerAuthToObject(localVarHeaderParameter, configuration);
// authentication AccessTokenQueryParam required
await setApiKeyToObject(
localVarQueryParameter,
"access_token",
configuration,
);
// authentication OAuth2 required
// oauth required
await setOAuthToObject(
localVarHeaderParameter,
"OAuth2",
["read"],
configuration,
);
if (page !== undefined) {
localVarQueryParameter["page"] = page;
}
if (perPage !== undefined) {
localVarQueryParameter["per_page"] = perPage;
}
setSearchParams(localVarUrlObj, localVarQueryParameter, options.query);
let headersFromBaseOptions =
baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {
...localVarHeaderParameter,
...headersFromBaseOptions,
...options.headers,
};
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* 指定されたコメントを更新します。
* @summary コメントを更新する
* @param {string} teamName チーム名
* @param {number} commentId コメントID
* @param {UpdateCommentBody} updateCommentBody
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
updateComment: async (
teamName: string,
commentId: number,
updateCommentBody: UpdateCommentBody,
options: any = {},
): Promise<RequestArgs> => {
// verify required parameter 'teamName' is not null or undefined
assertParamExists("updateComment", "teamName", teamName);
// verify required parameter 'commentId' is not null or undefined
assertParamExists("updateComment", "commentId", commentId);
// verify required parameter 'updateCommentBody' is not null or undefined
assertParamExists(
"updateComment",
"updateCommentBody",
updateCommentBody,
);
const localVarPath = `/teams/{team_name}/comments/{comment_id}`
.replace(`{${"team_name"}}`, encodeURIComponent(String(teamName)))
.replace(`{${"comment_id"}}`, encodeURIComponent(String(commentId)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = {
method: "PATCH",
...baseOptions,
...options,
};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
// authentication AccessTokenHeader required
// http bearer authentication required
await setBearerAuthToObject(localVarHeaderParameter, configuration);
// authentication AccessTokenQueryParam required
await setApiKeyToObject(
localVarQueryParameter,
"access_token",
configuration,
);
// authentication OAuth2 required
// oauth required
await setOAuthToObject(
localVarHeaderParameter,
"OAuth2",
["write"],
configuration,
);
localVarHeaderParameter["Content-Type"] = "application/json";
setSearchParams(localVarUrlObj, localVarQueryParameter, options.query);
let headersFromBaseOptions =
baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {
...localVarHeaderParameter,
...headersFromBaseOptions,
...options.headers,
};
localVarRequestOptions.data = serializeDataIfNeeded(
updateCommentBody,
localVarRequestOptions,
configuration,
);
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
};
};
/**
* CommentApi - functional programming interface
* @export
*/
export const CommentApiFp = function (configuration?: Configuration) {
const localVarAxiosParamCreator = CommentApiAxiosParamCreator(configuration);
return {
/**
* 記事に新しいコメントを作成します。
* @summary コメントを投稿する
* @param {string} teamName チーム名
* @param {number} postNumber 記事ID
* @param {CreateCommentBody} createCommentBody
* @param {number} [page] ページ番号
* @param {number} [perPage] 1ページあたりに含まれる要素数
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async createComment(
teamName: string,
postNumber: number,
createCommentBody: CreateCommentBody,
page?: number,
perPage?: number,
options?: any,
): Promise<
(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Comment>
> {
const localVarAxiosArgs = await localVarAxiosParamCreator.createComment(
teamName,
postNumber,
createCommentBody,
page,
perPage,
options,
);
return createRequestFunction(
localVarAxiosArgs,
globalAxios,
BASE_PATH,
configuration,
);
},
/**
* 指定されたコメントを削除します。
* @summary コメントを削除する
* @param {string} teamName チーム名
* @param {number} commentId コメントID
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async deleteComment(
teamName: string,
commentId: number,
options?: any,
): Promise<
(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>
> {
const localVarAxiosArgs = await localVarAxiosParamCreator.deleteComment(
teamName,
commentId,
options,
);
return createRequestFunction(
localVarAxiosArgs,
globalAxios,
BASE_PATH,
configuration,
);
},
/**
* 指定されたコメントを取得します。
* @summary コメントを取得する
* @param {string} teamName チーム名
* @param {number} commentId コメントID
* @param {'stargazers'} [include] `stargazers`を指定するとStarの配列を含んだレスポンスを返します。
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async getComment(
teamName: string,
commentId: number,
include?: "stargazers",
options?: any,
): Promise<
(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Comment>
> {
const localVarAxiosArgs = await localVarAxiosParamCreator.getComment(
teamName,
commentId,
include,
options,
);
return createRequestFunction(
localVarAxiosArgs,
globalAxios,
BASE_PATH,
configuration,
);
},
/**
* チーム全体のコメント一覧を作成日の降順で返却します。
* @summary コメント一覧を取得する
* @param {string} teamName チーム名
* @param {number} [page] ページ番号
* @param {number} [perPage] 1ページあたりに含まれる要素数
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async getComments(
teamName: string,
page?: number,
perPage?: number,
options?: any,
): Promise<
(
axios?: AxiosInstance,
basePath?: string,
) => AxiosPromise<PaginatedComments>
> {
const localVarAxiosArgs = await localVarAxiosParamCreator.getComments(
teamName,
page,
perPage,
options,
);
return createRequestFunction(
localVarAxiosArgs,
globalAxios,
BASE_PATH,
configuration,
);
},
/**
* 記事のコメント一覧を更新日の降順で返却します。
* @summary 記事のコメント一覧を取得する
* @param {string} teamName チーム名
* @param {number} postNumber 記事ID
* @param {number} [page] ページ番号
* @param {number} [perPage] 1ページあたりに含まれる要素数
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async getPostComments(
teamName: string,
postNumber: number,
page?: number,
perPage?: number,
options?: any,
): Promise<
(
axios?: AxiosInstance,
basePath?: string,
) => AxiosPromise<PaginatedComments>
> {
const localVarAxiosArgs = await localVarAxiosParamCreator.getPostComments(
teamName,
postNumber,
page,
perPage,
options,
);
return createRequestFunction(
localVarAxiosArgs,
globalAxios,
BASE_PATH,
configuration,
);
},
/**
* 指定されたコメントを更新します。
* @summary コメントを更新する
* @param {string} teamName チーム名
* @param {number} commentId コメントID
* @param {UpdateCommentBody} updateCommentBody
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async updateComment(
teamName: string,
commentId: number,
updateCommentBody: UpdateCommentBody,
options?: any,
): Promise<
(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Comment>
> {
const localVarAxiosArgs = await localVarAxiosParamCreator.updateComment(
teamName,
commentId,
updateCommentBody,
options,
);
return createRequestFunction(
localVarAxiosArgs,
globalAxios,
BASE_PATH,
configuration,
);
},
};
};
/**
* CommentApi - factory interface
* @export
*/
export const CommentApiFactory = function (
configuration?: Configuration,
basePath?: string,
axios?: AxiosInstance,
) {
const localVarFp = CommentApiFp(configuration);
return {
/**
* 記事に新しいコメントを作成します。
* @summary コメントを投稿する
* @param {string} teamName チーム名
* @param {number} postNumber 記事ID
* @param {CreateCommentBody} createCommentBody
* @param {number} [page] ページ番号
* @param {number} [perPage] 1ページあたりに含まれる要素数
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
createComment(
teamName: string,
postNumber: number,
createCommentBody: CreateCommentBody,
page?: number,
perPage?: number,
options?: any,
): AxiosPromise<Comment> {
return localVarFp
.createComment(
teamName,
postNumber,
createCommentBody,
page,
perPage,
options,
)
.then((request) => request(axios, basePath));
},
/**
* 指定されたコメントを削除します。
* @summary コメントを削除する
* @param {string} teamName チーム名
* @param {number} commentId コメントID
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
deleteComment(
teamName: string,
commentId: number,
options?: any,
): AxiosPromise<void> {
return localVarFp
.deleteComment(teamName, commentId, options)
.then((request) => request(axios, basePath));
},
/**
* 指定されたコメントを取得します。
* @summary コメントを取得する
* @param {string} teamName チーム名
* @param {number} commentId コメントID
* @param {'stargazers'} [include] `stargazers`を指定するとStarの配列を含んだレスポンスを返します。
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getComment(
teamName: string,
commentId: number,
include?: "stargazers",
options?: any,
): AxiosPromise<Comment> {
return localVarFp
.getComment(teamName, commentId, include, options)
.then((request) => request(axios, basePath));
},
/**
* チーム全体のコメント一覧を作成日の降順で返却します。
* @summary コメント一覧を取得する
* @param {string} teamName チーム名
* @param {number} [page] ページ番号
* @param {number} [perPage] 1ページあたりに含まれる要素数
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getComments(
teamName: string,
page?: number,
perPage?: number,
options?: any,
): AxiosPromise<PaginatedComments> {
return localVarFp
.getComments(teamName, page, perPage, options)
.then((request) => request(axios, basePath));
},
/**
* 記事のコメント一覧を更新日の降順で返却します。
* @summary 記事のコメント一覧を取得する
* @param {string} teamName チーム名
* @param {number} postNumber 記事ID
* @param {number} [page] ページ番号
* @param {number} [perPage] 1ページあたりに含まれる要素数
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getPostComments(
teamName: string,
postNumber: number,
page?: number,
perPage?: number,
options?: any,
): AxiosPromise<PaginatedComments> {
return localVarFp
.getPostComments(teamName, postNumber, page, perPage, options)
.then((request) => request(axios, basePath));
},
/**
* 指定されたコメントを更新します。
* @summary コメントを更新する
* @param {string} teamName チーム名
* @param {number} commentId コメントID
* @param {UpdateCommentBody} updateCommentBody
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
updateComment(
teamName: string,
commentId: number,
updateCommentBody: UpdateCommentBody,
options?: any,
): AxiosPromise<Comment> {
return localVarFp
.updateComment(teamName, commentId, updateCommentBody, options)
.then((request) => request(axios, basePath));
},
};
};
/**
* Request parameters for createComment operation in CommentApi.
* @export
* @interface CommentApiCreateCommentRequest
*/
export interface CommentApiCreateCommentRequest {
/**
* チーム名
* @type {string}
* @memberof CommentApiCreateComment
*/
readonly teamName: string;
/**
* 記事ID
* @type {number}
* @memberof CommentApiCreateComment
*/
readonly postNumber: number;
/**
*
* @type {CreateCommentBody}
* @memberof CommentApiCreateComment
*/
readonly createCommentBody: CreateCommentBody;
/**
* ページ番号
* @type {number}
* @memberof CommentApiCreateComment
*/
readonly page?: number;
/**
* 1ページあたりに含まれる要素数
* @type {number}
* @memberof CommentApiCreateComment
*/
readonly perPage?: number;
}
/**
* Request parameters for deleteComment operation in CommentApi.
* @export
* @interface CommentApiDeleteCommentRequest
*/
export interface CommentApiDeleteCommentRequest {
/**
* チーム名
* @type {string}
* @memberof CommentApiDeleteComment
*/
readonly teamName: string;
/**
* コメントID
* @type {number}
* @memberof CommentApiDeleteComment
*/
readonly commentId: number;
}
/**
* Request parameters for getComment operation in CommentApi.
* @export
* @interface CommentApiGetCommentRequest
*/
export interface CommentApiGetCommentRequest {
/**
* チーム名
* @type {string}
* @memberof CommentApiGetComment
*/
readonly teamName: string;
/**
* コメントID
* @type {number}
* @memberof CommentApiGetComment
*/
readonly commentId: number;
/**
* `stargazers`を指定するとStarの配列を含んだレスポンスを返します。
* @type {'stargazers'}
* @memberof CommentApiGetComment
*/
readonly include?: "stargazers";
}
/**
* Request parameters for getComments operation in CommentApi.
* @export
* @interface CommentApiGetCommentsRequest
*/
export interface CommentApiGetCommentsRequest {
/**
* チーム名
* @type {string}
* @memberof CommentApiGetComments
*/
readonly teamName: string;
/**
* ページ番号
* @type {number}
* @memberof CommentApiGetComments
*/
readonly page?: number;
/**
* 1ページあたりに含まれる要素数
* @type {number}
* @memberof CommentApiGetComments
*/
readonly perPage?: number;
}
/**
* Request parameters for getPostComments operation in CommentApi.
* @export
* @interface CommentApiGetPostCommentsRequest
*/
export interface CommentApiGetPostCommentsRequest {
/**
* チーム名
* @type {string}
* @memberof CommentApiGetPostComments
*/
readonly teamName: string;
/**
* 記事ID
* @type {number}
* @memberof CommentApiGetPostComments
*/
readonly postNumber: number;
/**
* ページ番号
* @type {number}
* @memberof CommentApiGetPostComments
*/
readonly page?: number;
/**
* 1ページあたりに含まれる要素数
* @type {number}
* @memberof CommentApiGetPostComments
*/
readonly perPage?: number;
}
/**
* Request parameters for updateComment operation in CommentApi.
* @export
* @interface CommentApiUpdateCommentRequest
*/
export interface CommentApiUpdateCommentRequest {
/**
* チーム名
* @type {string}
* @memberof CommentApiUpdateComment
*/
readonly teamName: string;
/**
* コメントID
* @type {number}
* @memberof CommentApiUpdateComment
*/
readonly commentId: number;
/**
*
* @type {UpdateCommentBody}
* @memberof CommentApiUpdateComment
*/
readonly updateCommentBody: UpdateCommentBody;
}
/**
* CommentApi - object-oriented interface
* @export
* @class CommentApi
* @extends {BaseAPI}
*/
export class CommentApi extends BaseAPI {
/**
* 記事に新しいコメントを作成します。
* @summary コメントを投稿する
* @param {CommentApiCreateCommentRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof CommentApi
*/
public createComment(
requestParameters: CommentApiCreateCommentRequest,
options?: any,
) {
return CommentApiFp(this.configuration)
.createComment(
requestParameters.teamName,
requestParameters.postNumber,
requestParameters.createCommentBody,
requestParameters.page,
requestParameters.perPage,
options,
)
.then((request) => request(this.axios, this.basePath));
}
/**
* 指定されたコメントを削除します。
* @summary コメントを削除する
* @param {CommentApiDeleteCommentRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof CommentApi
*/
public deleteComment(
requestParameters: CommentApiDeleteCommentRequest,
options?: any,
) {
return CommentApiFp(this.configuration)
.deleteComment(
requestParameters.teamName,
requestParameters.commentId,
options,
)
.then((request) => request(this.axios, this.basePath));
}
/**
* 指定されたコメントを取得します。
* @summary コメントを取得する
* @param {CommentApiGetCommentRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof CommentApi
*/
public getComment(
requestParameters: CommentApiGetCommentRequest,
options?: any,
) {
return CommentApiFp(this.configuration)
.getComment(
requestParameters.teamName,
requestParameters.commentId,
requestParameters.include,
options,
)
.then((request) => request(this.axios, this.basePath));
}
/**
* チーム全体のコメント一覧を作成日の降順で返却します。
* @summary コメント一覧を取得する
* @param {CommentApiGetCommentsRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof CommentApi
*/
public getComments(
requestParameters: CommentApiGetCommentsRequest,
options?: any,
) {
return CommentApiFp(this.configuration)
.getComments(
requestParameters.teamName,
requestParameters.page,
requestParameters.perPage,
options,
)
.then((request) => request(this.axios, this.basePath));
}
/**
* 記事のコメント一覧を更新日の降順で返却します。
* @summary 記事のコメント一覧を取得する
* @param {CommentApiGetPostCommentsRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof CommentApi
*/
public getPostComments(
requestParameters: CommentApiGetPostCommentsRequest,
options?: any,
) {
return CommentApiFp(this.configuration)
.getPostComments(
requestParameters.teamName,
requestParameters.postNumber,
requestParameters.page,
requestParameters.perPage,
options,
)
.then((request) => request(this.axios, this.basePath));
}
/**
* 指定されたコメントを更新します。
* @summary コメントを更新する
* @param {CommentApiUpdateCommentRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof CommentApi
*/
public updateComment(
requestParameters: CommentApiUpdateCommentRequest,
options?: any,
) {
return CommentApiFp(this.configuration)
.updateComment(
requestParameters.teamName,
requestParameters.commentId,
requestParameters.updateCommentBody,
options,
)
.then((request) => request(this.axios, this.basePath));
}
}