oauth

package
v0.0.0-...-26e1b9e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 5, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClient

func NewClient(appKey *string, appSecret *string, clientType *string) (*client, error)

NewClient 构建客户端,clientType值为robot(机器人),corp(企业)

func NewRobotWebHookClient

func NewRobotWebHookClient(appSecret *string, accessToken *string) (*client, error)

NewRobotWebHookClient webhook客户端

Types

type DingDingAt

type DingDingAt struct {
	AtMobiles []string `json:"atMobiles"`
	AtUserIds []string `json:"atUserIds"`
	IsAtAll   bool     `json:"isAtAll"`
}

type DingDingMessageBase

type DingDingMessageBase struct {
	At      DingDingAt `json:"at"`
	Msgtype string     `json:"msgtype"`
}

type GetAccessTokenResponseBody

type GetAccessTokenResponseBody struct {
	// accessToken
	AccessToken *string `json:"accessToken,omitempty" xml:"accessToken,omitempty"`
	// 超时时间
	ExpireIn *int64 `json:"expireIn,omitempty" xml:"expireIn,omitempty"`
}

type GetRobotAccessTokenResponseBody

type GetRobotAccessTokenResponseBody struct {
	//错误code
	Errcode int `json:"errcode,omitempty"`
	//错误信息
	Errmsg *string `json:"errmsg,omitempty"`
	// accessToken
	AccessToken *string `json:"access_token,omitempty"`
	// 超时时间
	ExpiresIn int `json:"expires_in,omitempty"`
}

type GetSsoUserInfoResponseBody

type GetSsoUserInfoResponseBody struct {
	// 用户头像链接
	Avatar *string `json:"avatar,omitempty" xml:"avatar,omitempty"`
	// 微应用免登用户所在企业id
	CorpId *string `json:"corpId,omitempty" xml:"corpId,omitempty"`
	// 微应用免登用户所在企业名称
	CorpName *string `json:"corpName,omitempty" xml:"corpName,omitempty"`
	// 用户邮箱
	Email *string `json:"email,omitempty" xml:"email,omitempty"`
	// 是否为企业管理员
	IsAdmin *bool `json:"isAdmin,omitempty" xml:"isAdmin,omitempty"`
	// 用户id
	UserId *string `json:"userId,omitempty" xml:"userId,omitempty"`
	// 用户名称
	UserName *string `json:"userName,omitempty" xml:"userName,omitempty"`
}

type MessagCorpconversationAsyncsendV2RequestBody

type MessagCorpconversationAsyncsendV2RequestBody struct {
	Msg        *Msg   `json:"msg"`
	ToAllUser  string `json:"to_all_user,omitempty"`
	AgentId    string `json:"agent_id,omitempty"`
	DeptIdList string `json:"dept_id_list,omitempty"`
	UseridList string `json:"userid_list,omitempty"`
}

type MessagCorpconversationAsyncsendV2ResponseBody

type MessagCorpconversationAsyncsendV2ResponseBody struct {
	RequestId string `json:"request_id"`
	Errmsg    string `json:"errmsg"`
	Errcode   int    `json:"errcode"`
	TaskId    int    `json:"task_id"`
}

type Msg

type Msg struct {
	Voice      *MsgVoice      `json:"voice,omitempty"`
	Image      *MsgImage      `json:"image,omitempty"`
	Oa         *MsgOa         `json:"oa,omitempty"`
	File       *MsgFile       `json:"file,omitempty"`
	ActionCard *MsgActionCard `json:"action_card,omitempty"`
	Link       *MsgLink       `json:"link,omitempty"`
	Markdown   *MsgMarkdown   `json:"markdown,omitempty"`
	Text       *MsgText       `json:"text,omitempty"`
	Msgtype    string         `json:"msgtype,omitempty"`
}

type MsgActionCard

type MsgActionCard struct {
	BtnJsonList    *MsgBtnJsonList `json:"btn_json_list,omitempty"`
	SingleUrl      string          `json:"single_url,omitempty"`
	BtnOrientation string          `json:"btn_orientation,omitempty"`
	SingleTitle    string          `json:"single_title,omitempty"`
	Markdown       string          `json:"markdown,omitempty"`
	Title          string          `json:"title,omitempty"`
}

type MsgBody

