internal

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAuthenticationService

func NewAuthenticationService(client service.Connector) common.Authentication

Types

type AnalyticsService added in v1.5.0

type AnalyticsService struct {
	// contains filtered or unexported fields
}

func NewAnalyticsService added in v1.5.0

func NewAnalyticsService(client service.Connector) *AnalyticsService

func (*AnalyticsService) Distinct added in v1.5.0

func (a *AnalyticsService) Distinct(ctx context.Context, contentId, fromDate string) (*model.ContentViewScheme, *model.ResponseScheme, error)

Distinct get the total number of distinct viewers a piece of content has.

GET /wiki/rest/api/analytics/content/{contentId}/viewers

https://docs.go-atlassian.io/confluence-cloud/analytics#get-viewers

func (*AnalyticsService) Get added in v1.5.0

func (a *AnalyticsService) Get(ctx context.Context, contentId, fromDate string) (*model.ContentViewScheme, *model.ResponseScheme, error)

Get gets the total number of views a piece of content has.

GET /wiki/rest/api/analytics/content/{contentId}/views

https://docs.go-atlassian.io/confluence-cloud/analytics#get-views

type AttachmentService

type AttachmentService struct {
	Version *AttachmentVersionService
	// contains filtered or unexported fields
}

func NewAttachmentService

func NewAttachmentService(client service.Connector, version *AttachmentVersionService) *AttachmentService

NewAttachmentService returns a new Confluence V2 Page service

func (*AttachmentService) Delete added in v1.5.1

func (a *AttachmentService) Delete(ctx context.Context, attachmentID string) (*model.ResponseScheme, error)

Delete deletes an attachment by id.

DELETE /wiki/api/v2/attachments/{id}

https://docs.go-atlassian.io/confluence-cloud/v2/attachments#delete-attachment

func (*AttachmentService) Get added in v1.5.1

func (a *AttachmentService) Get(ctx context.Context, attachmentID string, versionID int, serializeIDs bool) (*model.AttachmentScheme, *model.ResponseScheme, error)

Get returns a specific attachment.

GET /wiki/api/v2/attachments/{id}

https://docs.go-atlassian.io/confluence-cloud/v2/attachments#get-attachment-by-id

func (*AttachmentService) Gets

func (a *AttachmentService) Gets(ctx context.Context, entityID int, entityType string, options *model.AttachmentParamsScheme, cursor string, limit int) (*model.AttachmentPageScheme, *model.ResponseScheme, error)

Gets returns the attachments of specific entity type.

You can extract the attachments for blog-posts,custom-contents, labels and pages.

Depending on the entity type, the endpoint will change based on the entity type.

Valid entityType values: blogposts, custom-content, labels, pages.

The number of results is limited by the limit parameter and additional results.

(if available) will be available through the next URL present in the Link response header.

GET /wiki/api/v2/{blogposts,custom-content,labels,pages}/{id}/attachments

https://docs.go-atlassian.io/confluence-cloud/v2/attachments#get-attachments-by-type

type AttachmentVersionService added in v1.5.1

type AttachmentVersionService struct {
	// contains filtered or unexported fields
}

func NewAttachmentVersionService added in v1.5.1

func NewAttachmentVersionService(client service.Connector) *AttachmentVersionService

NewAttachmentVersionService returns a new Confluence V2 Attachment Version service

func (*AttachmentVersionService) Get added in v1.5.1

Get retrieves version details for the specified attachment and version number.

GET /wiki/api/v2/attachments/{attachment-id}/versions/{version-number}

https://docs.go-atlassian.io/confluence-cloud/v2/attachments/versions#get-attachment-version

func (*AttachmentVersionService) Gets added in v1.5.1

func (a *AttachmentVersionService) Gets(ctx context.Context, attachmentID, cursor, sort string, limit int) (*model.AttachmentVersionPageScheme, *model.ResponseScheme, error)

Gets returns the versions of specific attachment.

GET /wiki/api/v2/attachments/{id}/versions

https://docs.go-atlassian.io/confluence-cloud/v2/attachments/versions#get-attachment-versions

type AuthenticationService

type AuthenticationService struct {
	// contains filtered or unexported fields
}

func (*AuthenticationService) GetBasicAuth

func (a *AuthenticationService) GetBasicAuth() (string, string)

func (*AuthenticationService) GetBearerToken added in v1.5.0

func (a *AuthenticationService) GetBearerToken() string

func (*AuthenticationService) GetUserAgent

func (a *AuthenticationService) GetUserAgent() string

func (*AuthenticationService) HasBasicAuth

func (a *AuthenticationService) HasBasicAuth() bool

func (*AuthenticationService) HasSetExperimentalFlag

func (a *AuthenticationService) HasSetExperimentalFlag() bool

func (*AuthenticationService) HasUserAgent

func (a *AuthenticationService) HasUserAgent() bool

func (*AuthenticationService) SetBasicAuth

func (a *AuthenticationService) SetBasicAuth(mail, token string)

func (*AuthenticationService) SetBearerToken added in v1.5.0

func (a *AuthenticationService) SetBearerToken(token string)

func (*AuthenticationService) SetExperimentalFlag

func (a *AuthenticationService) SetExperimentalFlag()

func (*AuthenticationService) SetUserAgent

func (a *AuthenticationService) SetUserAgent(agent string)

type ChildrenDescandantsService

type ChildrenDescandantsService struct {
	// contains filtered or unexported fields
}

func NewChildrenDescandantsService

func NewChildrenDescandantsService(client service.Connector) *ChildrenDescandantsService

func (*ChildrenDescandantsService) Children

func (c *ChildrenDescandantsService) Children(ctx context.Context, contentID string, expand []string, parentVersion int) (*model.ContentChildrenScheme, *model.ResponseScheme, error)

Children returns a map of the direct children of a piece of content.

A piece of content has different types of child content, depending on its type.

These are the default parent-child content type relationships:

page: child content is page, comment, attachment

blogpost: child content is comment, attachment

attachment: child content is comment

comment: child content is attachment

GET /wiki/rest/api/content/{id}/child

https://docs.go-atlassian.io/confluence-cloud/content/children-descendants#get-content-children

func (*ChildrenDescandantsService) ChildrenByType

func (c *ChildrenDescandantsService) ChildrenByType(ctx context.Context, contentID, contentType string, parentVersion int, expand []string, startAt, maxResults int) (*model.ContentPageScheme, *model.ResponseScheme, error)

ChildrenByType returns all children of a given type, for a piece of content.

A piece of content has different types of child content

GET /wiki/rest/api/content/{id}/child/{type}

https://docs.go-atlassian.io/confluence-cloud/content/children-descendants#get-content-children-by-type

func (*ChildrenDescandantsService) CopyHierarchy

CopyHierarchy copy page hierarchy allows the copying of an entire hierarchy of pages and their associated properties,

permissions and attachments. The id path parameter refers to the content id of the page to copy,

and the new parent of this copied page is defined using the destinationPageId in the request body.

The titleOptions object defines the rules of renaming page titles during the copy;

for example, search and replace can be used in conjunction to rewrite the copied page titles.

RESPONSE = Use the /longtask/ REST API to get the copy task status.

POST /wiki/rest/api/content/{id}/pagehierarchy/copy

https://docs.go-atlassian.io/confluence-cloud/content/children-descendants#copy-page-hierarchy

func (*ChildrenDescandantsService) CopyPage

CopyPage copies a single page and its associated properties, permissions, attachments, and custom contents.

The id path parameter refers to the content ID of the page to copy.

The target of the page to be copied is defined using the destination in the request body and can be one of the following types.

1. space: page will be copied to the specified space as a root page on the space

2. parent_page: page will be copied as a child of the specified parent page

3. existing_page: page will be copied and replace the specified page

By default, the following objects are expanded: space, history, version.

POST /wiki/rest/api/content/{id}/copy

https://docs.go-atlassian.io/confluence-cloud/content/children-descendants#copy-single-page

func (*ChildrenDescandantsService) Descendants

Descendants returns a map of the descendants of a piece of content.

This is similar to Get content children, except that this method returns child pages at all levels,

rather than just the direct child pages.

GET /wiki/rest/api/content/{id}/descendant

https://docs.go-atlassian.io/confluence-cloud/content/children-descendants#get-content-descendants

func (*ChildrenDescandantsService) DescendantsByType

func (c *ChildrenDescandantsService) DescendantsByType(ctx context.Context, contentID, contentType, depth string, expand []string, startAt, maxResults int) (*model.ContentPageScheme, *model.ResponseScheme, error)

DescendantsByType returns all descendants of a given type, for a piece of content.

This is similar to Get content children by type,

except that this method returns child pages at all levels, rather than just the direct child pages.

GET /wiki/rest/api/content/{id}/descendant/{type}

https://docs.go-atlassian.io/confluence-cloud/content/children-descendants#get-content-descendants-by-type

func (*ChildrenDescandantsService) Move added in v1.5.1

Move moves a page from its current location in the hierarchy to another.

Position describes where in the hierarchy the page should be moved to in relationship to targetID.

before: page will be a sibling of target but show up just before target in the list of children

after: page will be a sibling of target but show up just after target in the list of children

append: page will be a child of the target and be appended to targets list of children

PUT /wiki/rest/api/content/{pageId}/move/{position}/{targetId}

https://docs.go-atlassian.io/confluence-cloud/content/children-descendants#move

type CommentService

type CommentService struct {
	// contains filtered or unexported fields
}

func NewCommentService

func NewCommentService(client service.Connector) *CommentService

func (*CommentService) Gets

func (c *CommentService) Gets(ctx context.Context, contentID string, expand, location []string, startAt, maxResults int) (*model.ContentPageScheme, *model.ResponseScheme, error)

