Birb / APIEndpoint
Class: APIEndpoint<Params, Response, Body>
Type parameters
Name | Type |
---|---|
Params | Params |
Response | Response |
Body | any |
Hierarchy
-
APIEndpoint
Table of contents
Constructors
Properties
Methods
Constructors
constructor
• new APIEndpoint<Params
, Response
, Body
>(client
, method
)
Type parameters
Name | Type |
---|---|
Params | Params |
Response | Response |
Body | any |
Parameters
Name | Type |
---|---|
client | Birb |
method | string |
Defined in
src/classes/api/APIEndpoint.ts:31
Properties
body
• body: undefined
| Body
The request body.
Defined in
src/classes/api/APIEndpoint.ts:29
client
• client: Birb
The Birb client.
Defined in
src/classes/api/APIEndpoint.ts:10
headers
• headers: Object
The parameters to use.
Index signature
▪ [key: string
]: string
Defined in
src/classes/api/APIEndpoint.ts:22
method
• Readonly
method: string
The method for the endpoint.
Defined in
src/classes/api/APIEndpoint.ts:14
params
• params: undefined
| Params
The parameters to use.
Defined in
src/classes/api/APIEndpoint.ts:18
Methods
buildURL
▸ Abstract
buildURL(params
): string
Parameters
Name | Type |
---|---|
params | Params |
Returns
string
Defined in
src/classes/api/APIEndpoint.ts:122
execute
▸ execute(): Promise
<APIResponse
<Response
>>
Returns
Promise
<APIResponse
<Response
>>
Defined in
src/classes/api/APIEndpoint.ts:51
setBody
▸ setBody(body
): APIEndpoint
<Params
, Response
, Body
>
Parameters
Name | Type |
---|---|
body | undefined | Body |
Returns
APIEndpoint
<Params
, Response
, Body
>
Defined in
src/classes/api/APIEndpoint.ts:46
setHeaders
▸ setHeaders(headers
): APIEndpoint
<Params
, Response
, Body
>
Parameters
Name | Type |
---|---|
headers | Object |
Returns
APIEndpoint
<Params
, Response
, Body
>
Defined in
src/classes/api/APIEndpoint.ts:36
setParams
▸ setParams(params
): APIEndpoint
<Params
, Response
, Body
>
Parameters
Name | Type |
---|---|
params | Params |
Returns
APIEndpoint
<Params
, Response
, Body
>
Defined in
src/classes/api/APIEndpoint.ts:41
throwJSONError
▸ throwJSONError(response
, json?
): BirbAPIError
Parameters
Name | Type |
---|---|
response | Response |
json? | any |
Returns
Defined in
src/classes/api/APIEndpoint.ts:124