|
| 1 | +/* tslint:disable */ |
| 2 | +/* eslint-disable */ |
| 3 | +/** |
| 4 | + * Cuculus API |
| 5 | + * The Cuculus API description |
| 6 | + * |
| 7 | + * The version of the OpenAPI document: 0.0.1 |
| 8 | + * |
| 9 | + * |
| 10 | + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). |
| 11 | + * https://openapi-generator.tech |
| 12 | + * Do not edit the class manually. |
| 13 | + */ |
| 14 | + |
| 15 | + |
| 16 | +import * as runtime from '../runtime'; |
| 17 | +import type { |
| 18 | + Invitation, |
| 19 | + InvitationCodeRequest, |
| 20 | + InvitationsInfo, |
| 21 | +} from '../models/index'; |
| 22 | +import { |
| 23 | + InvitationFromJSON, |
| 24 | + InvitationToJSON, |
| 25 | + InvitationCodeRequestFromJSON, |
| 26 | + InvitationCodeRequestToJSON, |
| 27 | + InvitationsInfoFromJSON, |
| 28 | + InvitationsInfoToJSON, |
| 29 | +} from '../models/index'; |
| 30 | + |
| 31 | +export interface PostInvitationVerifyCodeRequest { |
| 32 | + invitationCodeRequest: InvitationCodeRequest; |
| 33 | +} |
| 34 | + |
| 35 | +/** |
| 36 | + * |
| 37 | + */ |
| 38 | +export class InvitationsApi extends runtime.BaseAPI { |
| 39 | + |
| 40 | + /** |
| 41 | + * 自分が発行した招待コード一覧 |
| 42 | + */ |
| 43 | + async getInvitationsMeRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<InvitationsInfo>> { |
| 44 | + const queryParameters: any = {}; |
| 45 | + |
| 46 | + const headerParameters: runtime.HTTPHeaders = {}; |
| 47 | + |
| 48 | + if (this.configuration && this.configuration.accessToken) { |
| 49 | + const token = this.configuration.accessToken; |
| 50 | + const tokenString = await token("bearer", []); |
| 51 | + |
| 52 | + if (tokenString) { |
| 53 | + headerParameters["Authorization"] = `Bearer ${tokenString}`; |
| 54 | + } |
| 55 | + } |
| 56 | + const response = await this.request({ |
| 57 | + path: `/v0/invitations/me`, |
| 58 | + method: 'GET', |
| 59 | + headers: headerParameters, |
| 60 | + query: queryParameters, |
| 61 | + }, initOverrides); |
| 62 | + |
| 63 | + return new runtime.JSONApiResponse(response, (jsonValue) => InvitationsInfoFromJSON(jsonValue)); |
| 64 | + } |
| 65 | + |
| 66 | + /** |
| 67 | + * 自分が発行した招待コード一覧 |
| 68 | + */ |
| 69 | + async getInvitationsMe(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<InvitationsInfo> { |
| 70 | + const response = await this.getInvitationsMeRaw(initOverrides); |
| 71 | + return await response.value(); |
| 72 | + } |
| 73 | + |
| 74 | + /** |
| 75 | + * 招待コードの確認 |
| 76 | + */ |
| 77 | + async postInvitationVerifyCodeRaw(requestParameters: PostInvitationVerifyCodeRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> { |
| 78 | + if (requestParameters.invitationCodeRequest === null || requestParameters.invitationCodeRequest === undefined) { |
| 79 | + throw new runtime.RequiredError('invitationCodeRequest','Required parameter requestParameters.invitationCodeRequest was null or undefined when calling postInvitationVerifyCode.'); |
| 80 | + } |
| 81 | + |
| 82 | + const queryParameters: any = {}; |
| 83 | + |
| 84 | + const headerParameters: runtime.HTTPHeaders = {}; |
| 85 | + |
| 86 | + headerParameters['Content-Type'] = 'application/json'; |
| 87 | + |
| 88 | + const response = await this.request({ |
| 89 | + path: `/v0/invitations/verify-code`, |
| 90 | + method: 'POST', |
| 91 | + headers: headerParameters, |
| 92 | + query: queryParameters, |
| 93 | + body: InvitationCodeRequestToJSON(requestParameters.invitationCodeRequest), |
| 94 | + }, initOverrides); |
| 95 | + |
| 96 | + return new runtime.VoidApiResponse(response); |
| 97 | + } |
| 98 | + |
| 99 | + /** |
| 100 | + * 招待コードの確認 |
| 101 | + */ |
| 102 | + async postInvitationVerifyCode(requestParameters: PostInvitationVerifyCodeRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> { |
| 103 | + await this.postInvitationVerifyCodeRaw(requestParameters, initOverrides); |
| 104 | + } |
| 105 | + |
| 106 | + /** |
| 107 | + * 招待コードの発行 |
| 108 | + */ |
| 109 | + async postInvitationsCreateRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Invitation>> { |
| 110 | + const queryParameters: any = {}; |
| 111 | + |
| 112 | + const headerParameters: runtime.HTTPHeaders = {}; |
| 113 | + |
| 114 | + if (this.configuration && this.configuration.accessToken) { |
| 115 | + const token = this.configuration.accessToken; |
| 116 | + const tokenString = await token("bearer", []); |
| 117 | + |
| 118 | + if (tokenString) { |
| 119 | + headerParameters["Authorization"] = `Bearer ${tokenString}`; |
| 120 | + } |
| 121 | + } |
| 122 | + const response = await this.request({ |
| 123 | + path: `/v0/invitations/create`, |
| 124 | + method: 'POST', |
| 125 | + headers: headerParameters, |
| 126 | + query: queryParameters, |
| 127 | + }, initOverrides); |
| 128 | + |
| 129 | + return new runtime.JSONApiResponse(response, (jsonValue) => InvitationFromJSON(jsonValue)); |
| 130 | + } |
| 131 | + |
| 132 | + /** |
| 133 | + * 招待コードの発行 |
| 134 | + */ |
| 135 | + async postInvitationsCreate(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Invitation> { |
| 136 | + const response = await this.postInvitationsCreateRaw(initOverrides); |
| 137 | + return await response.value(); |
| 138 | + } |
| 139 | + |
| 140 | +} |
0 commit comments