@lomi./sdk
Version:
Official TypeScript SDK for the lomi. API
108 lines • 3.33 kB
JavaScript
import { OpenAPI } from '../core/OpenAPI.js';
import { request as __request } from '../core/request.js';
export class PricesService {
/**
* List prices
* Pricing tiers - manage product pricing
* @returns any Successful response with paginated data
* @throws ApiError
*/
static listPrices({ 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
* Pricing tiers - manage product pricing
* @returns prices Price successfully created
* @throws ApiError
*/
static createPrice({ 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`,
},
});
}
/**
* Retrieve price
* Retrieve a specific price by its unique identifier.
* @returns prices Price retrieved successfully
* @throws ApiError
*/
static retrievePrice({ 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. Only provided fields will be updated.
* @returns prices Price successfully updated
* @throws ApiError
*/
static updatePrice({ 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. This action cannot be undone.
* @returns void
* @throws ApiError
*/
static deletePrice({ 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=PricesService.js.map