Gets returns the comments on a piece of content.

GET /wiki/rest/api/content/{id}/child/comment

https://docs.go-atlassian.io/confluence-cloud/content/comments#get-content-comments

type ContentAttachmentService added in v1.5.1

type ContentAttachmentService struct {
	// contains filtered or unexported fields
}

func NewContentAttachmentService added in v1.5.1

func NewContentAttachmentService(client service.Connector) *ContentAttachmentService

func (*ContentAttachmentService) Create added in v1.5.1

func (a *ContentAttachmentService) Create(ctx context.Context, attachmentID, status, fileName string, file io.Reader) (*model.ContentPageScheme, *model.ResponseScheme, error)

Create adds an attachment to a piece of content.

This method only adds a new attachment.

If you want to update an existing attachment, use Create or update attachments.

POST /wiki/rest/api/content/{id}/child/attachment

https://docs.go-atlassian.io/confluence-cloud/content/attachments#create-attachment

func (*ContentAttachmentService) CreateOrUpdate added in v1.5.1

func (a *ContentAttachmentService) CreateOrUpdate(ctx context.Context, attachmentID, status, fileName string, file io.Reader) (*model.ContentPageScheme, *model.ResponseScheme, error)

CreateOrUpdate adds an attachment to a piece of content.

If the attachment already exists for the content,

then the attachment is updated (i.e. a new version of the attachment is created).

PUT /wiki/rest/api/content/{id}/child/attachment

https://docs.go-atlassian.io/confluence-cloud/content/attachments#create-or-update-attachment

func (*ContentAttachmentService) Gets added in v1.5.1

Gets returns the attachments for a piece of content.

By default, the following objects are expanded: metadata.

GET /wiki/rest/api/content/{id}/child/attachment

https://docs.go-atlassian.io/confluence-cloud/content/attachments#get-attachments

type ContentLabelService

type ContentLabelService struct {
	// contains filtered or unexported fields
}

func NewContentLabelService

func NewContentLabelService(client service.Connector) *ContentLabelService

func (*ContentLabelService) Add

Add adds labels to a piece of content. Does not modify the existing labels.

POST /wiki/rest/api/content/{id}/label

https://docs.go-atlassian.io/confluence-cloud/content/labels#add-labels-to-content

func (*ContentLabelService) Gets

func (c *ContentLabelService) Gets(ctx context.Context, contentID, prefix string, startAt, maxResults int) (*model.ContentLabelPageScheme, *model.ResponseScheme, error)

Gets returns the labels on a piece of content.

GET /wiki/rest/api/content/{id}/label

https://docs.go-atlassian.io/confluence-cloud/content/labels#get-labels-for-content

func (*ContentLabelService) Remove

func (c *ContentLabelService) Remove(ctx context.Context, contentID, labelName string) (*model.ResponseScheme, error)

Remove removes a label from a piece of content

DELETE /wiki/rest/api/content/{id}/label/{label}

https://docs.go-atlassian.io/confluence-cloud/content/labels#remove-label-from-content

type ContentService

type ContentService struct {
	Attachment         *ContentAttachmentService
	ChildrenDescendant *ChildrenDescandantsService
	Comment            *CommentService
	Permission         *PermissionService
	Label              *ContentLabelService
	Property           *PropertyService
	Restriction        *RestrictionService
	Version            *VersionService
	// contains filtered or unexported fields
}

func NewContentService

func NewContentService(client service.Connector, subServices *ContentSubServices) *ContentService

func (*ContentService) Archive

Archive archives a list of pages.

The pages to be archived are specified as a list of content IDs.

This API accepts the archival request and returns a task ID. The archival process happens asynchronously.

Use the /longtask/ REST API to get the copy task status.

POST /wiki/rest/api/content/archive

https://docs.go-atlassian.io/confluence-cloud/content#archive-pages

func (*ContentService) Create

Create creates a new piece of content or publishes an existing draft

To publish a draft, add the id and status properties to the body of the request.

Set the id to the ID of the draft and set the status to 'current'.

When the request is sent, a new piece of content will be created and the metadata from the draft will be transferred into it.

POST /wiki/rest/api/content

https://docs.go-atlassian.io/confluence-cloud/content#create-content

func (*ContentService) Delete

func (c *ContentService) Delete(ctx context.Context, contentID, status string) (*model.ResponseScheme, error)

Delete moves a piece of content to the space's trash or purges it from the trash, depending on the content's type and status:

If the content's type is page or blogpost and its status is current, it will be trashed.

If the content's type is page or blogpost and its status is trashed, the content will be purged from the trash and deleted permanently.

=== Note, you must also set the status query parameter to trashed in your request. ===

If the content's type is comment or attachment, it will be deleted permanently without being trashed.

DELETE /wiki/rest/api/content/{id}

https://docs.go-atlassian.io/confluence-cloud/content#delete-content

