#NEWLINE# @ webapi_check_local_site #NEWLINE# @ webapi_login_required #NEWLINE# @ webapi_response_errors ( DOES_NOT_EXIST , NOT_LOGGED_IN , PERMISSION_DENIED ) #NEWLINE# @ webapi_request_fields ( optional = dict ( { #NEWLINE# #INDENT# 'x' : { #NEWLINE# #INDENT# 'type' : int , #NEWLINE# 'description' : 'The X location for the comment.' , #NEWLINE# #UNINDENT# } , #NEWLINE# 'y' : { #NEWLINE# #INDENT# 'type' : int , #NEWLINE# 'description' : 'The Y location for the comment.' , #NEWLINE# #UNINDENT# } , #NEWLINE# 'w' : { #NEWLINE# #INDENT# 'type' : int , #NEWLINE# 'description' : 'The width of the comment region.' , #NEWLINE# #UNINDENT# } , #NEWLINE# 'h' : { #NEWLINE# #INDENT# 'type' : int , #NEWLINE# 'description' : 'The height of the comment region.' , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } , ** BaseScreenshotCommentResource . OPTIONAL_UPDATE_FIELDS ) , allow_unknown = True ) #NEWLINE# def update( self , request , * args , **kwargs ) : #NEWLINE# #INDENT# 'Updates a screenshot comment.\n\n        This can update the text or region of an existing comment. It\n        can only be done for comments that are part of a draft review.\n        ' #NEWLINE# try : #NEWLINE# #INDENT# resources . review_request . get_object ( request , * args , ** kwargs ) #NEWLINE# review = resources . review . get_object ( request , * args , ** kwargs ) #NEWLINE# screenshot_comment = self . get_object ( request , * args , ** kwargs ) #NEWLINE# #UNINDENT# except ObjectDoesNotExist : #NEWLINE# #INDENT# return DOES_NOT_EXIST #NEWLINE# #UNINDENT# if self . should_update_issue_status ( screenshot_comment , ** kwargs ) : #NEWLINE# #INDENT# return self . update_issue_status ( request , self , * args , ** kwargs ) #NEWLINE# #UNINDENT# if ( not resources . review . has_modify_permissions ( request , review ) ) : #NEWLINE# #INDENT# return self . get_no_access_error ( request ) #NEWLINE# #UNINDENT# self . update_comment ( screenshot_comment , ( 'x' , 'y' , 'w' , 'h' ) , ** kwargs ) #NEWLINE# return ( 200 , { #NEWLINE# #INDENT# self . item_result_key : screenshot_comment , #NEWLINE# #UNINDENT# } )