@@ -41,3 +41,233 @@ $protection = $client->api('repo')->protection()->show('twbs', 'bootstrap', 'mas
4141``` php
4242$protection = $client->api('repo')->protection()->remove('twbs', 'bootstrap', 'master');
4343```
44+
45+ ### Get required status checks of protected branch
46+
47+ > Requires [ authentication] ( ../security.md ) .
48+
49+ ``` php
50+ $protection = $client->api('repo')->protection()->showStatusChecks('twbs', 'bootstrap', 'master');
51+ ```
52+
53+ ### Update required status checks of protected branch
54+
55+ > Requires [ authentication] ( ../security.md ) .
56+
57+ ``` php
58+ $params = [
59+ 'strict' => true,
60+ 'contexts' => [
61+ 'continuous-integration/travis-ci',
62+ ],
63+ ];
64+ $protection = $client->api('repo')->protection()->updateStatusChecks('twbs', 'bootstrap', 'master', $params);
65+ ```
66+
67+ ### Remove required status checks of protected branch
68+
69+ > Requires [ authentication] ( ../security.md ) .
70+
71+ ``` php
72+ $protection = $client->api('repo')->protection()->removeStatusChecks('twbs', 'bootstrap', 'master');
73+ ```
74+
75+ ### List required status checks contexts of protected branch
76+
77+ > Requires [ authentication] ( ../security.md ) .
78+
79+ ``` php
80+ $protection = $client->api('repo')->protection()->showStatusChecksContexts('twbs', 'bootstrap', 'master');
81+ ```
82+
83+ ### Replace required status checks contexts of protected branch
84+
85+ > Requires [ authentication] ( ../security.md ) .
86+
87+ ``` php
88+ $params = [
89+ 'continuous-integration/travis-ci',
90+ ];
91+ $protection = $client->api('repo')->protection()->replaceStatusChecksContexts('twbs', 'bootstrap', 'master', $params);
92+ ```
93+
94+ ### Add required status checks contexts of protected branch
95+
96+ > Requires [ authentication] ( ../security.md ) .
97+
98+ ``` php
99+ $params = [
100+ 'continuous-integration/jenkins',
101+ ];
102+ $protection = $client->api('repo')->protection()->addStatusChecksContexts('twbs', 'bootstrap', 'master', $params);
103+ ```
104+
105+ ### Remove required status checks contexts of protected branch
106+
107+ > Requires [ authentication] ( ../security.md ) .
108+
109+ ``` php
110+ $params = [
111+ 'continuous-integration/jenkins',
112+ ];
113+ $protection = $client->api('repo')->protection()->removeStatusChecksContexts('twbs', 'bootstrap', 'master', $params);
114+ ```
115+
116+ ### Get pull request review enforcement of protected branch
117+
118+ > Requires [ authentication] ( ../security.md ) .
119+
120+ ``` php
121+ $protection = $client->api('repo')->protection()->showPullRequestReviewEnforcement('twbs', 'bootstrap', 'master');
122+ ```
123+
124+ ### Update pull request review enforcement of protected branch
125+
126+ > Requires [ authentication] ( ../security.md ) with admin access and branch protection to be enabled.
127+
128+ ``` php
129+ $params = [
130+ 'dismissal_restrictions' => [
131+ 'users' => [
132+ 'octocat',
133+ ],
134+ 'teams' => [
135+ 'justice-league',
136+ ],
137+ ],
138+ 'dismiss_stale_reviews' => true,
139+ 'require_code_owner_reviews' => true,
140+ ];
141+ $protection = $client->api('repo')->protection()->updatePullRequestReviewEnforcement('twbs', 'bootstrap', 'master', $params);
142+ ```
143+
144+ ### Remove pull request review enforcement of protected branch
145+
146+ > Requires [ authentication] ( ../security.md ) .
147+
148+ ``` php
149+ $protection = $client->api('repo')->protection()->removePullRequestReviewEnforcement('twbs', 'bootstrap', 'master');
150+ ```
151+
152+ ### Get admin enforcement of protected branch
153+
154+
155+ > Requires [ authentication] ( ../security.md ) .
156+
157+ ``` php
158+ $protection = $client->api('repo')->protection()->showAdminEnforcement('twbs', 'bootstrap', 'master');
159+ ```
160+
161+ ### Add admin enforcement of protected branch
162+
163+ > Requires [ authentication] ( ../security.md ) with admin access and branch protection to be enabled.
164+
165+ ``` php
166+ $protection = $client->api('repo')->protection()->addAdminEnforcement('twbs', 'bootstrap', 'master');
167+ ```
168+
169+ ### Remove admin enforcement of protected branch
170+
171+ > Requires [ authentication] ( ../security.md ) with admin access and branch protection to be enabled.
172+
173+ ``` php
174+ $protection = $client->api('repo')->protection()->removeAdminEnforcement('twbs', 'bootstrap', 'master');
175+ ```
176+
177+ ### Get restrictions of protected branch
178+
179+ > Requires [ authentication] ( ../security.md ) and is only available for organization-owned repositories.
180+
181+ ``` php
182+ $protection = $client->api('repo')->protection()->showRestrictions('twbs', 'bootstrap', 'master');
183+ ```
184+
185+ ### Remove restrictions of protected branch
186+
187+ > Requires [ authentication] ( ../security.md ) and is only available for organization-owned repositories.
188+
189+ ``` php
190+ $protection = $client->api('repo')->protection()->removeRestrictions('twbs', 'bootstrap', 'master');
191+ ```
192+
193+ ### List team restrictions of protected branch
194+
195+ > Requires [ authentication] ( ../security.md ) and is only available for organization-owned repositories.
196+
197+ ``` php
198+ $protection = $client->api('repo')->protection()->showTeamRestrictions('twbs', 'bootstrap', 'master');
199+ ```
200+
201+ ### Replace team restrictions of protected branch
202+
203+ > Requires [ authentication] ( ../security.md ) and is only available for organization-owned repositories.
204+
205+ ``` php
206+ $params = [
207+ 'justice-league',
208+ ];
209+ $protection = $client->api('repo')->protection()->replaceTeamRestrictions('twbs', 'bootstrap', 'master', $params);
210+ ```
211+
212+ ### Add team restrictions of protected branch
213+
214+ > Requires [ authentication] ( ../security.md ) and is only available for organization-owned repositories.
215+
216+ ``` php
217+ $params = [
218+ 'justice-league',
219+ ];
220+ $protection = $client->api('repo')->protection()->addTeamRestrictions('twbs', 'bootstrap', 'master', $params);
221+ ```
222+
223+ ### Remove team restrictions of protected branch
224+
225+ > Requires [ authentication] ( ../security.md ) and is only available for organization-owned repositories.
226+
227+ ``` php
228+ $params = [
229+ 'octocats',
230+ ];
231+ $protection = $client->api('repo')->protection()->removeTeamRestrictions('twbs', 'bootstrap', 'master', $params);
232+ ```
233+
234+ ### List user restrictions of protected branch
235+
236+ > Requires [ authentication] ( ../security.md ) and is only available for organization-owned repositories.
237+
238+ ``` php
239+ $protection = $client->api('repo')->protection()->showUserRestrictions('twbs', 'bootstrap', 'master');
240+ ```
241+
242+ ### Replace user restrictions of protected branch
243+
244+ > Requires [ authentication] ( ../security.md ) and is only available for organization-owned repositories.
245+
246+ ``` php
247+ $params = [
248+ 'octocat',
249+ ];
250+ $protection = $client->api('repo')->protection()->replaceUserRestrictions('twbs', 'bootstrap', 'master', $params);
251+ ```
252+
253+ ### Add user restrictions of protected branch
254+
255+ > Requires [ authentication] ( ../security.md ) and is only available for organization-owned repositories.
256+
257+ ``` php
258+ $params = [
259+ 'octocat',
260+ ];
261+ $protection = $client->api('repo')->protection()->addUserRestrictions('twbs', 'bootstrap', 'master', $params);
262+ ```
263+
264+ ### Remove user restrictions of protected branch
265+
266+ > Requires [ authentication] ( ../security.md ) and is only available for organization-owned repositories.
267+
268+ ``` php
269+ $params = [
270+ 'defunkt',
271+ ];
272+ $protection = $client->api('repo')->protection()->removeUserRestrictions('twbs', 'bootstrap', 'master', $params);
273+ ```
0 commit comments