Merge branch 'pass-lifetime-fixes' into 'main'
[ProtonMail-WebClient.git] / packages / components / containers / vpn / gateways / api.ts
blobcba777826132c8296bfcbf199e485b50ccaef302
1 import type { GatewayIpModel } from '../gateways/GatewayIpModel';
2 import type { GatewayModel } from './GatewayModel';
4 export const queryVPNGateways = () => ({
5     url: 'vpn/v1/business/gateways',
6     method: 'get',
7 });
9 export const createVPNGateway = (data: GatewayModel) => ({
10     url: 'vpn/v1/business/gateways',
11     method: 'post',
12     data,
13 });
15 export const addIpInVPNGateway = (data: GatewayIpModel) => ({
16     url: 'vpn/v1/business/gateways/ip',
17     method: 'post',
18     data,
19 });
21 export const deleteVPNGateway = (ids: readonly string[]) => ({
22     url: 'vpn/v1/business/gateways',
23     method: 'delete',
24     data: {
25         LogicalIds: ids,
26     },
27 });
29 export const renameVPNGateway = (currentName: string, newName: string) => ({
30     url: 'vpn/v1/business/gateways',
31     method: 'put',
32     data: {
33         CurrentName: currentName,
34         NewName: newName,
35     },
36 });
38 export const updateVPNGatewayUsers = (currentName: string, features: number, userIds?: readonly string[] | null) => ({
39     url: 'vpn/v1/business/gateways',
40     method: 'put',
41     data: {
42         CurrentName: currentName,
43         NewName: currentName,
44         Features: features,
45         UserIds: userIds ?? null,
46     },
47 });
49 export const queryDeletedDedicatedIPs = () => ({
50     url: 'vpn/v1/business/gateways/deleted-dedicated-ips',
51     method: 'get',
52 });