models

package
v2.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 13, 2026 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Attachment

type Attachment struct {
	ID          int    `json:"id"`
	Filename    string `json:"filename"`
	Filesize    int64  `json:"filesize"`
	ContentType string `json:"content_type"`
	Description string `json:"description"`
	ContentURL  string `json:"content_url"`
	Author      IDName `json:"author"`
	CreatedOn   string `json:"created_on"`
}

Attachment represents a file attached to a wiki page.

type CustomField added in v2.6.0

type CustomField struct {
	ID             int                        `json:"id"`
	Name           string                     `json:"name"`
	CustomizedType string                     `json:"customized_type"`
	FieldFormat    string                     `json:"field_format"`
	Regexp         string                     `json:"regexp,omitempty"`
	MinLength      *int                       `json:"min_length,omitempty"`
	MaxLength      *int                       `json:"max_length,omitempty"`
	IsRequired     bool                       `json:"is_required"`
	IsFilter       bool                       `json:"is_filter"`
	Searchable     bool                       `json:"searchable"`
	Multiple       bool                       `json:"multiple"`
	DefaultValue   string                     `json:"default_value,omitempty"`
	Visible        bool                       `json:"visible"`
	PossibleValues []CustomFieldPossibleValue `json:"possible_values,omitempty"`
	Trackers       []IDName                   `json:"trackers,omitempty"`
	Roles          []IDName                   `json:"roles,omitempty"`
}

CustomField represents a Redmine custom field definition as returned by /custom_fields.json. The endpoint is admin-only.

type CustomFieldPossibleValue added in v2.6.0

type CustomFieldPossibleValue struct {
	Value string `json:"value"`
	Label string `json:"label,omitempty"`
}

CustomFieldPossibleValue represents one entry of a list-format custom field's possible values. Redmine returns the field as an array of `{value,label}` objects, sometimes as bare strings on older versions; the list-of-objects form is what /custom_fields.json emits in 4.x+.

type CustomFieldValue

type CustomFieldValue struct {
	ID       int         `json:"id"`
	Name     string      `json:"name"`
	Value    interface{} `json:"value"`
	Multiple bool        `json:"multiple,omitempty"`
}

CustomFieldValue represents a custom field value on a resource.

type Enumeration

type Enumeration struct {
	ID        int    `json:"id"`
	Name      string `json:"name"`
	IsDefault bool   `json:"is_default"`
	Active    bool   `json:"active"`
}

Enumeration represents a Redmine enumeration (activity, priority, etc.).

type Group

type Group struct {
	ID          int      `json:"id"`
	Name        string   `json:"name"`
	Users       []IDName `json:"users,omitempty"`
	Memberships []IDName `json:"memberships,omitempty"`
}

Group represents a Redmine group.

type GroupCreate

type GroupCreate struct {
	Name    string `json:"name"`
	UserIDs []int  `json:"user_ids,omitempty"`
}

GroupCreate defines fields for creating a group.

type GroupFilter

type GroupFilter struct {
	Limit  int
	Offset int
}

GroupFilter defines parameters for listing groups.

type GroupUpdate

type GroupUpdate struct {
	Name    *string `json:"name,omitempty"`
	UserIDs *[]int  `json:"user_ids,omitempty"`
}

GroupUpdate defines fields for updating a group.

type IDName

type IDName struct {
	ID   int    `json:"id"`
	Name string `json:"name"`
}

IDName represents a Redmine resource reference with id and name.

type IDRef

type IDRef struct {
	ID int `json:"id"`
}

IDRef is a simple id-only reference (e.g., parent issue).

type Issue

