Esempio n. 1
0
        /// <summary>
        ///Downloads the files with the specific type and language code.
        /// </summary>
        /// <remarks>
        /// This method requires authentication.
        /// See the <a href="http://gs2017dev.sdl.com:41234/documentation/api/index#/">API documentation</a> for more information.
        /// </remarks>
        /// <exception cref="AuthorizationException">
        /// Thrown when the current user does not have permission to make the request.
        /// </exception>
        /// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
        /// <returns>A list of byte[] wich represents downloaded files.</returns>
        public async Task <byte[]> DownloadFile(FileDownloadRequest downloadRequest)
        {
            if (downloadRequest.Type != null)
            {
                return
                    (await
                     ApiConnection.Get <byte[]>(
                         ApiUrls.DownloadFile(downloadRequest.ProjectId, Enum.GetName(typeof(FileDownloadRequest.Types), downloadRequest.Type)),
                         null));
            }

            return(await ApiConnection.Get <byte[]>(ApiUrls.DownloadFile(downloadRequest.ProjectId, "all"), null));
        }
Esempio n. 2
0
 /// <summary>
 ///Downloads the files with the specific type and language code
 /// </summary>
 /// <remarks>
 /// This method requires authentication.
 /// See the <a href="http://sdldevelopmentpartners.sdlproducts.com/documentation/api">API documentation</a> for more information.
 /// </remarks>
 /// <exception cref="AuthorizationException">
 /// Thrown when the current user does not have permission to make the request.
 /// </exception>
 /// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
 /// <returns>A list of <see cref="byte[]"/>s.</returns>
 public async Task<byte[]> DownloadFile(FileDownloadRequest downloadRequest)
 {
     return await ApiConnection.Get<byte[]>(ApiUrls.DownloadFile(), downloadRequest.ToParametersDictionary());
 }