@@ -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,8 @@ 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 :
221
+ inputOptions . screenshot_options ?. capture_condition ,
222
222
storage_location : inputOptions . screenshot_options ?. storage_location ,
223
223
} ,
224
224
} ;
@@ -245,8 +245,8 @@ export function setDefaultOptions(
245
245
per_link_options : { } ,
246
246
total_synthetic_timeout_millis : 60000 ,
247
247
screenshot_options : {
248
- screenshot_condition :
249
- BrokenLinksResultV1_BrokenLinkCheckerOptions_ScreenshotOptions_ScreenshotCondition . FAILING ,
248
+ capture_condition :
249
+ ApiCaptureCondition . FAILING ,
250
250
storage_location : '' ,
251
251
} ,
252
252
} ;
@@ -283,14 +283,14 @@ export function setDefaultOptions(
283
283
// BrokenLinksResultV1_BrokenLinkCheckerOptions_ScreenshotOptions
284
284
outputOptions . screenshot_options =
285
285
{ } 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
286
+ if ( inputOptions . screenshot_options ?. capture_condition ) {
287
+ outputOptions . screenshot_options ! . capture_condition =
288
+ ApiCaptureCondition [
289
+ inputOptions . screenshot_options . capture_condition
290
290
] ;
291
291
} else {
292
- outputOptions . screenshot_options ! . screenshot_condition =
293
- defaultOptions . screenshot_options ! . screenshot_condition ;
292
+ outputOptions . screenshot_options ! . capture_condition =
293
+ defaultOptions . screenshot_options ! . capture_condition ;
294
294
}
295
295
296
296
if ( outputOptions . screenshot_options ?. storage_location ) {
0 commit comments