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

com.huaweicloud.sdk.sis.v1.SisMeta Maven / Gradle / Ivy

There is a newer version: 3.1.114
Show newest version
package com.huaweicloud.sdk.sis.v1;

import com.huaweicloud.sdk.core.TypeCasts;
import com.huaweicloud.sdk.core.http.FieldExistence;
import com.huaweicloud.sdk.core.http.HttpMethod;
import com.huaweicloud.sdk.core.http.HttpRequestDef;
import com.huaweicloud.sdk.core.http.LocationType;
import com.huaweicloud.sdk.sis.v1.model.CollectTranscriberJobRequest;
import com.huaweicloud.sdk.sis.v1.model.CollectTranscriberJobResponse;
import com.huaweicloud.sdk.sis.v1.model.CreateVocabularyRequest;
import com.huaweicloud.sdk.sis.v1.model.CreateVocabularyResponse;
import com.huaweicloud.sdk.sis.v1.model.DeleteVocabularyRequest;
import com.huaweicloud.sdk.sis.v1.model.DeleteVocabularyResponse;
import com.huaweicloud.sdk.sis.v1.model.PostCreateVocabReq;
import com.huaweicloud.sdk.sis.v1.model.PostCustomTTSReq;
import com.huaweicloud.sdk.sis.v1.model.PostShortAudioReq;
import com.huaweicloud.sdk.sis.v1.model.PostTranscriberJobs;
import com.huaweicloud.sdk.sis.v1.model.PushTranscriberJobsRequest;
import com.huaweicloud.sdk.sis.v1.model.PushTranscriberJobsResponse;
import com.huaweicloud.sdk.sis.v1.model.PutUpdateVocabReq;
import com.huaweicloud.sdk.sis.v1.model.RecognizeFlashAsrRequest;
import com.huaweicloud.sdk.sis.v1.model.RecognizeFlashAsrResponse;
import com.huaweicloud.sdk.sis.v1.model.RecognizeShortAudioRequest;
import com.huaweicloud.sdk.sis.v1.model.RecognizeShortAudioResponse;
import com.huaweicloud.sdk.sis.v1.model.RunTtsRequest;
import com.huaweicloud.sdk.sis.v1.model.RunTtsResponse;
import com.huaweicloud.sdk.sis.v1.model.ShowVocabulariesParams;
import com.huaweicloud.sdk.sis.v1.model.ShowVocabulariesRequest;
import com.huaweicloud.sdk.sis.v1.model.ShowVocabulariesResponse;
import com.huaweicloud.sdk.sis.v1.model.ShowVocabularyRequest;
import com.huaweicloud.sdk.sis.v1.model.ShowVocabularyResponse;
import com.huaweicloud.sdk.sis.v1.model.UpdateVocabularyRequest;
import com.huaweicloud.sdk.sis.v1.model.UpdateVocabularyResponse;

@SuppressWarnings("unchecked")
public class SisMeta {

    public static final HttpRequestDef collectTranscriberJob =
        genForCollectTranscriberJob();

    private static HttpRequestDef genForCollectTranscriberJob() {
        // basic
        HttpRequestDef.Builder builder = HttpRequestDef
            .builder(HttpMethod.GET, CollectTranscriberJobRequest.class, CollectTranscriberJobResponse.class)
            .withName("CollectTranscriberJob")
            .withUri("/v1/{project_id}/asr/transcriber/jobs/{job_id}")
            .withContentType("application/json");

        // requests
        builder.withRequestField("job_id",
            LocationType.Path,
            FieldExistence.NON_NULL_NON_EMPTY,
            TypeCasts.uncheckedConversion(String.class),
            f -> f.withMarshaller(CollectTranscriberJobRequest::getJobId, CollectTranscriberJobRequest::setJobId));

        // response

        return builder.build();
    }

    public static final HttpRequestDef createVocabulary =
        genForCreateVocabulary();

    private static HttpRequestDef genForCreateVocabulary() {
        // basic
        HttpRequestDef.Builder builder =
            HttpRequestDef.builder(HttpMethod.POST, CreateVocabularyRequest.class, CreateVocabularyResponse.class)
                .withName("CreateVocabulary")
                .withUri("/v1/{project_id}/asr/vocabularies")
                .withContentType("application/json;charset=UTF-8");

        // requests
        builder.withRequestField("body",
            LocationType.Body,
            FieldExistence.NON_NULL_NON_EMPTY,
            TypeCasts.uncheckedConversion(PostCreateVocabReq.class),
            f -> f.withMarshaller(CreateVocabularyRequest::getBody, CreateVocabularyRequest::setBody));

        // response

        return builder.build();
    }

    public static final HttpRequestDef deleteVocabulary =
        genForDeleteVocabulary();

    private static HttpRequestDef genForDeleteVocabulary() {
        // basic
        HttpRequestDef.Builder builder =
            HttpRequestDef.builder(HttpMethod.DELETE, DeleteVocabularyRequest.class, DeleteVocabularyResponse.class)
                .withName("DeleteVocabulary")
                .withUri("/v1/{project_id}/asr/vocabularies/{vocabulary_id}")
                .withContentType("application/json");

        // requests
        builder.withRequestField("vocabulary_id",
            LocationType.Path,
            FieldExistence.NON_NULL_NON_EMPTY,
            TypeCasts.uncheckedConversion(String.class),
            f -> f.withMarshaller(DeleteVocabularyRequest::getVocabularyId, DeleteVocabularyRequest::setVocabularyId));

        // response

        return builder.build();
    }

    public static final HttpRequestDef pushTranscriberJobs =
        genForPushTranscriberJobs();

    private static HttpRequestDef genForPushTranscriberJobs() {
        // basic
        HttpRequestDef.Builder builder =
            HttpRequestDef.builder(HttpMethod.POST, PushTranscriberJobsRequest.class, PushTranscriberJobsResponse.class)
                .withName("PushTranscriberJobs")
                .withUri("/v1/{project_id}/asr/transcriber/jobs")
                .withContentType("application/json;charset=UTF-8");

        // requests
        builder.withRequestField("Enterprise-Project-Id",
            LocationType.Header,
            FieldExistence.NULL_IGNORE,
            TypeCasts.uncheckedConversion(String.class),
            f -> f.withMarshaller(PushTranscriberJobsRequest::getEnterpriseProjectId,
                PushTranscriberJobsRequest::setEnterpriseProjectId));
        builder.withRequestField("body",
            LocationType.Body,
            FieldExistence.NULL_IGNORE,
            TypeCasts.uncheckedConversion(PostTranscriberJobs.class),
            f -> f.withMarshaller(PushTranscriberJobsRequest::getBody, PushTranscriberJobsRequest::setBody));

        // response

        return builder.build();
    }

    public static final HttpRequestDef recognizeFlashAsr =
        genForRecognizeFlashAsr();

