| 375 | } |
| 376 | |
| 377 | static validateIdempotencyOptions(idempotencyOptions) { |
| 378 | if (!idempotencyOptions) { |
| 379 | return; |
| 380 | } |
| 381 | if (idempotencyOptions.ttl === undefined) { |
| 382 | idempotencyOptions.ttl = IdempotencyOptions.ttl.default; |
| 383 | } else if (!isNaN(idempotencyOptions.ttl) && idempotencyOptions.ttl <= 0) { |
| 384 | throw 'idempotency TTL value must be greater than 0 seconds'; |
| 385 | } else if (isNaN(idempotencyOptions.ttl)) { |
| 386 | throw 'idempotency TTL value must be a number'; |
| 387 | } |
| 388 | if (!idempotencyOptions.paths) { |
| 389 | idempotencyOptions.paths = IdempotencyOptions.paths.default; |
| 390 | } else if (!Array.isArray(idempotencyOptions.paths)) { |
| 391 | throw 'idempotency paths must be of an array of strings'; |
| 392 | } |
| 393 | } |
| 394 | |
| 395 | static validateAccountLockoutPolicy(accountLockout) { |
| 396 | if (accountLockout) { |