@@ -321,18 +321,23 @@ def create_redactions_preset(
321321 """
322322 options = {
323323 "strategy" : "preset" ,
324- "strategy_options" : {"preset" : preset },
325- "include_annotations" : include_annotations ,
326- "include_text" : include_text ,
324+ "strategy_options" : {
325+ "preset" : preset ,
326+ "includeAnnotations" : include_annotations ,
327+ "includeText" : include_text ,
328+ },
327329 }
328330
329331 # Add appearance options if provided
332+ content = {}
330333 if appearance_fill_color :
331- options [ "appearance_fill_color " ] = appearance_fill_color
334+ content [ "fillColor " ] = appearance_fill_color
332335 if appearance_stroke_color :
333- options ["appearance_stroke_color" ] = appearance_stroke_color
334- if appearance_stroke_width is not None :
335- options ["appearance_stroke_width" ] = appearance_stroke_width
336+ content ["outlineColor" ] = appearance_stroke_color
337+ # Note: stroke width is not supported by the API
338+
339+ if content :
340+ options ["content" ] = content
336341
337342 return self ._process_file ("create-redactions" , input_file , output_path , ** options )
338343
@@ -378,19 +383,22 @@ def create_redactions_regex(
378383 "strategy" : "regex" ,
379384 "strategy_options" : {
380385 "pattern" : pattern ,
381- "case_sensitive" : case_sensitive ,
386+ "caseSensitive" : case_sensitive ,
387+ "includeAnnotations" : include_annotations ,
388+ "includeText" : include_text ,
382389 },
383- "include_annotations" : include_annotations ,
384- "include_text" : include_text ,
385390 }
386391
387392 # Add appearance options if provided
393+ content = {}
388394 if appearance_fill_color :
389- options [ "appearance_fill_color " ] = appearance_fill_color
395+ content [ "fillColor " ] = appearance_fill_color
390396 if appearance_stroke_color :
391- options ["appearance_stroke_color" ] = appearance_stroke_color
392- if appearance_stroke_width is not None :
393- options ["appearance_stroke_width" ] = appearance_stroke_width
397+ content ["outlineColor" ] = appearance_stroke_color
398+ # Note: stroke width is not supported by the API
399+
400+ if content :
401+ options ["content" ] = content
394402
395403 return self ._process_file ("create-redactions" , input_file , output_path , ** options )
396404
@@ -438,20 +446,23 @@ def create_redactions_text(
438446 "strategy" : "text" ,
439447 "strategy_options" : {
440448 "text" : text ,
441- "case_sensitive" : case_sensitive ,
442- "whole_words_only" : whole_words_only ,
449+ "caseSensitive" : case_sensitive ,
450+ "wholeWordsOnly" : whole_words_only ,
451+ "includeAnnotations" : include_annotations ,
452+ "includeText" : include_text ,
443453 },
444- "include_annotations" : include_annotations ,
445- "include_text" : include_text ,
446454 }
447455
448456 # Add appearance options if provided
457+ content = {}
449458 if appearance_fill_color :
450- options [ "appearance_fill_color " ] = appearance_fill_color
459+ content [ "fillColor " ] = appearance_fill_color
451460 if appearance_stroke_color :
452- options ["appearance_stroke_color" ] = appearance_stroke_color
453- if appearance_stroke_width is not None :
454- options ["appearance_stroke_width" ] = appearance_stroke_width
461+ content ["outlineColor" ] = appearance_stroke_color
462+ # Note: stroke width is not supported by the API
463+
464+ if content :
465+ options ["content" ] = content
455466
456467 return self ._process_file ("create-redactions" , input_file , output_path , ** options )
457468
0 commit comments