|
| 1 | +/* tslint:disable */ |
| 2 | +/* eslint-disable */ |
| 3 | +/** |
| 4 | + * Bitly API |
| 5 | + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) |
| 6 | + * |
| 7 | + * The version of the OpenAPI document: 4.0.0 |
| 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 | + BSDsResponse, |
| 19 | + BadRequest, |
| 20 | + Forbidden, |
| 21 | + InternalError, |
| 22 | + TemporarilyUnavailable, |
| 23 | +} from '../models/index'; |
| 24 | +import { |
| 25 | + BSDsResponseFromJSON, |
| 26 | + BSDsResponseToJSON, |
| 27 | + BadRequestFromJSON, |
| 28 | + BadRequestToJSON, |
| 29 | + ForbiddenFromJSON, |
| 30 | + ForbiddenToJSON, |
| 31 | + InternalErrorFromJSON, |
| 32 | + InternalErrorToJSON, |
| 33 | + TemporarilyUnavailableFromJSON, |
| 34 | + TemporarilyUnavailableToJSON, |
| 35 | +} from '../models/index'; |
| 36 | + |
| 37 | +/** |
| 38 | + * |
| 39 | + */ |
| 40 | +export class BSDsApi extends runtime.BaseAPI { |
| 41 | + |
| 42 | + /** |
| 43 | + * Fetch all Branded Short Domains |
| 44 | + * Get BSDs |
| 45 | + */ |
| 46 | + async getBSDsRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<BSDsResponse>> { |
| 47 | + const queryParameters: any = {}; |
| 48 | + |
| 49 | + const headerParameters: runtime.HTTPHeaders = {}; |
| 50 | + |
| 51 | + if (this.configuration && this.configuration.accessToken) { |
| 52 | + const token = this.configuration.accessToken; |
| 53 | + const tokenString = await token("bearerAuth", []); |
| 54 | + |
| 55 | + if (tokenString) { |
| 56 | + headerParameters["Authorization"] = `Bearer ${tokenString}`; |
| 57 | + } |
| 58 | + } |
| 59 | + |
| 60 | + let urlPath = `/bsds`; |
| 61 | + |
| 62 | + const response = await this.request({ |
| 63 | + path: urlPath, |
| 64 | + method: 'GET', |
| 65 | + headers: headerParameters, |
| 66 | + query: queryParameters, |
| 67 | + }, initOverrides); |
| 68 | + |
| 69 | + return new runtime.JSONApiResponse(response, (jsonValue) => BSDsResponseFromJSON(jsonValue)); |
| 70 | + } |
| 71 | + |
| 72 | + /** |
| 73 | + * Fetch all Branded Short Domains |
| 74 | + * Get BSDs |
| 75 | + */ |
| 76 | + async getBSDs(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<BSDsResponse> { |
| 77 | + const response = await this.getBSDsRaw(initOverrides); |
| 78 | + return await response.value(); |
| 79 | + } |
| 80 | + |
| 81 | +} |
0 commit comments