type Issue struct {
	ID             int                `json:"id"`
	Project        IDName             `json:"project"`
	Tracker        IDName             `json:"tracker"`
	Status         IDName             `json:"status"`
	Priority       IDName             `json:"priority"`
	Author         IDName             `json:"author"`
	AssignedTo     *IDName            `json:"assigned_to,omitempty"`
	Category       *IDName            `json:"category,omitempty"`
	FixedVersion   *IDName            `json:"fixed_version,omitempty"`
	Parent         *IDRef             `json:"parent,omitempty"`
	Subject        string             `json:"subject"`
	Description    string             `json:"description"`
	DoneRatio      int                `json:"done_ratio"`
	IsPrivate      bool               `json:"is_private,omitempty"`
	CreatedOn      string             `json:"created_on"`
	UpdatedOn      string             `json:"updated_on"`
	StartDate      string             `json:"start_date,omitempty"`
	DueDate        string             `json:"due_date,omitempty"`
	EstimatedHours *float64           `json:"estimated_hours,omitempty"`
	CustomFields   []CustomFieldValue `json:"custom_fields,omitempty"`
	Journals       []Journal          `json:"journals,omitempty"`
	Children       []IDRef            `json:"children,omitempty"`
	Watchers       []IDName           `json:"watchers,omitempty"`
	Relations      []IssueRelation    `json:"relations,omitempty"`
}

Issue represents a Redmine issue.

type IssueCategory

type IssueCategory struct {
	ID         int     `json:"id"`
	Name       string  `json:"name"`
	Project    IDName  `json:"project"`
	AssignedTo *IDName `json:"assigned_to,omitempty"`
}

IssueCategory represents a Redmine issue category.

type IssueCreate

type IssueCreate struct {
	ProjectID         int               `json:"project_id"`
	TrackerID         int               `json:"tracker_id,omitempty"`
	StatusID          int               `json:"status_id,omitempty"`
	PriorityID        int               `json:"priority_id,omitempty"`
	Subject           string            `json:"subject"`
	Description       string            `json:"description,omitempty"`
	AssignedToID      int               `json:"assigned_to_id,omitempty"`
	ParentIssueID     int               `json:"parent_issue_id,omitempty"`
	CategoryID        int               `json:"category_id,omitempty"`
	FixedVersionID    int               `json:"fixed_version_id,omitempty"`
	StartDate         string            `json:"start_date,omitempty"`
	DueDate           string            `json:"due_date,omitempty"`
	EstimatedHours    float64           `json:"estimated_hours,omitempty"`
	IsPrivate         *bool             `json:"is_private,omitempty"`
	WatcherUserIDs    []int             `json:"watcher_user_ids,omitempty"`
	CustomFieldValues map[string]string `json:"custom_field_values,omitempty"`
	Uploads           []Upload          `json:"uploads,omitempty"`
}

IssueCreate defines fields for creating a new issue.

type IssueFilter

type IssueFilter struct {
	ProjectID      string
	SubprojectID   string // "!*" excludes subprojects, numeric ID restricts to one
	TrackerID      int
	StatusID       string // "open", "closed", "*", or numeric ID
	AssignedToID   string // numeric ID or "me"
	AuthorID       string // numeric ID or "me"
	PriorityID     string // numeric ID
	CategoryID     int
	FixedVersionID int
	ParentID       int
	IsPrivate      *bool
	QueryID        int    // saved query ID (Redmine query_id parameter)
	Sort           string // e.g., "updated_on:desc"
	Includes       []string
	ExtraParams    map[string]string // escape hatch for Redmine filter syntax (e.g. created_on=">=2025-01-01", cf_5="Critical")
	Limit          int
	Offset         int
}

IssueFilter defines parameters for listing issues.

type IssueRelation added in v2.6.0

type IssueRelation struct {
	ID           int    `json:"id"`
	IssueID      int    `json:"issue_id"`
	IssueToID    int    `json:"issue_to_id"`
	RelationType string `json:"relation_type"`
	Delay        *int   `json:"delay,omitempty"`
}

IssueRelation represents a relation between two issues. Returned both via /issues/{id}.json?include=relations and /issues/{id}/relations.json.