    private static HttpRequestDef genForRecognizeFlashAsr() {
        // basic
        HttpRequestDef.Builder builder =
            HttpRequestDef.builder(HttpMethod.POST, RecognizeFlashAsrRequest.class, RecognizeFlashAsrResponse.class)
                .withName("RecognizeFlashAsr")
                .withUri("/v1/{project_id}/asr/flash")
                .withContentType("application/json");

        // requests
        builder.withRequestField("property",
            LocationType.Query,
            FieldExistence.NON_NULL_NON_EMPTY,
            TypeCasts.uncheckedConversion(RecognizeFlashAsrRequest.PropertyEnum.class),
            f -> f.withMarshaller(RecognizeFlashAsrRequest::getProperty, RecognizeFlashAsrRequest::setProperty));
        builder.withRequestField("audio_format",
            LocationType.Query,
            FieldExistence.NON_NULL_NON_EMPTY,
            TypeCasts.uncheckedConversion(RecognizeFlashAsrRequest.AudioFormatEnum.class),
            f -> f.withMarshaller(RecognizeFlashAsrRequest::getAudioFormat, RecognizeFlashAsrRequest::setAudioFormat));
        builder.withRequestField("obs_bucket_name",
            LocationType.Query,
            FieldExistence.NON_NULL_NON_EMPTY,
            TypeCasts.uncheckedConversion(String.class),
            f -> f.withMarshaller(RecognizeFlashAsrRequest::getObsBucketName,
                RecognizeFlashAsrRequest::setObsBucketName));
        builder.withRequestField("obs_object_key",
            LocationType.Query,
            FieldExistence.NON_NULL_NON_EMPTY,
            TypeCasts.uncheckedConversion(String.class),
            f -> f.withMarshaller(RecognizeFlashAsrRequest::getObsObjectKey,
                RecognizeFlashAsrRequest::setObsObjectKey));
        builder.withRequestField("add_punc",
            LocationType.Query,
            FieldExistence.NULL_IGNORE,
            TypeCasts.uncheckedConversion(RecognizeFlashAsrRequest.AddPuncEnum.class),
            f -> f.withMarshaller(RecognizeFlashAsrRequest::getAddPunc, RecognizeFlashAsrRequest::setAddPunc));
        builder.withRequestField("digit_norm",
            LocationType.Query,
            FieldExistence.NULL_IGNORE,
            TypeCasts.uncheckedConversion(RecognizeFlashAsrRequest.DigitNormEnum.class),
            f -> f.withMarshaller(RecognizeFlashAsrRequest::getDigitNorm, RecognizeFlashAsrRequest::setDigitNorm));
        builder.withRequestField("need_word_info",
            LocationType.Query,
            FieldExistence.NULL_IGNORE,
            TypeCasts.uncheckedConversion(RecognizeFlashAsrRequest.NeedWordInfoEnum.class),
            f -> f.withMarshaller(RecognizeFlashAsrRequest::getNeedWordInfo,
                RecognizeFlashAsrRequest::setNeedWordInfo));
        builder.withRequestField("vocabulary_id",
            LocationType.Query,
            FieldExistence.NULL_IGNORE,
            TypeCasts.uncheckedConversion(String.class),
            f -> f.withMarshaller(RecognizeFlashAsrRequest::getVocabularyId,
                RecognizeFlashAsrRequest::setVocabularyId));
        builder.withRequestField("first_channel_only",
            LocationType.Query,
            FieldExistence.NULL_IGNORE,
            TypeCasts.uncheckedConversion(RecognizeFlashAsrRequest.FirstChannelOnlyEnum.class),
            f -> f.withMarshaller(RecognizeFlashAsrRequest::getFirstChannelOnly,
                RecognizeFlashAsrRequest::setFirstChannelOnly));

        // response

        return builder.build();
    }

    public static final HttpRequestDef recognizeShortAudio =
        genForRecognizeShortAudio();

    private static HttpRequestDef genForRecognizeShortAudio() {
        // basic
        HttpRequestDef.Builder builder =
            HttpRequestDef.builder(HttpMethod.POST, RecognizeShortAudioRequest.class, RecognizeShortAudioResponse.class)
                .withName("RecognizeShortAudio")
                .withUri("/v1/{project_id}/asr/short-audio")
                .withContentType("application/json;charset=UTF-8");

        // requests
        builder.withRequestField("body",
            LocationType.Body,
            FieldExistence.NON_NULL_NON_EMPTY,
            TypeCasts.uncheckedConversion(PostShortAudioReq.class),
            f -> f.withMarshaller(RecognizeShortAudioRequest::getBody, RecognizeShortAudioRequest::setBody));

        // response

        return builder.build();
    }

    public static final HttpRequestDef runTts = genForRunTts();

