| 5117 | } |
| 5118 | |
| 5119 | func (c *unixSocketClient) AgentChannelSend( |
| 5120 | ctx context.Context, |
| 5121 | channel string, |
| 5122 | request AgentChannelSendRequest, |
| 5123 | credentials agentidentity.Credentials, |
| 5124 | ) (AgentChannelMessageRecord, error) { |
| 5125 | var response contract.AgentChannelMessageResponse |
| 5126 | path := "/api/agent/channels/" + url.PathEscape(strings.TrimSpace(channel)) + "/send" |
| 5127 | if err := c.doAgentJSON( |
| 5128 | ctx, |
| 5129 | http.MethodPost, |
| 5130 | path, |
| 5131 | nil, |
| 5132 | request, |
| 5133 | credentials, |
| 5134 | &response, |
| 5135 | ); err != nil { |
| 5136 | return AgentChannelMessageRecord{}, err |
| 5137 | } |
| 5138 | return response.Message, nil |
| 5139 | } |
| 5140 | |
| 5141 | func (c *unixSocketClient) AgentChannelReply( |
| 5142 | ctx context.Context, |