import service from '@/utils/request'

export const getIntegrationConfigs = (kind) => service({
  url: `/integration/configs/${encodeURIComponent(kind)}`,
  method: 'get'
})

export const saveIntegrationConfig = (kind, provider, data) => service({
  url: `/integration/configs/${encodeURIComponent(kind)}/${encodeURIComponent(provider)}`,
  method: 'put',
  data
})

export const testIntegrationConfig = (kind, provider, data) => service({
  url: `/integration/configs/${encodeURIComponent(kind)}/${encodeURIComponent(provider)}/test`,
  method: 'post',
  data
})

export const deleteIntegrationConfig = (kind, provider) => service({
  url: `/integration/configs/${encodeURIComponent(kind)}/${encodeURIComponent(provider)}`,
  method: 'delete'
})