type MsgBody struct {
	FileCount string   `json:"file_count,omitempty"`
	Image     string   `json:"image,omitempty"`
	Form      *MsgForm `json:"form,omitempty"`
	Author    string   `json:"author,omitempty"`
	Rich      *MsgRich `json:"rich,omitempty"`
	Title     string   `json:"title,omitempty"`
	Content   string   `json:"content,omitempty"`
}

type MsgBtnJsonList

type MsgBtnJsonList struct {
	ActionUrl string `json:"action_url,omitempty"`
	Title     string `json:"title,omitempty"`
}

type MsgFile

type MsgFile struct {
	MediaId string `json:"media_id,omitempty"`
}

type MsgForm

type MsgForm struct {
	Value string `json:"value,omitempty"`
	Key   string `json:"key,omitempty"`
}

type MsgHead

type MsgHead struct {
	Bgcolor string `json:"bgcolor,omitempty"`
	Text    string `json:"text,omitempty"`
}

type MsgImage

type MsgImage struct {
	MediaId string `json:"media_id,omitempty"`
}
type MsgLink struct {
	PicUrl     string `json:"picUrl,omitempty"`
	MessageUrl string `json:"messageUrl,omitempty"`
	Text       string `json:"text,omitempty"`
	Title      string `json:"title,omitempty"`
}

type MsgMarkdown

type MsgMarkdown struct {
	Text  string `json:"text,omitempty"`
	Title string `json:"title,omitempty"`
}

type MsgOa

type MsgOa struct {
	Head         *MsgHead      `json:"head,omitempty"`
	PcMessageUrl string        `json:"pc_message_url,omitempty"`
	StatusBar    *MsgStatusBar `json:"status_bar,omitempty"`
	Body         *MsgBody      `json:"body,omitempty"`
	MessageUrl   string        `json:"message_url,omitempty"`
}

type MsgRich

type MsgRich struct {
	Unit string `json:"unit,omitempty"`
	Num  string `json:"num,omitempty"`
}

type MsgStatusBar

type MsgStatusBar struct {
	StatusValue string `json:"status_value,omitempty"`
	StatusBg    string `json:"status_bg,omitempty"`
}

type MsgText

type MsgText struct {
	Content string `json:"content,omitempty"`
}

type MsgVoice

type MsgVoice struct {
	Duration string `json:"duration,omitempty"`
	MediaId  string `json:"media_id,omitempty"`
}

type RobotMsg

type RobotMsg struct {
	DingDingMessageBase
	Voice      *MsgVoice      `json:"voice,omitempty"`
	Image      *MsgImage      `json:"image,omitempty"`
	Oa         *MsgOa         `json:"oa,omitempty"`
	File       *MsgFile       `json:"file,omitempty"`
	ActionCard *MsgActionCard `json:"action_card,omitempty"`
	Link       *MsgLink       `json:"link,omitempty"`
	Markdown   *MsgMarkdown   `json:"markdown,omitempty"`
	Text       *MsgText       `json:"text,omitempty"`
}

type RobotOToMessagesBatchSendExceptionResponseBody

type RobotOToMessagesBatchSendExceptionResponseBody struct {
	// 请求id
	Requestid *string `json:"requestid"`
	// 错误码
	Code *string `json:"code"`
	// 错误信息
	Message *string `json:"message"`
}

type RobotOToMessagesBatchSendRequestBody

type RobotOToMessagesBatchSendRequestBody struct {
	// 机器人的编码
	RobotCode *string `json:"robotCode"`
	// 用户的userid,每次最多传20个
	UserIds []*string `json:"userIds"`
	// 消息的msgKey,参考消息类型和数据格式 @https://open.dingtalk.com/document/group/message-types-and-data-format
	MsgKey *string `json:"msgKey"`
	// 消息体,参考消息类型和数据格式  @https://open.dingtalk.com/document/group/message-types-and-data-format
	MsgParam *string `json:"msgParam"`
}

RobotOToMessagesBatchSendRequestBody 接口方式发送机器人request body

type RobotOToMessagesBatchSendResponseBody

type RobotOToMessagesBatchSendResponseBody struct {
	//消息id
	ProcessQueryKey *string `json:"processQueryKey"`
	//无效的用户userid列表。
	InvalidStaffIdList []*string `json:"invalidStaffIdList"`
	//被限流的userid列表
	FlowControlledStaffIdList []*string `json:"flowControlledStaffIdList"`
}

RobotOToMessagesBatchSendResponseBody 接口方式发送机器人response body

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL