/**
* Generated by orval v7.8.0 🍺
* Do not edit manually.
* esa API
* API for esa.io - A documentation sharing service
* OpenAPI spec version: 1.0.0
*/
import type {
Comment,
ErrorResponseBody,
GetOauthTokenInfo200,
GetV1Teams200,
GetV1TeamsParams,
GetV1TeamsTeamNameComments200,
GetV1TeamsTeamNameCommentsCommentIdParams,
GetV1TeamsTeamNameCommentsCommentIdStargazers200,
GetV1TeamsTeamNameEmojis200,
GetV1TeamsTeamNameEmojisParams,
GetV1TeamsTeamNameInvitation200,
GetV1TeamsTeamNameInvitations200,
GetV1TeamsTeamNamePosts200,
GetV1TeamsTeamNamePostsParams,
GetV1TeamsTeamNamePostsPostNumberComments200,
GetV1TeamsTeamNamePostsPostNumberParams,
GetV1TeamsTeamNamePostsPostNumberStargazers200,
GetV1TeamsTeamNamePostsPostNumberWatchers200,
GetV1TeamsTeamNameStats200,
GetV1TeamsTeamNameTags200,
GetV1User200,
GetV1UserParams,
PatchV1TeamsTeamNameCommentsCommentIdBody,
PatchV1TeamsTeamNamePostsPostNumber200,
PatchV1TeamsTeamNamePostsPostNumberBody,
Post,
PostOauthRevoke200,
PostOauthRevokeBody,
PostOauthToken200,
PostOauthTokenBody,
PostV1TeamsTeamNameCategoriesBatchMove200,
PostV1TeamsTeamNameCategoriesBatchMoveBody,
PostV1TeamsTeamNameCommentsCommentIdStarBody,
PostV1TeamsTeamNameEmojis201,
PostV1TeamsTeamNameEmojisBodyOne,
PostV1TeamsTeamNameEmojisBodyTwo,
PostV1TeamsTeamNameInvitationRegenerator200,
PostV1TeamsTeamNameInvitations201,
PostV1TeamsTeamNameInvitationsBody,
PostV1TeamsTeamNamePostsBody,
PostV1TeamsTeamNamePostsPostNumberCommentsBody,
PostV1TeamsTeamNamePostsPostNumberStarBody,
Team
} from './esaAPI.schemas';
/**
* @summary Issue new access token
*/
export type postOauthTokenResponse200 = {
data: PostOauthToken200
status: 200
}
export type postOauthTokenResponse400 = {
data: ErrorResponseBody
status: 400
}
export type postOauthTokenResponseComposite = postOauthTokenResponse200 | postOauthTokenResponse400;
export type postOauthTokenResponse = postOauthTokenResponseComposite & {
headers: Headers;
}
export const getPostOauthTokenUrl = () => {
return `https://api.esa.io/oauth/token`
}
export const postOauthToken = async (postOauthTokenBody: PostOauthTokenBody, options?: RequestInit): Promise<postOauthTokenResponse> => {
const res = await fetch(getPostOauthTokenUrl(),
{
...options,
method: 'POST',
headers: { 'Content-Type': 'application/json', ...options?.headers },
body: JSON.stringify(
postOauthTokenBody,)
}
)
const body = [204, 205, 304].includes(res.status) ? null : await res.text()
const data: postOauthTokenResponse['data'] = body ? JSON.parse(body) : {}
return { data, status: res.status, headers: res.headers } as postOauthTokenResponse
}
/**
* @summary Get access token information
*/
export type getOauthTokenInfoResponse200 = {
data: GetOauthTokenInfo200
status: 200
}
export type getOauthTokenInfoResponse400 = {
data: ErrorResponseBody
status: 400
}
export type getOauthTokenInfoResponseComposite = getOauthTokenInfoResponse200 | getOauthTokenInfoResponse400;
export type getOauthTokenInfoResponse = getOauthTokenInfoResponseComposite & {
headers: Headers;
}
export const getGetOauthTokenInfoUrl = () => {
return `https://api.esa.io/oauth/token/info`
}
export const getOauthTokenInfo = async ( options?: RequestInit): Promise<getOauthTokenInfoResponse> => {
const res = await fetch(getGetOauthTokenInfoUrl(),
{
...options,
method: 'GET'
}
)
const body = [204, 205, 304].includes(res.status) ? null : await res.text()
const data: getOauthTokenInfoResponse['data'] = body ? JSON.parse(body) : {}
return { data, status: res.status, headers: res.headers } as getOauthTokenInfoResponse
}
/**
* @summary Revoke access token
*/
export type postOauthRevokeResponse200 = {
data: PostOauthRevoke200
status: 200
}
export type postOauthRevokeResponse400 = {
data: ErrorResponseBody
status: 400
}
export type postOauthRevokeResponseComposite = postOauthRevokeResponse200 | postOauthRevokeResponse400;
export type postOauthRevokeResponse = postOauthRevokeResponseComposite & {
headers: Headers;
}
export const getPostOauthRevokeUrl = () => {
return `https://api.esa.io/oauth/revoke`
}
export const postOauthRevoke = async (postOauthRevokeBody: PostOauthRevokeBody, options?: RequestInit): Promise<postOauthRevokeResponse> => {
const res = await fetch(getPostOauthRevokeUrl(),
{
...options,
method: 'POST',
headers: { 'Content-Type': 'application/json', ...options?.headers },
body: JSON.stringify(
postOauthRevokeBody,)
}
)
const body = [204, 205, 304].includes(res.status) ? null : await res.text()
const data: postOauthRevokeResponse['data'] = body ? JSON.parse(body) : {}
return { data, status: res.status, headers: res.headers } as postOauthRevokeResponse
}
/**
* @summary List teams
*/
export type getV1TeamsResponse200 = {
data: GetV1Teams200
status: 200
}
export type getV1TeamsResponse400 = {
data: ErrorResponseBody
status: 400
}
export type getV1TeamsResponseComposite = getV1TeamsResponse200 | getV1TeamsResponse400;
export type getV1TeamsResponse = getV1TeamsResponseComposite & {
headers: Headers;
}
export const getGetV1TeamsUrl = (params?: GetV1TeamsParams,) => {
const normalizedParams = new URLSearchParams();
Object.entries(params || {}).forEach(([key, value]) => {
if (value !== undefined) {
normalizedParams.append(key, value === null ? 'null' : value.toString())
}
});
const stringifiedParams = normalizedParams.toString();
return stringifiedParams.length > 0 ? `https://api.esa.io/v1/teams?${stringifiedParams}` : `https://api.esa.io/v1/teams`
}
export const getV1Teams = async (params?: GetV1TeamsParams, options?: RequestInit): Promise<getV1TeamsResponse> => {
const res = await fetch(getGetV1TeamsUrl(params),
{
...options,
method: 'GET'
}
)
const body = [204, 205, 304].includes(res.status) ? null : await res.text()
const data: getV1TeamsResponse['data'] = body ? JSON.parse(body) : {}
return { data, status: res.status, headers: res.headers } as getV1TeamsResponse
}
/**
* @summary Get a team
*/
export type getV1TeamsTeamNameResponse200 = {
data: Team
status: 200
}
export type getV1TeamsTeamNameResponse400 = {
data: ErrorResponseBody
status: 400
}
export type getV1TeamsTeamNameResponseComposite = getV1TeamsTeamNameResponse200 | getV1TeamsTeamNameResponse400;
export type getV1TeamsTeamNameResponse = getV1TeamsTeamNameResponseComposite & {
headers: Headers;
}
export const getGetV1TeamsTeamNameUrl = (teamName: string,) => {
return `https://api.esa.io/v1/teams/${teamName}`
}
export const getV1TeamsTeamName = async (teamName: string, options?: RequestInit): Promise<getV1TeamsTeamNameResponse> => {
const res = await fetch(getGetV1TeamsTeamNameUrl(teamName),
{
...options,
method: 'GET'
}
)
const body = [204, 205, 304].includes(res.status) ? null : await res.text()
const data: getV1TeamsTeamNameResponse['data'] = body ? JSON.parse(body) : {}
return { data, status: res.status, headers: res.headers } as getV1TeamsTeamNameResponse
}
/**
* @summary Get team statistics
*/
export type getV1TeamsTeamNameStatsResponse200 = {
data: GetV1TeamsTeamNameStats200
status: 200
}
export type getV1TeamsTeamNameStatsResponse400 = {
data: ErrorResponseBody
status: 400
}
export type getV1TeamsTeamNameStatsResponseComposite = getV1TeamsTeamNameStatsResponse200 | getV1TeamsTeamNameStatsResponse400;
export type getV1TeamsTeamNameStatsResponse = getV1TeamsTeamNameStatsResponseComposite & {
headers: Headers;
}
export const getGetV1TeamsTeamNameStatsUrl = (teamName: string,) => {
return `https://api.esa.io/v1/teams/${teamName}/stats`
}
export const getV1TeamsTeamNameStats = async (teamName: string, options?: RequestInit): Promise<getV1TeamsTeamNameStatsResponse> => {
const res = await fetch(getGetV1TeamsTeamNameStatsUrl(teamName),
{
...options,
method: 'GET'
}
)
const body = [204, 205, 304].includes(res.status) ? null : await res.text()
const data: getV1TeamsTeamNameStatsResponse['data'] = body ? JSON.parse(body) : {}
return { data, status: res.status, headers: res.headers } as getV1TeamsTeamNameStatsResponse
}
/**
* @summary List posts
*/
export type getV1TeamsTeamNamePostsResponse200 = {
data: GetV1TeamsTeamNamePosts200
status: 200
}
export type getV1TeamsTeamNamePostsResponse400 = {
data: ErrorResponseBody
status: 400
}
export type getV1TeamsTeamNamePostsResponseComposite = getV1TeamsTeamNamePostsResponse200 | getV1TeamsTeamNamePostsResponse400;
export type getV1TeamsTeamNamePostsResponse = getV1TeamsTeamNamePostsResponseComposite & {
headers: Headers;
}
export const getGetV1TeamsTeamNamePostsUrl = (teamName: string,
params?: GetV1TeamsTeamNamePostsParams,) => {
const normalizedParams = new URLSearchParams();
Object.entries(params || {}).forEach(([key, value]) => {
if (value !== undefined) {
normalizedParams.append(key, value === null ? 'null' : value.toString())
}
});
const stringifiedParams = normalizedParams.toString();
return stringifiedParams.length > 0 ? `https://api.esa.io/v1/teams/${teamName}/posts?${stringifiedParams}` : `https://api.esa.io/v1/teams/${teamName}/posts`
}
export const getV1TeamsTeamNamePosts = async (teamName: string,
params?: GetV1TeamsTeamNamePostsParams, options?: RequestInit): Promise<getV1TeamsTeamNamePostsResponse> => {
const res = await fetch(getGetV1TeamsTeamNamePostsUrl(teamName,params),
{
...options,
method: 'GET'
}
)
const body = [204, 205, 304].includes(res.status) ? null : await res.text()
const data: getV1TeamsTeamNamePostsResponse['data'] = body ? JSON.parse(body) : {}
return { data, status: res.status, headers: res.headers } as getV1TeamsTeamNamePostsResponse
}
/**
* @summary Create a post
*/
export type postV1TeamsTeamNamePostsResponse201 = {
data: Post
status: 201
}
export type postV1TeamsTeamNamePostsResponse400 = {
data: ErrorResponseBody
status: 400
}
export type postV1TeamsTeamNamePostsResponseComposite = postV1TeamsTeamNamePostsResponse201 | postV1TeamsTeamNamePostsResponse400;
export type postV1TeamsTeamNamePostsResponse = postV1TeamsTeamNamePostsResponseComposite & {
headers: Headers;
}
export const getPostV1TeamsTeamNamePostsUrl = (teamName: string,) => {
return `https://api.esa.io/v1/teams/${teamName}/posts`
}
export const postV1TeamsTeamNamePosts = async (teamName: string,
postV1TeamsTeamNamePostsBody: PostV1TeamsTeamNamePostsBody, options?: RequestInit): Promise<postV1TeamsTeamNamePostsResponse> => {
const res = await fetch(getPostV1TeamsTeamNamePostsUrl(teamName),
{
...options,
method: 'POST',
headers: { 'Content-Type': 'application/json', ...options?.headers },
body: JSON.stringify(
postV1TeamsTeamNamePostsBody,)
}
)
const body = [204, 205, 304].includes(res.status) ? null : await res.text()
const data: postV1TeamsTeamNamePostsResponse['data'] = body ? JSON.parse(body) : {}
return { data, status: res.status, headers: res.headers } as postV1TeamsTeamNamePostsResponse
}
/**
* @summary Get a post
*/
export type getV1TeamsTeamNamePostsPostNumberResponse200 = {
data: Post
status: 200
}
export type getV1TeamsTeamNamePostsPostNumberResponse400 = {
data: ErrorResponseBody
status: 400
}
export type getV1TeamsTeamNamePostsPostNumberResponseComposite = getV1TeamsTeamNamePostsPostNumberResponse200 | getV1TeamsTeamNamePostsPostNumberResponse400;
export type getV1TeamsTeamNamePostsPostNumberResponse = getV1TeamsTeamNamePostsPostNumberResponseComposite & {
headers: Headers;
}
export const getGetV1TeamsTeamNamePostsPostNumberUrl = (teamName: string,
postNumber: number,
params?: GetV1TeamsTeamNamePostsPostNumberParams,) => {
const normalizedParams = new URLSearchParams();
Object.entries(params || {}).forEach(([key, value]) => {
if (value !== undefined) {
normalizedParams.append(key, value === null ? 'null' : value.toString())
}
});
const stringifiedParams = normalizedParams.toString();
return stringifiedParams.length > 0 ? `https://api.esa.io/v1/teams/${teamName}/posts/${postNumber}?${stringifiedParams}` : `https://api.esa.io/v1/teams/${teamName}/posts/${postNumber}`
}
export const getV1TeamsTeamNamePostsPostNumber = async (teamName: string,
postNumber: number,
params?: GetV1TeamsTeamNamePostsPostNumberParams, options?: RequestInit): Promise<getV1TeamsTeamNamePostsPostNumberResponse> => {
const res = await fetch(getGetV1TeamsTeamNamePostsPostNumberUrl(teamName,postNumber,params),
{
...options,
method: 'GET'
}
)
const body = [204, 205, 304].includes(res.status) ? null : await res.text()
const data: getV1TeamsTeamNamePostsPostNumberResponse['data'] = body ? JSON.parse(body) : {}
return { data, status: res.status, headers: res.headers } as getV1TeamsTeamNamePostsPostNumberResponse
}
/**
* @summary Update a post
*/
export type patchV1TeamsTeamNamePostsPostNumberResponse200 = {
data: PatchV1TeamsTeamNamePostsPostNumber200
status: 200
}
export type patchV1TeamsTeamNamePostsPostNumberResponse400 = {
data: ErrorResponseBody
status: 400
}
export type patchV1TeamsTeamNamePostsPostNumberResponseComposite = patchV1TeamsTeamNamePostsPostNumberResponse200 | patchV1TeamsTeamNamePostsPostNumberResponse400;
export type patchV1TeamsTeamNamePostsPostNumberResponse = patchV1TeamsTeamNamePostsPostNumberResponseComposite & {
headers: Headers;
}
export const getPatchV1TeamsTeamNamePostsPostNumberUrl = (teamName: string,
postNumber: number,) => {
return `https://api.esa.io/v1/teams/${teamName}/posts/${postNumber}`
}
export const patchV1TeamsTeamNamePostsPostNumber = async (teamName: string,
postNumber: number,
patchV1TeamsTeamNamePostsPostNumberBody: PatchV1TeamsTeamNamePostsPostNumberBody, options?: RequestInit): Promise<patchV1TeamsTeamNamePostsPostNumberResponse> => {
const res = await fetch(getPatchV1TeamsTeamNamePostsPostNumberUrl(teamName,postNumber),
{
...options,
method: 'PATCH',
headers: { 'Content-Type': 'application/json', ...options?.headers },
body: JSON.stringify(
patchV1TeamsTeamNamePostsPostNumberBody,)
}
)
const body = [204, 205, 304].includes(res.status) ? null : await res.text()
const data: patchV1TeamsTeamNamePostsPostNumberResponse['data'] = body ? JSON.parse(body) : {}
return { data, status: res.status, headers: res.headers } as patchV1TeamsTeamNamePostsPostNumberResponse
}
/**
* @summary Delete a post
*/
export type deleteV1TeamsTeamNamePostsPostNumberResponse204 = {
data: void
status: 204
}
export type deleteV1TeamsTeamNamePostsPostNumberResponse400 = {
data: ErrorResponseBody
status: 400
}
export type deleteV1TeamsTeamNamePostsPostNumberResponseComposite = deleteV1TeamsTeamNamePostsPostNumberResponse204 | deleteV1TeamsTeamNamePostsPostNumberResponse400;
export type deleteV1TeamsTeamNamePostsPostNumberResponse = deleteV1TeamsTeamNamePostsPostNumberResponseComposite & {
headers: Headers;
}
export const getDeleteV1TeamsTeamNamePostsPostNumberUrl = (teamName: string,
postNumber: number,) => {
return `https://api.esa.io/v1/teams/${teamName}/posts/${postNumber}`
}
export const deleteV1TeamsTeamNamePostsPostNumber = async (teamName: string,
postNumber: number, options?: RequestInit): Promise<deleteV1TeamsTeamNamePostsPostNumberResponse> => {
const res = await fetch(getDeleteV1TeamsTeamNamePostsPostNumberUrl(teamName,postNumber),
{
...options,
method: 'DELETE'
}
)
const body = [204, 205, 304].includes(res.status) ? null : await res.text()
const data: deleteV1TeamsTeamNamePostsPostNumberResponse['data'] = body ? JSON.parse(body) : {}
return { data, status: res.status, headers: res.headers } as deleteV1TeamsTeamNamePostsPostNumberResponse
}
/**
* @summary List comments on a post
*/
export type getV1TeamsTeamNamePostsPostNumberCommentsResponse200 = {
data: GetV1TeamsTeamNamePostsPostNumberComments200
status: 200
}
export type getV1TeamsTeamNamePostsPostNumberCommentsResponse400 = {
data: ErrorResponseBody
status: 400
}
export type getV1TeamsTeamNamePostsPostNumberCommentsResponseComposite = getV1TeamsTeamNamePostsPostNumberCommentsResponse200 | getV1TeamsTeamNamePostsPostNumberCommentsResponse400;
export type getV1TeamsTeamNamePostsPostNumberCommentsResponse = getV1TeamsTeamNamePostsPostNumberCommentsResponseComposite & {
headers: Headers;
}
export const getGetV1TeamsTeamNamePostsPostNumberCommentsUrl = (teamName: string,
postNumber: number,) => {
return `https://api.esa.io/v1/teams/${teamName}/posts/${postNumber}/comments`
}
export const getV1TeamsTeamNamePostsPostNumberComments = async (teamName: string,
postNumber: number, options?: RequestInit): Promise<getV1TeamsTeamNamePostsPostNumberCommentsResponse> => {
const res = await fetch(getGetV1TeamsTeamNamePostsPostNumberCommentsUrl(teamName,postNumber),
{
...options,
method: 'GET'
}
)
const body = [204, 205, 304].includes(res.status) ? null : await res.text()
const data: getV1TeamsTeamNamePostsPostNumberCommentsResponse['data'] = body ? JSON.parse(body) : {}
return { data, status: res.status, headers: res.headers } as getV1TeamsTeamNamePostsPostNumberCommentsResponse
}
/**
* @summary Create a comment
*/
export type postV1TeamsTeamNamePostsPostNumberCommentsResponse201 = {
data: Comment
status: 201
}
export type postV1TeamsTeamNamePostsPostNumberCommentsResponse400 = {
data: ErrorResponseBody
status: 400
}
export type postV1TeamsTeamNamePostsPostNumberCommentsResponseComposite = postV1TeamsTeamNamePostsPostNumberCommentsResponse201 | postV1TeamsTeamNamePostsPostNumberCommentsResponse400;
export type postV1TeamsTeamNamePostsPostNumberCommentsResponse = postV1TeamsTeamNamePostsPostNumberCommentsResponseComposite & {
headers: Headers;
}
export const getPostV1TeamsTeamNamePostsPostNumberCommentsUrl = (teamName: string,
postNumber: number,) => {
return `https://api.esa.io/v1/teams/${teamName}/posts/${postNumber}/comments`
}
export const postV1TeamsTeamNamePostsPostNumberComments = async (teamName: string,
postNumber: number,
postV1TeamsTeamNamePostsPostNumberCommentsBody: PostV1TeamsTeamNamePostsPostNumberCommentsBody, options?: RequestInit): Promise<postV1TeamsTeamNamePostsPostNumberCommentsResponse> => {
const res = await fetch(getPostV1TeamsTeamNamePostsPostNumberCommentsUrl(teamName,postNumber),
{
...options,
method: 'POST',
headers: { 'Content-Type': 'application/json', ...options?.headers },
body: JSON.stringify(
postV1TeamsTeamNamePostsPostNumberCommentsBody,)
}
)
const body = [204, 205, 304].includes(res.status) ? null : await res.text()
const data: postV1TeamsTeamNamePostsPostNumberCommentsResponse['data'] = body ? JSON.parse(body) : {}
return { data, status: res.status, headers: res.headers } as postV1TeamsTeamNamePostsPostNumberCommentsResponse
}
/**
* @summary Get a comment
*/
export type getV1TeamsTeamNameCommentsCommentIdResponse200 = {
data: Comment
status: 200
}
export type getV1TeamsTeamNameCommentsCommentIdResponse400 = {
data: ErrorResponseBody
status: 400
}
export type getV1TeamsTeamNameCommentsCommentIdResponseComposite = getV1TeamsTeamNameCommentsCommentIdResponse200 | getV1TeamsTeamNameCommentsCommentIdResponse400;
export type getV1TeamsTeamNameCommentsCommentIdResponse = getV1TeamsTeamNameCommentsCommentIdResponseComposite & {
headers: Headers;
}
export const getGetV1TeamsTeamNameCommentsCommentIdUrl = (teamName: string,
commentId: number,
params?: GetV1TeamsTeamNameCommentsCommentIdParams,) => {
const normalizedParams = new URLSearchParams();
Object.entries(params || {}).forEach(([key, value]) => {
if (value !== undefined) {
normalizedParams.append(key, value === null ? 'null' : value.toString())
}
});
const stringifiedParams = normalizedParams.toString();
return stringifiedParams.length > 0 ? `https://api.esa.io/v1/teams/${teamName}/comments/${commentId}?${stringifiedParams}` : `https://api.esa.io/v1/teams/${teamName}/comments/${commentId}`
}
export const getV1TeamsTeamNameCommentsCommentId = async (teamName: string,
commentId: number,
params?: GetV1TeamsTeamNameCommentsCommentIdParams, options?: RequestInit): Promise<getV1TeamsTeamNameCommentsCommentIdResponse> => {
const res = await fetch(getGetV1TeamsTeamNameCommentsCommentIdUrl(teamName,commentId,params),
{
...options,
method: 'GET'
}
)
const body = [204, 205, 304].includes(res.status) ? null : await res.text()
const data: getV1TeamsTeamNameCommentsCommentIdResponse['data'] = body ? JSON.parse(body) : {}
return { data, status: res.status, headers: res.headers } as getV1TeamsTeamNameCommentsCommentIdResponse
}
/**
* @summary Update a comment
*/
export type patchV1TeamsTeamNameCommentsCommentIdResponse200 = {
data: Comment
status: 200
}
export type patchV1TeamsTeamNameCommentsCommentIdResponse400 = {
data: ErrorResponseBody
status: 400
}
export type patchV1TeamsTeamNameCommentsCommentIdResponseComposite = patchV1TeamsTeamNameCommentsCommentIdResponse200 | patchV1TeamsTeamNameCommentsCommentIdResponse400;
export type patchV1TeamsTeamNameCommentsCommentIdResponse = patchV1TeamsTeamNameCommentsCommentIdResponseComposite & {
headers: Headers;
}
export const getPatchV1TeamsTeamNameCommentsCommentIdUrl = (teamName: string,
commentId: number,) => {
return `https://api.esa.io/v1/teams/${teamName}/comments/${commentId}`
}
export const patchV1TeamsTeamNameCommentsCommentId = async (teamName: string,
commentId: number,
patchV1TeamsTeamNameCommentsCommentIdBody: PatchV1TeamsTeamNameCommentsCommentIdBody, options?: RequestInit): Promise<patchV1TeamsTeamNameCommentsCommentIdResponse> => {
const res = await fetch(getPatchV1TeamsTeamNameCommentsCommentIdUrl(teamName,commentId),
{
...options,
method: 'PATCH',
headers: { 'Content-Type': 'application/json', ...options?.headers },
body: JSON.stringify(
patchV1TeamsTeamNameCommentsCommentIdBody,)
}
)
const body = [204, 205, 304].includes(res.status) ? null : await res.text()
const data: patchV1TeamsTeamNameCommentsCommentIdResponse['data'] = body ? JSON.parse(body) : {}
return { data, status: res.status, headers: res.headers } as patchV1TeamsTeamNameCommentsCommentIdResponse
}
/**
* @summary Delete a comment
*/
export type deleteV1TeamsTeamNameCommentsCommentIdResponse204 = {
data: void
status: 204
}
export type deleteV1TeamsTeamNameCommentsCommentIdResponse400 = {
data: ErrorResponseBody
status: 400
}
export type deleteV1TeamsTeamNameCommentsCommentIdResponseComposite = deleteV1TeamsTeamNameCommentsCommentIdResponse204 | deleteV1TeamsTeamNameCommentsCommentIdResponse400;
export type deleteV1TeamsTeamNameCommentsCommentIdResponse = deleteV1TeamsTeamNameCommentsCommentIdResponseComposite & {
headers: Headers;
}
export const getDeleteV1TeamsTeamNameCommentsCommentIdUrl = (teamName: string,
commentId: number,) => {
return `https://api.esa.io/v1/teams/${teamName}/comments/${commentId}`
}
export const deleteV1TeamsTeamNameCommentsCommentId = async (teamName: string,
commentId: number, options?: RequestInit): Promise<deleteV1TeamsTeamNameCommentsCommentIdResponse> => {
const res = await fetch(getDeleteV1TeamsTeamNameCommentsCommentIdUrl(teamName,commentId),
{
...options,
method: 'DELETE'
}
)
const body = [204, 205, 304].includes(res.status) ? null : await res.text()
const data: deleteV1TeamsTeamNameCommentsCommentIdResponse['data'] = body ? JSON.parse(body) : {}
return { data, status: res.status, headers: res.headers } as deleteV1TeamsTeamNameCommentsCommentIdResponse
}
/**
* @summary List all team comments
*/
export type getV1TeamsTeamNameCommentsResponse200 = {
data: GetV1TeamsTeamNameComments200
status: 200
}
export type getV1TeamsTeamNameCommentsResponse400 = {
data: ErrorResponseBody
status: 400
}
export type getV1TeamsTeamNameCommentsResponseComposite = getV1TeamsTeamNameCommentsResponse200 | getV1TeamsTeamNameCommentsResponse400;
export type getV1TeamsTeamNameCommentsResponse = getV1TeamsTeamNameCommentsResponseComposite & {
headers: Headers;
}
export const getGetV1TeamsTeamNameCommentsUrl = (teamName: string,) => {
return `https://api.esa.io/v1/teams/${teamName}/comments`
}
export const getV1TeamsTeamNameComments = async (teamName: string, options?: RequestInit): Promise<getV1TeamsTeamNameCommentsResponse> => {
const res = await fetch(getGetV1TeamsTeamNameCommentsUrl(teamName),
{
...options,
method: 'GET'
}
)
const body = [204, 205, 304].includes(res.status) ? null : await res.text()
const data: getV1TeamsTeamNameCommentsResponse['data'] = body ? JSON.parse(body) : {}
return { data, status: res.status, headers: res.headers } as getV1TeamsTeamNameCommentsResponse
}
/**
* @summary List post stargazers
*/
export type getV1TeamsTeamNamePostsPostNumberStargazersResponse200 = {
data: GetV1TeamsTeamNamePostsPostNumberStargazers200
status: 200
}
export type getV1TeamsTeamNamePostsPostNumberStargazersResponse400 = {
data: ErrorResponseBody
status: 400
}
export type getV1TeamsTeamNamePostsPostNumberStargazersResponseComposite = getV1TeamsTeamNamePostsPostNumberStargazersResponse200 | getV1TeamsTeamNamePostsPostNumberStargazersResponse400;
export type getV1TeamsTeamNamePostsPostNumberStargazersResponse = getV1TeamsTeamNamePostsPostNumberStargazersResponseComposite & {
headers: Headers;
}
export const getGetV1TeamsTeamNamePostsPostNumberStargazersUrl = (teamName: string,
postNumber: number,) => {
return `https://api.esa.io/v1/teams/${teamName}/posts/${postNumber}/stargazers`
}
export const getV1TeamsTeamNamePostsPostNumberStargazers = async (teamName: string,
postNumber: number, options?: RequestInit): Promise<getV1TeamsTeamNamePostsPostNumberStargazersResponse> => {
const res = await fetch(getGetV1TeamsTeamNamePostsPostNumberStargazersUrl(teamName,postNumber),
{
...options,
method: 'GET'
}
)
const body = [204, 205, 304].includes(res.status) ? null : await res.text()
const data: getV1TeamsTeamNamePostsPostNumberStargazersResponse['data'] = body ? JSON.parse(body) : {}
return { data, status: res.status, headers: res.headers } as getV1TeamsTeamNamePostsPostNumberStargazersResponse
}
/**
* @summary Star a post
*/
export type postV1TeamsTeamNamePostsPostNumberStarResponse204 = {
data: void
status: 204
}
export type postV1TeamsTeamNamePostsPostNumberStarResponse400 = {
data: ErrorResponseBody
status: 400
}
export type postV1TeamsTeamNamePostsPostNumberStarResponseComposite = postV1TeamsTeamNamePostsPostNumberStarResponse204 | postV1TeamsTeamNamePostsPostNumberStarResponse400;
export type postV1TeamsTeamNamePostsPostNumberStarResponse = postV1TeamsTeamNamePostsPostNumberStarResponseComposite & {
headers: Headers;
}
export const getPostV1TeamsTeamNamePostsPostNumberStarUrl = (teamName: string,
postNumber: number,) => {
return `https://api.esa.io/v1/teams/${teamName}/posts/${postNumber}/star`
}
export const postV1TeamsTeamNamePostsPostNumberStar = async (teamName: string,
postNumber: number,
postV1TeamsTeamNamePostsPostNumberStarBody: PostV1TeamsTeamNamePostsPostNumberStarBody, options?: RequestInit): Promise<postV1TeamsTeamNamePostsPostNumberStarResponse> => {
const res = await fetch(getPostV1TeamsTeamNamePostsPostNumberStarUrl(teamName,postNumber),
{
...options,
method: 'POST',
headers: { 'Content-Type': 'application/json', ...options?.headers },
body: JSON.stringify(
postV1TeamsTeamNamePostsPostNumberStarBody,)
}
)
const body = [204, 205, 304].includes(res.status) ? null : await res.text()
const data: postV1TeamsTeamNamePostsPostNumberStarResponse['data'] = body ? JSON.parse(body) : {}
return { data, status: res.status, headers: res.headers } as postV1TeamsTeamNamePostsPostNumberStarResponse
}
/**
* @summary Unstar a post
*/
export type deleteV1TeamsTeamNamePostsPostNumberStarResponse204 = {
data: void
status: 204
}
export type deleteV1TeamsTeamNamePostsPostNumberStarResponse400 = {
data: ErrorResponseBody
status: 400
}
export type deleteV1TeamsTeamNamePostsPostNumberStarResponseComposite = deleteV1TeamsTeamNamePostsPostNumberStarResponse204 | deleteV1TeamsTeamNamePostsPostNumberStarResponse400;
export type deleteV1TeamsTeamNamePostsPostNumberStarResponse = deleteV1TeamsTeamNamePostsPostNumberStarResponseComposite & {
headers: Headers;
}
export const getDeleteV1TeamsTeamNamePostsPostNumberStarUrl = (teamName: string,
postNumber: number,) => {
return `https://api.esa.io/v1/teams/${teamName}/posts/${postNumber}/star`
}
export const deleteV1TeamsTeamNamePostsPostNumberStar = async (teamName: string,
postNumber: number, options?: RequestInit): Promise<deleteV1TeamsTeamNamePostsPostNumberStarResponse> => {
const res = await fetch(getDeleteV1TeamsTeamNamePostsPostNumberStarUrl(teamName,postNumber),
{
...options,
method: 'DELETE'
}
)
const body = [204, 205, 304].includes(res.status) ? null : await res.text()
const data: deleteV1TeamsTeamNamePostsPostNumberStarResponse['data'] = body ? JSON.parse(body) : {}
return { data, status: res.status, headers: res.headers } as deleteV1TeamsTeamNamePostsPostNumberStarResponse
}
/**
* @summary List comment stargazers
*/
export type getV1TeamsTeamNameCommentsCommentIdStargazersResponse200 = {
data: GetV1TeamsTeamNameCommentsCommentIdStargazers200
status: 200
}
export type getV1TeamsTeamNameCommentsCommentIdStargazersResponse400 = {
data: ErrorResponseBody
status: 400
}
export type getV1TeamsTeamNameCommentsCommentIdStargazersResponseComposite = getV1TeamsTeamNameCommentsCommentIdStargazersResponse200 | getV1TeamsTeamNameCommentsCommentIdStargazersResponse400;
export type getV1TeamsTeamNameCommentsCommentIdStargazersResponse = getV1TeamsTeamNameCommentsCommentIdStargazersResponseComposite & {
headers: Headers;
}
export const getGetV1TeamsTeamNameCommentsCommentIdStargazersUrl = (teamName: string,
commentId: number,) => {
return `https://api.esa.io/v1/teams/${teamName}/comments/${commentId}/stargazers`
}
export const getV1TeamsTeamNameCommentsCommentIdStargazers = async (teamName: string,
commentId: number, options?: RequestInit): Promise<getV1TeamsTeamNameCommentsCommentIdStargazersResponse> => {
const res = await fetch(getGetV1TeamsTeamNameCommentsCommentIdStargazersUrl(teamName,commentId),
{
...options,
method: 'GET'
}
)
const body = [204, 205, 304].includes(res.status) ? null : await res.text()
const data: getV1TeamsTeamNameCommentsCommentIdStargazersResponse['data'] = body ? JSON.parse(body) : {}
return { data, status: res.status, headers: res.headers } as getV1TeamsTeamNameCommentsCommentIdStargazersResponse
}
/**
* @summary Star a comment
*/
export type postV1TeamsTeamNameCommentsCommentIdStarResponse204 = {
data: void
status: 204
}
export type postV1TeamsTeamNameCommentsCommentIdStarResponse400 = {
data: ErrorResponseBody
status: 400
}
export type postV1TeamsTeamNameCommentsCommentIdStarResponseComposite = postV1TeamsTeamNameCommentsCommentIdStarResponse204 | postV1TeamsTeamNameCommentsCommentIdStarResponse400;
export type postV1TeamsTeamNameCommentsCommentIdStarResponse = postV1TeamsTeamNameCommentsCommentIdStarResponseComposite & {
headers: Headers;
}
export const getPostV1TeamsTeamNameCommentsCommentIdStarUrl = (teamName: string,
commentId: number,) => {
return `https://api.esa.io/v1/teams/${teamName}/comments/${commentId}/star`
}
export const postV1TeamsTeamNameCommentsCommentIdStar = async (teamName: string,
commentId: number,
postV1TeamsTeamNameCommentsCommentIdStarBody: PostV1TeamsTeamNameCommentsCommentIdStarBody, options?: RequestInit): Promise<postV1TeamsTeamNameCommentsCommentIdStarResponse> => {
const res = await fetch(getPostV1TeamsTeamNameCommentsCommentIdStarUrl(teamName,commentId),
{
...options,
method: 'POST',
headers: { 'Content-Type': 'application/json', ...options?.headers },
body: JSON.stringify(
postV1TeamsTeamNameCommentsCommentIdStarBody,)
}
)
const body = [204, 205, 304].includes(res.status) ? null : await res.text()
const data: postV1TeamsTeamNameCommentsCommentIdStarResponse['data'] = body ? JSON.parse(body) : {}
return { data, status: res.status, headers: res.headers } as postV1TeamsTeamNameCommentsCommentIdStarResponse
}
/**
* @summary Unstar a comment
*/
export type deleteV1TeamsTeamNameCommentsCommentIdStarResponse204 = {
data: void
status: 204
}
export type deleteV1TeamsTeamNameCommentsCommentIdStarResponse400 = {
data: ErrorResponseBody
status: 400
}
export type deleteV1TeamsTeamNameCommentsCommentIdStarResponseComposite = deleteV1TeamsTeamNameCommentsCommentIdStarResponse204 | deleteV1TeamsTeamNameCommentsCommentIdStarResponse400;
export type deleteV1TeamsTeamNameCommentsCommentIdStarResponse = deleteV1TeamsTeamNameCommentsCommentIdStarResponseComposite & {
headers: Headers;
}
export const getDeleteV1TeamsTeamNameCommentsCommentIdStarUrl = (teamName: string,
commentId: number,) => {
return `https://api.esa.io/v1/teams/${teamName}/comments/${commentId}/star`
}
export const deleteV1TeamsTeamNameCommentsCommentIdStar = async (teamName: string,
commentId: number, options?: RequestInit): Promise<deleteV1TeamsTeamNameCommentsCommentIdStarResponse> => {
const res = await fetch(getDeleteV1TeamsTeamNameCommentsCommentIdStarUrl(teamName,commentId),
{
...options,
method: 'DELETE'
}
)
const body = [204, 205, 304].includes(res.status) ? null : await res.text()
const data: deleteV1TeamsTeamNameCommentsCommentIdStarResponse['data'] = body ? JSON.parse(body) : {}
return { data, status: res.status, headers: res.headers } as deleteV1TeamsTeamNameCommentsCommentIdStarResponse
}
/**
* @summary List post watchers
*/
export type getV1TeamsTeamNamePostsPostNumberWatchersResponse200 = {
data: GetV1TeamsTeamNamePostsPostNumberWatchers200
status: 200
}
export type getV1TeamsTeamNamePostsPostNumberWatchersResponse400 = {
data: ErrorResponseBody
status: 400
}
export type getV1TeamsTeamNamePostsPostNumberWatchersResponseComposite = getV1TeamsTeamNamePostsPostNumberWatchersResponse200 | getV1TeamsTeamNamePostsPostNumberWatchersResponse400;
export type getV1TeamsTeamNamePostsPostNumberWatchersResponse = getV1TeamsTeamNamePostsPostNumberWatchersResponseComposite & {
headers: Headers;
}
export const getGetV1TeamsTeamNamePostsPostNumberWatchersUrl = (teamName: string,
postNumber: number,) => {
return `https://api.esa.io/v1/teams/${teamName}/posts/${postNumber}/watchers`
}
export const getV1TeamsTeamNamePostsPostNumberWatchers = async (teamName: string,
postNumber: number, options?: RequestInit): Promise<getV1TeamsTeamNamePostsPostNumberWatchersResponse> => {
const res = await fetch(getGetV1TeamsTeamNamePostsPostNumberWatchersUrl(teamName,postNumber),
{
...options,
method: 'GET'
}
)
const body = [204, 205, 304].includes(res.status) ? null : await res.text()
const data: getV1TeamsTeamNamePostsPostNumberWatchersResponse['data'] = body ? JSON.parse(body) : {}
return { data, status: res.status, headers: res.headers } as getV1TeamsTeamNamePostsPostNumberWatchersResponse
}
/**
* @summary Watch a post
*/
export type postV1TeamsTeamNamePostsPostNumberWatchResponse204 = {
data: void
status: 204
}
export type postV1TeamsTeamNamePostsPostNumberWatchResponse400 = {
data: ErrorResponseBody
status: 400
}
export type postV1TeamsTeamNamePostsPostNumberWatchResponseComposite = postV1TeamsTeamNamePostsPostNumberWatchResponse204 | postV1TeamsTeamNamePostsPostNumberWatchResponse400;
export type postV1TeamsTeamNamePostsPostNumberWatchResponse = postV1TeamsTeamNamePostsPostNumberWatchResponseComposite & {
headers: Headers;
}
export const getPostV1TeamsTeamNamePostsPostNumberWatchUrl = (teamName: string,
postNumber: number,) => {
return `https://api.esa.io/v1/teams/${teamName}/posts/${postNumber}/watch`
}
export const postV1TeamsTeamNamePostsPostNumberWatch = async (teamName: string,
postNumber: number, options?: RequestInit): Promise<postV1TeamsTeamNamePostsPostNumberWatchResponse> => {
const res = await fetch(getPostV1TeamsTeamNamePostsPostNumberWatchUrl(teamName,postNumber),
{
...options,
method: 'POST'
}
)
const body = [204, 205, 304].includes(res.status) ? null : await res.text()
const data: postV1TeamsTeamNamePostsPostNumberWatchResponse['data'] = body ? JSON.parse(body) : {}
return { data, status: res.status, headers: res.headers } as postV1TeamsTeamNamePostsPostNumberWatchResponse
}
/**
* @summary Unwatch a post
*/
export type deleteV1TeamsTeamNamePostsPostNumberWatchResponse204 = {
data: void
status: 204
}
export type deleteV1TeamsTeamNamePostsPostNumberWatchResponse400 = {
data: ErrorResponseBody
status: 400
}
export type deleteV1TeamsTeamNamePostsPostNumberWatchResponseComposite = deleteV1TeamsTeamNamePostsPostNumberWatchResponse204 | deleteV1TeamsTeamNamePostsPostNumberWatchResponse400;
export type deleteV1TeamsTeamNamePostsPostNumberWatchResponse = deleteV1TeamsTeamNamePostsPostNumberWatchResponseComposite & {
headers: Headers;
}
export const getDeleteV1TeamsTeamNamePostsPostNumberWatchUrl = (teamName: string,
postNumber: number,) => {
return `https://api.esa.io/v1/teams/${teamName}/posts/${postNumber}/watch`
}
export const deleteV1TeamsTeamNamePostsPostNumberWatch = async (teamName: string,
postNumber: number, options?: RequestInit): Promise<deleteV1TeamsTeamNamePostsPostNumberWatchResponse> => {
const res = await fetch(getDeleteV1TeamsTeamNamePostsPostNumberWatchUrl(teamName,postNumber),
{
...options,
method: 'DELETE'
}
)
const body = [204, 205, 304].includes(res.status) ? null : await res.text()
const data: deleteV1TeamsTeamNamePostsPostNumberWatchResponse['data'] = body ? JSON.parse(body) : {}
return { data, status: res.status, headers: res.headers } as deleteV1TeamsTeamNamePostsPostNumberWatchResponse
}
/**
* @summary Batch move categories
*/
export type postV1TeamsTeamNameCategoriesBatchMoveResponse200 = {
data: PostV1TeamsTeamNameCategoriesBatchMove200
status: 200
}
export type postV1TeamsTeamNameCategoriesBatchMoveResponse400 = {
data: ErrorResponseBody
status: 400
}
export type postV1TeamsTeamNameCategoriesBatchMoveResponseComposite = postV1TeamsTeamNameCategoriesBatchMoveResponse200 | postV1TeamsTeamNameCategoriesBatchMoveResponse400;
export type postV1TeamsTeamNameCategoriesBatchMoveResponse = postV1TeamsTeamNameCategoriesBatchMoveResponseComposite & {
headers: Headers;
}
export const getPostV1TeamsTeamNameCategoriesBatchMoveUrl = (teamName: string,) => {
return `https://api.esa.io/v1/teams/${teamName}/categories/batch_move`
}
export const postV1TeamsTeamNameCategoriesBatchMove = async (teamName: string,
postV1TeamsTeamNameCategoriesBatchMoveBody: PostV1TeamsTeamNameCategoriesBatchMoveBody, options?: RequestInit): Promise<postV1TeamsTeamNameCategoriesBatchMoveResponse> => {
const res = await fetch(getPostV1TeamsTeamNameCategoriesBatchMoveUrl(teamName),
{
...options,
method: 'POST',
headers: { 'Content-Type': 'application/json', ...options?.headers },
body: JSON.stringify(
postV1TeamsTeamNameCategoriesBatchMoveBody,)
}
)
const body = [204, 205, 304].includes(res.status) ? null : await res.text()
const data: postV1TeamsTeamNameCategoriesBatchMoveResponse['data'] = body ? JSON.parse(body) : {}
return { data, status: res.status, headers: res.headers } as postV1TeamsTeamNameCategoriesBatchMoveResponse
}
/**
* @summary List tags
*/
export type getV1TeamsTeamNameTagsResponse200 = {
data: GetV1TeamsTeamNameTags200
status: 200
}
export type getV1TeamsTeamNameTagsResponse400 = {
data: ErrorResponseBody
status: 400
}
export type getV1TeamsTeamNameTagsResponseComposite = getV1TeamsTeamNameTagsResponse200 | getV1TeamsTeamNameTagsResponse400;
export type getV1TeamsTeamNameTagsResponse = getV1TeamsTeamNameTagsResponseComposite & {
headers: Headers;
}
export const getGetV1TeamsTeamNameTagsUrl = (teamName: string,) => {
return `https://api.esa.io/v1/teams/${teamName}/tags`
}
export const getV1TeamsTeamNameTags = async (teamName: string, options?: RequestInit): Promise<getV1TeamsTeamNameTagsResponse> => {
const res = await fetch(getGetV1TeamsTeamNameTagsUrl(teamName),
{
...options,
method: 'GET'
}
)
const body = [204, 205, 304].includes(res.status) ? null : await res.text()
const data: getV1TeamsTeamNameTagsResponse['data'] = body ? JSON.parse(body) : {}
return { data, status: res.status, headers: res.headers } as getV1TeamsTeamNameTagsResponse
}
/**
* @summary Get team invitation URL
*/
export type getV1TeamsTeamNameInvitationResponse200 = {
data: GetV1TeamsTeamNameInvitation200
status: 200
}
export type getV1TeamsTeamNameInvitationResponse400 = {
data: ErrorResponseBody
status: 400
}
export type getV1TeamsTeamNameInvitationResponseComposite = getV1TeamsTeamNameInvitationResponse200 | getV1TeamsTeamNameInvitationResponse400;
export type getV1TeamsTeamNameInvitationResponse = getV1TeamsTeamNameInvitationResponseComposite & {
headers: Headers;
}
export const getGetV1TeamsTeamNameInvitationUrl = (teamName: string,) => {
return `https://api.esa.io/v1/teams/${teamName}/invitation`
}
export const getV1TeamsTeamNameInvitation = async (teamName: string, options?: RequestInit): Promise<getV1TeamsTeamNameInvitationResponse> => {
const res = await fetch(getGetV1TeamsTeamNameInvitationUrl(teamName),
{
...options,
method: 'GET'
}
)
const body = [204, 205, 304].includes(res.status) ? null : await res.text()
const data: getV1TeamsTeamNameInvitationResponse['data'] = body ? JSON.parse(body) : {}
return { data, status: res.status, headers: res.headers } as getV1TeamsTeamNameInvitationResponse
}
/**
* @summary Regenerate team invitation URL
*/
export type postV1TeamsTeamNameInvitationRegeneratorResponse200 = {
data: PostV1TeamsTeamNameInvitationRegenerator200
status: 200
}
export type postV1TeamsTeamNameInvitationRegeneratorResponse400 = {
data: ErrorResponseBody
status: 400
}
export type postV1TeamsTeamNameInvitationRegeneratorResponseComposite = postV1TeamsTeamNameInvitationRegeneratorResponse200 | postV1TeamsTeamNameInvitationRegeneratorResponse400;
export type postV1TeamsTeamNameInvitationRegeneratorResponse = postV1TeamsTeamNameInvitationRegeneratorResponseComposite & {
headers: Headers;
}
export const getPostV1TeamsTeamNameInvitationRegeneratorUrl = (teamName: string,) => {
return `https://api.esa.io/v1/teams/${teamName}/invitation_regenerator`
}
export const postV1TeamsTeamNameInvitationRegenerator = async (teamName: string, options?: RequestInit): Promise<postV1TeamsTeamNameInvitationRegeneratorResponse> => {
const res = await fetch(getPostV1TeamsTeamNameInvitationRegeneratorUrl(teamName),
{
...options,
method: 'POST'
}
)
const body = [204, 205, 304].includes(res.status) ? null : await res.text()
const data: postV1TeamsTeamNameInvitationRegeneratorResponse['data'] = body ? JSON.parse(body) : {}
return { data, status: res.status, headers: res.headers } as postV1TeamsTeamNameInvitationRegeneratorResponse
}
/**
* @summary List pending invitations
*/
export type getV1TeamsTeamNameInvitationsResponse200 = {
data: GetV1TeamsTeamNameInvitations200
status: 200
}
export type getV1TeamsTeamNameInvitationsResponse400 = {
data: ErrorResponseBody
status: 400
}
export type getV1TeamsTeamNameInvitationsResponseComposite = getV1TeamsTeamNameInvitationsResponse200 | getV1TeamsTeamNameInvitationsResponse400;
export type getV1TeamsTeamNameInvitationsResponse = getV1TeamsTeamNameInvitationsResponseComposite & {
headers: Headers;
}
export const getGetV1TeamsTeamNameInvitationsUrl = (teamName: string,) => {
return `https://api.esa.io/v1/teams/${teamName}/invitations`
}
export const getV1TeamsTeamNameInvitations = async (teamName: string, options?: RequestInit): Promise<getV1TeamsTeamNameInvitationsResponse> => {
const res = await fetch(getGetV1TeamsTeamNameInvitationsUrl(teamName),
{
...options,
method: 'GET'
}
)
const body = [204, 205, 304].includes(res.status) ? null : await res.text()
const data: getV1TeamsTeamNameInvitationsResponse['data'] = body ? JSON.parse(body) : {}
return { data, status: res.status, headers: res.headers } as getV1TeamsTeamNameInvitationsResponse
}
/**
* @summary Send email invitations
*/
export type postV1TeamsTeamNameInvitationsResponse201 = {
data: PostV1TeamsTeamNameInvitations201
status: 201
}
export type postV1TeamsTeamNameInvitationsResponse400 = {
data: ErrorResponseBody
status: 400
}
export type postV1TeamsTeamNameInvitationsResponseComposite = postV1TeamsTeamNameInvitationsResponse201 | postV1TeamsTeamNameInvitationsResponse400;
export type postV1TeamsTeamNameInvitationsResponse = postV1TeamsTeamNameInvitationsResponseComposite & {
headers: Headers;
}
export const getPostV1TeamsTeamNameInvitationsUrl = (teamName: string,) => {
return `https://api.esa.io/v1/teams/${teamName}/invitations`
}
export const postV1TeamsTeamNameInvitations = async (teamName: string,
postV1TeamsTeamNameInvitationsBody: PostV1TeamsTeamNameInvitationsBody, options?: RequestInit): Promise<postV1TeamsTeamNameInvitationsResponse> => {
const res = await fetch(getPostV1TeamsTeamNameInvitationsUrl(teamName),
{
...options,
method: 'POST',
headers: { 'Content-Type': 'application/json', ...options?.headers },
body: JSON.stringify(
postV1TeamsTeamNameInvitationsBody,)
}
)
const body = [204, 205, 304].includes(res.status) ? null : await res.text()
const data: postV1TeamsTeamNameInvitationsResponse['data'] = body ? JSON.parse(body) : {}
return { data, status: res.status, headers: res.headers } as postV1TeamsTeamNameInvitationsResponse
}
/**
* @summary Delete an invitation
*/
export type deleteV1TeamsTeamNameInvitationsCodeResponse204 = {
data: void
status: 204
}
export type deleteV1TeamsTeamNameInvitationsCodeResponse400 = {
data: ErrorResponseBody
status: 400
}
export type deleteV1TeamsTeamNameInvitationsCodeResponseComposite = deleteV1TeamsTeamNameInvitationsCodeResponse204 | deleteV1TeamsTeamNameInvitationsCodeResponse400;
export type deleteV1TeamsTeamNameInvitationsCodeResponse = deleteV1TeamsTeamNameInvitationsCodeResponseComposite & {
headers: Headers;
}
export const getDeleteV1TeamsTeamNameInvitationsCodeUrl = (teamName: string,
code: string,) => {
return `https://api.esa.io/v1/teams/${teamName}/invitations/${code}`
}
export const deleteV1TeamsTeamNameInvitationsCode = async (teamName: string,
code: string, options?: RequestInit): Promise<deleteV1TeamsTeamNameInvitationsCodeResponse> => {
const res = await fetch(getDeleteV1TeamsTeamNameInvitationsCodeUrl(teamName,code),
{
...options,
method: 'DELETE'
}
)
const body = [204, 205, 304].includes(res.status) ? null : await res.text()
const data: deleteV1TeamsTeamNameInvitationsCodeResponse['data'] = body ? JSON.parse(body) : {}
return { data, status: res.status, headers: res.headers } as deleteV1TeamsTeamNameInvitationsCodeResponse
}
/**
* @summary List emojis
*/
export type getV1TeamsTeamNameEmojisResponse200 = {
data: GetV1TeamsTeamNameEmojis200
status: 200
}
export type getV1TeamsTeamNameEmojisResponse400 = {
data: ErrorResponseBody
status: 400
}
export type getV1TeamsTeamNameEmojisResponseComposite = getV1TeamsTeamNameEmojisResponse200 | getV1TeamsTeamNameEmojisResponse400;
export type getV1TeamsTeamNameEmojisResponse = getV1TeamsTeamNameEmojisResponseComposite & {
headers: Headers;
}
export const getGetV1TeamsTeamNameEmojisUrl = (teamName: string,
params?: GetV1TeamsTeamNameEmojisParams,) => {
const normalizedParams = new URLSearchParams();
Object.entries(params || {}).forEach(([key, value]) => {
if (value !== undefined) {
normalizedParams.append(key, value === null ? 'null' : value.toString())
}
});
const stringifiedParams = normalizedParams.toString();
return stringifiedParams.length > 0 ? `https://api.esa.io/v1/teams/${teamName}/emojis?${stringifiedParams}` : `https://api.esa.io/v1/teams/${teamName}/emojis`
}
export const getV1TeamsTeamNameEmojis = async (teamName: string,
params?: GetV1TeamsTeamNameEmojisParams, options?: RequestInit): Promise<getV1TeamsTeamNameEmojisResponse> => {
const res = await fetch(getGetV1TeamsTeamNameEmojisUrl(teamName,params),
{
...options,
method: 'GET'
}
)
const body = [204, 205, 304].includes(res.status) ? null : await res.text()
const data: getV1TeamsTeamNameEmojisResponse['data'] = body ? JSON.parse(body) : {}
return { data, status: res.status, headers: res.headers } as getV1TeamsTeamNameEmojisResponse
}
/**
* @summary Create a new emoji
*/
export type postV1TeamsTeamNameEmojisResponse201 = {
data: PostV1TeamsTeamNameEmojis201
status: 201
}
export type postV1TeamsTeamNameEmojisResponse400 = {
data: ErrorResponseBody
status: 400
}
export type postV1TeamsTeamNameEmojisResponseComposite = postV1TeamsTeamNameEmojisResponse201 | postV1TeamsTeamNameEmojisResponse400;
export type postV1TeamsTeamNameEmojisResponse = postV1TeamsTeamNameEmojisResponseComposite & {
headers: Headers;
}
export const getPostV1TeamsTeamNameEmojisUrl = (teamName: string,) => {
return `https://api.esa.io/v1/teams/${teamName}/emojis`
}
export const postV1TeamsTeamNameEmojis = async (teamName: string,
postV1TeamsTeamNameEmojisBody: PostV1TeamsTeamNameEmojisBodyOne | PostV1TeamsTeamNameEmojisBodyTwo, options?: RequestInit): Promise<postV1TeamsTeamNameEmojisResponse> => {
const res = await fetch(getPostV1TeamsTeamNameEmojisUrl(teamName),
{
...options,
method: 'POST'
,
body: JSON.stringify(
postV1TeamsTeamNameEmojisBody,)
}
)
const body = [204, 205, 304].includes(res.status) ? null : await res.text()
const data: postV1TeamsTeamNameEmojisResponse['data'] = body ? JSON.parse(body) : {}
return { data, status: res.status, headers: res.headers } as postV1TeamsTeamNameEmojisResponse
}
/**
* @summary Delete an emoji
*/
export type deleteV1TeamsTeamNameEmojisCodeResponse204 = {
data: void
status: 204
}
export type deleteV1TeamsTeamNameEmojisCodeResponse400 = {
data: ErrorResponseBody
status: 400
}
export type deleteV1TeamsTeamNameEmojisCodeResponseComposite = deleteV1TeamsTeamNameEmojisCodeResponse204 | deleteV1TeamsTeamNameEmojisCodeResponse400;
export type deleteV1TeamsTeamNameEmojisCodeResponse = deleteV1TeamsTeamNameEmojisCodeResponseComposite & {
headers: Headers;
}
export const getDeleteV1TeamsTeamNameEmojisCodeUrl = (teamName: string,
code: string,) => {
return `https://api.esa.io/v1/teams/${teamName}/emojis/${code}`
}
export const deleteV1TeamsTeamNameEmojisCode = async (teamName: string,
code: string, options?: RequestInit): Promise<deleteV1TeamsTeamNameEmojisCodeResponse> => {
const res = await fetch(getDeleteV1TeamsTeamNameEmojisCodeUrl(teamName,code),
{
...options,
method: 'DELETE'
}
)
const body = [204, 205, 304].includes(res.status) ? null : await res.text()
const data: deleteV1TeamsTeamNameEmojisCodeResponse['data'] = body ? JSON.parse(body) : {}
return { data, status: res.status, headers: res.headers } as deleteV1TeamsTeamNameEmojisCodeResponse
}
/**
* @summary Get authenticated user
*/
export type getV1UserResponse200 = {
data: GetV1User200
status: 200
}
export type getV1UserResponse400 = {
data: ErrorResponseBody
status: 400
}
export type getV1UserResponseComposite = getV1UserResponse200 | getV1UserResponse400;
export type getV1UserResponse = getV1UserResponseComposite & {
headers: Headers;
}
export const getGetV1UserUrl = (params?: GetV1UserParams,) => {
const normalizedParams = new URLSearchParams();
Object.entries(params || {}).forEach(([key, value]) => {
if (value !== undefined) {
normalizedParams.append(key, value === null ? 'null' : value.toString())
}
});
const stringifiedParams = normalizedParams.toString();
return stringifiedParams.length > 0 ? `https://api.esa.io/v1/user?${stringifiedParams}` : `https://api.esa.io/v1/user`
}
export const getV1User = async (params?: GetV1UserParams, options?: RequestInit): Promise<getV1UserResponse> => {
const res = await fetch(getGetV1UserUrl(params),
{
...options,
method: 'GET'
}
)
const body = [204, 205, 304].includes(res.status) ? null : await res.text()
const data: getV1UserResponse['data'] = body ? JSON.parse(body) : {}
return { data, status: res.status, headers: res.headers } as getV1UserResponse
}