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

com.huaweicloud.sdk.dms.v2.DmsMeta Maven / Gradle / Ivy

There is a newer version: 3.1.42
Show newest version
package com.huaweicloud.sdk.dms.v2;

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.dms.v2.model.*;
import java.util.List;
import java.util.Map;
import java.time.OffsetDateTime;

@SuppressWarnings("unchecked")
public class DmsMeta {

    public static final HttpRequestDef batchCreateOrDeleteQueueTag = genForbatchCreateOrDeleteQueueTag();

    private static HttpRequestDef genForbatchCreateOrDeleteQueueTag() {
        // basic
        HttpRequestDef.Builder builder =
            HttpRequestDef.builder(HttpMethod.POST, BatchCreateOrDeleteQueueTagRequest.class, BatchCreateOrDeleteQueueTagResponse.class)
                .withUri("/v2/{project_id}/queue/{queue_id}/tags/action")
                .withContentType("application/json");

        // requests
        builder.withRequestField("queue_id",
            LocationType.Path,
            FieldExistence.NON_NULL_NON_EMPTY,
            String.class,
            f -> f.withMarshaller(BatchCreateOrDeleteQueueTagRequest::getQueueId, (req, v) -> {
                req.setQueueId(v);
            })
        );
        builder.withRequestField("body",
            LocationType.Body,
            FieldExistence.NON_NULL_NON_EMPTY,
            BatchCreateOrDeleteTagReq.class,
            f -> f.withMarshaller(BatchCreateOrDeleteQueueTagRequest::getBody, (req, v) -> {
                req.setBody(v);
            })
        );

        // response

        return builder.build();
    }

    public static final HttpRequestDef confirmConsumptionMessages = genForconfirmConsumptionMessages();

    private static HttpRequestDef genForconfirmConsumptionMessages() {
        // basic
        HttpRequestDef.Builder builder =
            HttpRequestDef.builder(HttpMethod.POST, ConfirmConsumptionMessagesRequest.class, ConfirmConsumptionMessagesResponse.class)
                .withUri("/v2/{project_id}/queues/{queue_id}/groups/{consumer_group_id}/ack")
                .withContentType("application/json");

        // requests
        builder.withRequestField("queue_id",
            LocationType.Path,
            FieldExistence.NON_NULL_NON_EMPTY,
            String.class,
            f -> f.withMarshaller(ConfirmConsumptionMessagesRequest::getQueueId, (req, v) -> {
                req.setQueueId(v);
            })
        );
        builder.withRequestField("consumer_group_id",
            LocationType.Path,
            FieldExistence.NON_NULL_NON_EMPTY,
            String.class,
            f -> f.withMarshaller(ConfirmConsumptionMessagesRequest::getConsumerGroupId, (req, v) -> {
                req.setConsumerGroupId(v);
            })
        );
        builder.withRequestField("body",
            LocationType.Body,
            FieldExistence.NON_NULL_NON_EMPTY,
            ConfirmConsumptionMessagesReq.class,
            f -> f.withMarshaller(ConfirmConsumptionMessagesRequest::getBody, (req, v) -> {
                req.setBody(v);
            })
        );

        // response

        return builder.build();
    }

    public static final HttpRequestDef confirmDeadLettersMessages = genForconfirmDeadLettersMessages();

    private static HttpRequestDef genForconfirmDeadLettersMessages() {
        // basic
        HttpRequestDef.Builder builder =
            HttpRequestDef.builder(HttpMethod.POST, ConfirmDeadLettersMessagesRequest.class, ConfirmDeadLettersMessagesResponse.class)
                .withUri("/v2/{project_id}/queues/{queue_id}/groups/{consumer_group_id}/deadletters/ack")
                .withContentType("application/json");

        // requests
        builder.withRequestField("queue_id",
            LocationType.Path,
            FieldExistence.NON_NULL_NON_EMPTY,
            String.class,
            f -> f.withMarshaller(ConfirmDeadLettersMessagesRequest::getQueueId, (req, v) -> {
                req.setQueueId(v);
            })
        );
        builder.withRequestField("consumer_group_id",
            LocationType.Path,
            FieldExistence.NON_NULL_NON_EMPTY,
            String.class,
            f -> f.withMarshaller(ConfirmDeadLettersMessagesRequest::getConsumerGroupId, (req, v) -> {
                req.setConsumerGroupId(v);
            })
        );
        builder.withRequestField("body",
            LocationType.Body,
            FieldExistence.NON_NULL_NON_EMPTY,
            ConfirmDeadLettersMessagesReq.class,
            f -> f.withMarshaller(ConfirmDeadLettersMessagesRequest::getBody, (req, v) -> {
                req.setBody(v);
            })
        );

        // response

        return builder.build();
    }

