#NEWLINE# def protect( self , enforcement = None , status_checks = None ) : #NEWLINE# #INDENT# "Enable force push protection and configure status check enforcement.\n\n        See: http://git.io/v4Gvu\n\n        :param str enforcement: (optional), Specifies the enforcement level of\n            the status checks. Must be one of 'off', 'non_admins', or\n            'everyone'. Use `None` or omit to use the already associated value.\n        :param list status_checks: (optional), An list of strings naming\n            status checks that must pass before merging. Use `None` or omit to\n            use the already associated value.\n        " #NEWLINE# previous_values = self . protection [ 'required_status_checks' ] #NEWLINE# if ( enforcement is None ) : #NEWLINE# #INDENT# enforcement = previous_values [ 'enforcement_level' ] #NEWLINE# #UNINDENT# if ( status_checks is None ) : #NEWLINE# #INDENT# status_checks = previous_values [ 'contexts' ] #NEWLINE# #UNINDENT# edit = { #NEWLINE# #INDENT# 'protection' : { #NEWLINE# #INDENT# 'enabled' : True , #NEWLINE# 'required_status_checks' : { #NEWLINE# #INDENT# 'enforcement_level' : enforcement , #NEWLINE# 'contexts' : status_checks , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } #NEWLINE# json = self . _json ( self . _patch ( self . _api , data = dumps ( edit ) , headers = self . PREVIEW_HEADERS ) , 200 ) #NEWLINE# self . _update_attributes ( json ) #NEWLINE# return True