• Articles
  • Api Documentation
Show / Hide Table of Contents
  • Dapplo.Confluence
    • AttachmentDomain
    • ConfluenceClient
    • ConfluenceClientConfig
    • ConfluenceException
    • ContentExtensions
    • GroupDomain
    • IAttachmentDomain
    • IConfluenceClient
    • IConfluenceClientPlugins
    • IConfluenceDomain
    • IContentDomain
    • IGroupDomain
    • IMiscDomain
    • ISpaceDomain
    • IUserDomain
    • MiscExtensions
    • SpaceExtensions
    • UserDomain
    • UserIdentifierExtensions
  • Dapplo.Confluence.Entities
    • BaseEntity<TId>
    • Body
    • BodyContent
    • Children
    • Content
    • CopyContent
    • CopyDestinations
    • CopyPageRequestDestination
    • Description
    • Error
    • Group
    • History
    • IUserIdentifier
    • Label
    • LastUpdated
    • Links
    • LongRunningTask
    • Metadata
    • PagingInformation
    • Picture
    • Plain
    • Positions
    • Result<TResult>
    • SearchDetails
    • Space
    • SpaceContents
    • SystemInfoEntity
    • User
    • UserWatch
    • Version
  • Dapplo.Confluence.Query
    • ContentTypes
    • Fields
    • IContentClause
    • IDatetimeClause
    • IDatetimeClauseWithoutValue
    • IFinalClause
    • ISimpleValueClause
    • ISpaceClause
    • ITextClause
    • ITitleClause
    • ITypeClause
    • IUserClause
    • Operators
    • Where

Class AttachmentDomain

All attachment related extension methods

Inheritance
System.Object
AttachmentDomain
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Dapplo.Confluence
Assembly: Dapplo.Confluence.dll
Syntax
public static class AttachmentDomain

Methods

| Improve this Doc View Source

AttachAsync<TContent>(IAttachmentDomain, Int64, TContent, String, String, String, CancellationToken)

Add an attachment to the specified content

Declaration
public static async Task<Result<Content>> AttachAsync<TContent>(this IAttachmentDomain confluenceClient, long contentId, TContent content, string filename, string comment = null, string contentType = null, CancellationToken cancellationToken = null)
    where TContent : class
Parameters
Type Name Description
IAttachmentDomain confluenceClient

IAttachmentDomain to bind the extension method to

System.Int64 contentId

content to add the attachment to

TContent content

content of type TContent for the attachment

System.String filename

Filename of the attachment

System.String comment

Comment in the attachments information

System.String contentType

Content-Type for the content, or null

CancellationToken cancellationToken

CancellationToken

Returns
Type Description
Task<Result<Content>>

Result with Attachment

Type Parameters
Name Description
TContent

The content to upload

| Improve this Doc View Source

AttachAsync<TContent>(IAttachmentDomain, String, TContent, String, String, String, CancellationToken)

Obsolete: this AttachAsync is a wrapper for the new signature, which only excepts a long for the ID.

Declaration
public static Task<Result<Content>> AttachAsync<TContent>(this IAttachmentDomain confluenceClient, string contentId, TContent content, string filename, string comment = null, string contentType = null, CancellationToken cancellationToken = null)
    where TContent : class
Parameters
Type Name Description
IAttachmentDomain confluenceClient

IAttachmentDomain

System.String contentId

string

TContent content

TContent

System.String filename

string

System.String comment

string

System.String contentType

string

CancellationToken cancellationToken

CancellationToken

Returns
Type Description
Task<Result<Content>>

Result with Content

Type Parameters
Name Description
TContent

Type of the content

| Improve this Doc View Source

DeleteAsync(IAttachmentDomain, Content, CancellationToken)

Delete attachment Can't work yet, see CONF-36015

Declaration
public static async Task DeleteAsync(this IAttachmentDomain confluenceClient, Content attachment, CancellationToken cancellationToken = null)
Parameters
Type Name Description
IAttachmentDomain confluenceClient

IAttachmentDomain to bind the extension method to

Content attachment

Attachment which needs to be deleted

CancellationToken cancellationToken

cancellationToken

Returns
Type Description
Task
| Improve this Doc View Source

DeleteAsync(IAttachmentDomain, Int64, Boolean, CancellationToken)