func (*ContentService) Get

func (c *ContentService) Get(ctx context.Context, contentID string, expand []string, version int) (*model.ContentScheme, *model.ResponseScheme, error)

Get returns a single piece of content, like a page or a blog post.

By default, the following objects are expanded: space, history, version.

GET /wiki/rest/api/content/{id}

https://docs.go-atlassian.io/confluence-cloud/content#get-content

func (*ContentService) Gets

Gets returns all content in a Confluence instance.

GET /wiki/rest/api/content

https://docs.go-atlassian.io/confluence-cloud/content#get-content

func (*ContentService) History

func (c *ContentService) History(ctx context.Context, contentID string, expand []string) (*model.ContentHistoryScheme, *model.ResponseScheme, error)

History returns the most recent update for a piece of content.

GET /wiki/rest/api/content/{id}/history

https://docs.go-atlassian.io/confluence-cloud/content#get-content-history

func (*ContentService) Search

func (c *ContentService) Search(ctx context.Context, cql, cqlContext string, expand []string, cursor string, maxResults int) (*model.ContentPageScheme, *model.ResponseScheme, error)

Search returns the list of content that matches a Confluence Query Language (CQL) query

GET /wiki/rest/api/content/search

https://docs.go-atlassian.io/confluence-cloud/content#search-contents-by-cql

func (*ContentService) Update

Update updates a piece of content.

Use this method to update the title or body of a piece of content, change the status, change the parent page, and more.

PUT /wiki/rest/api/content/{id}

https://docs.go-atlassian.io/confluence-cloud/content#update-content

type ContentSubServices

type ContentSubServices struct {
	Attachment         *ContentAttachmentService
	ChildrenDescendant *ChildrenDescandantsService
	Comment            *CommentService
	Permission         *PermissionService
	Label              *ContentLabelService
	Property           *PropertyService
	Restriction        *RestrictionService
	Version            *VersionService
}

type CustomContentService added in v1.5.1

type CustomContentService struct {
	// contains filtered or unexported fields
}

func NewCustomContentService added in v1.5.1

func NewCustomContentService(client service.Connector) *CustomContentService

func (*CustomContentService) Create added in v1.5.1

Create creates a new custom content in the given space, page, blogpost or other custom content.

POST /wiki/api/v2/custom-content

https://docs.go-atlassian.io/confluence-cloud/v2/custom-content#create-custom-content

func (*CustomContentService) Delete added in v1.5.1

func (c *CustomContentService) Delete(ctx context.Context, customContentID int) (*model.ResponseScheme, error)

Delete deletes a custom content by id.

DELETE /wiki/api/v2/custom-content/{id}

https://docs.go-atlassian.io/confluence-cloud/v2/custom-content#delete-custom-content

func (*CustomContentService) Get added in v1.5.1

func (c *CustomContentService) Get(ctx context.Context, customContentID int, format string, versionID int) (*model.CustomContentScheme, *model.ResponseScheme, error)

Get returns a specific piece of custom content.

GET /wiki/api/v2/custom-content/{id}

https://docs.go-atlassian.io/confluence-cloud/v2/custom-content#get-custom-content-by-id

func (*CustomContentService) Gets added in v1.5.1

Gets returns all custom content for a given type.

GET /wiki/api/v2/custom-content

https://docs.go-atlassian.io/confluence-cloud/v2/custom-content#get-custom-content-by-type

func (*CustomContentService) Update added in v1.5.1

Update updates a custom content by id.

The spaceId is always required and maximum one of pageId, blogPostId,

or customContentId is allowed in the request body

PUT /wiki/api/v2/custom-content/{id}

https://docs.go-atlassian.io/confluence-cloud/v2/custom-content#update-custom-content

type LabelService

type LabelService struct {
	// contains filtered or unexported fields
}

func NewLabelService

func NewLabelService(client service.Connector) *LabelService

func (*LabelService) Get

func (l *LabelService) Get(ctx context.Context, labelName, labelType string, start, limit int) (*model.LabelDetailsScheme, *model.ResponseScheme, error)

Get returns label information and a list of contents associated with the label.

GET /wiki/rest/api/label

https://docs.go-atlassian.io/confluence-cloud/label#get-label-information

type PageService added in v1.5.0

type PageService struct {
	// contains filtered or unexported fields
}

func NewPageService added in v1.5.0

func NewPageService(client service.Connector) *PageService

NewPageService returns a new Confluence V2 Page service

func (*PageService) Bulk added in v1.5.0

func (p *PageService) Bulk(ctx context.Context, cursor string, limit int) (*model.PageChunkScheme, *model.ResponseScheme, error)

Bulk returns all pages.

Deprecated. Please use Page.Gets() instead.

GET /wiki/api/v2/pages

https://docs.go-atlassian.io/confluence-cloud/v2/page#get-pages

func (*PageService) Create added in v1.5.0

