All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.volcengine.service.translate.TranslateConfig Maven / Gradle / Ivy

There is a newer version: 1.0.192
Show newest version
package com.volcengine.service.translate;

import com.volcengine.helper.Const;
import com.volcengine.model.ApiInfo;
import com.volcengine.model.Credentials;
import com.volcengine.model.ServiceInfo;
import org.apache.http.Header;
import org.apache.http.NameValuePair;
import org.apache.http.message.BasicHeader;
import org.apache.http.message.BasicNameValuePair;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;

public class TranslateConfig {
    public static ServiceInfo serviceInfo = new ServiceInfo(
            new HashMap() {
                {
                    put(Const.CONNECTION_TIMEOUT, 5000);
                    put(Const.SOCKET_TIMEOUT, 5000);
                    put(Const.Host, "translate.volcengineapi.com");
                    put(Const.Header, new ArrayList
() { { add(new BasicHeader("Accept", "application/json")); } }); put(Const.Credentials, new Credentials(Const.REGION_CN_NORTH_1, "translate")); } } ); public static Map apiInfoList = new HashMap() { { put(Const.LangDetect, new ApiInfo( new HashMap() { { put(Const.Method, "POST"); put(Const.Path, "/"); put(Const.Query, new ArrayList() { { add(new BasicNameValuePair("Action", Const.LangDetect)); add(new BasicNameValuePair("Version", "2020-06-01")); } }); } } )); put(Const.TranslateText, new ApiInfo( new HashMap() { { put(Const.Method, "POST"); put(Const.Path, "/"); put(Const.Query, new ArrayList() { { add(new BasicNameValuePair("Action", Const.TranslateText)); add(new BasicNameValuePair("Version", "2020-06-01")); } }); } } )); put(Const.TranslateImage, new ApiInfo( new HashMap() { { put(Const.Method, "POST"); put(Const.Path, "/"); put(Const.Query, new ArrayList() { { add(new BasicNameValuePair("Action", Const.TranslateImage)); add(new BasicNameValuePair("Version", "2020-07-01")); } }); } } )); put(Const.TranslateAudioSubmit, new ApiInfo( new HashMap() { { put(Const.Method, "POST"); put(Const.Path, "/"); put(Const.Query, new ArrayList() { { add(new BasicNameValuePair("Action", Const.TranslateAudioSubmit)); add(new BasicNameValuePair("Version", "2020-06-01")); } }); } } )); put(Const.TranslateAudioQuery, new ApiInfo( new HashMap() { { put(Const.Method, "POST"); put(Const.Path, "/"); put(Const.Query, new ArrayList() { { add(new BasicNameValuePair("Action", Const.TranslateAudioQuery)); add(new BasicNameValuePair("Version", "2020-06-01")); } }); } } )); put(Const.GlossaryPublish, new ApiInfo( new HashMap() { { put(Const.Method, "POST"); put(Const.Path, "/"); put(Const.Query, new ArrayList() { { add(new BasicNameValuePair("Action", Const.GlossaryPublish)); add(new BasicNameValuePair("Version", "2020-06-01")); } }); } } )); } }; }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy