variables.ts 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. // @ts-ignore
  2. /* eslint-disable */
  3. import request from '@repo/api-client'
  4. /** Retrieve variables Retrieve variables from your instance. GET /variables */
  5. export async function getVariables(
  6. // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  7. params: API.getVariablesParams,
  8. options?: { [key: string]: any }
  9. ) {
  10. return request<API.variableList>('/variables', {
  11. method: 'GET',
  12. params: {
  13. // limit has a default value: 100
  14. limit: '100',
  15. ...params
  16. },
  17. ...(options || {})
  18. })
  19. }
  20. /** Create a variable Create a variable in your instance. POST /variables */
  21. export async function postVariables(body: API.create, options?: { [key: string]: any }) {
  22. return request<any>('/variables', {
  23. method: 'POST',
  24. headers: {
  25. 'Content-Type': 'application/json'
  26. },
  27. data: body,
  28. ...(options || {})
  29. })
  30. }
  31. /** Update a variable Update a variable from your instance. PUT /variables/${param0} */
  32. export async function putVariablesId(
  33. // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  34. params: API.putVariablesIdParams,
  35. body: API.create,
  36. options?: { [key: string]: any }
  37. ) {
  38. const { id: param0, ...queryParams } = params
  39. return request<any>(`/variables/${param0}`, {
  40. method: 'PUT',
  41. headers: {
  42. 'Content-Type': 'application/json'
  43. },
  44. params: { ...queryParams },
  45. data: body,
  46. ...(options || {})
  47. })
  48. }
  49. /** Delete a variable Delete a variable from your instance. DELETE /variables/${param0} */
  50. export async function deleteVariablesId(
  51. // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  52. params: API.deleteVariablesIdParams,
  53. options?: { [key: string]: any }
  54. ) {
  55. const { id: param0, ...queryParams } = params
  56. return request<any>(`/variables/${param0}`, {
  57. method: 'DELETE',
  58. params: { ...queryParams },
  59. ...(options || {})
  60. })
  61. }