Create creates a page in the space.

Pages are created as published by default unless specified as a draft in the status field.

If creating a published page, the title must be specified.

POST /wiki/api/v2/pages

https://docs.go-atlassian.io/confluence-cloud/v2/page#create-page

func (*PageService) Delete added in v1.5.0

func (p *PageService) Delete(ctx context.Context, pageID int) (*model.ResponseScheme, error)

Delete deletes a page by id.

DELETE /wiki/api/v2/pages/{id}

https://docs.go-atlassian.io/confluence-cloud/v2/page#delete-page

func (*PageService) Get added in v1.5.0

func (p *PageService) Get(ctx context.Context, pageID int, format string, draft bool, version int) (*model.PageScheme, *model.ResponseScheme, error)

Get returns a specific page.

GET /wiki/api/v2/pages/{id}

https://docs.go-atlassian.io/confluence-cloud/v2/page#get-page-by-id

func (*PageService) Gets added in v1.5.1

Gets returns all pages.

GET /wiki/api/v2/pages

https://docs.go-atlassian.io/confluence-cloud/v2/page#get-pages

func (*PageService) GetsByLabel added in v1.5.0

func (p *PageService) GetsByLabel(ctx context.Context, labelID int, sort, cursor string, limit int) (*model.PageChunkScheme, *model.ResponseScheme, error)

GetsByLabel returns the pages of specified label.

GET /wiki/api/v2/labels/{id}/pages

https://docs.go-atlassian.io/confluence-cloud/v2/page#get-pages-for-label

func (*PageService) GetsByParent added in v1.6.0

func (p *PageService) GetsByParent(ctx context.Context, pageID int, cursor string, limit int) (*model.ChildPageChunkScheme, *model.ResponseScheme, error)

GetsByParent returns all children of a page.

The number of results is limited by the limit parameter and additional results (if available)

will be available through the next cursor

GET /wiki/api/v2/pages/{id}/children

https://docs.go-atlassian.io/confluence-cloud/v2/page#get-pages-by-parent

func (*PageService) GetsBySpace added in v1.5.0

func (p *PageService) GetsBySpace(ctx context.Context, spaceID int, cursor string, limit int) (*model.PageChunkScheme, *model.ResponseScheme, error)

GetsBySpace returns all pages in a space.

The number of results is limited by the limit parameter and additional results (if available)

will be available through the next cursor

GET /wiki/api/v2/spaces/{id}/pages

https://docs.go-atlassian.io/confluence-cloud/v2/page#get-pages-in-space

func (*PageService) Update added in v1.5.0

Update updates a page by id.

PUT /wiki/api/v2/pages/{id}

https://docs.go-atlassian.io/confluence-cloud/v2/page#update-page

type PermissionService

type PermissionService struct {
	// contains filtered or unexported fields
}

func NewPermissionService

func NewPermissionService(client service.Connector) *PermissionService

func (*PermissionService) Check

Check if a user or a group can perform an operation to the specified content.

The operation to check must be provided.

The user’s account ID or the ID of the group can be provided in the subject to check permissions against a specified user or group.

The following permission checks are done to make sure that the user or group has the proper access:

1. site permissions

2. space permissions

3. content restrictions

POST /wiki/rest/api/content/{id}/permission/check

https://docs.go-atlassian.io/confluence-cloud/content/permissions#check-content-permissions

type PropertyService

type PropertyService struct {
	// contains filtered or unexported fields
}

func NewPropertyService

func NewPropertyService(client service.Connector) *PropertyService

func (*PropertyService) Create

Create creates a property for an existing piece of content.

POST /wiki/rest/api/content/{id}/property

https://docs.go-atlassian.io/confluence-cloud/content/properties#create-content-property

func (*PropertyService) Delete

func (p *PropertyService) Delete(ctx context.Context, contentID, key string) (*model.ResponseScheme, error)

Delete deletes a content property.

DELETE /wiki/rest/api/content/{id}/property/{key}

https://docs.go-atlassian.io/confluence-cloud/content/properties#delete-content-property

func (*PropertyService) Get

Get returns a content property for a piece of content.

GET /wiki/rest/api/content/{id}/property/{key}

https://docs.go-atlassian.io/confluence-cloud/content/properties#get-content-property

func (*PropertyService) Gets

func (p *PropertyService) Gets(ctx context.Context, contentID string, expand []string, startAt, maxResults int) (*model.ContentPropertyPageScheme, *model.ResponseScheme, error)

Gets returns the properties for a piece of content.

GET /wiki/rest/api/content/{id}/property

https://docs.go-atlassian.io/confluence-cloud/content/properties#get-content-properties

type RestrictionOperationGroupService

type RestrictionOperationGroupService struct {
	// contains filtered or unexported fields
}

func NewRestrictionOperationGroupService

func NewRestrictionOperationGroupService(client service.Connector) *RestrictionOperationGroupService

