Record Class WeComChannelProperties

java.lang.Object
java.lang.Record
io.agentscope.extensions.channel.wecom.WeComChannelProperties
Record Components:
corpId - WeCom corporation id (cn: 企业 ID)
agentId - self-built application id (numeric, but kept as int for the send API)
secret - application secret
token - callback token (configured in the WeCom admin console)
encodingAesKey - 43-character base64 (no padding) AES key for callback encryption
callbackPath - the HTTP path Spring exposes the callback under; defaults to /api/channels/wecom/{channelId}/callback
apiBase - override for the WeCom API base URL; default https://qyapi.weixin.qq.com

public record WeComChannelProperties(String corpId, int agentId, String secret, String token, String encodingAesKey, String callbackPath, String apiBase) extends Record
Provider-specific configuration for a single WeCom (企业微信) channel instance, sourced from the properties block of channels.<id> in agentscope.json.

The environment-variable-resolved values (e.g. ${WECOM_CORP_ID}) are expected to be substituted by the caller before construction.

  • Constructor Details

    • WeComChannelProperties

      public WeComChannelProperties(String corpId, int agentId, String secret, String token, String encodingAesKey, String callbackPath, String apiBase)
      Creates an instance of a WeComChannelProperties record class.
      Parameters:
      corpId - the value for the corpId record component
      agentId - the value for the agentId record component
      secret - the value for the secret record component
      token - the value for the token record component
      encodingAesKey - the value for the encodingAesKey record component
      callbackPath - the value for the callbackPath record component
      apiBase - the value for the apiBase record component
  • Method Details

    • from

      public static WeComChannelProperties from(String channelId, Map<String,Object> props)
      Reads a WeComChannelProperties 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      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.
    • corpId

      public String corpId()
      Returns the value of the corpId record component.
      Returns:
      the value of the corpId record component
    • agentId

      public int agentId()
      Returns the value of the agentId record component.
      Returns:
      the value of the agentId record component
    • secret

      public String secret()
      Returns the value of the secret record component.
      Returns:
      the value of the secret record component
    • token

      public String token()
      Returns the value of the token record component.
      Returns:
      the value of the token record component
    • encodingAesKey

      public String encodingAesKey()
      Returns the value of the encodingAesKey record component.
      Returns:
      the value of the encodingAesKey record component
    • callbackPath

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

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