import apiRequest from '@/network/http/apiRequest'

/**
 * 根据Id获取ObjectMapping
 * @param bizId
 * @param objectId
 * @param oamId
 * @returns
 */
export function getObjectOAMMappingListByOamId(bizId: number, objectId: number, oamId: number) {
  return apiRequest({
    url: `/biz/object/oam/mapping/${bizId}/${objectId}/${oamId}`,
    method: 'GET',
  })
}

/**
 * 根据Id获取ObjectMapping
 * @param bizId
 * @param objectId
 * @param oamId
 * @param mappingId
 * @returns
 */
export function getObjectOAMMappingById(bizId: number, objectId: number, oamId: number, mappingId: number) {
  return apiRequest({
    url: `/biz/object/oam/mapping/${bizId}/${objectId}/${oamId}/${mappingId}`,
    method: 'GET',
  })
}

/**
 * 添加ObjectMapping
 * @param data
 * @returns
 */
export function createObjectOAMMapping(data: any) {
  return apiRequest({
    url: '/biz/object/oam/mapping/add',
    method: 'POST',
    data,
  })
}

/**
 * 更新ObjectMapping
 * @param data
 * @returns
 */
export function updateObjectOAMMapping(data: any) {
  return apiRequest({
    url: '/biz/object/oam/mapping/update',
    method: 'PUT',
    data,
  })
}

/**
 * 删除ObjectMapping
 * @param bizId
 * @param objectId
 * @param oamId
 * @param mappingId
 * @returns
 */
export function deleteObjectOAMMappingById(bizId: number, objectId: number, oamId: number, mappingId: number) {
  return apiRequest({
    url: `/biz/object/oam/mapping/${bizId}/${objectId}/${oamId}/${mappingId}`,
    method: 'DELETE',
  })
}