Delete content (attachments are also content)

Declaration
public static async Task DeleteAsync(this IAttachmentDomain confluenceClient, long attachtmentId, bool isTrashed = false, CancellationToken cancellationToken = null)
Parameters
Type Name Description
IAttachmentDomain confluenceClient

IAttachmentDomain to bind the extension method to

System.Int64 attachtmentId

ID for the content which needs to be deleted

System.Boolean isTrashed

If the content is trashable, you will need to call DeleteAsyc twice, second time with isTrashed = true

CancellationToken cancellationToken

CancellationToken

Returns
Type Description
Task
| Improve this Doc View Source

GetAttachmentsAsync(IAttachmentDomain, Int64, CancellationToken)

Retrieve the attachments for the specified content

Declaration
public static async Task<Result<Content>> GetAttachmentsAsync(this IAttachmentDomain confluenceClient, long contentId, CancellationToken cancellationToken = null)
Parameters
Type Name Description
IAttachmentDomain confluenceClient

IAttachmentDomain to bind the extension method to

System.Int64 contentId

string with the content id

CancellationToken cancellationToken

CancellationToken

Returns
Type Description
Task<Result<Content>>

Result with Attachment(s)

| Improve this Doc View Source

GetAttachmentsAsync(IAttachmentDomain, String, CancellationToken)

Obsolete: this GetAttachmentsAsync is a wrapper for the new signature, which only excepts a long for the ID.

Declaration
public static Task<Result<Content>> GetAttachmentsAsync(this IAttachmentDomain confluenceClient, string contentId, CancellationToken cancellationToken = null)
Parameters
Type Name Description
IAttachmentDomain confluenceClient

IAttachmentDomain

System.String contentId

string

CancellationToken cancellationToken

CancellationToken

Returns
Type Description
Task<Result<Content>>

Result with Content

| Improve this Doc View Source

GetContentAsync<TResponse>(IAttachmentDomain, Content, CancellationToken)

Retrieve the attachment for the supplied Attachment entity

Declaration
public static async Task<TResponse> GetContentAsync<TResponse>(this IAttachmentDomain confluenceClient, Content attachment, CancellationToken cancellationToken = null)
    where TResponse : class
Parameters
Type Name Description
IAttachmentDomain confluenceClient

IAttachmentDomain to bind the extension method to

Content attachment

Attachment

CancellationToken cancellationToken

CancellationToken

Returns
Type Description
Task<TResponse>

Bitmap,BitmapSource or MemoryStream (etc) depending on TResponse

Type Parameters
Name Description
TResponse

the type to return the result into. e.g. Bitmap,BitmapSource or MemoryStream

| Improve this Doc View Source

UpdateAsync(IAttachmentDomain, Content, CancellationToken)

Update the attachment information

Declaration
public static async Task<Content> UpdateAsync(this IAttachmentDomain confluenceClient, Content attachment, CancellationToken cancellationToken = null)
Parameters
Type Name Description
IAttachmentDomain confluenceClient

IAttachmentDomain to bind the extension method to

Content attachment

Attachment

CancellationToken cancellationToken

CancellationToken

Returns
Type Description
Task<Content>

Attachment

| Improve this Doc View Source

UpdateDataAsync<TContent>(IAttachmentDomain, Int64, Int64, TContent, String, String, String, CancellationToken)

Update data (Content) of existing attachment

Declaration
public static async Task<Result<Content>> UpdateDataAsync<TContent>(this IAttachmentDomain confluenceClient, long contentId, long attachmentId, TContent content, string filename, string comment = null, string contentType = null, CancellationToken cancellationToken = null)
    where TContent : class
Parameters
Type Name Description
IAttachmentDomain confluenceClient

IAttachmentDomain to bind the extension method to

System.Int64 contentId

content to add the attachment to

System.Int64 attachmentId

Id of attachment to update

TContent content

content of type TContent for the attachment

System.String filename

Filename of the attachment

System.String comment

Comment in the attachments information

System.String contentType

Content-Type for the content, or null

CancellationToken cancellationToken

CancellationToken

Returns
Type Description
Task<Result<Content>>
Type Parameters
Name Description
TContent

The content to upload

  • Improve this Doc
  • View Source
In This Article
Back to top Copyright © 2017 Dapplo