CreateWikiPage

com.worxbend.codeberg4s.repositories.hooks.CreateWikiPage
See theCreateWikiPage companion object
final case class CreateWikiPage(title: WikiPageName, content: FileContent, message: Option[String])

What POST /repos/{owner}/{repo}/wiki/new is told.

CreateWikiPage.ofText(name, "# Deployment\n\nRun `make deploy`.").withMessage("document the deploy")

CreateWikiPageOptions is shared by the create and the edit route in spec/swagger.v1.json, but the two do not mean the same thing by it — a create must name the page it is creating, while an edit's title is documented as "leave empty to keep unchanged" and is therefore a rename. Modelling them as one type would make title optional on a route that cannot work without it, so there are two: this one and EditWikiPage. They share a renderer, which is where the wire spellings live exactly once.

Value parameters

content

the page body, base64-encoded — build it with WikiContent, or reuse a com.worxbend.codeberg4s.repositories.FileContent read back from another page

message

the commit message for the revision this creates, absent to let Forgejo write its own

title

the page to create

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

def withMessage(text: String): CreateWikiPage

Records text as the commit message of the revision this creates.

Records text as the commit message of the revision this creates.

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