94 lines
2.5 KiB
Go
94 lines
2.5 KiB
Go
package confluence
|
|||
|
|
|
||
|
|
// Content is a page, blog post or comment.
|
||
|
|
type Content struct {
|
||
|
|
ID string `json:"id"`
|
||
|
|
Type string `json:"type"`
|
||
|
|
Status string `json:"status"`
|
||
|
|
Title string `json:"title"`
|
||
|
|
Space *SpaceRef `json:"space"`
|
||
|
|
Version *Version `json:"version"`
|
||
|
|
Body *Body `json:"body"`
|
||
|
|
Ancestors []ContentRef `json:"ancestors"`
|
||
|
|
Links *Links `json:"_links"`
|
||
|
|
}
|
||
|
|
|
||
|
|
// ContentRef is a minimal content reference (ancestors, children, home
|
||
|
|
// page).
|
||
|
|
type ContentRef struct {
|
||
|
|
ID string `json:"id"`
|
||
|
|
Title string `json:"title,omitempty"`
|
||
|
|
}
|
||
|
|
|
||
|
|
// SpaceRef identifies a space inside content.
|
||
|
|
type SpaceRef struct {
|
||
|
|
ID int `json:"id,omitempty"`
|
||
|
|
Key string `json:"key"`
|
||
|
|
Name string `json:"name,omitempty"`
|
||
|
|
}
|
||
|
|
|
||
|
|
// Version is a content version.
|
||
|
|
type Version struct {
|
||
|
|
Number int `json:"number"`
|
||
|
|
When string `json:"when"`
|
||
|
|
By *User `json:"by"`
|
||
|
|
}
|
||
|
|
|
||
|
|
// Body holds the storage-format body when expanded.
|
||
|
|
type Body struct {
|
||
|
|
Storage *BodyRepresentation `json:"storage"`
|
||
|
|
}
|
||
|
|
|
||
|
|
// BodyRepresentation is one body format ("storage", "plain", ...).
|
||
|
|
type BodyRepresentation struct {
|
||
|
|
Value string `json:"value"`
|
||
|
|
Representation string `json:"representation"`
|
||
|
|
}
|
||
|
|
|
||
|
|
// Links are the _links of a content object.
|
||
|
|
type Links struct {
|
||
|
|
WebUI string `json:"webui"`
|
||
|
|
Base string `json:"base"`
|
||
|
|
}
|
||
|
|
|
||
|
|
// User is a Confluence account: AccountID on Cloud, Username on
|
||
|
|
// Server/Data Center.
|
||
|
|
type User struct {
|
||
|
|
AccountID string `json:"accountId"`
|
||
|
|
Username string `json:"username"`
|
||
|
|
DisplayName string `json:"displayName"`
|
||
|
|
Email string `json:"email"`
|
||
|
|
AccountEmail string `json:"accountEmail,omitempty"`
|
||
|
|
}
|
||
|
|
|
||
|
|
// ContentList is one page of content.
|
||
|
|
type ContentList struct {
|
||
|
|
Results []Content `json:"results"`
|
||
|
|
Start int `json:"start"`
|
||
|
|
Limit int `json:"limit"`
|
||
|
|
Size int `json:"size"`
|
||
|
|
}
|
||
|
|
|
||
|
|
// Space is a Confluence space.
|
||
|
|
type Space struct {
|
||
|
|
ID int `json:"id"`
|
||
|
|
Key string `json:"key"`
|
||
|
|
Name string `json:"name"`
|
||
|
|
Type string `json:"type"`
|
||
|
|
Status string `json:"status"`
|
||
|
|
Description *SpaceDescription `json:"description"`
|
||
|
|
Homepage *ContentRef `json:"homepage"`
|
||
|
|
}
|
||
|
|
|
||
|
|
// SpaceDescription holds the expanded plain description.
|
||
|
|
type SpaceDescription struct {
|
||
|
|
Plain *BodyRepresentation `json:"plain"`
|
||
|
|
}
|
||
|
|
|
||
|
|
// SpaceList is one page of spaces.
|
||
|
|
type SpaceList struct {
|
||
|
|
Results []Space `json:"results"`
|
||
|
|
Start int `json:"start"`
|
||
|
|
Limit int `json:"limit"`
|
||
|
|
Size int `json:"size"`
|
||
|
|
}
|