Skip to content

UpdateFileOptions

Import from pyfj or pyfj.models as UpdateFileOptions.

UpdateFileOptions

UpdateFileOptions options for updating files Note: author and committer are optional (if only one is given, it will be used for the other, otherwise the authenticated user will be used)

author

author: Identity | None = None

branch

branch: str | None = Field(
    default=None, description="branch (optional) to base this file from. if not given, the default branch is used"
)

committer

committer: Identity | None = None

content

content: str = Field(description='content must be base64 encoded')

dates

dates: CommitDateOptions | None = None

force_overwrite_new_branch

force_overwrite_new_branch: bool | None = Field(
    default=None, description="(optional) will do a force-push if the new branch already exists"
)

from_path

from_path: str | None = Field(
    default=None,
    description="from_path (optional) is the path of the original file which will be moved/renamed to the path in the URL",
)

message

message: str | None = Field(
    default=None,
    description="message (optional) for the commit of this file. if not supplied, a default message will be used",
)

new_branch

new_branch: str | None = Field(
    default=None, description="new_branch (optional) will make a new branch from `branch` before creating the file"
)

sha

sha: str = Field(description='sha is the SHA for the file that already exists')

signoff

signoff: bool | None = Field(
    default=None, description="Add a Signed-off-by trailer by the committer at the end of the commit log message."
)