|
| 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 | + ConnectAtProtocol, |
| 19 | +} from '../models/index'; |
| 20 | +import { |
| 21 | + ConnectAtProtocolFromJSON, |
| 22 | + ConnectAtProtocolToJSON, |
| 23 | +} from '../models/index'; |
| 24 | + |
| 25 | +export interface ConnectAtProtocolRequest { |
| 26 | + connectAtProtocol: ConnectAtProtocol; |
| 27 | +} |
| 28 | + |
| 29 | +export interface SyncAtProtocolActorRequest { |
| 30 | + handle: string; |
| 31 | +} |
| 32 | + |
| 33 | +/** |
| 34 | + * |
| 35 | + */ |
| 36 | +export class AtProtocolApi extends runtime.BaseAPI { |
| 37 | + |
| 38 | + /** |
| 39 | + * |
| 40 | + */ |
| 41 | + async connectAtProtocolRaw(requestParameters: ConnectAtProtocolRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> { |
| 42 | + if (requestParameters.connectAtProtocol === null || requestParameters.connectAtProtocol === undefined) { |
| 43 | + throw new runtime.RequiredError('connectAtProtocol','Required parameter requestParameters.connectAtProtocol was null or undefined when calling connectAtProtocol.'); |
| 44 | + } |
| 45 | + |
| 46 | + const queryParameters: any = {}; |
| 47 | + |
| 48 | + const headerParameters: runtime.HTTPHeaders = {}; |
| 49 | + |
| 50 | + headerParameters['Content-Type'] = 'application/json'; |
| 51 | + |
| 52 | + if (this.configuration && this.configuration.accessToken) { |
| 53 | + const token = this.configuration.accessToken; |
| 54 | + const tokenString = await token("bearer", []); |
| 55 | + |
| 56 | + if (tokenString) { |
| 57 | + headerParameters["Authorization"] = `Bearer ${tokenString}`; |
| 58 | + } |
| 59 | + } |
| 60 | + const response = await this.request({ |
| 61 | + path: `/v0/at-protocol/connect`, |
| 62 | + method: 'POST', |
| 63 | + headers: headerParameters, |
| 64 | + query: queryParameters, |
| 65 | + body: ConnectAtProtocolToJSON(requestParameters.connectAtProtocol), |
| 66 | + }, initOverrides); |
| 67 | + |
| 68 | + return new runtime.VoidApiResponse(response); |
| 69 | + } |
| 70 | + |
| 71 | + /** |
| 72 | + * |
| 73 | + */ |
| 74 | + async connectAtProtocol(requestParameters: ConnectAtProtocolRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> { |
| 75 | + await this.connectAtProtocolRaw(requestParameters, initOverrides); |
| 76 | + } |
| 77 | + |
| 78 | + /** |
| 79 | + * |
| 80 | + */ |
| 81 | + async syncAtProtocolActorRaw(requestParameters: SyncAtProtocolActorRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> { |
| 82 | + if (requestParameters.handle === null || requestParameters.handle === undefined) { |
| 83 | + throw new runtime.RequiredError('handle','Required parameter requestParameters.handle was null or undefined when calling syncAtProtocolActor.'); |
| 84 | + } |
| 85 | + |
| 86 | + const queryParameters: any = {}; |
| 87 | + |
| 88 | + const headerParameters: runtime.HTTPHeaders = {}; |
| 89 | + |
| 90 | + if (this.configuration && this.configuration.accessToken) { |
| 91 | + const token = this.configuration.accessToken; |
| 92 | + const tokenString = await token("bearer", []); |
| 93 | + |
| 94 | + if (tokenString) { |
| 95 | + headerParameters["Authorization"] = `Bearer ${tokenString}`; |
| 96 | + } |
| 97 | + } |
| 98 | + const response = await this.request({ |
| 99 | + path: `/v0/at-protocol/actor/{handle}`.replace(`{${"handle"}}`, encodeURIComponent(String(requestParameters.handle))), |
| 100 | + method: 'POST', |
| 101 | + headers: headerParameters, |
| 102 | + query: queryParameters, |
| 103 | + }, initOverrides); |
| 104 | + |
| 105 | + return new runtime.VoidApiResponse(response); |
| 106 | + } |
| 107 | + |
| 108 | + /** |
| 109 | + * |
| 110 | + */ |
| 111 | + async syncAtProtocolActor(requestParameters: SyncAtProtocolActorRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> { |
| 112 | + await this.syncAtProtocolActorRaw(requestParameters, initOverrides); |
| 113 | + } |
| 114 | + |
| 115 | +} |
0 commit comments