import request from '@/utils/request';
import { ZoomPhoneUserQuery, ZoomPhoneUserForm } from './types';

export function listZoomPhoneUser(query: ZoomPhoneUserQuery) {
  return request({
    url: '/talk/admin/zoomphone/user/list',
    method: 'get',
    params: query
  });
}

export function getZoomPhoneUser(id: string | number) {
  return request({
    url: '/talk/admin/zoomphone/user/' + id,
    method: 'get'
  });
}

export function addZoomPhoneUser(data: ZoomPhoneUserForm) {
  return request({
    url: '/talk/admin/zoomphone/user',
    method: 'post',
    data: data
  });
}

export function updateZoomPhoneUser(data: ZoomPhoneUserForm) {
  return request({
    url: '/talk/admin/zoomphone/user',
    method: 'put',
    data: data
  });
}

export function delZoomPhoneUser(id: string | number | Array<string | number>) {
  return request({
    url: '/talk/admin/zoomphone/user/' + id,
    method: 'delete'
  });
}

export function exportZoomPhoneUser(query: ZoomPhoneUserQuery) {
  return request({
    url: '/talk/admin/zoomphone/user/export',
    method: 'post',
    data: query
  });
}
