Record Class DingTalkChannelProperties

java.lang.Object
java.lang.Record
io.agentscope.extensions.channel.dingtalk.DingTalkChannelProperties
Record Components:
appKey - enterprise internal app key
appSecret - enterprise internal app secret
robotCode - robot code used as outbound sender id; required for replies
mode - reception mode: stream (default) or http
aesKey - 43-character base64 (no padding) AES key for callback body decryption; only used in http mode, and only required when the robot is configured with encryption
apiBase - override for the DingTalk OpenAPI base; default https://api.dingtalk.com
oapiBase - override for the legacy OAPI base used by gettoken; default https://oapi.dingtalk.com
streamRegisterUrl - override for the Stream gateway registration endpoint; default https://api.dingtalk.com/v1.0/gateway/connections/open

public record DingTalkChannelProperties(String appKey, String appSecret, String robotCode, String mode, String aesKey, String apiBase, String oapiBase, String streamRegisterUrl) extends Record
Configuration for a single DingTalk (钉钉) channel instance.

Reception mode: MODE_STREAM (default) receives bot messages over a persistent WebSocket connection; MODE_HTTP receives them via signed HTTP callbacks delivered to /api/channels/dingtalk/{channelId}/callback, requiring a Spring web application.

  • Field Details

  • Constructor Details

    • DingTalkChannelProperties

      public DingTalkChannelProperties(String appKey, String appSecret, String robotCode, String mode, String aesKey, String apiBase, String oapiBase, String streamRegisterUrl)
      Creates an instance of a DingTalkChannelProperties record class.
      Parameters:
      appKey - the value for the appKey record component
      appSecret - the value for the appSecret record component
      robotCode - the value for the robotCode record component
      mode - the value for the mode record component
      aesKey - the value for the aesKey record component
      apiBase - the value for the apiBase record component
      oapiBase - the value for the oapiBase record component
      streamRegisterUrl - the value for the streamRegisterUrl record component
    • DingTalkChannelProperties

      @Deprecated public DingTalkChannelProperties(String appKey, String appSecret, String robotCode, String apiBase, String oapiBase, String streamRegisterUrl)
      Deprecated.
      use the canonical constructor (or from(java.lang.String, java.util.Map<java.lang.String, java.lang.Object>)) so the reception mode is explicit
      Convenience constructor matching the pre-callback-mode signature; delegates with mode=stream and no aesKey.
  • Method Details

    • from

      public static DingTalkChannelProperties from(String channelId, Map<String,Object> props)
      Reads a DingTalkChannelProperties out of an arbitrary properties map.
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • appKey

      public String appKey()
      Returns the value of the appKey record component.
      Returns:
      the value of the appKey record component
    • appSecret

      public String appSecret()
      Returns the value of the appSecret record component.
      Returns:
      the value of the appSecret record component
    • robotCode

      public String robotCode()
      Returns the value of the robotCode record component.
      Returns:
      the value of the robotCode record component
    • mode

      public String mode()
      Returns the value of the mode record component.
      Returns:
      the value of the mode record component
    • aesKey

      public String aesKey()
      Returns the value of the aesKey record component.
      Returns:
      the value of the aesKey record component
    • apiBase

      public String apiBase()
      Returns the value of the apiBase record component.
      Returns:
      the value of the apiBase record component
    • oapiBase

      public String oapiBase()
      Returns the value of the oapiBase record component.
      Returns:
      the value of the oapiBase record component
    • streamRegisterUrl

      public String streamRegisterUrl()
      Returns the value of the streamRegisterUrl record component.
      Returns:
      the value of the streamRegisterUrl record component