type IssueRelationCreate added in v2.6.0

type IssueRelationCreate struct {
	IssueToID    int    `json:"issue_to_id"`
	RelationType string `json:"relation_type,omitempty"`
	Delay        *int   `json:"delay,omitempty"`
}

IssueRelationCreate defines the payload for creating an issue relation.

type IssueStatus

type IssueStatus struct {
	ID       int    `json:"id"`
	Name     string `json:"name"`
	IsClosed bool   `json:"is_closed"`
}

IssueStatus represents a Redmine issue status.

type IssueUpdate

type IssueUpdate struct {
	TrackerID         *int              `json:"tracker_id,omitempty"`
	StatusID          *int              `json:"status_id,omitempty"`
	PriorityID        *int              `json:"priority_id,omitempty"`
	Subject           *string           `json:"subject,omitempty"`
	Description       *string           `json:"description,omitempty"`
	AssignedToID      *int              `json:"assigned_to_id,omitempty"`
	DoneRatio         *int              `json:"done_ratio,omitempty"`
	Notes             *string           `json:"notes,omitempty"`
	PrivateNotes      *bool             `json:"private_notes,omitempty"`
	StartDate         *string           `json:"start_date,omitempty"`
	DueDate           *string           `json:"due_date,omitempty"`
	ParentIssueID     *int              `json:"parent_issue_id,omitempty"`
	CategoryID        *int              `json:"category_id,omitempty"`
	FixedVersionID    *int              `json:"fixed_version_id,omitempty"`
	EstimatedHours    *float64          `json:"estimated_hours,omitempty"`
	IsPrivate         *bool             `json:"is_private,omitempty"`
	CustomFieldValues map[string]string `json:"custom_field_values,omitempty"`
	Uploads           []Upload          `json:"uploads,omitempty"`
}

IssueUpdate defines fields for updating an issue. Nil fields are not sent.

type Journal

type Journal struct {
	ID           int             `json:"id"`
	User         IDName          `json:"user"`
	Notes        string          `json:"notes"`
	PrivateNotes bool            `json:"private_notes,omitempty"`
	CreatedOn    string          `json:"created_on"`
	Details      []JournalDetail `json:"details,omitempty"`
}

Journal represents an issue history entry.

type JournalDetail

type JournalDetail struct {
	Property string `json:"property"`
	Name     string `json:"name"`
	OldValue string `json:"old_value"`
	NewValue string `json:"new_value"`
}

JournalDetail represents a single change in a journal entry.

type Membership

type Membership struct {
	ID      int      `json:"id"`
	Project IDName   `json:"project"`
	User    *IDName  `json:"user,omitempty"`
	Group   *IDName  `json:"group,omitempty"`
	Roles   []IDName `json:"roles"`
}

Membership represents a project membership.

type MembershipCreate

type MembershipCreate struct {
	UserID  int   `json:"user_id"`
	RoleIDs []int `json:"role_ids"`
}

MembershipCreate defines fields for creating a membership.

type MembershipFilter

type MembershipFilter struct {
	Project string
	Limit   int
	Offset  int
}

MembershipFilter defines parameters for listing memberships.

type MembershipUpdate

type MembershipUpdate struct {
	RoleIDs []int `json:"role_ids"`
}

MembershipUpdate defines fields for updating a membership.

type MyAccountUpdate added in v2.6.0

type MyAccountUpdate struct {
	FirstName        *string `json:"firstname,omitempty"`
	LastName         *string `json:"lastname,omitempty"`
	Mail             *string `json:"mail,omitempty"`
	MailNotification *string `json:"mail_notification,omitempty"`
}

MyAccountUpdate is the writable subset for PUT /my/account.json. The endpoint is the only user-write path available to non-admins; we intentionally keep the type narrow so admin-only fields cannot be sent here by accident.

type Project

