Ejemplo n.º 1
0
 /// <summary>
 /// Downloads an issue's attachment.
 /// </summary>
 /// <param name="jira">Instance of <c>SimpleJira.Interface.IJira</c>.</param>
 /// <param name="attachment">Attachment's model. Should contains content url to download.</param>
 /// <exception cref="SimpleJira.Interface.JiraAuthorizationException">Throws exception when user is not authorized.</exception>
 /// <exception cref="SimpleJira.Interface.JiraException">Throws exception in other cases.</exception>
 /// <returns>
 ///     Attachment's content.
 /// </returns>
 public static Task <byte[]> DownloadAttachmentAsync(this IJira jira, JiraAttachment attachment)
 {
     return(jira.DownloadAttachmentAsync(attachment, CancellationToken.None));
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Downloads an issue's attachment.
 /// </summary>
 /// <param name="jira">Instance of <c>SimpleJira.Interface.IJira</c>.</param>
 /// <param name="attachment">Attachment's model. Should contains content url to download.</param>
 /// <exception cref="SimpleJira.Interface.JiraAuthorizationException">Throws exception when user is not authorized.</exception>
 /// <exception cref="SimpleJira.Interface.JiraException">Throws exception in other cases.</exception>
 /// <returns>
 ///     Attachment's content.
 /// </returns>
 public static byte[] DownloadAttachment(this IJira jira, JiraAttachment attachment)
 {
     return(jira.DownloadAttachmentAsync(attachment, CancellationToken.None).GetAwaiter().GetResult());
 }