@lomi./sdk
Version:
Official TypeScript SDK for the lomi. API
108 lines • 3.17 kB
JavaScript
import { OpenAPI } from '../core/OpenAPI.js';
import { request as __request } from '../core/request.js';
export class PriceService {
/**
* List prices
* Retrieve a paginated list of prices
* @returns any Successful response
* @throws ApiError
*/
static getPrices({ limit = 20, offset, sort, }) {
return __request(OpenAPI, {
method: 'GET',
url: '/prices',
query: {
'limit': limit,
'offset': offset,
'sort': sort,
},
errors: {
401: `Unauthorized - Invalid or missing API key`,
500: `Internal server error`,
},
});
}
/**
* Create price
* Create a new price
* @returns prices Successfully created
* @throws ApiError
*/
static postPrices({ requestBody, }) {
return __request(OpenAPI, {
method: 'POST',
url: '/prices',
body: requestBody,
mediaType: 'application/json',
errors: {
400: `Bad request - Invalid input`,
401: `Unauthorized - Invalid or missing API key`,
500: `Internal server error`,
},
});
}
/**
* Get price
* Retrieve a specific price by ID
* @returns prices Successful response
* @throws ApiError
*/
static getPrices1({ priceId, }) {
return __request(OpenAPI, {
method: 'GET',
url: '/prices/{price_id}',
path: {
'price_id': priceId,
},
errors: {
401: `Unauthorized - Invalid or missing API key`,
404: `Not found - Resource does not exist`,
500: `Internal server error`,
},
});
}
/**
* Update price
* Update a specific price
* @returns prices Successfully updated
* @throws ApiError
*/
static patchPrices({ priceId, requestBody, }) {
return __request(OpenAPI, {
method: 'PATCH',
url: '/prices/{price_id}',
path: {
'price_id': priceId,
},
body: requestBody,
mediaType: 'application/json',
errors: {
400: `Bad request - Invalid input`,
401: `Unauthorized - Invalid or missing API key`,
404: `Not found - Resource does not exist`,
500: `Internal server error`,
},
});
}
/**
* Delete price
* Delete a specific price
* @returns void
* @throws ApiError
*/
static deletePrices({ priceId, }) {
return __request(OpenAPI, {
method: 'DELETE',
url: '/prices/{price_id}',
path: {
'price_id': priceId,
},
errors: {
401: `Unauthorized - Invalid or missing API key`,
404: `Not found - Resource does not exist`,
500: `Internal server error`,
},
});
}
}
//# sourceMappingURL=PriceService.js.map