Class: CodeEndpoint
Defined in: api/endpoints/code/CodeEndpoint.ts:13
Endpoints for interacting with promotional codes.
Extends
Constructors
Constructor
new CodeEndpoint(
config,tokenManager,log?,headerProvider?):CodeEndpoint
Defined in: api/endpoints/code/CodeEndpoint.ts:14
Parameters
config
tokenManager
log?
Logger
headerProvider?
HeaderProvider
Returns
CodeEndpoint
Overrides
Properties
config
readonlyconfig:DefaultApiConfig
Defined in: api/endpoints/ApiEndpoint.ts:10
Inherited from
log?
protectedreadonlyoptionallog:Logger
Defined in: api/endpoints/ApiEndpoint.ts:15
Inherited from
tokenManager
readonlytokenManager:TokenManager
Defined in: api/endpoints/ApiEndpoint.ts:14
Inherited from
Methods
deleteRequest()
protecteddeleteRequest(endpoint,queryParams?,noAuthentication?):Promise<ApiResponse<unknown>>
Defined in: api/endpoints/ApiEndpoint.ts:85
Parameters
endpoint
string
queryParams?
noAuthentication?
boolean
Returns
Promise<ApiResponse<unknown>>
Inherited from
endpoint()
protectedendpoint():string
Defined in: api/endpoints/code/CodeEndpoint.ts:18
Returns
string
Overrides
endpointUrl()
protectedendpointUrl():string
Defined in: api/endpoints/ApiEndpoint.ts:23
Returns
string
Inherited from
getRedeemedCodes()
getRedeemedCodes():
Promise<ApiResponse<PromotionalCode[]>>
Defined in: api/endpoints/code/CodeEndpoint.ts:25
Gets the redeemed codes for the current user.
Returns
Promise<ApiResponse<PromotionalCode[]>>
getRequest()
protectedgetRequest<T>(endpoint,queryParams?,noAuthentication?):Promise<ApiResponse<T>>
Defined in: api/endpoints/ApiEndpoint.ts:53
Type Parameters
T
T = unknown
Parameters
endpoint
string
queryParams?
noAuthentication?
boolean
Returns
Promise<ApiResponse<T>>
Inherited from
patchRequest()
protectedpatchRequest<T>(endpoint,data?,noAuthentication?):Promise<ApiResponse<T>>
Defined in: api/endpoints/ApiEndpoint.ts:77
Type Parameters
T
T = unknown
Parameters
endpoint
string
data?
unknown
noAuthentication?
boolean
Returns
Promise<ApiResponse<T>>
Inherited from
postRequest()
protectedpostRequest<T>(endpoint,data?,noAuthentication?):Promise<ApiResponse<T>>
Defined in: api/endpoints/ApiEndpoint.ts:61
Type Parameters
T
T = unknown
Parameters
endpoint
string
data?
unknown
noAuthentication?
boolean
Returns
Promise<ApiResponse<T>>
Inherited from
putRequest()
protectedputRequest<T>(endpoint,data?,noAuthentication?):Promise<ApiResponse<T>>
Defined in: api/endpoints/ApiEndpoint.ts:69
Type Parameters
T
T = unknown
Parameters
endpoint
string
data?
unknown
noAuthentication?
boolean
Returns
Promise<ApiResponse<T>>
Inherited from
redeem()
redeem(
code):Promise<ApiResponse<unknown>>
Defined in: api/endpoints/code/CodeEndpoint.ts:34
Redeems the specified promotional code for the current user
Parameters
code
string
The code to redeem.
Returns
Promise<ApiResponse<unknown>>