    public static final HttpRequestDef consumeDeadlettersMessage = genForconsumeDeadlettersMessage();

    private static HttpRequestDef genForconsumeDeadlettersMessage() {
        // basic
        HttpRequestDef.Builder builder =
            HttpRequestDef.builder(HttpMethod.GET, ConsumeDeadlettersMessageRequest.class, ConsumeDeadlettersMessageResponse.class)
                .withUri("/v2/{project_id}/queues/{queue_id}/groups/{consumer_group_id}/deadletters")
                .withContentType("application/json");

        // requests
        builder.withRequestField("queue_id",
            LocationType.Path,
            FieldExistence.NON_NULL_NON_EMPTY,
            String.class,
            f -> f.withMarshaller(ConsumeDeadlettersMessageRequest::getQueueId, (req, v) -> {
                req.setQueueId(v);
            })
        );
        builder.withRequestField("consumer_group_id",
            LocationType.Path,
            FieldExistence.NON_NULL_NON_EMPTY,
            String.class,
            f -> f.withMarshaller(ConsumeDeadlettersMessageRequest::getConsumerGroupId, (req, v) -> {
                req.setConsumerGroupId(v);
            })
        );
        builder.withRequestField("max_msgs",
            LocationType.Query,
            FieldExistence.NULL_IGNORE,
            Integer.class,
            f -> f.withMarshaller(ConsumeDeadlettersMessageRequest::getMaxMsgs, (req, v) -> {
                req.setMaxMsgs(v);
            })
        );
        builder.withRequestField("time_wait",
            LocationType.Query,
            FieldExistence.NULL_IGNORE,
            Integer.class,
            f -> f.withMarshaller(ConsumeDeadlettersMessageRequest::getTimeWait, (req, v) -> {
                req.setTimeWait(v);
            })
        );
        builder.withRequestField("ack_wait",
            LocationType.Query,
            FieldExistence.NULL_IGNORE,
            Integer.class,
            f -> f.withMarshaller(ConsumeDeadlettersMessageRequest::getAckWait, (req, v) -> {
                req.setAckWait(v);
            })
        );

        // response
        builder.withResponseField(
            "body",
            LocationType.Body,
            FieldExistence.NULL_IGNORE,
            List.class,
            f -> f.withMarshaller(ConsumeDeadlettersMessageResponse::getBody, (response, data)->{
                response.setBody(data);
            }).withInnerContainerType(ConsumeDeadlettersMessage.class)
        );

        return builder.build();
    }

    public static final HttpRequestDef consumeMessages = genForconsumeMessages();

