@leavepulse/control-sdk 0.3.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/README.md +2 -0
  2. package/auth-types.ts +5296 -0
  3. package/client.ts +320 -0
  4. package/index.ts +110 -0
  5. package/models.ts +232 -0
  6. package/package.json +28 -0
  7. package/procedures.ts +451 -0
  8. package/resources/ControlAgentRelease.ts +40 -0
  9. package/resources/ControlAlert.ts +39 -0
  10. package/resources/ControlCfAccount.ts +82 -0
  11. package/resources/ControlDcimAcceptance.ts +126 -0
  12. package/resources/ControlDcimCable.ts +70 -0
  13. package/resources/ControlDcimComponent.ts +62 -0
  14. package/resources/ControlDcimDevice.ts +71 -0
  15. package/resources/ControlDcimFeed.ts +61 -0
  16. package/resources/ControlDcimLocation.ts +55 -0
  17. package/resources/ControlDcimOutlet.ts +61 -0
  18. package/resources/ControlDcimPdu.ts +58 -0
  19. package/resources/ControlDcimPort.ts +61 -0
  20. package/resources/ControlDcimPowerLink.ts +34 -0
  21. package/resources/ControlDcimRack.ts +61 -0
  22. package/resources/ControlEdge.ts +43 -0
  23. package/resources/ControlEnrollToken.ts +45 -0
  24. package/resources/ControlEnvGroup.ts +60 -0
  25. package/resources/ControlHost.ts +184 -0
  26. package/resources/ControlNode.ts +48 -0
  27. package/resources/ControlProject.ts +36 -0
  28. package/resources/ControlRule.ts +56 -0
  29. package/resources/ControlSchedule.ts +56 -0
  30. package/resources/ControlService.ts +101 -0
  31. package/runtime/cache-policy.ts +371 -0
  32. package/runtime/cache.ts +129 -0
  33. package/runtime/credentials.ts +139 -0
  34. package/runtime/device.ts +199 -0
  35. package/runtime/errors.ts +225 -0
  36. package/runtime/etag-store.ts +252 -0
  37. package/runtime/json.ts +25 -0
  38. package/runtime/oauth2.ts +150 -0
  39. package/runtime/page.ts +81 -0
  40. package/runtime/realtime-client.ts +339 -0
  41. package/runtime/realtime.ts +257 -0
  42. package/runtime/realtime_pb/leavepulse/realtime/v1/ws_pb.ts +464 -0
  43. package/runtime/resource.ts +84 -0
  44. package/runtime/snowflake.ts +7 -0
  45. package/runtime/transport.ts +404 -0
  46. package/types.ts +7279 -0
