CreateBranchProtection

com.worxbend.codeberg4s.repositories.access.CreateBranchProtection
See theCreateBranchProtection companion object
final case class CreateBranchProtection(ruleName: BranchRuleName, legacyBranchName: Option[BranchName], settings: BranchProtectionSettings)

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_name property. Forgejo replaced it with rule_name and 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 Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

Also sends the deprecated branch_name property; see legacyBranchName.

Also sends the deprecated branch_name property; see legacyBranchName.

Attributes

Replaces the settings the rule is created with.

Replaces the settings the rule is created with.

Attributes

Inherited methods

def productElementNames: Iterator[String]

An iterator over the names of all the elements of this product.

An iterator over the names of all the elements of this product.

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

An iterator over all the elements of this product.

An iterator over all the elements of this product.

Attributes

Returns

in the default implementation, an Iterator[Any]

Inherited from:
Product