    private static HttpRequestDef genForconsumeMessages() {
        // basic
        HttpRequestDef.Builder builder =
            HttpRequestDef.builder(HttpMethod.GET, ConsumeMessagesRequest.class, ConsumeMessagesResponse.class)
                .withUri("/v2/{project_id}/queues/{queue_id}/groups/{consumer_group_id}/messages")
                .withContentType("application/json");

        // requests
        builder.withRequestField("queue_id",
            LocationType.Path,
            FieldExistence.NON_NULL_NON_EMPTY,
            String.class,
            f -> f.withMarshaller(ConsumeMessagesRequest::getQueueId, (req, v) -> {
                req.setQueueId(v);
            })
        );
        builder.withRequestField("consumer_group_id",
            LocationType.Path,
            FieldExistence.NON_NULL_NON_EMPTY,
            String.class,
            f -> f.withMarshaller(ConsumeMessagesRequest::getConsumerGroupId, (req, v) -> {
                req.setConsumerGroupId(v);
            })
        );
        builder.withRequestField("max_msgs",
            LocationType.Query,
            FieldExistence.NULL_IGNORE,
            Integer.class,
            f -> f.withMarshaller(ConsumeMessagesRequest::getMaxMsgs, (req, v) -> {
                req.setMaxMsgs(v);
            })
        );
        builder.withRequestField("time_wait",
            LocationType.Query,
            FieldExistence.NULL_IGNORE,
            Integer.class,
            f -> f.withMarshaller(ConsumeMessagesRequest::getTimeWait, (req, v) -> {
                req.setTimeWait(v);
            })
        );
        builder.withRequestField("ack_wait",
            LocationType.Query,
            FieldExistence.NULL_IGNORE,
            Integer.class,
            f -> f.withMarshaller(ConsumeMessagesRequest::getAckWait, (req, v) -> {
                req.setAckWait(v);
            })
        );
        builder.withRequestField("tag",
            LocationType.Query,
            FieldExistence.NULL_IGNORE,
            String.class,
            f -> f.withMarshaller(ConsumeMessagesRequest::getTag, (req, v) -> {
                req.setTag(v);
            })
        );
        builder.withRequestField("tag_type",
            LocationType.Query,
            FieldExistence.NULL_IGNORE,
            String.class,
            f -> f.withMarshaller(ConsumeMessagesRequest::getTagType, (req, v) -> {
                req.setTagType(v);
            })
        );

        // response
        builder.withResponseField(
            "body",
            LocationType.Body,
            FieldExistence.NULL_IGNORE,
            List.class,
            f -> f.withMarshaller(ConsumeMessagesResponse::getBody, (response, data)->{
                response.setBody(data);
            }).withInnerContainerType(ConsumeMessage.class)
        );

        return builder.build();
    }

    public static final HttpRequestDef createConsumerGroup = genForcreateConsumerGroup();

    private static HttpRequestDef genForcreateConsumerGroup() {
        // basic
        HttpRequestDef.Builder builder =
            HttpRequestDef.builder(HttpMethod.POST, CreateConsumerGroupRequest.class, CreateConsumerGroupResponse.class)
                .withUri("/v2/{project_id}/queues/{queue_id}/groups")
                .withContentType("application/json");

        // requests
        builder.withRequestField("queue_id",
            LocationType.Path,
            FieldExistence.NON_NULL_NON_EMPTY,
            String.class,
            f -> f.withMarshaller(CreateConsumerGroupRequest::getQueueId, (req, v) -> {
                req.setQueueId(v);
            })
        );
        builder.withRequestField("body",
            LocationType.Body,
            FieldExistence.NON_NULL_NON_EMPTY,
            CreateConsumerGroupReq.class,
            f -> f.withMarshaller(CreateConsumerGroupRequest::getBody, (req, v) -> {
                req.setBody(v);
            })
        );

        // response

        return builder.build();
    }

    public static final HttpRequestDef createQueue = genForcreateQueue();

    private static HttpRequestDef genForcreateQueue() {
        // basic
        HttpRequestDef.Builder builder =
            HttpRequestDef.builder(HttpMethod.POST, CreateQueueRequest.class, CreateQueueResponse.class)
                .withUri("/v2/{project_id}/queues")
                .withContentType("application/json");

        // requests
        builder.withRequestField("body",
            LocationType.Body,
            FieldExistence.NON_NULL_NON_EMPTY,
            CreateQueueReq.class,
            f -> f.withMarshaller(CreateQueueRequest::getBody, (req, v) -> {
                req.setBody(v);
            })
        );

        // response

        return builder.build();
    }

    public static final HttpRequestDef deleteQueue = genFordeleteQueue();