type Project struct {
	ID                  int                `json:"id"`
	Name                string             `json:"name"`
	Identifier          string             `json:"identifier"`
	Description         string             `json:"description"`
	Homepage            string             `json:"homepage,omitempty"`
	Status              int                `json:"status"`
	IsPublic            bool               `json:"is_public"`
	InheritMembers      bool               `json:"inherit_members,omitempty"`
	Parent              *IDName            `json:"parent,omitempty"`
	CreatedOn           string             `json:"created_on"`
	UpdatedOn           string             `json:"updated_on"`
	DefaultAssignedTo   *IDName            `json:"default_assigned_to,omitempty"`
	DefaultVersion      *IDName            `json:"default_version,omitempty"`
	Trackers            []IDName           `json:"trackers,omitempty"`
	IssueCategories     []IDName           `json:"issue_categories,omitempty"`
	EnabledModules      []IDName           `json:"enabled_modules,omitempty"`
	TimeEntryActivities []Enumeration      `json:"time_entry_activities,omitempty"`
	IssueCustomFields   []IDName           `json:"issue_custom_fields,omitempty"`
	CustomFields        []CustomFieldValue `json:"custom_fields,omitempty"`
}

Project represents a Redmine project.

type ProjectCreate

type ProjectCreate struct {
	Name                string            `json:"name"`
	Identifier          string            `json:"identifier"`
	Description         string            `json:"description,omitempty"`
	Homepage            string            `json:"homepage,omitempty"`
	IsPublic            *bool             `json:"is_public,omitempty"`
	ParentID            int               `json:"parent_id,omitempty"`
	InheritMembers      bool              `json:"inherit_members,omitempty"`
	DefaultAssignedToID int               `json:"default_assigned_to_id,omitempty"`
	DefaultVersionID    int               `json:"default_version_id,omitempty"`
	TrackerIDs          []int             `json:"tracker_ids,omitempty"`
	EnabledModuleNames  []string          `json:"enabled_module_names,omitempty"`
	IssueCustomFieldIDs []int             `json:"issue_custom_field_ids,omitempty"`
	CustomFieldValues   map[string]string `json:"custom_field_values,omitempty"`
}

ProjectCreate defines fields for creating a project.

type ProjectFile added in v2.6.0

type ProjectFile struct {
	ID          int     `json:"id"`
	Filename    string  `json:"filename"`
	Filesize    int64   `json:"filesize"`
	ContentType string  `json:"content_type,omitempty"`
	Description string  `json:"description,omitempty"`
	ContentURL  string  `json:"content_url,omitempty"`
	Author      IDName  `json:"author"`
	CreatedOn   string  `json:"created_on"`
	Version     *IDName `json:"version,omitempty"`
	Digest      string  `json:"digest,omitempty"`
	Downloads   int     `json:"downloads,omitempty"`
}

ProjectFile represents a project-level file as returned by the Redmine /projects/:id/files.json endpoint.

type ProjectFileCreate added in v2.6.0

type ProjectFileCreate struct {
	Token       string `json:"token"`
	Filename    string `json:"filename,omitempty"`
	VersionID   int    `json:"version_id,omitempty"`
	Description string `json:"description,omitempty"`
	ContentType string `json:"content_type,omitempty"`
}

ProjectFileCreate defines fields for uploading a file to a project. The Token is obtained from the /uploads.json endpoint.

type ProjectUpdate

type ProjectUpdate struct {
	Name                *string           `json:"name,omitempty"`
	Description         *string           `json:"description,omitempty"`
	Homepage            *string           `json:"homepage,omitempty"`
	IsPublic            *bool             `json:"is_public,omitempty"`
	ParentID            *int              `json:"parent_id,omitempty"`
	InheritMembers      *bool             `json:"inherit_members,omitempty"`
	DefaultAssignedToID *int              `json:"default_assigned_to_id,omitempty"`
	DefaultVersionID    *int              `json:"default_version_id,omitempty"`
	TrackerIDs          []int             `json:"tracker_ids,omitempty"`
	EnabledModuleNames  []string          `json:"enabled_module_names,omitempty"`
	IssueCustomFieldIDs []int             `json:"issue_custom_field_ids,omitempty"`
	CustomFieldValues   map[string]string `json:"custom_field_values,omitempty"`
}

ProjectUpdate defines fields for updating a project. Pointer-typed fields distinguish "not provided" (omit from request body) from "set to zero value". Slices use nil to mean "do not touch"; an explicitly empty slice would clear the field on Redmine.

type Role added in v2.6.0

type Role struct {
	ID                    int      `json:"id"`
	Name                  string   `json:"name"`
	Assignable            *bool    `json:"assignable,omitempty"`
	Builtin               *bool    `json:"builtin,omitempty"`
	IsBuiltin             *bool    `json:"is_builtin,omitempty"`
	IssuesVisibility      string   `json:"issues_visibility,omitempty"`
	TimeEntriesVisibility string   `json:"time_entries_visibility,omitempty"`
	UsersVisibility       string   `json:"users_visibility,omitempty"`
	Permissions           []string `json:"permissions,omitempty"`
}

Role represents a Redmine project role and its permissions.

func (Role) IsAssignable added in v2.6.0

func (r Role) IsAssignable() bool

IsAssignable reports whether the role is assignable when the API exposed that attribute.

func (Role) IsBuiltIn added in v2.6.0

func (r Role) IsBuiltIn() bool

IsBuiltIn reports whether the role is one of Redmine's built-in roles.

type SavedQuery added in v2.6.0

type SavedQuery struct {
	ID        int    `json:"id"`
	Name      string `json:"name"`
	IsPublic  bool   `json:"is_public"`
	ProjectID *int   `json:"project_id,omitempty"`
}

SavedQuery represents a Redmine saved query (custom filter) as returned by the /queries.json endpoint. Project queries carry a project_id; global queries omit it. The is_public flag indicates whether the query is visible to other users.

ProjectID is a pointer because Redmine versions inconsistently encode the "global query" case: some omit the project_id key entirely, others emit `"project_id": null`. The pointer keeps both shapes distinguishable from project_id == 0 (which is not a value Redmine ever returns).

type SearchResponse

type SearchResponse struct {
	Results    []SearchResult `json:"results"`
	TotalCount int            `json:"total_count"`
	Offset     int            `json:"offset"`
	Limit      int            `json:"limit"`
}

SearchResponse represents the full response from the Redmine search API.

type SearchResult

type SearchResult struct {
	ID          int    `json:"id"`
	Title       string `json:"title"`
	Type        string `json:"type"`
	URL         string `json:"url"`
	Description string `json:"description"`
	DateTime    string `json:"datetime"`
}

SearchResult represents a single result from the Redmine search API.

type TimeEntry

type TimeEntry struct {
	ID        int     `json:"id"`
	Project   IDName  `json:"project"`
	Issue     *IDRef  `json:"issue,omitempty"`
	User      IDName  `json:"user"`
	Activity  IDName  `json:"activity"`
	Hours     float64 `json:"hours"`
	Comments  string  `json:"comments"`
	SpentOn   string  `json:"spent_on"`
	CreatedOn string  `json:"created_on"`
	UpdatedOn string  `json:"updated_on"`
}

TimeEntry represents a Redmine time entry.

type TimeEntryCreate

type TimeEntryCreate struct {
	IssueID    int     `json:"issue_id,omitempty"`
	ProjectID  string  `json:"project_id,omitempty"`
	Hours      float64 `json:"hours"`
	ActivityID int     `json:"activity_id,omitempty"`
	SpentOn    string  `json:"spent_on,omitempty"`
	Comments   string  `json:"comments,omitempty"`
	UserID     int     `json:"user_id,omitempty"`
}

TimeEntryCreate defines fields for creating a time entry.

type TimeEntryFilter