func (*RestrictionOperationGroupService) Add

func (r *RestrictionOperationGroupService) Add(ctx context.Context, contentID, operationKey, groupNameOrID string) (*model.ResponseScheme, error)

Add adds a group to a content restriction.

That is, grant read or update permission to the group for a piece of content.

PUT /wiki/rest/api/content/{id}/restriction/byOperation/{operationKey}/byGroupId/{groupId}

https://docs.go-atlassian.io/confluence-cloud/content/restrictions/operations/group#add-group-to-content-restriction

func (*RestrictionOperationGroupService) Get

func (r *RestrictionOperationGroupService) Get(ctx context.Context, contentID, operationKey, groupNameOrID string) (*model.ResponseScheme, error)

Get returns whether the specified content restriction applies to a group.

Note that a response of true does not guarantee that the group can view the page,

as it does not account for account-inherited restrictions, space permissions, or even product access.

GET /wiki/rest/api/content/{id}/restriction/byOperation/{operationKey}/byGroupId/{groupId}

https://docs.go-atlassian.io/confluence-cloud/content/restrictions/operations/group#get-content-restriction-status-for-group

func (*RestrictionOperationGroupService) Remove

func (r *RestrictionOperationGroupService) Remove(ctx context.Context, contentID, operationKey, groupNameOrID string) (*model.ResponseScheme, error)

Remove removes a group from a content restriction.

That is, remove read or update permission for the group for a piece of content.

DELETE /wiki/rest/api/content/{id}/restriction/byOperation/{operationKey}/byGroupId/{groupId}

https://docs.go-atlassian.io/confluence-cloud/content/restrictions/operations/group#remove-group-from-content-restriction

type RestrictionOperationService

type RestrictionOperationService struct {
	Group *RestrictionOperationGroupService
	User  *RestrictionOperationUserService
	// contains filtered or unexported fields
}

func (*RestrictionOperationService) Get

func (r *RestrictionOperationService) Get(ctx context.Context, contentID, operationKey string, expand []string, startAt, maxResults int) (*model.ContentRestrictionScheme, *model.ResponseScheme, error)

Get returns the restrictions on a piece of content for a given operation (read or update).

GET /wiki/rest/api/content/{id}/restriction/byOperation/{operationKey}

https://docs.go-atlassian.io/confluence-cloud/content/restrictions/operations#get-restrictions-for-operation

func (*RestrictionOperationService) Gets

Gets returns restrictions on a piece of content by operation.

This method is similar to Get restrictions except that the operations are properties

of the return object, rather than items in a results array.

GET /wiki/rest/api/content/{id}/restriction

https://docs.go-atlassian.io/confluence-cloud/content/restrictions/operations#get-restrictions-by-operation

type RestrictionOperationUserService

type RestrictionOperationUserService struct {
	// contains filtered or unexported fields
}

func NewRestrictionOperationUserService

func NewRestrictionOperationUserService(client service.Connector) *RestrictionOperationUserService

func (*RestrictionOperationUserService) Add

func (r *RestrictionOperationUserService) Add(ctx context.Context, contentID, operationKey, accountID string) (*model.ResponseScheme, error)

Add adds a user to a content restriction.

That is, grant read or update permission to the user for a piece of content.

PUT /wiki/rest/api/content/{id}/restriction/byOperation/{operationKey}/user

https://docs.go-atlassian.io/confluence-cloud/content/restrictions/operations/user#add-user-to-content-restriction

func (*RestrictionOperationUserService) Get

func (r *RestrictionOperationUserService) Get(ctx context.Context, contentID, operationKey, accountID string) (*model.ResponseScheme, error)

Get returns whether the specified content restriction applies to a user.

GET /wiki/rest/api/content/{id}/restriction/byOperation/{operationKey}/user

https://docs.go-atlassian.io/confluence-cloud/content/restrictions/operations/user#get-content-restriction-status-for-user

func (*RestrictionOperationUserService) Remove

func (r *RestrictionOperationUserService) Remove(ctx context.Context, contentID, operationKey, accountID string) (*model.ResponseScheme, error)

Remove removes a group from a content restriction.

That is, remove read or update permission for the group for a piece of content.

DELETE /wiki/rest/api/content/{id}/restriction/byOperation/{operationKey}/user

https://docs.go-atlassian.io/confluence-cloud/content/restrictions/operations/user#remove-user-from-content-restriction

type RestrictionService

type RestrictionService struct {
	Operation *RestrictionOperationService
	// contains filtered or unexported fields
}

func NewRestrictionService

func NewRestrictionService(client service.Connector, operation *RestrictionOperationService) *RestrictionService

func (*RestrictionService) Add

Add adds restrictions to a piece of content. Note, this does not change any existing restrictions on the content.

POST /wiki/rest/api/content/{id}/restriction

https://docs.go-atlassian.io/confluence-cloud/content/restrictions#add-restrictions