    private static HttpRequestDef genFordeleteQueue() {
        // basic
        HttpRequestDef.Builder builder =
            HttpRequestDef.builder(HttpMethod.DELETE, DeleteQueueRequest.class, DeleteQueueResponse.class)
                .withUri("/v2/{project_id}/queues/{queue_id}")
                .withContentType("application/json");

        // requests
        builder.withRequestField("queue_id",
            LocationType.Path,
            FieldExistence.NON_NULL_NON_EMPTY,
            String.class,
            f -> f.withMarshaller(DeleteQueueRequest::getQueueId, (req, v) -> {
                req.setQueueId(v);
            })
        );

        // response

        return builder.build();
    }

    public static final HttpRequestDef deleteSpecifiedConsumerGroup = genFordeleteSpecifiedConsumerGroup();

    private static HttpRequestDef genFordeleteSpecifiedConsumerGroup() {
        // basic
        HttpRequestDef.Builder builder =
            HttpRequestDef.builder(HttpMethod.DELETE, DeleteSpecifiedConsumerGroupRequest.class, DeleteSpecifiedConsumerGroupResponse.class)
                .withUri("/v2/{project_id}/queues/{queue_id}/groups/{group_id}")
                .withContentType("application/json");

        // requests
        builder.withRequestField("queue_id",
            LocationType.Path,
            FieldExistence.NON_NULL_NON_EMPTY,
            String.class,
            f -> f.withMarshaller(DeleteSpecifiedConsumerGroupRequest::getQueueId, (req, v) -> {
                req.setQueueId(v);
            })
        );
        builder.withRequestField("group_id",
            LocationType.Path,
            FieldExistence.NON_NULL_NON_EMPTY,
            String.class,
            f -> f.withMarshaller(DeleteSpecifiedConsumerGroupRequest::getGroupId, (req, v) -> {
                req.setGroupId(v);
            })
        );

        // response

        return builder.build();
    }

    public static final HttpRequestDef listConsumerGroups = genForlistConsumerGroups();

    private static HttpRequestDef genForlistConsumerGroups() {
        // basic
        HttpRequestDef.Builder builder =
            HttpRequestDef.builder(HttpMethod.GET, ListConsumerGroupsRequest.class, ListConsumerGroupsResponse.class)
                .withUri("/v2/{project_id}/queues/{queue_id}/groups")
                .withContentType("application/json");

        // requests
        builder.withRequestField("queue_id",
            LocationType.Path,
            FieldExistence.NON_NULL_NON_EMPTY,
            String.class,
            f -> f.withMarshaller(ListConsumerGroupsRequest::getQueueId, (req, v) -> {
                req.setQueueId(v);
            })
        );
        builder.withRequestField("include_deadletter",
            LocationType.Query,
            FieldExistence.NULL_IGNORE,
            Boolean.class,
            f -> f.withMarshaller(ListConsumerGroupsRequest::getIncludeDeadletter, (req, v) -> {
                req.setIncludeDeadletter(v);
            })
        );
        builder.withRequestField("include_messages_num",
            LocationType.Query,
            FieldExistence.NULL_IGNORE,
            Boolean.class,
            f -> f.withMarshaller(ListConsumerGroupsRequest::getIncludeMessagesNum, (req, v) -> {
                req.setIncludeMessagesNum(v);
            })
        );
        builder.withRequestField("page_size",
            LocationType.Query,
            FieldExistence.NULL_IGNORE,
            Integer.class,
            f -> f.withMarshaller(ListConsumerGroupsRequest::getPageSize, (req, v) -> {
                req.setPageSize(v);
            })
        );
        builder.withRequestField("current_page",
            LocationType.Query,
            FieldExistence.NULL_IGNORE,
            Integer.class,
            f -> f.withMarshaller(ListConsumerGroupsRequest::getCurrentPage, (req, v) -> {
                req.setCurrentPage(v);
            })
        );

        // response

        return builder.build();
    }

    public static final HttpRequestDef listQueues = genForlistQueues();

