/// <summary> /// UploadAttachment /// </summary> /// <remarks> /// Upload an attachment directly into a channel's blob storage. /// /// This is useful because it allows you to store data in a compliant store /// when dealing with enterprises. /// /// The response is a ResourceResponse which contains an AttachmentId which is /// suitable for using with the attachments API. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='conversationId'> /// Conversation ID /// </param> /// <param name='attachmentUpload'> /// Attachment data /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <ResourceResponse> UploadAttachmentAsync(this IConversations operations, string conversationId, AttachmentData attachmentUpload, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.UploadAttachmentWithHttpMessagesAsync(conversationId, attachmentUpload, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// UploadAttachment /// </summary> /// <remarks> /// Upload an attachment directly into a channel's blob storage. /// /// This is useful because it allows you to store data in a compliant store /// when dealing with enterprises. /// /// The response is a ResourceResponse which contains an AttachmentId which is /// suitable for using with the attachments API. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='conversationId'> /// Conversation ID /// </param> /// <param name='attachmentUpload'> /// Attachment data /// </param> public static ResourceResponse UploadAttachment(this IConversations operations, string conversationId, AttachmentData attachmentUpload) { return(operations.UploadAttachmentAsync(conversationId, attachmentUpload).GetAwaiter().GetResult()); }
/// <summary> /// UploadAttachment /// </summary> /// This method allows you to upload an attachment directly into a channels /// blob storage. /// /// This is useful because it allows you to store data in a compliant store /// when dealing with enterprises. /// /// The response is a ResourceResponse which contains an AttachmentId which is /// suitable for using with the attachments api. /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='conversationId'> /// Conversation ID /// </param> /// <param name='attachmentUpload'> /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task<ResourceResponse> UploadAttachmentAsync(this IConversations operations, string conversationId, AttachmentData attachmentUpload, CancellationToken cancellationToken = default(CancellationToken)) { var _result = await operations.UploadAttachmentWithHttpMessagesAsync(conversationId, attachmentUpload, null, cancellationToken).ConfigureAwait(false); return _result.HandleError<ResourceResponse>(); }
/// <summary> /// UploadAttachment /// </summary> /// This method allows you to upload an attachment directly into a channels /// blob storage. /// /// This is useful because it allows you to store data in a compliant store /// when dealing with enterprises. /// /// The response is a ResourceResponse which contains an AttachmentId which is /// suitable for using with the attachments api. /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='conversationId'> /// Conversation ID /// </param> /// <param name='attachmentUpload'> /// Attachment data /// </param> public static ResourceResponse UploadAttachment(this IConversations operations, string conversationId, AttachmentData attachmentUpload) { return(Task.Factory.StartNew(s => ((IConversations)s).UploadAttachmentAsync(conversationId, attachmentUpload), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult()); }
/// <summary> /// UploadAttachment /// </summary> /// This method allows you to upload an attachment directly into a channels /// blob storage. /// /// This is useful because it allows you to store data in a compliant store /// when dealing with enterprises. /// /// The response is a ResourceResponse which contains an AttachmentId which is /// suitable for using with the attachments api. /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='conversationId'> /// Conversation ID /// </param> /// <param name='attachmentUpload'> /// </param> public static ResourceResponse UploadAttachment(this IConversations operations, string conversationId, AttachmentData attachmentUpload) { return Task.Factory.StartNew(s => ((IConversations)s).UploadAttachmentAsync(conversationId, attachmentUpload), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); }