func (*RestrictionService) Delete

Delete removes all restrictions (read and update) on a piece of content.

DELETE /wiki/rest/api/content/{id}/restriction

https://docs.go-atlassian.io/confluence-cloud/content/restrictions#delete-restrictions

func (*RestrictionService) Gets

func (r *RestrictionService) Gets(ctx context.Context, contentID string, expand []string, startAt, maxResults int) (*model.ContentRestrictionPageScheme, *model.ResponseScheme, error)

Gets returns the restrictions on a piece of content.

GET /wiki/rest/api/content/{id}/restriction

https://docs.go-atlassian.io/confluence-cloud/content/restrictions#get-restrictions

func (*RestrictionService) Update

Update updates restrictions for a piece of content. This removes the existing restrictions and replaces them with the restrictions in the request.

PUT /wiki/rest/api/content/{id}/restriction

https://docs.go-atlassian.io/confluence-cloud/content/restrictions#update-restrictions

type SearchService

type SearchService struct {
	// contains filtered or unexported fields
}

func NewSearchService

func NewSearchService(client service.Connector) *SearchService

func (*SearchService) Content

Content searches for content using the Confluence Query Language (CQL)

GET /wiki/rest/api/search

https://docs.go-atlassian.io/confluence-cloud/search#search-content

func (*SearchService) Users

func (s *SearchService) Users(ctx context.Context, cql string, start, limit int, expand []string) (*model.SearchPageScheme, *model.ResponseScheme, error)

Users searches for users using user-specific queries from the Confluence Query Language (CQL).

Note that some user fields may be set to null depending on the user's privacy settings.

These are: email, profilePicture, displayName, and timeZone.

GET /wiki/rest/api/search/user

https://docs.go-atlassian.io/confluence-cloud/search#search-users

type SpacePermissionService

type SpacePermissionService struct {
	// contains filtered or unexported fields
}

func NewSpacePermissionService

func NewSpacePermissionService(client service.Connector) *SpacePermissionService

func (*SpacePermissionService) Add

Add adds new permission to space.

If the permission to be added is a group permission, the group can be identified by its group name or group id.

Note: Apps cannot access this REST resource - including when utilizing user impersonation.

POST /wiki/rest/api/space/{spaceKey}/permission

https://docs.go-atlassian.io/confluence-cloud/space/permissions#add-new-permission-to-space

func (*SpacePermissionService) Bulk

Bulk adds new custom content permission to space.

If the permission to be added is a group permission, the group can be identified by its group name or group id.

Note: Only apps can access this REST resource and only make changes to the respective app permissions.

POST /wiki/rest/api/space/{spaceKey}/permission/custom-content

https://docs.go-atlassian.io/confluence-cloud/space/permissions#add-new-custom-content-permission-to-space

func (*SpacePermissionService) Remove

func (s *SpacePermissionService) Remove(ctx context.Context, spaceKey string, permissionID int) (*model.ResponseScheme, error)

Remove removes a space permission.

Note that removing Read Space permission for a user or group will remove all the space permissions for that user or group.

DELETE /wiki/rest/api/space/{spaceKey}/permission/{id}

https://docs.go-atlassian.io/confluence-cloud/space/permissions#remove-a-space-permission

type SpaceService

type SpaceService struct {
	Permission *SpacePermissionService
	// contains filtered or unexported fields
}

func NewSpaceService

func NewSpaceService(client service.Connector, permission *SpacePermissionService) *SpaceService

func (*SpaceService) Content

func (s *SpaceService) Content(ctx context.Context, spaceKey, depth string, expand []string, startAt, maxResults int) (*model.ContentChildrenScheme, *model.ResponseScheme, error)

Content returns all content in a space.

The returned content is grouped by type (pages then blogposts), then ordered by content ID in ascending order.

GET /wiki/rest/api/space/{spaceKey}/content

https://docs.go-atlassian.io/confluence-cloud/space#get-content-for-space

func (*SpaceService) ContentByType

func (s *SpaceService) ContentByType(ctx context.Context, spaceKey, contentType, depth string, expand []string, startAt, maxResults int) (*model.ContentPageScheme, *model.ResponseScheme, error)

ContentByType returns all content of a given type, in a space.

The returned content is ordered by content ID in ascending order.

GET /wiki/rest/api/space/{spaceKey}/content/{type}

https://docs.go-atlassian.io/confluence-cloud/space#get-content-by-type-for-space

func (*SpaceService) Create

Create creates a new space.

Note, currently you cannot set space labels when creating a space.

POST /wiki/rest/api/space

https://docs.go-atlassian.io/confluence-cloud/space#create-space

func (*SpaceService) Delete

Delete deletes a space.

Note, the space will be deleted in a long-running task.

Therefore, the space may not be deleted yet when this method has returned.

Clients should poll the status link that is returned to the response until the task completes.

DELETE /wiki/rest/api/space/{spaceKey}

