@@ -628,6 +628,7 @@ public DetailedResponse<DocumentList> ListDocuments()
628628 /// types](https://cloud.ibm.com/docs/services/language-translator?topic=language-translator-document-translator-tutorial#supported-file-formats)
629629 ///
630630 /// Maximum file size: **20 MB**.</param>
631+ /// <param name="filename">The filename for file.</param>
631632 /// <param name="fileContentType">The content type of file. (optional)</param>
632633 /// <param name="modelId">The model to use for translation. `model_id` or both `source` and `target` are
633634 /// required. (optional)</param>
@@ -636,12 +637,16 @@ public DetailedResponse<DocumentList> ListDocuments()
636637 /// <param name="documentId">To use a previously submitted document as the source for a new translation, enter
637638 /// the `document_id` of the document. (optional)</param>
638639 /// <returns><see cref="DocumentStatus" />DocumentStatus</returns>
639- public DetailedResponse < DocumentStatus > TranslateDocument ( System . IO . MemoryStream file , string fileContentType = null , string modelId = null , string source = null , string target = null , string documentId = null )
640+ public DetailedResponse < DocumentStatus > TranslateDocument ( System . IO . MemoryStream file , string filename , string fileContentType = null , string modelId = null , string source = null , string target = null , string documentId = null )
640641 {
641642 if ( file == null )
642643 {
643644 throw new ArgumentNullException ( "`file` is required for `TranslateDocument`" ) ;
644645 }
646+ if ( string . IsNullOrEmpty ( filename ) )
647+ {
648+ throw new ArgumentNullException ( "`filename` is required for `TranslateDocument`" ) ;
649+ }
645650
646651 if ( string . IsNullOrEmpty ( VersionDate ) )
647652 {
@@ -660,7 +665,7 @@ public DetailedResponse<DocumentStatus> TranslateDocument(System.IO.MemoryStream
660665 System . Net . Http . Headers . MediaTypeHeaderValue contentType ;
661666 System . Net . Http . Headers . MediaTypeHeaderValue . TryParse ( fileContentType , out contentType ) ;
662667 fileContent . Headers . ContentType = contentType ;
663- formData . Add ( fileContent , "file" , " filename" ) ;
668+ formData . Add ( fileContent , "file" , filename ) ;
664669 }
665670
666671 if ( modelId != null )
0 commit comments