Skip to content

Commit

Permalink
📝 Added the Attachment, Custom Content, and Attachment version docume…
Browse files Browse the repository at this point in the history
…ntations links.
  • Loading branch information
ctreminiom committed Aug 14, 2023
1 parent cd9d535 commit 98e787b
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 8 deletions.
2 changes: 2 additions & 0 deletions confluence/internal/attachment_impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ func (a *AttachmentService) Gets(ctx context.Context, entityID int, entityType s
// Delete deletes an attachment by id.
//
// DELETE /wiki/api/v2/attachments/{id}
//
// https://docs.go-atlassian.io/confluence-cloud/v2/attachments#delete-attachment
func (a *AttachmentService) Delete(ctx context.Context, attachmentID string) (*model.ResponseScheme, error) {
return a.internalClient.Delete(ctx, attachmentID)
}
Expand Down
4 changes: 4 additions & 0 deletions confluence/internal/attachment_version_impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,17 @@ type AttachmentVersionService struct {
// 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
func (a *AttachmentVersionService) Gets(ctx context.Context, attachmentID, cursor, sort string, limit int) (*model.AttachmentVersionPageScheme, *model.ResponseScheme, error) {
return a.internalClient.Gets(ctx, attachmentID, cursor, sort, limit)
}

// 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 (a *AttachmentVersionService) Get(ctx context.Context, attachmentID string, versionID int) (*model.DetailedVersionScheme, *model.ResponseScheme, error) {
return a.internalClient.Get(ctx, attachmentID, versionID)
}
Expand Down
14 changes: 10 additions & 4 deletions confluence/internal/custom_content_impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,25 +25,27 @@ type CustomContentService struct {

// Gets returns all custom content for a given type.
//
// # 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/custom-content
//
// https://docs.go-atlassian.io/confluence-cloud/v2/custom-content#get-custom-content-by-type
func (c *CustomContentService) Gets(ctx context.Context, type_ string, options *model.CustomContentOptionsScheme, cursor string, limit int) (*model.CustomContentPageScheme, *model.ResponseScheme, error) {
return c.internalClient.Gets(ctx, type_, options, cursor, limit)
}

// 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 (c *CustomContentService) Create(ctx context.Context, payload *model.CustomContentPayloadScheme) (*model.CustomContentScheme, *model.ResponseScheme, error) {
return c.internalClient.Create(ctx, payload)
}

// 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 (c *CustomContentService) Get(ctx context.Context, customContentID int, format string, versionID int) (*model.CustomContentScheme, *model.ResponseScheme, error) {
return c.internalClient.Get(ctx, customContentID, format, versionID)
}
Expand All @@ -55,13 +57,17 @@ func (c *CustomContentService) Get(ctx context.Context, customContentID int, for
// 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
func (c *CustomContentService) Update(ctx context.Context, customContentID int, payload *model.CustomContentPayloadScheme) (*model.CustomContentScheme, *model.ResponseScheme, error) {
return c.internalClient.Update(ctx, customContentID, payload)
}

// 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 (c *CustomContentService) Delete(ctx context.Context, customContentID int) (*model.ResponseScheme, error) {
return c.internalClient.Delete(ctx, customContentID)
}
Expand Down
6 changes: 6 additions & 0 deletions service/confluence/attachment.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ type AttachmentConnector interface {
// Delete deletes an attachment by id.
//
// DELETE /wiki/api/v2/attachments/{id}
//
// https://docs.go-atlassian.io/confluence-cloud/v2/attachments#delete-attachment
Delete(ctx context.Context, attachmentID string) (*model.ResponseScheme, error)
}

Expand All @@ -77,10 +79,14 @@ type AttachmentVersionConnector interface {
// 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
Gets(ctx context.Context, attachmentID, cursor, sort string, limit int) (*model.AttachmentVersionPageScheme, *model.ResponseScheme, error)

// 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
Get(ctx context.Context, attachmentID string, versionID int) (*model.DetailedVersionScheme, *model.ResponseScheme, error)
}
14 changes: 10 additions & 4 deletions service/confluence/custom-content.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,24 @@ type CustomContentConnector interface {

// Gets returns all custom content for a given type.
//
// 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/custom-content
//
// https://docs.go-atlassian.io/confluence-cloud/v2/custom-content#get-custom-content-by-type
Gets(ctx context.Context, type_ string, options *models.CustomContentOptionsScheme, cursor string, limit int) (
*models.CustomContentPageScheme, *models.ResponseScheme, error)

// 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
Create(ctx context.Context, payload *models.CustomContentPayloadScheme) (*models.CustomContentScheme, *models.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
Get(ctx context.Context, customContentID int, format string, versionID int) (*models.CustomContentScheme, *models.ResponseScheme, error)

// Update updates a custom content by id.
Expand All @@ -34,10 +36,14 @@ type CustomContentConnector interface {
// 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
Update(ctx context.Context, customContentID int, payload *models.CustomContentPayloadScheme) (*models.CustomContentScheme, *models.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
Delete(ctx context.Context, customContentID int) (*models.ResponseScheme, error)
}

0 comments on commit 98e787b

Please sign in to comment.