type TimeEntryFilter struct {
	ProjectID  string
	UserID     string
	IssueID    int
	From       string
	To         string
	ActivityID int
	Limit      int
	Offset     int
}

TimeEntryFilter defines parameters for listing time entries.

type TimeEntryUpdate

type TimeEntryUpdate struct {
	Hours      *float64 `json:"hours,omitempty"`
	ActivityID *int     `json:"activity_id,omitempty"`
	SpentOn    *string  `json:"spent_on,omitempty"`
	Comments   *string  `json:"comments,omitempty"`
}

TimeEntryUpdate defines fields for updating a time entry.

type Tracker

type Tracker struct {
	ID                    int      `json:"id"`
	Name                  string   `json:"name"`
	Description           string   `json:"description"`
	DefaultStatus         *IDName  `json:"default_status,omitempty"`
	EnabledStandardFields []string `json:"enabled_standard_fields,omitempty"`
}

Tracker represents a Redmine tracker (e.g., Bug, Feature, Support).

type Upload

type Upload struct {
	Token       string `json:"token"`
	Filename    string `json:"filename"`
	ContentType string `json:"content_type,omitempty"`
	Description string `json:"description,omitempty"`
}

Upload represents a file attachment reference for an issue create/update.

type User

type User struct {
	ID               int                `json:"id"`
	Login            string             `json:"login"`
	Admin            bool               `json:"admin"`
	FirstName        string             `json:"firstname"`
	LastName         string             `json:"lastname"`
	Mail             string             `json:"mail"`
	CreatedOn        string             `json:"created_on"`
	UpdatedOn        string             `json:"updated_on,omitempty"`
	LastLoginOn      string             `json:"last_login_on,omitempty"`
	Status           int                `json:"status"`
	APIKey           string             `json:"api_key,omitempty"`
	MailNotification string             `json:"mail_notification,omitempty"`
	MustChangePasswd *bool              `json:"must_change_passwd,omitempty"`
	Memberships      []UserMembership   `json:"memberships,omitempty"`
	Groups           []IDName           `json:"groups,omitempty"`
	CustomFields     []CustomFieldValue `json:"custom_fields,omitempty"`
}

User represents a Redmine user.

type UserCreate

type UserCreate struct {
	Login            string  `json:"login"`
	Password         string  `json:"password,omitempty"`
	FirstName        string  `json:"firstname"`
	LastName         string  `json:"lastname"`
	Mail             string  `json:"mail"`
	Admin            bool    `json:"admin,omitempty"`
	MailNotification *string `json:"mail_notification,omitempty"`
	MustChangePasswd *bool   `json:"must_change_passwd,omitempty"`
	GeneratePassword *bool   `json:"generate_password,omitempty"`
	AuthSourceID     *int    `json:"auth_source_id,omitempty"`
}

UserCreate defines fields for creating a user. The send_information sibling flag on POST /users.json is passed separately through the API layer.

type UserFilter

type UserFilter struct {
	Status  string // "active", "registered", "locked"
	Name    string // filter by name
	GroupID int
	Limit   int
	Offset  int
}

UserFilter defines parameters for listing users.

type UserMembership added in v2.6.0

type UserMembership struct {
	ID      int      `json:"id"`
	Project IDName   `json:"project"`
	Roles   []IDName `json:"roles,omitempty"`
}

UserMembership represents one row of a user's project memberships as returned by GET /users/:id.json?include=memberships. The project + roles shape mirrors the Redmine REST response.

type UserUpdate

type UserUpdate struct {
	FirstName        *string `json:"firstname,omitempty"`
	LastName         *string `json:"lastname,omitempty"`
	Mail             *string `json:"mail,omitempty"`
	Admin            *bool   `json:"admin,omitempty"`
	Status           *int    `json:"status,omitempty"`
	MailNotification *string `json:"mail_notification,omitempty"`
	MustChangePasswd *bool   `json:"must_change_passwd,omitempty"`
	GeneratePassword *bool   `json:"generate_password,omitempty"`
	AuthSourceID     *int    `json:"auth_source_id,omitempty"`
}