    private static HttpRequestDef genForlistQueues() {
        // basic
        HttpRequestDef.Builder builder =
            HttpRequestDef.builder(HttpMethod.GET, ListQueuesRequest.class, ListQueuesResponse.class)
                .withUri("/v2/{project_id}/queues")
                .withContentType("application/json");

        // requests
        builder.withRequestField("include_deadletter",
            LocationType.Query,
            FieldExistence.NULL_IGNORE,
            Boolean.class,
            f -> f.withMarshaller(ListQueuesRequest::getIncludeDeadletter, (req, v) -> {
                req.setIncludeDeadletter(v);
            })
        );

        // response

        return builder.build();
    }

    public static final HttpRequestDef sendMessages = genForsendMessages();

    private static HttpRequestDef genForsendMessages() {
        // basic
        HttpRequestDef.Builder builder =
            HttpRequestDef.builder(HttpMethod.POST, SendMessagesRequest.class, SendMessagesResponse.class)
                .withUri("/v2/{project_id}/queues/{queue_id}/messages")
                .withContentType("application/json");

        // requests
        builder.withRequestField("queue_id",
            LocationType.Path,
            FieldExistence.NON_NULL_NON_EMPTY,
            String.class,
            f -> f.withMarshaller(SendMessagesRequest::getQueueId, (req, v) -> {
                req.setQueueId(v);
            })
        );
        builder.withRequestField("body",
            LocationType.Body,
            FieldExistence.NULL_IGNORE,
            SendMessagesReq.class,
            f -> f.withMarshaller(SendMessagesRequest::getBody, (req, v) -> {
                req.setBody(v);
            })
        );

        // response

        return builder.build();
    }

    public static final HttpRequestDef showProjectTags = genForshowProjectTags();

    private static HttpRequestDef genForshowProjectTags() {
        // basic
        HttpRequestDef.Builder builder =
            HttpRequestDef.builder(HttpMethod.GET, ShowProjectTagsRequest.class, ShowProjectTagsResponse.class)
                .withUri("/v2/{project_id}/queue/tags")
                .withContentType("application/json");

        // requests

        // response

        return builder.build();
    }

    public static final HttpRequestDef showQueue = genForshowQueue();

    private static HttpRequestDef genForshowQueue() {
        // basic
        HttpRequestDef.Builder builder =
            HttpRequestDef.builder(HttpMethod.GET, ShowQueueRequest.class, ShowQueueResponse.class)
                .withUri("/v2/{project_id}/queues/{queue_id}")
                .withContentType("application/json");

        // requests
        builder.withRequestField("queue_id",
            LocationType.Path,
            FieldExistence.NON_NULL_NON_EMPTY,
            String.class,
            f -> f.withMarshaller(ShowQueueRequest::getQueueId, (req, v) -> {
                req.setQueueId(v);
            })
        );
        builder.withRequestField("include_deadletter",
            LocationType.Query,
            FieldExistence.NULL_IGNORE,
            Boolean.class,
            f -> f.withMarshaller(ShowQueueRequest::getIncludeDeadletter, (req, v) -> {
                req.setIncludeDeadletter(v);
            })
        );

        // response

        return builder.build();
    }

    public static final HttpRequestDef showQueueTags = genForshowQueueTags();

    private static HttpRequestDef genForshowQueueTags() {
        // basic
        HttpRequestDef.Builder builder =
            HttpRequestDef.builder(HttpMethod.GET, ShowQueueTagsRequest.class, ShowQueueTagsResponse.class)
                .withUri("/v2/{project_id}/queue/{queue_id}/tags")
                .withContentType("application/json");

        // requests
        builder.withRequestField("queue_id",
            LocationType.Path,
            FieldExistence.NON_NULL_NON_EMPTY,
            String.class,
            f -> f.withMarshaller(ShowQueueTagsRequest::getQueueId, (req, v) -> {
                req.setQueueId(v);
            })
        );

        // response

        return builder.build();
    }

    public static final HttpRequestDef showQuotas = genForshowQuotas();

    private static HttpRequestDef genForshowQuotas() {
        // basic
        HttpRequestDef.Builder builder =
            HttpRequestDef.builder(HttpMethod.GET, ShowQuotasRequest.class, ShowQuotasResponse.class)
                .withUri("/v2/{project_id}/quotas")
                .withContentType("application/json");

        // requests

        // response

        return builder.build();
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy