@cli.register_custom_action('<STR_LIT>', tuple(),<EOL>('<STR_LIT>',<EOL>'<STR_LIT>'))<EOL><INDENT>@exc.on_http_error(exc.GitlabProtectError)<EOL>def protect(self, developers_can_push=False, developers_can_merge=False,<EOL>**kwargs):<DEDENT>
id = self.get_id().replace('<STR_LIT:/>', '<STR_LIT>')<EOL>path = '<STR_LIT>' % (self.manager.path, id)<EOL>post_data = {'<STR_LIT>': developers_can_push,<EOL>'<STR_LIT>': developers_can_merge}<EOL>self.manager.gitlab.http_put(path, post_data=post_data, **kwargs)<EOL>self._attrs['<STR_LIT>'] = True<EOL>
Protect the branch.

        Args:
            developers_can_push (bool): Set to True if developers are allowed
                                        to push to the branch
            developers_can_merge (bool): Set to True if developers are allowed
                                         to merge to the branch
            **kwargs: Extra options to send to the server (e.g. sudo)

        Raises:
            GitlabAuthenticationError: If authentication is not correct
            GitlabProtectError: If the branch could not be protected