UserUpdate defines fields for updating a user.

type Version

type Version struct {
	ID            int    `json:"id"`
	Project       IDName `json:"project"`
	Name          string `json:"name"`
	Description   string `json:"description"`
	Status        string `json:"status"` // "open", "locked", "closed"
	DueDate       string `json:"due_date,omitempty"`
	Sharing       string `json:"sharing"`
	WikiPageTitle string `json:"wiki_page_title,omitempty"`
	CreatedOn     string `json:"created_on"`
	UpdatedOn     string `json:"updated_on"`
}

Version represents a Redmine project version (milestone).

type VersionCreate added in v2.4.0

type VersionCreate struct {
	Name          string `json:"name"`
	Status        string `json:"status,omitempty"`
	Sharing       string `json:"sharing,omitempty"`
	DueDate       string `json:"due_date,omitempty"`
	Description   string `json:"description,omitempty"`
	WikiPageTitle string `json:"wiki_page_title,omitempty"`
}

VersionCreate defines fields for creating a project version.

type VersionUpdate added in v2.4.0

type VersionUpdate struct {
	Name          *string `json:"name,omitempty"`
	Status        *string `json:"status,omitempty"`
	Sharing       *string `json:"sharing,omitempty"`
	DueDate       *string `json:"due_date,omitempty"`
	Description   *string `json:"description,omitempty"`
	WikiPageTitle *string `json:"wiki_page_title,omitempty"`
}

VersionUpdate defines fields for updating a project version.

type WikiPage

type WikiPage struct {
	Title       string         `json:"title"`
	Text        string         `json:"text"`
	Comments    string         `json:"comments,omitempty"`
	Version     int            `json:"version"`
	Author      *IDName        `json:"author,omitempty"`
	UpdatedOn   string         `json:"updated_on"`
	CreatedOn   string         `json:"created_on"`
	Parent      *WikiPageTitle `json:"parent,omitempty"`
	Attachments []Attachment   `json:"attachments,omitempty"`
}

WikiPage represents a Redmine wiki page.

type WikiPageCreate

type WikiPageCreate struct {
	Text     string   `json:"text"`
	Comments string   `json:"comments,omitempty"`
	Title    string   `json:"title,omitempty"`
	Uploads  []Upload `json:"uploads,omitempty"`
}

WikiPageCreate defines fields for creating a wiki page.

type WikiPageIndex

type WikiPageIndex struct {
	Title     string `json:"title"`
	UpdatedOn string `json:"updated_on"`
}

WikiPageIndex represents a wiki page entry in the index listing.

type WikiPageTitle

type WikiPageTitle struct {
	Title string `json:"title"`
}

WikiPageTitle is a minimal reference used for parent pages.

type WikiPageUpdate

type WikiPageUpdate struct {
	Text     *string  `json:"text,omitempty"`
	Comments *string  `json:"comments,omitempty"`
	Title    *string  `json:"title,omitempty"`
	Version  *int     `json:"version,omitempty"`
	Uploads  []Upload `json:"uploads,omitempty"`

	// Section and SectionHash select a single section to replace. Redmine
	// reads these from the top level of the request params (see
	// WikiController#update), NOT from inside the wiki_page object, so they
	// are excluded from the wiki_page JSON here and added top-level by
	// WikiService.Update. Sending them nested makes Redmine ignore them and
	// overwrite the entire page.
	Section     *int    `json:"-"`
	SectionHash *string `json:"-"`
}

WikiPageUpdate defines fields for updating a wiki page.

Version, when non-nil, asserts the page version the client believes is current. Redmine compares it against the stored version and answers with 409 Conflict if the page has moved on, giving callers optimistic-locking semantics for the update.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL