def edit_protection(self, strict=github.GithubObject.NotSet, contexts=github.GithubObject.NotSet, enforce_admins=github.GithubObject.NotSet, dismissal_users=github.GithubObject.NotSet, dismissal_teams=github.GithubObject.NotSet, dismiss_stale_reviews=github.GithubObject.NotSet, require_code_owner_reviews=github.GithubObject.NotSet, required_approving_review_count=github.GithubObject.NotSet, user_push_restrictions=github.GithubObject.NotSet, team_push_restrictions=github.GithubObject.NotSet):
assert strict is github.GithubObject.NotSet or isinstance(strict, bool), strict<EOL>assert contexts is github.GithubObject.NotSet or all(isinstance(element, (str, unicode)) or isinstance(element, (str, unicode)) for element in contexts), contexts<EOL>assert enforce_admins is github.GithubObject.NotSet or isinstance(enforce_admins, bool), enforce_admins<EOL>assert dismissal_users is github.GithubObject.NotSet or all(isinstance(element, (str, unicode)) or isinstance(element, (str, unicode)) for element in dismissal_users), dismissal_users<EOL>assert dismissal_teams is github.GithubObject.NotSet or all(isinstance(element, (str, unicode)) or isinstance(element, (str, unicode)) for element in dismissal_teams), dismissal_teams<EOL>assert dismiss_stale_reviews is github.GithubObject.NotSet or isinstance(dismiss_stale_reviews, bool), dismiss_stale_reviews<EOL>assert require_code_owner_reviews is github.GithubObject.NotSet or isinstance(require_code_owner_reviews, bool), require_code_owner_reviews<EOL>assert required_approving_review_count is github.GithubObject.NotSet or isinstance(required_approving_review_count, int), required_approving_review_count<EOL>post_parameters = {}<EOL>if strict is not github.GithubObject.NotSet or contexts is not github.GithubObject.NotSet:<EOL><INDENT>if strict is github.GithubObject.NotSet:<EOL><INDENT>strict = False<EOL><DEDENT>if contexts is github.GithubObject.NotSet:<EOL><INDENT>contexts = []<EOL><DEDENT>post_parameters["<STR_LIT>"] = {"<STR_LIT:strict>": strict, "<STR_LIT>": contexts}<EOL><DEDENT>else:<EOL><INDENT>post_parameters["<STR_LIT>"] = None<EOL><DEDENT>if enforce_admins is not github.GithubObject.NotSet:<EOL><INDENT>post_parameters["<STR_LIT>"] = enforce_admins<EOL><DEDENT>else:<EOL><INDENT>post_parameters["<STR_LIT>"] = None<EOL><DEDENT>if dismissal_users is not github.GithubObject.NotSet or dismissal_teams is not github.GithubObject.NotSet or dismiss_stale_reviews is not github.GithubObject.NotSet or require_code_owner_reviews is not github.GithubObject.NotSet or required_approving_review_count is not github.GithubObject.NotSet:<EOL><INDENT>post_parameters["<STR_LIT>"] = {}<EOL>if dismiss_stale_reviews is not github.GithubObject.NotSet:<EOL><INDENT>post_parameters["<STR_LIT>"]["<STR_LIT>"] = dismiss_stale_reviews<EOL><DEDENT>if require_code_owner_reviews is not github.GithubObject.NotSet:<EOL><INDENT>post_parameters["<STR_LIT>"]["<STR_LIT>"] = require_code_owner_reviews<EOL><DEDENT>if required_approving_review_count is not github.GithubObject.NotSet:<EOL><INDENT>post_parameters["<STR_LIT>"]["<STR_LIT>"] = required_approving_review_count<EOL><DEDENT>if dismissal_users is not github.GithubObject.NotSet:<EOL><INDENT>post_parameters["<STR_LIT>"]["<STR_LIT>"] = {"<STR_LIT>": dismissal_users}<EOL><DEDENT>if dismissal_teams is not github.GithubObject.NotSet:<EOL><INDENT>if "<STR_LIT>" not in post_parameters["<STR_LIT>"]:<EOL><INDENT>post_parameters["<STR_LIT>"]["<STR_LIT>"] = {}<EOL><DEDENT>post_parameters["<STR_LIT>"]["<STR_LIT>"]["<STR_LIT>"] = dismissal_teams<EOL><DEDENT><DEDENT>else:<EOL><INDENT>post_parameters["<STR_LIT>"] = None<EOL><DEDENT>if user_push_restrictions is not github.GithubObject.NotSet or team_push_restrictions is not github.GithubObject.NotSet:<EOL><INDENT>if user_push_restrictions is github.GithubObject.NotSet:<EOL><INDENT>user_push_restrictions = []<EOL><DEDENT>if team_push_restrictions is github.GithubObject.NotSet:<EOL><INDENT>team_push_restrictions = []<EOL><DEDENT>post_parameters["<STR_LIT>"] = {"<STR_LIT>": user_push_restrictions, "<STR_LIT>": team_push_restrictions}<EOL><DEDENT>else:<EOL><INDENT>post_parameters["<STR_LIT>"] = None<EOL><DEDENT>headers, data = self._requester.requestJsonAndCheck(<EOL>"<STR_LIT>",<EOL>self.protection_url,<EOL>headers={'<STR_LIT>': Consts.mediaTypeRequireMultipleApprovingReviews},<EOL>input=post_parameters<EOL>)<EOL>
:calls: `PUT /repos/:owner/:repo/branches/:branch/protection <https://developer.github.com/v3/repos/branches>`_
:strict: bool
:contexts: list of strings
:enforce_admins: bool
:dismissal_users: list of strings
:dismissal_teams: list of strings
:dismiss_stale_reviews: bool
:require_code_owner_reviews: bool
:required_approving_review_count: int
:user_push_restrictions: list of strings
:team_push_restrictions: list of strings

NOTE: The GitHub API groups strict and contexts together, both must
be submitted. Take care to pass both as arguments even if only one is
changing. Use edit_required_status_checks() to avoid this.