https://docs.go-atlassian.io/confluence-cloud/space#delete-space

func (*SpaceService) Get

func (s *SpaceService) Get(ctx context.Context, spaceKey string, expand []string) (*model.SpaceScheme, *model.ResponseScheme, error)

Get returns a space.

This includes information like the name, description, and permissions, but not the content in the space.

GET /wiki/rest/api/space/{spaceKey}

https://docs.go-atlassian.io/confluence-cloud/space#get-space

func (*SpaceService) Gets

func (s *SpaceService) Gets(ctx context.Context, options *model.GetSpacesOptionScheme, startAt, maxResults int) (result *model.SpacePageScheme, response *model.ResponseScheme, err error)

Gets returns all spaces.

The returned spaces are ordered alphabetically in ascending order by space key.

GET /wiki/rest/api/space

https://docs.go-atlassian.io/confluence-cloud/space#get-spaces

func (*SpaceService) Update

Update updates the name, description, or homepage of a space.

PUT /wiki/rest/api/space/{spaceKey}

https://docs.go-atlassian.io/confluence-cloud/space#update-space

type SpaceV2Service added in v1.5.0

type SpaceV2Service struct {
	// contains filtered or unexported fields
}

func NewSpaceV2Service added in v1.5.0

func NewSpaceV2Service(client service.Connector) *SpaceV2Service

func (*SpaceV2Service) Bulk added in v1.5.0

Bulk returns all spaces.

The results will be sorted by id ascending.

The number of results is limited by the limit parameter and additional results (if available)

will be available through the next URL present in the Link response header.

GET /wiki/api/v2/spaces

https://docs.go-atlassian.io/confluence-cloud/v2/space#get-spaces

func (*SpaceV2Service) Get added in v1.5.0

func (s *SpaceV2Service) Get(ctx context.Context, spaceID int, descriptionFormat string) (*model.SpaceSchemeV2, *model.ResponseScheme, error)

Get returns a specific space.

GET /wiki/api/v2/spaces/{id}

https://docs.go-atlassian.io/confluence-cloud/v2/space#get-space-by-id

func (*SpaceV2Service) Permissions added in v1.5.1

func (s *SpaceV2Service) Permissions(ctx context.Context, spaceID int, cursor string, limit int) (*model.SpacePermissionPageScheme, *model.ResponseScheme, error)

Permissions returns space permissions for a specific space.

GET /wiki/api/v2/spaces/{id}/permissions

type TaskService

type TaskService struct {
	// contains filtered or unexported fields
}

func NewTaskService

func NewTaskService(client service.Connector) *TaskService

func (*TaskService) Get

Get returns information about an active long-running task (e.g. space export), such as how long it has been running

and the percentage of the task that has completed.

GET /wiki/rest/api/longtask/{id}

https://docs.go-atlassian.io/confluence-cloud/long-task#get-long-running-task

func (*TaskService) Gets

func (t *TaskService) Gets(ctx context.Context, start, limit int) (*model.LongTaskPageScheme, *model.ResponseScheme, error)

Gets returns information about all active long-running tasks (e.g. space export),

such as how long each task has been running and the percentage of each task that has completed.

GET /wiki/rest/api/longtask

https://docs.go-atlassian.io/confluence-cloud/long-task#get-long-running-tasks

type VersionService

type VersionService struct {
	// contains filtered or unexported fields
}

func NewVersionService

func NewVersionService(client service.Connector) *VersionService

func (*VersionService) Delete

func (v *VersionService) Delete(ctx context.Context, contentID string, versionNumber int) (*model.ResponseScheme, error)

Delete deletes a historical version.

This does not delete the changes made to the content in that version, rather the changes for the deleted version

are rolled up into the next version. Note, you cannot delete the current version.

DELETE /wiki/rest/api/content/{id}/version/{versionNumber}

https://docs.go-atlassian.io/confluence-cloud/content/versions#delete-content-version

func (*VersionService) Get

func (v *VersionService) Get(ctx context.Context, contentID string, versionNumber int, expand []string) (*model.ContentVersionScheme, *model.ResponseScheme, error)

Get returns a version for a piece of content.

GET /wiki/rest/api/content/{id}/version/{versionNumber}

https://docs.go-atlassian.io/confluence-cloud/content/versions#get-content-version

func (*VersionService) Gets

func (v *VersionService) Gets(ctx context.Context, contentID string, expand []string, start, limit int) (*model.ContentVersionPageScheme, *model.ResponseScheme, error)

Gets returns the versions for a piece of content in descending order.

GET /wiki/rest/api/content/{id}/version

https://docs.go-atlassian.io/confluence-cloud/content/versions#get-content-versions

func (*VersionService) Restore

Restore restores a historical version to be the latest version.

That is, a new version is created with the content of the historical version.

https://docs.go-atlassian.io/confluence-cloud/content/versions#restore-content-version

Jump to

Keyboard shortcuts

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