@suin/esa-api
Version:
esa.io APIクライアント
1,540 lines (1,403 loc) • 188 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 { AuthenticatedUser } from "../models";
// @ts-ignore
import { BatchMoveOptions } from "../models";
// @ts-ignore
import { BatchMoveResult } from "../models";
// @ts-ignore
import { Comment } from "../models";
// @ts-ignore
import { CreateCommentBody } from "../models";
// @ts-ignore
import { CreateEmojiBody } from "../models";
// @ts-ignore
import { CreatePostBody } from "../models";
// @ts-ignore
import { CreatedEmoji } from "../models";
// @ts-ignore
import { EmojiList } from "../models";
// @ts-ignore
import { InvitationList } from "../models";
// @ts-ignore
import { InviteBody } from "../models";
// @ts-ignore
import { NewStar } from "../models";
// @ts-ignore
import { PaginatedComments } from "../models";
// @ts-ignore
import { PaginatedMembers } from "../models";
// @ts-ignore
import { PaginatedPosts } from "../models";
// @ts-ignore
import { PaginatedStargazers } from "../models";
// @ts-ignore
import { PaginatedTags } from "../models";
// @ts-ignore
import { PaginatedTeams } from "../models";
// @ts-ignore
import { PaginatedWatchers } from "../models";
// @ts-ignore
import { Post } from "../models";
// @ts-ignore
import { Team } from "../models";
// @ts-ignore
import { TeamStats } from "../models";
// @ts-ignore
import { UpdateCommentBody } from "../models";
// @ts-ignore
import { UpdatePostBody } from "../models";
/**
* EsaApi - axios parameter creator
* @export
*/
export const EsaApiAxiosParamCreator = function (
configuration?: Configuration,
) {
return {
/**
* 指定されたカテゴリを配下のカテゴリを含めて一括で変更します。
* @summary カテゴリを一括移動する
* @param {string} teamName チーム名
* @param {BatchMoveOptions} batchMoveOptions
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
batchMoveCategory: async (
teamName: string,
batchMoveOptions: BatchMoveOptions,
options: any = {},
): Promise<RequestArgs> => {
// verify required parameter 'teamName' is not null or undefined
assertParamExists("batchMoveCategory", "teamName", teamName);
// verify required parameter 'batchMoveOptions' is not null or undefined
assertParamExists(
"batchMoveCategory",
"batchMoveOptions",
batchMoveOptions,
);
const localVarPath = `/teams/{team_name}/categories/batch_move`.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: "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,
);
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(
batchMoveOptions,
localVarRequestOptions,
configuration,
);
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* 記事に新しいコメントを作成します。
* @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 {CreateEmojiBody} createEmojiBody
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
createEmoji: async (
teamName: string,
createEmojiBody: CreateEmojiBody,
options: any = {},
): Promise<RequestArgs> => {
// verify required parameter 'teamName' is not null or undefined
assertParamExists("createEmoji", "teamName", teamName);
// verify required parameter 'createEmojiBody' is not null or undefined
assertParamExists("createEmoji", "createEmojiBody", createEmojiBody);
const localVarPath = `/teams/{team_name}/emojis`.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: "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,
);
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(
createEmojiBody,
localVarRequestOptions,
configuration,
);
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
*
* @summary 記事を投稿する
* @param {string} teamName チーム名
* @param {CreatePostBody} createPostBody
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
createPost: async (
teamName: string,
createPostBody: CreatePostBody,
options: any = {},
): Promise<RequestArgs> => {
// verify required parameter 'teamName' is not null or undefined
assertParamExists("createPost", "teamName", teamName);
// verify required parameter 'createPostBody' is not null or undefined
assertParamExists("createPost", "createPostBody", createPostBody);
const localVarPath = `/teams/{team_name}/posts`.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: "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,
);
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(
createPostBody,
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 {string} code 絵文字コード
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
deleteEmoji: async (
teamName: string,
code: string,
options: any = {},
): Promise<RequestArgs> => {
// verify required parameter 'teamName' is not null or undefined
assertParamExists("deleteEmoji", "teamName", teamName);
// verify required parameter 'code' is not null or undefined
assertParamExists("deleteEmoji", "code", code);
const localVarPath = `/teams/{team_name}/emojis/{code}`
.replace(`{${"team_name"}}`, encodeURIComponent(String(teamName)))
.replace(`{${"code"}}`, encodeURIComponent(String(code)));
// 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,
};
},
/**
* 指定した screen_name のメンバーをチームから削除します。 - チームの owner である必要があります - APIで自分自身をチームから削除することはできません。
* @summary メンバーを削除する
* @param {string} teamName チーム名
* @param {string} screenName 削除するメンバーのscreen_name
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
deleteMember: async (
teamName: string,
screenName: string,
options: any = {},
): Promise<RequestArgs> => {
// verify required parameter 'teamName' is not null or undefined
assertParamExists("deleteMember", "teamName", teamName);
// verify required parameter 'screenName' is not null or undefined
assertParamExists("deleteMember", "screenName", screenName);
const localVarPath = `/teams/{team_name}/members/{screen_name}`
.replace(`{${"team_name"}}`, encodeURIComponent(String(teamName)))
.replace(`{${"screen_name"}}`, encodeURIComponent(String(screenName)));
// 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} postNumber 記事ID
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
deletePost: async (
teamName: string,
postNumber: number,
options: any = {},
): Promise<RequestArgs> => {
// verify required parameter 'teamName' is not null or undefined
assertParamExists("deletePost", "teamName", teamName);
// verify required parameter 'postNumber' is not null or undefined
assertParamExists("deletePost", "postNumber", postNumber);
const localVarPath = `/teams/{team_name}/posts/{post_number}`
.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: "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,
};
},
/**
* 招待中のメンバーの招待を削除します。招待時に送信されたメールに記載された招待用のURLは無効となります。 このAPIは**team**の**owner**だけがご利用可能です。
* @summary 招待を取り下げる
* @param {string} teamName チーム名
* @param {string} code 招待時の識別子を指定します
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
disinvite: async (
teamName: string,
code: string,
options: any = {},
): Promise<RequestArgs> => {
// verify required parameter 'teamName' is not null or undefined
assertParamExists("disinvite", "teamName", teamName);
// verify required parameter 'code' is not null or undefined
assertParamExists("disinvite", "code", code);
const localVarPath = `/teams/{team_name}/invitations/{code}`
.replace(`{${"team_name"}}`, encodeURIComponent(String(teamName)))
.replace(`{${"code"}}`, encodeURIComponent(String(code)));
// 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 {'teams'} [include] teams を指定すると所属するチームの配列を含んだレスポンスを返します。
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getAuthenticatedUser: async (
include?: "teams",
options: any = {},
): Promise<RequestArgs> => {
const localVarPath = `/user`;
// 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} 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,
};
},
/**
* 指定されたコメントにStarをしたユーザ一覧を取得します。
* @summary コメントのStarを取得する
* @param {string} teamName チーム名
* @param {number} commentId コメントID
* @param {number} [page] ページ番号
* @param {number} [perPage] 1ページあたりに含まれる要素数
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getCommentStargazers: async (
teamName: string,
commentId: number,
page?: number,
perPage?: number,
options: any = {},
): Promise<RequestArgs> => {
// verify required parameter 'teamName' is not null or undefined
assertParamExists("getCommentStargazers", "teamName", teamName);
// verify required parameter 'commentId' is not null or undefined
assertParamExists("getCommentStargazers", "commentId", commentId);
const localVarPath = `/teams/{team_name}/comments/{comment_id}/stargazers`
.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 (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} [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,
};
},
/**
* チームで利用可能な絵文字を取得します。URIクエリ文字列を含めない場合、チーム固有の絵文字だけを取得します。
* @summary 絵文字一覧を取得する
* @param {string} teamName チーム名
* @param {'all'} [include] `all`を指定すると、チーム固有の絵文字だけではなく、すべての絵文字を返します。
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getEmojis: async (
teamName: string,
include?: "all",
options: any = {},
): Promise<RequestArgs> => {
// verify required parameter 'teamName' is not null or undefined
assertParamExists("getEmojis", "teamName", teamName);
const localVarPath = `/teams/{team_name}/emojis`.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 (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,
};
},
/**
* 招待中のメンバーの一覧を取得します。 このAPIは**team**の**owner**だけがご利用可能です。
* @summary 招待中のメンバー一覧を取得する
* @param {string} teamName チーム名
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getInvitations: async (
teamName: string,
options: any = {},
): Promise<RequestArgs> => {
// verify required parameter 'teamName' is not null or undefined
assertParamExists("getInvitations", "teamName", teamName);
const localVarPath = `/teams/{team_name}/invitations`.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,
);
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 {'posts_count' | 'joined' | 'last_accessed'} [sort]
* @param {'asc' | 'desc'} [order] 設定可能な値: - `desc`: 降順 (default) - `asc`: 昇順
* @param {number} [page] ページ番号
* @param {number} [perPage] 1ページあたりに含まれる要素数
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getMembers: async (
teamName: string,
sort?: "posts_count" | "joined" | "last_accessed",
order?: "asc" | "desc",
page?: number,
perPage?: number,
options: any = {},
): Promise<RequestArgs> => {
// verify required parameter 'teamName' is not null or undefined
assertParamExists("getMembers", "teamName", teamName);
const localVarPath = `/teams/{team_name}/members`.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 (sort !== undefined) {
localVarQueryParameter["sort"] = sort;
}
if (order !== undefined) {
localVarQueryParameter["order"] = order;
}
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 {Array<'comments' | 'comments.stargazers' | 'stargazers'>} [include] - `comments` を指定するとコメントの配列を含んだレスポンスを返します。 - `comments,comments.stargazers`を指定するとコメントとコメントに対するStarの配列を含んだレスポンスを返します。 - `stargazers` を指定するとStarの配列を含んだレスポンスを返します。 - `stargazers,comments` のように `,` で区切ることで複数指定できます
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getPost: async (
teamName: string,
postNumber: number,
include?: Array<"comments" | "comments.stargazers" | "stargazers">,
options: any = {},
): Promise<RequestArgs> => {
// verify required parameter 'teamName' is not null or undefined
assertParamExists("getPost", "teamName", teamName);
// verify required parameter 'postNumber' is not null or undefined
assertParamExists("getPost", "postNumber", postNumber);
const localVarPath = `/teams/{team_name}/posts/{post_number}`
.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 (include) {
localVarQueryParameter["include"] = include.join(
COLLECTION_FORMATS.csv,
);
}
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,
};
},
/**
* 指定された記事にStarをしたユーザ一覧を取得します。
* @summary 記事のStarを取得する
* @param {string} teamName チーム名
* @param {number} postNumber 記事ID
* @param {number} [page] ページ番号
* @param {number} [perPage] 1ページあたりに含まれる要素数
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getPostStargazers: async (
teamName: string,
postNumber: number,
page?: number,
perPage?: number,
options: any = {},
): Promise<RequestArgs> => {
// verify required parameter 'teamName' is not null or undefined
assertParamExists("getPostStargazers", "teamName", teamName);
// verify required parameter 'postNumber' is not null or undefined
assertParamExists("getPostStargazers", "postNumber", postNumber);
const localVarPath = `/teams/{team_name}/posts/{post_number}/stargazers`
.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