@@ -0,0 +1,126 @@
1
+ // Generated from the LeavePulse contract. Do not edit.
2
+ import { Resource } from "../runtime/resource";
3
+ import { fetchCachedOrThrow } from "../runtime/etag-store";
4
+ import type * as models from "../models";
5
+ import type { ClientContext } from "../client";
6
+
7
+ type Data = { id: string | number } & Record<string, unknown>;
8
+
9
+ export class ControlDcimAcceptance extends Resource<Data> {
10
+ constructor(
11
+ data: Data,
12
+ private readonly ctx: ClientContext,
13
+ ) {
14
+ super(data);
15
+ }
16
+
17
+ /** control.dcim.acceptance.list */
18
+ async controlDcimAcceptanceList(params?: {
19
+ location?: string;
20
+ status?: string;
21
+ }): Promise<models.AcceptanceRecordListResponse> {
22
+ return fetchCachedOrThrow<models.AcceptanceRecordListResponse>(
23
+ this.ctx.transport,
24
+ this.ctx.etagStore,
25
+ {
26
+ method: "GET",
27
+ path: `/v1/control/dcim/acceptance`,
28
+ query: { location: params?.location, status: params?.status },
29
+ },
30
+ );
31
+ }
32
+
33
+ /** control.dcim.acceptance.get */
34
+ async controlDcimAcceptanceGet(): Promise<models.AcceptanceRecordDTO> {
35
+ return fetchCachedOrThrow<models.AcceptanceRecordDTO>(
36
+ this.ctx.transport,
37
+ this.ctx.etagStore,
38
+ { method: "GET", path: `/v1/control/dcim/acceptance/${this.id}` },
39
+ );
40
+ }
41
+
42
+ /** control.dcim.acceptance.create */
43
+ async dcimAcceptanceCreate(
44
+ body: models.CreateAcceptanceRequest,
45
+ ): Promise<models.AcceptanceRecordDTO> {
46
+ return this.ctx.transport.request<models.AcceptanceRecordDTO>({
47
+ method: "POST",
48
+ path: `/v1/control/dcim/acceptance`,
49
+ body,
50
+ });
51
+ }
52
+
53
+ /** control.dcim.acceptance.delete */
54
+ async dcimAcceptanceDelete(): Promise<models.DeleteResultDTO> {
55
+ return this.ctx.transport.request<models.DeleteResultDTO>({
56
+ method: "DELETE",
57
+ path: `/v1/control/dcim/acceptance/${this.id}`,
58
+ });
59
+ }
60
+
61
+ /** control.dcim.acceptance.update */
62
+ async dcimAcceptanceUpdate(
63
+ body: models.UpdateAcceptanceRequest,
64
+ ): Promise<models.AcceptanceRecordDTO> {
65
+ return this.ctx.transport.request<models.AcceptanceRecordDTO>({
66
+ method: "PATCH",
67
+ path: `/v1/control/dcim/acceptance/${this.id}`,
68
+ body,
69
+ });
70
+ }
71
+
72
+ /** control.dcim.acceptance.accept */
73
+ async dcimAcceptanceAccept(
74
+ body: models.AcceptAcceptanceRequest,
75
+ ): Promise<models.AcceptanceRecordDTO> {
76
+ return this.ctx.transport.request<models.AcceptanceRecordDTO>({
77
+ method: "POST",
78
+ path: `/v1/control/dcim/acceptance/${this.id}/accept`,
79
+ body,
80
+ });
81
+ }
82
+
83
+ /** control.dcim.acceptance.dispute */
84
+ async dcimAcceptanceDispute(
85
+ body: models.DisputeAcceptanceRequest,
86
+ ): Promise<models.AcceptanceRecordDTO> {
87
+ return this.ctx.transport.request<models.AcceptanceRecordDTO>({
88
+ method: "POST",
89
+ path: `/v1/control/dcim/acceptance/${this.id}/dispute`,
90
+ body,
91
+ });
92
+ }
93
+
94
+ /** control.dcim.acceptance.setItems */
95
+ async dcimAcceptanceSetItems(
96
+ body: models.SetAcceptanceItemsRequest,
97
+ ): Promise<models.AcceptanceRecordDTO> {
98
+ return this.ctx.transport.request<models.AcceptanceRecordDTO>({
99
+ method: "POST",
100
+ path: `/v1/control/dcim/acceptance/${this.id}/items`,
101
+ body,
102
+ });
103
+ }
104
+
105
+ /** control.dcim.acceptance.sign */
106
+ async dcimAcceptanceSign(
107
+ body: models.SignAcceptanceRequest,
108
+ ): Promise<models.AcceptanceRecordDTO> {
109
+ return this.ctx.transport.request<models.AcceptanceRecordDTO>({
110
+ method: "POST",
111
+ path: `/v1/control/dcim/acceptance/${this.id}/sign`,
112
+ body,
113
+ });
114
+ }
115
+
116
+ /** control.dcim.acceptance.verify */
117
+ async dcimAcceptanceVerify(
118
+ body: models.VerifyAcceptanceRequest,
119
+ ): Promise<models.AcceptanceRecordDTO> {
120
+ return this.ctx.transport.request<models.AcceptanceRecordDTO>({
121
+ method: "POST",
122
+ path: `/v1/control/dcim/acceptance/${this.id}/verify`,
123
+ body,
124
+ });
125
+ }
126
+ }
@@ -0,0 +1,70 @@
1
+ // Generated from the LeavePulse contract. Do not edit.
2
+ import { Resource } from "../runtime/resource";
3
+ import { fetchCachedOrThrow } from "../runtime/etag-store";
4
+ import type * as models from "../models";
5
+ import type { ClientContext } from "../client";
6
+
7
+ type Data = { id: string | number } & Record<string, unknown>;
8
+
9
+ export class ControlDcimCable extends Resource<Data> {
10
+ constructor(
11
+ data: Data,
12
+ private readonly ctx: ClientContext,
13
+ ) {
14
+ super(data);
15
+ }
16
+
17
+ /** control.dcim.cables.list */
18
+ async controlDcimCablesList(params?: {
19
+ device?: string;
20
+ }): Promise<models.CableListResponse> {
21
+ return fetchCachedOrThrow<models.CableListResponse>(
22
+ this.ctx.transport,
23
+ this.ctx.etagStore,
24
+ {
25
+ method: "GET",
26
+ path: `/v1/control/dcim/cables`,
27
+ query: { device: params?.device },
28
+ },
29
+ );
30
+ }
31
+
32
+ /** control.dcim.cables.get */
33
+ async controlDcimCablesGet(): Promise<models.CableDTO> {
34
+ return fetchCachedOrThrow<models.CableDTO>(
35
+ this.ctx.transport,
36
+ this.ctx.etagStore,
37
+ { method: "GET", path: `/v1/control/dcim/cables/${this.id}` },
38
+ );
39
+ }
40
+
41
+ /** control.dcim.cables.create */
42
+ async dcimCablesCreate(
43
+ body: models.CreateCableRequest,
44
+ ): Promise<models.CableDTO> {
45
+ return this.ctx.transport.request<models.CableDTO>({
46
+ method: "POST",
47
+ path: `/v1/control/dcim/cables`,
48
+ body,
49
+ });
50
+ }
51
+
52
+ /** control.dcim.cables.delete */
53
+ async dcimCablesDelete(): Promise<models.DeleteResultDTO> {
54
+ return this.ctx.transport.request<models.DeleteResultDTO>({
55
+ method: "DELETE",
56
+ path: `/v1/control/dcim/cables/${this.id}`,
57
+ });
58
+ }
59
+
60
+ /** control.dcim.cables.update */
61
+ async dcimCablesUpdate(
62
+ body: models.UpdateCableRequest,
63
+ ): Promise<models.CableDTO> {
64
+ return this.ctx.transport.request<models.CableDTO>({
65
+ method: "PATCH",
66
+ path: `/v1/control/dcim/cables/${this.id}`,
67
+ body,
68
+ });
69
+ }
70
+ }
@@ -0,0 +1,62 @@
1
+ // Generated from the LeavePulse contract. Do not edit.
2
+ import { Resource } from "../runtime/resource";
3
+ import { fetchCachedOrThrow } from "../runtime/etag-store";
4
+ import type * as models from "../models";
5
+ import type { ClientContext } from "../client";
6
+
7
+ type Data = { id: string | number } & Record<string, unknown>;
8
+
9
+ export class ControlDcimComponent extends Resource<Data> {
10
+ constructor(
11
+ data: Data,
12
+ private readonly ctx: ClientContext,
13
+ ) {
14
+ super(data);
15
+ }
16
+
17
+ /** control.dcim.components.list */
18
+ async controlDcimComponentsList(params?: {
19
+ device?: string;
20
+ state?: string;
21
+ }): Promise<models.ComponentListResponse> {
22
+ return fetchCachedOrThrow<models.ComponentListResponse>(
23
+ this.ctx.transport,
24
+ this.ctx.etagStore,
25
+ {
26
+ method: "GET",
27
+ path: `/v1/control/dcim/components`,
28
+ query: { device: params?.device, state: params?.state },
29
+ },
30
+ );
31
+ }
32
+
33
+ /** control.dcim.components.create */
34
+ async dcimComponentsCreate(
35
+ body: models.CreateComponentRequest,
36
+ ): Promise<models.ComponentDTO> {
37
+ return this.ctx.transport.request<models.ComponentDTO>({
38
+ method: "POST",
39
+ path: `/v1/control/dcim/components`,
40
+ body,
41
+ });
42
+ }
43
+
44
+ /** control.dcim.components.delete */
45
+ async dcimComponentsDelete(): Promise<models.DeleteResultDTO> {
46
+ return this.ctx.transport.request<models.DeleteResultDTO>({
47
+ method: "DELETE",
48
+ path: `/v1/control/dcim/components/${this.id}`,
49
+ });
50
+ }
51
+
52
+ /** control.dcim.components.update */
53
+ async dcimComponentsUpdate(
54
+ body: models.UpdateComponentRequest,
55
+ ): Promise<models.ComponentDTO> {
56
+ return this.ctx.transport.request<models.ComponentDTO>({
57
+ method: "PATCH",
58
+ path: `/v1/control/dcim/components/${this.id}`,
59
+ body,
60
+ });
61
+ }
62
+ }
@@ -0,0 +1,71 @@
1
+ // Generated from the LeavePulse contract. Do not edit.
2
+ import { Resource } from "../runtime/resource";
3
+ import { fetchCachedOrThrow } from "../runtime/etag-store";
4
+ import type * as models from "../models";
5
+ import type { ClientContext } from "../client";
6
+
7
+ type Data = { id: string | number } & Record<string, unknown>;
8
+
9
+ export class ControlDcimDevice extends Resource<Data> {
10
+ constructor(
11
+ data: Data,
12
+ private readonly ctx: ClientContext,
13
+ ) {
14
+ super(data);
15
+ }
16
+
17
+ /** control.dcim.devices.list */
18
+ async controlDcimDevicesList(params?: {
19
+ location?: string;
20
+ kind?: string;
21
+ }): Promise<models.DeviceListResponse> {
22
+ return fetchCachedOrThrow<models.DeviceListResponse>(
23
+ this.ctx.transport,
24
+ this.ctx.etagStore,
25
+ {
26
+ method: "GET",
27
+ path: `/v1/control/dcim/devices`,
28
+ query: { location: params?.location, kind: params?.kind },
29
+ },
30
+ );
31
+ }
32
+
33
+ /** control.dcim.devices.get */
34
+ async controlDcimDevicesGet(): Promise<models.DeviceDTO> {
35
+ return fetchCachedOrThrow<models.DeviceDTO>(
36
+ this.ctx.transport,
37
+ this.ctx.etagStore,
38
+ { method: "GET", path: `/v1/control/dcim/devices/${this.id}` },
39
+ );
40
+ }
41
+
42
+ /** control.dcim.devices.create */
43
+ async dcimDevicesCreate(
44
+ body: models.CreateDeviceRequest,
45
+ ): Promise<models.DeviceDTO> {
46
+ return this.ctx.transport.request<models.DeviceDTO>({
47
+ method: "POST",
48
+ path: `/v1/control/dcim/devices`,
49
+ body,
50
+ });
51
+ }
52
+
53
+ /** control.dcim.devices.delete */
54
+ async dcimDevicesDelete(): Promise<models.DeleteResultDTO> {
55
+ return this.ctx.transport.request<models.DeleteResultDTO>({
56
+ method: "DELETE",
57
+ path: `/v1/control/dcim/devices/${this.id}`,
58
+ });
59
+ }
60
+
61
+ /** control.dcim.devices.update */
62
+ async dcimDevicesUpdate(
63
+ body: models.UpdateDeviceRequest,
64
+ ): Promise<models.DeviceDTO> {
65
+ return this.ctx.transport.request<models.DeviceDTO>({
66
+ method: "PATCH",
67
+ path: `/v1/control/dcim/devices/${this.id}`,
68
+ body,
69
+ });
70
+ }
71
+ }
@@ -0,0 +1,61 @@
1
+ // Generated from the LeavePulse contract. Do not edit.
2
+ import { Resource } from "../runtime/resource";
3
+ import { fetchCachedOrThrow } from "../runtime/etag-store";
4
+ import type * as models from "../models";
5
+ import type { ClientContext } from "../client";
6
+
7
+ type Data = { id: string | number } & Record<string, unknown>;
8
+
9
+ export class ControlDcimFeed extends Resource<Data> {
10
+ constructor(
11
+ data: Data,
12
+ private readonly ctx: ClientContext,
13
+ ) {
14
+ super(data);
15
+ }
16
+
17
+ /** control.dcim.feeds.list */
18
+ async controlDcimFeedsList(params?: {
19
+ location?: string;
20
+ }): Promise<models.FeedListResponse> {
21
+ return fetchCachedOrThrow<models.FeedListResponse>(
22
+ this.ctx.transport,
23
+ this.ctx.etagStore,
24
+ {
25
+ method: "GET",
26
+ path: `/v1/control/dcim/power/feeds`,
27
+ query: { location: params?.location },
28
+ },
29
+ );
30
+ }
31
+
32
+ /** control.dcim.feeds.create */
33
+ async dcimFeedsCreate(
34
+ body: models.CreateFeedRequest,
35
+ ): Promise<models.FeedDTO> {
36
+ return this.ctx.transport.request<models.FeedDTO>({
37
+ method: "POST",
38
+ path: `/v1/control/dcim/power/feeds`,
39
+ body,
40
+ });
41
+ }
42
+
43
+ /** control.dcim.feeds.delete */
44
+ async dcimFeedsDelete(): Promise<models.DeleteResultDTO> {
45
+ return this.ctx.transport.request<models.DeleteResultDTO>({
46
+ method: "DELETE",
47
+ path: `/v1/control/dcim/power/feeds/${this.id}`,
48
+ });
49
+ }
50
+
51
+ /** control.dcim.feeds.update */
52
+ async dcimFeedsUpdate(
53
+ body: models.UpdateFeedRequest,
54
+ ): Promise<models.FeedDTO> {
55
+ return this.ctx.transport.request<models.FeedDTO>({
56
+ method: "PATCH",
57
+ path: `/v1/control/dcim/power/feeds/${this.id}`,
58
+ body,
59
+ });
60
+ }
61
+ }
@@ -0,0 +1,55 @@
1
+ // Generated from the LeavePulse contract. Do not edit.
2
+ import { Resource } from "../runtime/resource";
3
+ import { fetchCachedOrThrow } from "../runtime/etag-store";
4
+ import type * as models from "../models";
5
+ import type { ClientContext } from "../client";
6
+
7
+ type Data = { id: string | number } & Record<string, unknown>;
8
+
9
+ export class ControlDcimLocation extends Resource<Data> {
10
+ constructor(
11
+ data: Data,
12
+ private readonly ctx: ClientContext,
13
+ ) {
14
+ super(data);
15
+ }
16
+
17
+ /** control.dcim.locations.list */
18
+ async controlDcimLocationsList(): Promise<models.LocationListResponse> {
19
+ return fetchCachedOrThrow<models.LocationListResponse>(
20
+ this.ctx.transport,
21
+ this.ctx.etagStore,
22
+ { method: "GET", path: `/v1/control/dcim/locations` },
23
+ );
24
+ }
25
+
26
+ /** control.dcim.locations.create */
27
+ async dcimLocationsCreate(
28
+ body: models.CreateLocationRequest,
29
+ ): Promise<models.LocationDTO> {
30
+ return this.ctx.transport.request<models.LocationDTO>({
31
+ method: "POST",
32
+ path: `/v1/control/dcim/locations`,
33
+ body,
34
+ });
35
+ }
36
+
37
+ /** control.dcim.locations.delete */
38
+ async dcimLocationsDelete(): Promise<models.DeleteResultDTO> {
39
+ return this.ctx.transport.request<models.DeleteResultDTO>({
40
+ method: "DELETE",
41
+ path: `/v1/control/dcim/locations/${this.id}`,
42
+ });
43
+ }
44
+
45
+ /** control.dcim.locations.update */
46
+ async dcimLocationsUpdate(
47
+ body: models.UpdateLocationRequest,
48
+ ): Promise<models.LocationDTO> {
49
+ return this.ctx.transport.request<models.LocationDTO>({
50
+ method: "PATCH",
51
+ path: `/v1/control/dcim/locations/${this.id}`,
52
+ body,
53
+ });
54
+ }
55
+ }
@@ -0,0 +1,61 @@
1
+ // Generated from the LeavePulse contract. Do not edit.
2
+ import { Resource } from "../runtime/resource";
3
+ import { fetchCachedOrThrow } from "../runtime/etag-store";
4
+ import type * as models from "../models";
5
+ import type { ClientContext } from "../client";
6
+
7
+ type Data = { id: string | number } & Record<string, unknown>;
8
+
9
+ export class ControlDcimOutlet extends Resource<Data> {
10
+ constructor(
11
+ data: Data,
12
+ private readonly ctx: ClientContext,
13
+ ) {
14
+ super(data);
15
+ }
16
+
17
+ /** control.dcim.outlets.list */
18
+ async controlDcimOutletsList(params?: {
19
+ pdu?: string;
20
+ }): Promise<models.OutletListResponse> {
21
+ return fetchCachedOrThrow<models.OutletListResponse>(
22
+ this.ctx.transport,
23
+ this.ctx.etagStore,
24
+ {
25
+ method: "GET",
26
+ path: `/v1/control/dcim/power/outlets`,
27
+ query: { pdu: params?.pdu },
28
+ },
29
+ );
30
+ }
31
+
32
+ /** control.dcim.outlets.create */
33
+ async dcimOutletsCreate(
34
+ body: models.CreateOutletRequest,
35
+ ): Promise<models.OutletDTO> {
36
+ return this.ctx.transport.request<models.OutletDTO>({
37
+ method: "POST",
38
+ path: `/v1/control/dcim/power/outlets`,
39
+ body,
40
+ });
41
+ }
42
+
43
+ /** control.dcim.outlets.delete */
44
+ async dcimOutletsDelete(): Promise<models.DeleteResultDTO> {
45
+ return this.ctx.transport.request<models.DeleteResultDTO>({
46
+ method: "DELETE",
47
+ path: `/v1/control/dcim/power/outlets/${this.id}`,
48
+ });
49
+ }
50
+
51
+ /** control.dcim.outlets.update */
52
+ async dcimOutletsUpdate(
53
+ body: models.UpdateOutletRequest,
54
+ ): Promise<models.OutletDTO> {
55
+ return this.ctx.transport.request<models.OutletDTO>({
56
+ method: "PATCH",
57
+ path: `/v1/control/dcim/power/outlets/${this.id}`,
58
+ body,
59
+ });
60
+ }
61
+ }
@@ -0,0 +1,58 @@
1
+ // Generated from the LeavePulse contract. Do not edit.
2
+ import { Resource } from "../runtime/resource";
3
+ import { fetchCachedOrThrow } from "../runtime/etag-store";
4
+ import type * as models from "../models";
5
+ import type { ClientContext } from "../client";
6
+
7
+ type Data = { id: string | number } & Record<string, unknown>;
8
+
9
+ export class ControlDcimPdu extends Resource<Data> {
10
+ constructor(
11
+ data: Data,
12
+ private readonly ctx: ClientContext,
13
+ ) {
14
+ super(data);
15
+ }
16
+
17
+ /** control.dcim.pdus.list */
18
+ async controlDcimPdusList(params?: {
19
+ location?: string;
20
+ feed?: string;
21
+ }): Promise<models.PduListResponse> {
22
+ return fetchCachedOrThrow<models.PduListResponse>(
23
+ this.ctx.transport,
24
+ this.ctx.etagStore,
25
+ {
26
+ method: "GET",
27
+ path: `/v1/control/dcim/power/pdus`,
28
+ query: { location: params?.location, feed: params?.feed },
29
+ },
30
+ );
31
+ }
32
+
33
+ /** control.dcim.pdus.create */
34
+ async dcimPdusCreate(body: models.CreatePduRequest): Promise<models.PduDTO> {
35
+ return this.ctx.transport.request<models.PduDTO>({
36
+ method: "POST",
37
+ path: `/v1/control/dcim/power/pdus`,
38
+ body,
39
+ });
40
+ }
41
+
42
+ /** control.dcim.pdus.delete */
43
+ async dcimPdusDelete(): Promise<models.DeleteResultDTO> {
44
+ return this.ctx.transport.request<models.DeleteResultDTO>({
45
+ method: "DELETE",
46
+ path: `/v1/control/dcim/power/pdus/${this.id}`,
47
+ });
48
+ }
49
+
50
+ /** control.dcim.pdus.update */
51
+ async dcimPdusUpdate(body: models.UpdatePduRequest): Promise<models.PduDTO> {
52
+ return this.ctx.transport.request<models.PduDTO>({
53
+ method: "PATCH",
54
+ path: `/v1/control/dcim/power/pdus/${this.id}`,
55
+ body,
56
+ });
57
+ }
58
+ }
@@ -0,0 +1,61 @@
1
+ // Generated from the LeavePulse contract. Do not edit.
2
+ import { Resource } from "../runtime/resource";
3
+ import { fetchCachedOrThrow } from "../runtime/etag-store";
4
+ import type * as models from "../models";
5
+ import type { ClientContext } from "../client";
6
+
7
+ type Data = { id: string | number } & Record<string, unknown>;
8
+
9
+ export class ControlDcimPort extends Resource<Data> {
10
+ constructor(
11
+ data: Data,
12
+ private readonly ctx: ClientContext,
13
+ ) {
14
+ super(data);
15
+ }
16
+
17
+ /** control.dcim.ports.list */
18
+ async controlDcimPortsList(params?: {
19
+ device?: string;
20
+ }): Promise<models.PortListResponse> {
21
+ return fetchCachedOrThrow<models.PortListResponse>(
22
+ this.ctx.transport,
23
+ this.ctx.etagStore,
24
+ {
25
+ method: "GET",
26
+ path: `/v1/control/dcim/ports`,
27
+ query: { device: params?.device },
28
+ },
29
+ );
30
+ }
31
+
32
+ /** control.dcim.ports.create */
33
+ async dcimPortsCreate(
34
+ body: models.CreatePortRequest,
35
+ ): Promise<models.PortDTO> {
36
+ return this.ctx.transport.request<models.PortDTO>({
37
+ method: "POST",
38
+ path: `/v1/control/dcim/ports`,
39
+ body,
40
+ });
41
+ }
42
+
43
+ /** control.dcim.ports.delete */
44
+ async dcimPortsDelete(): Promise<models.DeleteResultDTO> {
45
+ return this.ctx.transport.request<models.DeleteResultDTO>({
46
+ method: "DELETE",
47
+ path: `/v1/control/dcim/ports/${this.id}`,
48
+ });
49
+ }
50
+
51
+ /** control.dcim.ports.update */
52
+ async dcimPortsUpdate(
53
+ body: models.UpdatePortRequest,
54
+ ): Promise<models.PortDTO> {
55
+ return this.ctx.transport.request<models.PortDTO>({
56
+ method: "PATCH",
57
+ path: `/v1/control/dcim/ports/${this.id}`,
58
+ body,
59
+ });
60
+ }
61
+ }
@@ -0,0 +1,34 @@
1
+ // Generated from the LeavePulse contract. Do not edit.
2
+ import { Resource } from "../runtime/resource";
3
+ import type * as models from "../models";
4
+ import type { ClientContext } from "../client";
5
+
6
+ type Data = { id: string | number } & Record<string, unknown>;
7
+
8
+ export class ControlDcimPowerLink extends Resource<Data> {
9
+ constructor(
10
+ data: Data,
11
+ private readonly ctx: ClientContext,
12
+ ) {
13
+ super(data);
14
+ }
15
+
16
+ /** control.dcim.power.connect */
17
+ async dcimPowerConnect(
18
+ body: models.ConnectPowerRequest,
19
+ ): Promise<models.PowerLinkDTO> {
20
+ return this.ctx.transport.request<models.PowerLinkDTO>({
21
+ method: "POST",
22
+ path: `/v1/control/dcim/power/links`,
23
+ body,
24
+ });
25
+ }
26
+
27
+ /** control.dcim.power.disconnect */
28
+ async dcimPowerDisconnect(): Promise<models.DeleteResultDTO> {
29
+ return this.ctx.transport.request<models.DeleteResultDTO>({
30
+ method: "DELETE",
31
+ path: `/v1/control/dcim/power/links/${this.id}`,
32
+ });
33
+ }
34
+ }