@greensecurity/javascript-sdk 0.40.8-beta.31 → 0.40.8-beta.33
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.
- package/dist/commonjs/__tests__/webhooks.test.js +1 -1
- package/dist/commonjs/__tests__/webhooks.test.js.map +1 -1
- package/dist/commonjs/__tests__/zones.test.js +6 -4
- package/dist/commonjs/__tests__/zones.test.js.map +1 -1
- package/dist/commonjs/lib/config.d.ts +3 -3
- package/dist/commonjs/lib/config.js +3 -3
- package/dist/commonjs/models/components/paymentprofile.d.ts +4 -4
- package/dist/commonjs/models/components/paymentprofile.d.ts.map +1 -1
- package/dist/commonjs/models/components/paymentprofile.js +4 -4
- package/dist/commonjs/models/components/paymentprofile.js.map +1 -1
- package/dist/commonjs/models/components/vendor.d.ts +8 -8
- package/dist/commonjs/models/components/vendor.d.ts.map +1 -1
- package/dist/commonjs/models/components/vendor.js +14 -8
- package/dist/commonjs/models/components/vendor.js.map +1 -1
- package/dist/esm/__tests__/webhooks.test.js +1 -1
- package/dist/esm/__tests__/webhooks.test.js.map +1 -1
- package/dist/esm/__tests__/zones.test.js +6 -4
- package/dist/esm/__tests__/zones.test.js.map +1 -1
- package/dist/esm/lib/config.d.ts +3 -3
- package/dist/esm/lib/config.js +3 -3
- package/dist/esm/models/components/paymentprofile.d.ts +4 -4
- package/dist/esm/models/components/paymentprofile.d.ts.map +1 -1
- package/dist/esm/models/components/paymentprofile.js +4 -4
- package/dist/esm/models/components/paymentprofile.js.map +1 -1
- package/dist/esm/models/components/vendor.d.ts +8 -8
- package/dist/esm/models/components/vendor.d.ts.map +1 -1
- package/dist/esm/models/components/vendor.js +14 -8
- package/dist/esm/models/components/vendor.js.map +1 -1
- package/examples/package-lock.json +1 -1
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/__tests__/webhooks.test.ts +1 -1
- package/src/__tests__/zones.test.ts +6 -4
- package/src/lib/config.ts +3 -3
- package/src/models/components/paymentprofile.ts +9 -9
- package/src/models/components/vendor.ts +24 -18
- package/.devcontainer/README.md +0 -35
- package/docs/sdks/alerts/README.md +0 -219
- package/docs/sdks/companies/README.md +0 -126
- package/docs/sdks/datarequests/README.md +0 -302
- package/docs/sdks/events/README.md +0 -1126
- package/docs/sdks/fhirconfigs/README.md +0 -551
- package/docs/sdks/greensecurity/README.md +0 -14
- package/docs/sdks/invoices/README.md +0 -324
- package/docs/sdks/mobiledevices/README.md +0 -100
- package/docs/sdks/organizations/README.md +0 -508
- package/docs/sdks/supportarticles/README.md +0 -249
- package/docs/sdks/systems/README.md +0 -136
- package/docs/sdks/users/README.md +0 -831
- package/docs/sdks/vendors/README.md +0 -4904
- package/docs/sdks/vendorscans/README.md +0 -104
- package/docs/sdks/webhooks/README.md +0 -352
- package/docs/sdks/zones/README.md +0 -344
- package/examples/README.md +0 -31
|
@@ -1,324 +0,0 @@
|
|
|
1
|
-
# Invoices
|
|
2
|
-
(*invoices*)
|
|
3
|
-
|
|
4
|
-
## Overview
|
|
5
|
-
|
|
6
|
-
### Available Operations
|
|
7
|
-
|
|
8
|
-
* [createInvoice](#createinvoice) - Create invoice
|
|
9
|
-
* [updateInvoice](#updateinvoice) - Update invoice
|
|
10
|
-
* [makePayment](#makepayment) - Make payment for the invoice
|
|
11
|
-
|
|
12
|
-
## createInvoice
|
|
13
|
-
|
|
14
|
-
It will create an invoice based on the lines passed as parameter.
|
|
15
|
-
- Exactly one of vendor_id, company_id, facility_id, or system_id must be provided. - variant_id is required for the line - payment_handler_data must be set in the following format:
|
|
16
|
-
1. for the 'vendor credential' and 'expedited credential' payment_handlers this should be a JSON
|
|
17
|
-
with a key 'vendor_credential_id' and value as integer
|
|
18
|
-
2. for the 'credentialing subscription' payment handler this should be a JSON
|
|
19
|
-
with the following keys and values:
|
|
20
|
-
- old_vendor_type_id: required, must be nil or integer
|
|
21
|
-
- new_vendor_type_id: required, must be integer
|
|
22
|
-
- old_facility_ids: required, must be an array of integers (can be empty)
|
|
23
|
-
- new_facility_ids: required, must be array of integers
|
|
24
|
-
|
|
25
|
-
### Example Usage
|
|
26
|
-
|
|
27
|
-
<!-- UsageSnippet language="typescript" operationID="createInvoice" method="post" path="/invoices" -->
|
|
28
|
-
```typescript
|
|
29
|
-
import { GreenSecurity } from "@greensecurity/javascript-sdk";
|
|
30
|
-
|
|
31
|
-
const greenSecurity = new GreenSecurity({
|
|
32
|
-
security: {
|
|
33
|
-
token: process.env["GREEN_SECURITY_TOKEN"] ?? "",
|
|
34
|
-
},
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
async function run() {
|
|
38
|
-
const result = await greenSecurity.invoices.createInvoice({
|
|
39
|
-
systemId: 278007,
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
console.log(result);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
run();
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
### Standalone function
|
|
49
|
-
|
|
50
|
-
The standalone function version of this method:
|
|
51
|
-
|
|
52
|
-
```typescript
|
|
53
|
-
import { GreenSecurityCore } from "@greensecurity/javascript-sdk/core.js";
|
|
54
|
-
import { invoicesCreateInvoice } from "@greensecurity/javascript-sdk/funcs/invoicesCreateInvoice.js";
|
|
55
|
-
|
|
56
|
-
// Use `GreenSecurityCore` for best tree-shaking performance.
|
|
57
|
-
// You can create one instance of it to use across an application.
|
|
58
|
-
const greenSecurity = new GreenSecurityCore({
|
|
59
|
-
security: {
|
|
60
|
-
token: process.env["GREEN_SECURITY_TOKEN"] ?? "",
|
|
61
|
-
},
|
|
62
|
-
});
|
|
63
|
-
|
|
64
|
-
async function run() {
|
|
65
|
-
const res = await invoicesCreateInvoice(greenSecurity, {
|
|
66
|
-
systemId: 278007,
|
|
67
|
-
});
|
|
68
|
-
if (res.ok) {
|
|
69
|
-
const { value: result } = res;
|
|
70
|
-
console.log(result);
|
|
71
|
-
} else {
|
|
72
|
-
console.log("invoicesCreateInvoice failed:", res.error);
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
run();
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
### React hooks and utilities
|
|
80
|
-
|
|
81
|
-
This method can be used in React components through the following hooks and
|
|
82
|
-
associated utilities.
|
|
83
|
-
|
|
84
|
-
> Check out [this guide][hook-guide] for information about each of the utilities
|
|
85
|
-
> below and how to get started using React hooks.
|
|
86
|
-
|
|
87
|
-
[hook-guide]: ../../../REACT_QUERY.md
|
|
88
|
-
|
|
89
|
-
```tsx
|
|
90
|
-
import {
|
|
91
|
-
// Mutation hook for triggering the API call.
|
|
92
|
-
useInvoicesCreateInvoiceMutation
|
|
93
|
-
} from "@greensecurity/javascript-sdk/react-query/invoicesCreateInvoice.js";
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
### Parameters
|
|
97
|
-
|
|
98
|
-
| Parameter | Type | Required | Description |
|
|
99
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
100
|
-
| `request` | [operations.CreateInvoiceRequestBody](../../models/operations/createinvoicerequestbody.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
101
|
-
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
102
|
-
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
|
|
103
|
-
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
104
|
-
|
|
105
|
-
### Response
|
|
106
|
-
|
|
107
|
-
**Promise\<[operations.CreateInvoiceResponseBody](../../models/operations/createinvoiceresponsebody.md)\>**
|
|
108
|
-
|
|
109
|
-
### Errors
|
|
110
|
-
|
|
111
|
-
| Error Type | Status Code | Content Type |
|
|
112
|
-
| ----------------------- | ----------------------- | ----------------------- |
|
|
113
|
-
| errors.ApiErrorResponse | 400, 401, 403, 404 | application/json |
|
|
114
|
-
| errors.ApiErrorResponse | 500 | application/json |
|
|
115
|
-
| errors.APIError | 4XX, 5XX | \*/\* |
|
|
116
|
-
|
|
117
|
-
## updateInvoice
|
|
118
|
-
|
|
119
|
-
It will replace all the lines with the lines passed as parameter
|
|
120
|
-
- Exactly one of vendor_id, company_id, facility_id, or system_id must be provided. - variant_id is required for the line - payment_handler_data must be set in the following format:
|
|
121
|
-
1. for the 'vendor credential' and 'expedited credential' payment_handlers this should be a JSON
|
|
122
|
-
with a key 'vendor_credential_id' and value as integer
|
|
123
|
-
2. for the 'credentialing subscription' payment handler this should be a JSON
|
|
124
|
-
with the following keys and values:
|
|
125
|
-
- old_vendor_type_id: required, must be nil or integer
|
|
126
|
-
- new_vendor_type_id: required, must be integer
|
|
127
|
-
- old_facility_ids: required, must be an array of integers (can be empty)
|
|
128
|
-
- new_facility_ids: required, must be array of integers
|
|
129
|
-
|
|
130
|
-
### Example Usage
|
|
131
|
-
|
|
132
|
-
<!-- UsageSnippet language="typescript" operationID="updateInvoice" method="put" path="/invoices/{id}" -->
|
|
133
|
-
```typescript
|
|
134
|
-
import { GreenSecurity } from "@greensecurity/javascript-sdk";
|
|
135
|
-
|
|
136
|
-
const greenSecurity = new GreenSecurity({
|
|
137
|
-
security: {
|
|
138
|
-
token: process.env["GREEN_SECURITY_TOKEN"] ?? "",
|
|
139
|
-
},
|
|
140
|
-
});
|
|
141
|
-
|
|
142
|
-
async function run() {
|
|
143
|
-
const result = await greenSecurity.invoices.updateInvoice({
|
|
144
|
-
id: 801666,
|
|
145
|
-
requestBody: {
|
|
146
|
-
systemId: 761923,
|
|
147
|
-
},
|
|
148
|
-
});
|
|
149
|
-
|
|
150
|
-
console.log(result);
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
run();
|
|
154
|
-
```
|
|
155
|
-
|
|
156
|
-
### Standalone function
|
|
157
|
-
|
|
158
|
-
The standalone function version of this method:
|
|
159
|
-
|
|
160
|
-
```typescript
|
|
161
|
-
import { GreenSecurityCore } from "@greensecurity/javascript-sdk/core.js";
|
|
162
|
-
import { invoicesUpdateInvoice } from "@greensecurity/javascript-sdk/funcs/invoicesUpdateInvoice.js";
|
|
163
|
-
|
|
164
|
-
// Use `GreenSecurityCore` for best tree-shaking performance.
|
|
165
|
-
// You can create one instance of it to use across an application.
|
|
166
|
-
const greenSecurity = new GreenSecurityCore({
|
|
167
|
-
security: {
|
|
168
|
-
token: process.env["GREEN_SECURITY_TOKEN"] ?? "",
|
|
169
|
-
},
|
|
170
|
-
});
|
|
171
|
-
|
|
172
|
-
async function run() {
|
|
173
|
-
const res = await invoicesUpdateInvoice(greenSecurity, {
|
|
174
|
-
id: 801666,
|
|
175
|
-
requestBody: {
|
|
176
|
-
systemId: 761923,
|
|
177
|
-
},
|
|
178
|
-
});
|
|
179
|
-
if (res.ok) {
|
|
180
|
-
const { value: result } = res;
|
|
181
|
-
console.log(result);
|
|
182
|
-
} else {
|
|
183
|
-
console.log("invoicesUpdateInvoice failed:", res.error);
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
run();
|
|
188
|
-
```
|
|
189
|
-
|
|
190
|
-
### React hooks and utilities
|
|
191
|
-
|
|
192
|
-
This method can be used in React components through the following hooks and
|
|
193
|
-
associated utilities.
|
|
194
|
-
|
|
195
|
-
> Check out [this guide][hook-guide] for information about each of the utilities
|
|
196
|
-
> below and how to get started using React hooks.
|
|
197
|
-
|
|
198
|
-
[hook-guide]: ../../../REACT_QUERY.md
|
|
199
|
-
|
|
200
|
-
```tsx
|
|
201
|
-
import {
|
|
202
|
-
// Mutation hook for triggering the API call.
|
|
203
|
-
useInvoicesUpdateInvoiceMutation
|
|
204
|
-
} from "@greensecurity/javascript-sdk/react-query/invoicesUpdateInvoice.js";
|
|
205
|
-
```
|
|
206
|
-
|
|
207
|
-
### Parameters
|
|
208
|
-
|
|
209
|
-
| Parameter | Type | Required | Description |
|
|
210
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
211
|
-
| `request` | [operations.UpdateInvoiceRequest](../../models/operations/updateinvoicerequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
212
|
-
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
213
|
-
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
|
|
214
|
-
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
215
|
-
|
|
216
|
-
### Response
|
|
217
|
-
|
|
218
|
-
**Promise\<[boolean](../../models/.md)\>**
|
|
219
|
-
|
|
220
|
-
### Errors
|
|
221
|
-
|
|
222
|
-
| Error Type | Status Code | Content Type |
|
|
223
|
-
| ----------------------- | ----------------------- | ----------------------- |
|
|
224
|
-
| errors.ApiErrorResponse | 400, 401, 403, 404 | application/json |
|
|
225
|
-
| errors.ApiErrorResponse | 500 | application/json |
|
|
226
|
-
| errors.APIError | 4XX, 5XX | \*/\* |
|
|
227
|
-
|
|
228
|
-
## makePayment
|
|
229
|
-
|
|
230
|
-
Make payment for the invoice
|
|
231
|
-
|
|
232
|
-
### Example Usage
|
|
233
|
-
|
|
234
|
-
<!-- UsageSnippet language="typescript" operationID="makePayment" method="post" path="/invoices/{id}/payment" -->
|
|
235
|
-
```typescript
|
|
236
|
-
import { GreenSecurity } from "@greensecurity/javascript-sdk";
|
|
237
|
-
|
|
238
|
-
const greenSecurity = new GreenSecurity({
|
|
239
|
-
security: {
|
|
240
|
-
token: process.env["GREEN_SECURITY_TOKEN"] ?? "",
|
|
241
|
-
},
|
|
242
|
-
});
|
|
243
|
-
|
|
244
|
-
async function run() {
|
|
245
|
-
const result = await greenSecurity.invoices.makePayment({
|
|
246
|
-
id: 711595,
|
|
247
|
-
requestBody: {},
|
|
248
|
-
});
|
|
249
|
-
|
|
250
|
-
console.log(result);
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
run();
|
|
254
|
-
```
|
|
255
|
-
|
|
256
|
-
### Standalone function
|
|
257
|
-
|
|
258
|
-
The standalone function version of this method:
|
|
259
|
-
|
|
260
|
-
```typescript
|
|
261
|
-
import { GreenSecurityCore } from "@greensecurity/javascript-sdk/core.js";
|
|
262
|
-
import { invoicesMakePayment } from "@greensecurity/javascript-sdk/funcs/invoicesMakePayment.js";
|
|
263
|
-
|
|
264
|
-
// Use `GreenSecurityCore` for best tree-shaking performance.
|
|
265
|
-
// You can create one instance of it to use across an application.
|
|
266
|
-
const greenSecurity = new GreenSecurityCore({
|
|
267
|
-
security: {
|
|
268
|
-
token: process.env["GREEN_SECURITY_TOKEN"] ?? "",
|
|
269
|
-
},
|
|
270
|
-
});
|
|
271
|
-
|
|
272
|
-
async function run() {
|
|
273
|
-
const res = await invoicesMakePayment(greenSecurity, {
|
|
274
|
-
id: 711595,
|
|
275
|
-
requestBody: {},
|
|
276
|
-
});
|
|
277
|
-
if (res.ok) {
|
|
278
|
-
const { value: result } = res;
|
|
279
|
-
console.log(result);
|
|
280
|
-
} else {
|
|
281
|
-
console.log("invoicesMakePayment failed:", res.error);
|
|
282
|
-
}
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
run();
|
|
286
|
-
```
|
|
287
|
-
|
|
288
|
-
### React hooks and utilities
|
|
289
|
-
|
|
290
|
-
This method can be used in React components through the following hooks and
|
|
291
|
-
associated utilities.
|
|
292
|
-
|
|
293
|
-
> Check out [this guide][hook-guide] for information about each of the utilities
|
|
294
|
-
> below and how to get started using React hooks.
|
|
295
|
-
|
|
296
|
-
[hook-guide]: ../../../REACT_QUERY.md
|
|
297
|
-
|
|
298
|
-
```tsx
|
|
299
|
-
import {
|
|
300
|
-
// Mutation hook for triggering the API call.
|
|
301
|
-
useInvoicesMakePaymentMutation
|
|
302
|
-
} from "@greensecurity/javascript-sdk/react-query/invoicesMakePayment.js";
|
|
303
|
-
```
|
|
304
|
-
|
|
305
|
-
### Parameters
|
|
306
|
-
|
|
307
|
-
| Parameter | Type | Required | Description |
|
|
308
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
309
|
-
| `request` | [operations.MakePaymentRequest](../../models/operations/makepaymentrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
310
|
-
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
311
|
-
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
|
|
312
|
-
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
313
|
-
|
|
314
|
-
### Response
|
|
315
|
-
|
|
316
|
-
**Promise\<[operations.MakePaymentResponseBody](../../models/operations/makepaymentresponsebody.md)\>**
|
|
317
|
-
|
|
318
|
-
### Errors
|
|
319
|
-
|
|
320
|
-
| Error Type | Status Code | Content Type |
|
|
321
|
-
| ----------------------- | ----------------------- | ----------------------- |
|
|
322
|
-
| errors.ApiErrorResponse | 400, 401, 403, 404 | application/json |
|
|
323
|
-
| errors.ApiErrorResponse | 500 | application/json |
|
|
324
|
-
| errors.APIError | 4XX, 5XX | \*/\* |
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
# MobileDevices
|
|
2
|
-
(*mobileDevices*)
|
|
3
|
-
|
|
4
|
-
## Overview
|
|
5
|
-
|
|
6
|
-
### Available Operations
|
|
7
|
-
|
|
8
|
-
* [addMobileDevice](#addmobiledevice) - Add mobile device
|
|
9
|
-
|
|
10
|
-
## addMobileDevice
|
|
11
|
-
|
|
12
|
-
Add mobile device
|
|
13
|
-
|
|
14
|
-
### Example Usage
|
|
15
|
-
|
|
16
|
-
<!-- UsageSnippet language="typescript" operationID="addMobileDevice" method="post" path="/mobile-device" -->
|
|
17
|
-
```typescript
|
|
18
|
-
import { GreenSecurity } from "@greensecurity/javascript-sdk";
|
|
19
|
-
|
|
20
|
-
const greenSecurity = new GreenSecurity({
|
|
21
|
-
security: {
|
|
22
|
-
token: process.env["GREEN_SECURITY_TOKEN"] ?? "",
|
|
23
|
-
},
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
async function run() {
|
|
27
|
-
const result = await greenSecurity.mobileDevices.addMobileDevice({});
|
|
28
|
-
|
|
29
|
-
console.log(result);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
run();
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
### Standalone function
|
|
36
|
-
|
|
37
|
-
The standalone function version of this method:
|
|
38
|
-
|
|
39
|
-
```typescript
|
|
40
|
-
import { GreenSecurityCore } from "@greensecurity/javascript-sdk/core.js";
|
|
41
|
-
import { mobileDevicesAddMobileDevice } from "@greensecurity/javascript-sdk/funcs/mobileDevicesAddMobileDevice.js";
|
|
42
|
-
|
|
43
|
-
// Use `GreenSecurityCore` for best tree-shaking performance.
|
|
44
|
-
// You can create one instance of it to use across an application.
|
|
45
|
-
const greenSecurity = new GreenSecurityCore({
|
|
46
|
-
security: {
|
|
47
|
-
token: process.env["GREEN_SECURITY_TOKEN"] ?? "",
|
|
48
|
-
},
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
async function run() {
|
|
52
|
-
const res = await mobileDevicesAddMobileDevice(greenSecurity, {});
|
|
53
|
-
if (res.ok) {
|
|
54
|
-
const { value: result } = res;
|
|
55
|
-
console.log(result);
|
|
56
|
-
} else {
|
|
57
|
-
console.log("mobileDevicesAddMobileDevice failed:", res.error);
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
run();
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
### React hooks and utilities
|
|
65
|
-
|
|
66
|
-
This method can be used in React components through the following hooks and
|
|
67
|
-
associated utilities.
|
|
68
|
-
|
|
69
|
-
> Check out [this guide][hook-guide] for information about each of the utilities
|
|
70
|
-
> below and how to get started using React hooks.
|
|
71
|
-
|
|
72
|
-
[hook-guide]: ../../../REACT_QUERY.md
|
|
73
|
-
|
|
74
|
-
```tsx
|
|
75
|
-
import {
|
|
76
|
-
// Mutation hook for triggering the API call.
|
|
77
|
-
useMobileDevicesAddMobileDeviceMutation
|
|
78
|
-
} from "@greensecurity/javascript-sdk/react-query/mobileDevicesAddMobileDevice.js";
|
|
79
|
-
```
|
|
80
|
-
|
|
81
|
-
### Parameters
|
|
82
|
-
|
|
83
|
-
| Parameter | Type | Required | Description |
|
|
84
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
85
|
-
| `request` | [operations.AddMobileDeviceRequestBody](../../models/operations/addmobiledevicerequestbody.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
86
|
-
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
87
|
-
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
|
|
88
|
-
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
89
|
-
|
|
90
|
-
### Response
|
|
91
|
-
|
|
92
|
-
**Promise\<[operations.AddMobileDeviceResponseBody](../../models/operations/addmobiledeviceresponsebody.md)\>**
|
|
93
|
-
|
|
94
|
-
### Errors
|
|
95
|
-
|
|
96
|
-
| Error Type | Status Code | Content Type |
|
|
97
|
-
| ----------------------- | ----------------------- | ----------------------- |
|
|
98
|
-
| errors.ApiErrorResponse | 400, 401, 403, 404 | application/json |
|
|
99
|
-
| errors.ApiErrorResponse | 500 | application/json |
|
|
100
|
-
| errors.APIError | 4XX, 5XX | \*/\* |
|