    private static HttpRequestDef genForRunTts() {
        // basic
        HttpRequestDef.Builder builder =
            HttpRequestDef.builder(HttpMethod.POST, RunTtsRequest.class, RunTtsResponse.class)
                .withName("RunTts")
                .withUri("/v1/{project_id}/tts")
                .withContentType("application/json;charset=UTF-8");

        // requests
        builder.withRequestField("body",
            LocationType.Body,
            FieldExistence.NON_NULL_NON_EMPTY,
            TypeCasts.uncheckedConversion(PostCustomTTSReq.class),
            f -> f.withMarshaller(RunTtsRequest::getBody, RunTtsRequest::setBody));

        // response

        return builder.build();
    }

    public static final HttpRequestDef showVocabularies =
        genForShowVocabularies();

    private static HttpRequestDef genForShowVocabularies() {
        // basic
        HttpRequestDef.Builder builder =
            HttpRequestDef.builder(HttpMethod.GET, ShowVocabulariesRequest.class, ShowVocabulariesResponse.class)
                .withName("ShowVocabularies")
                .withUri("/v1/{project_id}/asr/vocabularies")
                .withContentType("application/json;charset=UTF-8");

        // requests
        builder.withRequestField("offset",
            LocationType.Query,
            FieldExistence.NULL_IGNORE,
            TypeCasts.uncheckedConversion(Integer.class),
            f -> f.withMarshaller(ShowVocabulariesRequest::getOffset, ShowVocabulariesRequest::setOffset));
        builder.withRequestField("limit",
            LocationType.Query,
            FieldExistence.NULL_IGNORE,
            TypeCasts.uncheckedConversion(Integer.class),
            f -> f.withMarshaller(ShowVocabulariesRequest::getLimit, ShowVocabulariesRequest::setLimit));
        builder.withRequestField("body",
            LocationType.Body,
            FieldExistence.NULL_IGNORE,
            TypeCasts.uncheckedConversion(ShowVocabulariesParams.class),
            f -> f.withMarshaller(ShowVocabulariesRequest::getBody, ShowVocabulariesRequest::setBody));

        // response

        return builder.build();
    }

    public static final HttpRequestDef showVocabulary =
        genForShowVocabulary();

    private static HttpRequestDef genForShowVocabulary() {
        // basic
        HttpRequestDef.Builder builder =
            HttpRequestDef.builder(HttpMethod.GET, ShowVocabularyRequest.class, ShowVocabularyResponse.class)
                .withName("ShowVocabulary")
                .withUri("/v1/{project_id}/asr/vocabularies/{vocabulary_id}")
                .withContentType("application/json");

        // requests
        builder.withRequestField("vocabulary_id",
            LocationType.Path,
            FieldExistence.NON_NULL_NON_EMPTY,
            TypeCasts.uncheckedConversion(String.class),
            f -> f.withMarshaller(ShowVocabularyRequest::getVocabularyId, ShowVocabularyRequest::setVocabularyId));

        // response

        return builder.build();
    }

    public static final HttpRequestDef updateVocabulary =
        genForUpdateVocabulary();

    private static HttpRequestDef genForUpdateVocabulary() {
        // basic
        HttpRequestDef.Builder builder =
            HttpRequestDef.builder(HttpMethod.PUT, UpdateVocabularyRequest.class, UpdateVocabularyResponse.class)
                .withName("UpdateVocabulary")
                .withUri("/v1/{project_id}/asr/vocabularies/{vocabulary_id}")
                .withContentType("application/json;charset=UTF-8");

        // requests
        builder.withRequestField("vocabulary_id",
            LocationType.Path,
            FieldExistence.NON_NULL_NON_EMPTY,
            TypeCasts.uncheckedConversion(String.class),
            f -> f.withMarshaller(UpdateVocabularyRequest::getVocabularyId, UpdateVocabularyRequest::setVocabularyId));
        builder.withRequestField("body",
            LocationType.Body,
            FieldExistence.NON_NULL_NON_EMPTY,
            TypeCasts.uncheckedConversion(PutUpdateVocabReq.class),
            f -> f.withMarshaller(UpdateVocabularyRequest::getBody, UpdateVocabularyRequest::setBody));

        // response

        return builder.build();
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy