@@ -17,15 +17,15 @@ import {
17
17
BrokenLinksResultV1_BrokenLinkCheckerOptions_LinkOrder ,
18
18
BrokenLinksResultV1_BrokenLinkCheckerOptions_PerLinkOption ,
19
19
BrokenLinksResultV1_BrokenLinkCheckerOptions_ScreenshotOptions ,
20
- BrokenLinksResultV1_BrokenLinkCheckerOptions_ScreenshotOptions_ScreenshotCondition ,
20
+ BrokenLinksResultV1_BrokenLinkCheckerOptions_ScreenshotOptions_CaptureCondition as ApiCaptureCondition ,
21
21
ResponseStatusCode ,
22
22
ResponseStatusCode_StatusClass ,
23
23
} from '@google-cloud/synthetics-sdk-api' ;
24
24
import {
25
25
BrokenLinkCheckerOptions ,
26
26
LinkOrder ,
27
27
StatusClass ,
28
- ScreenshotCondition ,
28
+ CaptureCondition ,
29
29
} from './broken_links' ;
30
30
31
31
/**
@@ -156,13 +156,13 @@ export function validateInputOptions(
156
156
157
157
// check storage_condition
158
158
if (
159
- inputOptions . screenshot_options ?. screenshot_condition !== undefined &&
160
- ! Object . values ( ScreenshotCondition ) . includes (
161
- inputOptions . screenshot_options ?. screenshot_condition
159
+ inputOptions . screenshot_options ?. capture_condition !== undefined &&
160
+ ! Object . values ( CaptureCondition ) . includes (
161
+ inputOptions . screenshot_options ?. capture_condition
162
162
)
163
163
) {
164
164
throw new Error (
165
- 'Invalid screenshot_condition value, must be `ALL`, `FAILING`, OR `NONE`'
165
+ 'Invalid capture_condition value, must be `ALL`, `FAILING`, OR `NONE`'
166
166
) ;
167
167
}
168
168
@@ -217,8 +217,7 @@ export function validateInputOptions(
217
217
per_link_options : inputOptions . per_link_options ,
218
218
total_synthetic_timeout_millis : inputOptions . total_synthetic_timeout_millis ,
219
219
screenshot_options : {
220
- screenshot_condition :
221
- inputOptions . screenshot_options ?. screenshot_condition ,
220
+ capture_condition : inputOptions . screenshot_options ?. capture_condition ,
222
221
storage_location : inputOptions . screenshot_options ?. storage_location ,
223
222
} ,
224
223
} ;
@@ -245,8 +244,7 @@ export function setDefaultOptions(
245
244
per_link_options : { } ,
246
245
total_synthetic_timeout_millis : 60000 ,
247
246
screenshot_options : {
248
- screenshot_condition :
249
- BrokenLinksResultV1_BrokenLinkCheckerOptions_ScreenshotOptions_ScreenshotCondition . FAILING ,
247
+ capture_condition : ApiCaptureCondition . FAILING ,
250
248
storage_location : '' ,
251
249
} ,
252
250
} ;
@@ -283,14 +281,12 @@ export function setDefaultOptions(
283
281
// BrokenLinksResultV1_BrokenLinkCheckerOptions_ScreenshotOptions
284
282
outputOptions . screenshot_options =
285
283
{ } as BrokenLinksResultV1_BrokenLinkCheckerOptions_ScreenshotOptions ;
286
- if ( inputOptions . screenshot_options ?. screenshot_condition ) {
287
- outputOptions . screenshot_options ! . screenshot_condition =
288
- BrokenLinksResultV1_BrokenLinkCheckerOptions_ScreenshotOptions_ScreenshotCondition [
289
- inputOptions . screenshot_options . screenshot_condition
290
- ] ;
284
+ if ( inputOptions . screenshot_options ?. capture_condition ) {
285
+ outputOptions . screenshot_options ! . capture_condition =
286
+ ApiCaptureCondition [ inputOptions . screenshot_options . capture_condition ] ;
291
287
} else {
292
- outputOptions . screenshot_options ! . screenshot_condition =
293
- defaultOptions . screenshot_options ! . screenshot_condition ;
288
+ outputOptions . screenshot_options ! . capture_condition =
289
+ defaultOptions . screenshot_options ! . capture_condition ;
294
290
}
295
291
296
292
if ( outputOptions . screenshot_options ?. storage_location ) {
0 commit comments