What POST /repos/{owner}/{repo}/branch_protections is told.
CreateBranchProtection
.on(ruleName)
.withSettings(BranchProtectionSettings.Unchanged.requiringSignedCommits(true).applyingToAdmins(true))
spec/swagger.v1.json declares '''no''' required property on CreateBranchProtectionOption — consistent with docs/HAZARDS.md §1, which measured that the 38 definitions carrying a required list are all request models and that this is not one of them. That is not a licence to send {}: a rule that matches nothing is not a rule, so CreateBranchProtection.on demands the name up front and the type has no way to spell a nameless rule.
Value parameters
- legacyBranchName
-
the deprecated
branch_nameproperty. Forgejo replaced it withrule_nameand the spec says so in the property's own description; it is offered because an older instance may still read it, and because a request model this library renders is a rendering of what the spec declares rather than of what it wishes the spec declared. Typed as a com.worxbend.codeberg4s.repositories.BranchName and not a BranchRuleName, because this one really is a branch: it names a single branch, and it may span segments - ruleName
-
the glob the new rule matches branches with, sent as
rule_name - settings
-
the tunables to state; anything left unset is Forgejo's own default
Attributes
- Companion
- object
- Graph
-
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass Any