@lomi./sdk
Version:
Official TypeScript SDK for the lomi. API
108 lines • 3.28 kB
JavaScript
import { OpenAPI } from '../core/OpenAPI.js';
import { request as __request } from '../core/request.js';
export class CustomerService {
/**
* List customers
* Retrieve a paginated list of customers
* @returns any Successful response
* @throws ApiError
*/
static getCustomers({ limit = 20, offset, sort, }) {
return __request(OpenAPI, {
method: 'GET',
url: '/customers',
query: {
'limit': limit,
'offset': offset,
'sort': sort,
},
errors: {
401: `Unauthorized - Invalid or missing API key`,
500: `Internal server error`,
},
});
}
/**
* Create customer
* Create a new customer
* @returns customers Successfully created
* @throws ApiError
*/
static postCustomers({ requestBody, }) {
return __request(OpenAPI, {
method: 'POST',
url: '/customers',
body: requestBody,
mediaType: 'application/json',
errors: {
400: `Bad request - Invalid input`,
401: `Unauthorized - Invalid or missing API key`,
500: `Internal server error`,
},
});
}
/**
* Get customer
* Retrieve a specific customer by ID
* @returns customers Successful response
* @throws ApiError
*/
static getCustomers1({ customerId, }) {
return __request(OpenAPI, {
method: 'GET',
url: '/customers/{customer_id}',
path: {
'customer_id': customerId,
},
errors: {
401: `Unauthorized - Invalid or missing API key`,
404: `Not found - Resource does not exist`,
500: `Internal server error`,
},
});
}
/**
* Update customer
* Update a specific customer
* @returns customers Successfully updated
* @throws ApiError
*/
static patchCustomers({ customerId, requestBody, }) {
return __request(OpenAPI, {
method: 'PATCH',
url: '/customers/{customer_id}',
path: {
'customer_id': customerId,
},
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 customer
* Delete a specific customer
* @returns void
* @throws ApiError
*/
static deleteCustomers({ customerId, }) {
return __request(OpenAPI, {
method: 'DELETE',
url: '/customers/{customer_id}',
path: {
'customer_id': customerId,
},
errors: {
401: `Unauthorized - Invalid or missing API key`,
404: `Not found - Resource does not exist`,
500: `Internal server error`,
},
});
}
}
//# sourceMappingURL=CustomerService.js.map