AS AgentScopeAPI 手册 / API Reference

GitLabInboundMapper

public final class GitLabInboundMapper
源码Source io/agentscope/extensions/channel/gitlab/GitLabInboundMapper.java:42–119

GitLab 入站 Mapper,把智能体接入外部消息渠道与企业平台。位于 io.agentscope.extensions.channel.gitlab 包。核心成员包括 extractNoteId、extractAuthorId、map、GitLabInboundMapper。

Maps a GitLab Note Hook payload into an InboundMessage.

Only Issue and MergeRequest notes are mapped in MVP; Commit and Snippet notes are dropped. System notes (label changes, status changes) are skipped via object_attributes.system.

Peer model:

  • peerKind = PeerKind#THREAD

  • peerId = "<project.path_with_namespace>#<iid>:<noteable_type>" — the trailing :Issue|MergeRequest is essential for the outbound dispatcher to pick the correct endpoint.

构造器摘要Constructor Summary

构造器Constructor说明Description
public GitLabInboundMapper(String channelId)
初始化 `GitLabInboundMapper` 实例。
Creates a new instance.

方法摘要Method Summary

方法Method说明Description
public static Optional<Long> extractNoteId(JsonNode payload)
static
设置该参数。
Returns the `object_attributes.id` used as the idempotency key.
public static Optional<Long> extractAuthorId(JsonNode payload)
static
设置该参数。
Returns the `user.id` used for bot-loop self-detection.
public Optional<InboundMessage> map(JsonNode payload)
设置映射。
Maps a Note Hook payload into an `InboundMessage`.

构造器详情Constructor Detail

GitLabInboundMapper

public GitLabInboundMapper(String channelId)

初始化 GitLabInboundMapper 实例。

Creates a new instance.

参数Parameters
名称Name类型Type说明Description
channelIdString渠道标识(类型 `String`)。The channel id.
源码Source io/agentscope/extensions/channel/gitlab/GitLabInboundMapper.java:46–48

方法详情Method Detail

extractNoteId

public static Optional<Long> extractNoteId(JsonNode payload)
static

设置该参数。

Returns the object_attributes.id used as the idempotency key.

参数Parameters
名称Name类型Type说明Description
payloadJsonNode负载(类型 `JsonNode`)。The payload.
返回Returns Optional<Long>
返回可选。Returns optional.
源码Source io/agentscope/extensions/channel/gitlab/GitLabInboundMapper.java:51–57

extractAuthorId

public static Optional<Long> extractAuthorId(JsonNode payload)
static

设置该参数。

Returns the user.id used for bot-loop self-detection.

参数Parameters
名称Name类型Type说明Description
payloadJsonNode负载(类型 `JsonNode`)。The payload.
返回Returns Optional<Long>
返回可选。Returns optional.
源码Source io/agentscope/extensions/channel/gitlab/GitLabInboundMapper.java:60–66

map

public Optional<InboundMessage> map(JsonNode payload)

设置映射。

Maps a Note Hook payload into an InboundMessage.

参数Parameters
名称Name类型Type说明Description
payloadJsonNode负载(类型 `JsonNode`)。The payload.
返回Returns Optional<InboundMessage>
返回可选。Returns optional.
源码Source io/agentscope/extensions/channel/gitlab/GitLabInboundMapper.java:72–118
基于官方固定版本源码静态生成Generated from pinned official sources · Python 2.0.11 · Java 2.0.4
签名与文档为静态抽取;如有疑问请以源码为准。Signatures and docs are extracted statically; verify against the source when in doubt.