public ServiceCall < Void > addAudio ( AddAudioOptions addAudioOptions ) { Validator . notNull ( addAudioOptions , "addAudioOptions cannot be null" ) ; String [ ] pathSegments = { "v1/acoustic_customizations" , "audio" } ; String [ ] pathParameters = { addAudioOptions . customizationId ( ) , addAudioOptions . audioName ( ) } ; RequestBuilder builder = RequestBuilder . post ( RequestBuilder . constructHttpUrl ( getEndPoint ( ) , pathSegments , pathParameters ) ) ; Map < String , String > sdkHeaders = SdkCommon . getSdkHeaders ( "speech_to_text" , "v1" , "addAudio" ) ; for ( Entry < String , String > header : sdkHeaders . entrySet ( ) ) { builder . header ( header . getKey ( ) , header . getValue ( ) ) ; } builder . header ( "Accept" , "application/json" ) ; if ( addAudioOptions . containedContentType ( ) != null ) { builder . header ( "Contained-Content-Type" , addAudioOptions . containedContentType ( ) ) ; } if ( addAudioOptions . contentType ( ) != null ) { builder . header ( "Content-Type" , addAudioOptions . contentType ( ) ) ; } if ( addAudioOptions . allowOverwrite ( ) != null ) { builder . query ( "allow_overwrite" , String . valueOf ( addAudioOptions . allowOverwrite ( ) ) ) ; } builder . bodyContent ( addAudioOptions . contentType ( ) , null , null , addAudioOptions . audioResource ( ) ) ; return createServiceCall ( builder . build ( ) , ResponseConverterUtils . getVoid ( ) ) ; }
Add an audio resource .