larkauthen

package
v3.0.21 Latest Latest
Warning

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

Go to latest
Published: May 19, 2023 License: MIT Imports: 3 Imported by: 13

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthenService

type AuthenService struct {
	AccessToken        *accessToken        // access_token
	RefreshAccessToken *refreshAccessToken // refresh_access_token
	UserInfo           *userInfo           // user_info
	// contains filtered or unexported fields
}

func NewService

func NewService(config *larkcore.Config) *AuthenService

type CreateAccessTokenPathReqBodyBuilder

type CreateAccessTokenPathReqBodyBuilder struct {
	// contains filtered or unexported fields
}

func NewCreateAccessTokenPathReqBodyBuilder

func NewCreateAccessTokenPathReqBodyBuilder() *CreateAccessTokenPathReqBodyBuilder

func (*CreateAccessTokenPathReqBodyBuilder) Build

func (*CreateAccessTokenPathReqBodyBuilder) Code

登录预授权码,调用[获取登录预授权码](https://open.feishu.cn/document/ukTMukTMukTM/ukzN4UjL5cDO14SO3gTN)接口获取

示例值:xMSldislSkdK

func (*CreateAccessTokenPathReqBodyBuilder) GrantType

授权类型,**固定值**

示例值:authorization_code

type CreateAccessTokenReq

type CreateAccessTokenReq struct {
	Body *CreateAccessTokenReqBody `body:""`
	// contains filtered or unexported fields
}

type CreateAccessTokenReqBody

type CreateAccessTokenReqBody struct {
	GrantType *string `json:"grant_type,omitempty"` // 授权类型,**固定值**
	Code      *string `json:"code,omitempty"`       // 登录预授权码,调用[获取登录预授权码](https://open.feishu.cn/document/ukTMukTMukTM/ukzN4UjL5cDO14SO3gTN)接口获取
}

type CreateAccessTokenReqBodyBuilder

type CreateAccessTokenReqBodyBuilder struct {
	// contains filtered or unexported fields
}

func NewCreateAccessTokenReqBodyBuilder

func NewCreateAccessTokenReqBodyBuilder() *CreateAccessTokenReqBodyBuilder

func (*CreateAccessTokenReqBodyBuilder) Build

func (*CreateAccessTokenReqBodyBuilder) Code

登录预授权码,调用[获取登录预授权码](https://open.feishu.cn/document/ukTMukTMukTM/ukzN4UjL5cDO14SO3gTN)接口获取

示例值:xMSldislSkdK

func (*CreateAccessTokenReqBodyBuilder) GrantType

授权类型,**固定值**

示例值:authorization_code

type CreateAccessTokenReqBuilder

type CreateAccessTokenReqBuilder struct {
	// contains filtered or unexported fields
}

func NewCreateAccessTokenReqBuilder

func NewCreateAccessTokenReqBuilder() *CreateAccessTokenReqBuilder

func (*CreateAccessTokenReqBuilder) Body

func (*CreateAccessTokenReqBuilder) Build

type CreateAccessTokenResp

type CreateAccessTokenResp struct {
	*larkcore.ApiResp `json:"-"`
	larkcore.CodeError
	Data *CreateAccessTokenRespData `json:"data"` // 业务数据
}

func (*CreateAccessTokenResp) Success

func (resp *CreateAccessTokenResp) Success() bool

type CreateAccessTokenRespData

type CreateAccessTokenRespData struct {
	AccessToken      *string `json:"access_token,omitempty"`       // user_access_token,用于获取用户资源
	TokenType        *string `json:"token_type,omitempty"`         // token 类型
	ExpiresIn        *int    `json:"expires_in,omitempty"`         // `access_token`的有效期,单位: 秒
	Name             *string `json:"name,omitempty"`               // 用户姓名
	EnName           *string `json:"en_name,omitempty"`            // 用户英文名称
	AvatarUrl        *string `json:"avatar_url,omitempty"`         // 用户头像
	AvatarThumb      *string `json:"avatar_thumb,omitempty"`       // 用户头像 72x72
	AvatarMiddle     *string `json:"avatar_middle,omitempty"`      // 用户头像 240x240
	AvatarBig        *string `json:"avatar_big,omitempty"`         // 用户头像 640x640
	OpenId           *string `json:"open_id,omitempty"`            // 用户在应用内的唯一标识
	UnionId          *string `json:"union_id,omitempty"`           // 用户统一ID
	Email            *string `json:"email,omitempty"`              // 用户邮箱
	EnterpriseEmail  *string `json:"enterprise_email,omitempty"`   // 企业邮箱,请先确保已在管理后台启用飞书邮箱服务
	UserId           *string `json:"user_id,omitempty"`            // 用户 user_id
	Mobile           *string `json:"mobile,omitempty"`             // 用户手机号
	TenantKey        *string `json:"tenant_key,omitempty"`         // 当前企业标识
	RefreshExpiresIn *int    `json:"refresh_expires_in,omitempty"` // `refresh_token` 的有效期,单位: 秒
	RefreshToken     *string `json:"refresh_token,omitempty"`      // 刷新用户 `access_token` 时使用的 token
	Sid              *string `json:"sid,omitempty"`                // 用户当前登录态session的唯一标识,为空则不返回
}

type CreateRefreshAccessTokenPathReqBodyBuilder

type CreateRefreshAccessTokenPathReqBodyBuilder struct {
	// contains filtered or unexported fields
}

func NewCreateRefreshAccessTokenPathReqBodyBuilder

func NewCreateRefreshAccessTokenPathReqBodyBuilder() *CreateRefreshAccessTokenPathReqBodyBuilder

func (*CreateRefreshAccessTokenPathReqBodyBuilder) Build

func (*CreateRefreshAccessTokenPathReqBodyBuilder) GrantType

授权类型,**固定值**:

示例值:refresh_token

func (*CreateRefreshAccessTokenPathReqBodyBuilder) RefreshToken

刷新 `user_access_token` 需要的凭证<br>获取user_access_token`接口和本接口均返回 `refresh_token`,**每次请求,请注意使用最新获取到的`refresh_token`**

示例值:ur-oQ0mMq6MCcueAv0pwx2fQQhxqv__CbLu6G8ySFwafeKww2Def2BJdOkW3.9gCFM.LBQgFri901QaqeuL

type CreateRefreshAccessTokenReq

type CreateRefreshAccessTokenReq struct {
	Body *CreateRefreshAccessTokenReqBody `body:""`
	// contains filtered or unexported fields
}

type CreateRefreshAccessTokenReqBody

type CreateRefreshAccessTokenReqBody struct {
	GrantType    *string `json:"grant_type,omitempty"`    // 授权类型,**固定值**:
	RefreshToken *string `json:"refresh_token,omitempty"` // 刷新 `user_access_token` 需要的凭证<br>获取user_access_token`接口和本接口均返回 `refresh_token`,**每次请求,请注意使用最新获取到的`refresh_token`**
}

type CreateRefreshAccessTokenReqBodyBuilder

type CreateRefreshAccessTokenReqBodyBuilder struct {
	// contains filtered or unexported fields
}

func NewCreateRefreshAccessTokenReqBodyBuilder

func NewCreateRefreshAccessTokenReqBodyBuilder() *CreateRefreshAccessTokenReqBodyBuilder

func (*CreateRefreshAccessTokenReqBodyBuilder) Build

func (*CreateRefreshAccessTokenReqBodyBuilder) GrantType

授权类型,**固定值**:

示例值:refresh_token

func (*CreateRefreshAccessTokenReqBodyBuilder) RefreshToken

刷新 `user_access_token` 需要的凭证<br>获取user_access_token`接口和本接口均返回 `refresh_token`,**每次请求,请注意使用最新获取到的`refresh_token`**

示例值:ur-oQ0mMq6MCcueAv0pwx2fQQhxqv__CbLu6G8ySFwafeKww2Def2BJdOkW3.9gCFM.LBQgFri901QaqeuL

type CreateRefreshAccessTokenReqBuilder

type CreateRefreshAccessTokenReqBuilder struct {
	// contains filtered or unexported fields
}

func NewCreateRefreshAccessTokenReqBuilder

func NewCreateRefreshAccessTokenReqBuilder() *CreateRefreshAccessTokenReqBuilder

func (*CreateRefreshAccessTokenReqBuilder) Body

func (*CreateRefreshAccessTokenReqBuilder) Build

type CreateRefreshAccessTokenResp

type CreateRefreshAccessTokenResp struct {
	*larkcore.ApiResp `json:"-"`
	larkcore.CodeError
	Data *CreateRefreshAccessTokenRespData `json:"data"` // 业务数据
}

func (*CreateRefreshAccessTokenResp) Success

func (resp *CreateRefreshAccessTokenResp) Success() bool

type CreateRefreshAccessTokenRespData

type CreateRefreshAccessTokenRespData struct {
	AccessToken      *string `json:"access_token,omitempty"`       // user_access_token,用于获取用户资源
	TokenType        *string `json:"token_type,omitempty"`         // token 类型
	ExpiresIn        *int    `json:"expires_in,omitempty"`         // `access_token`的有效期,单位: 秒
	Name             *string `json:"name,omitempty"`               // 用户姓名
	EnName           *string `json:"en_name,omitempty"`            // 用户英文名称
	AvatarUrl        *string `json:"avatar_url,omitempty"`         // 用户头像
	AvatarThumb      *string `json:"avatar_thumb,omitempty"`       // 用户头像 72x72
	AvatarMiddle     *string `json:"avatar_middle,omitempty"`      // 用户头像 240x240
	AvatarBig        *string `json:"avatar_big,omitempty"`         // 用户头像 640x640
	OpenId           *string `json:"open_id,omitempty"`            // 用户在应用内的唯一标识
	UnionId          *string `json:"union_id,omitempty"`           // 用户统一ID
	Email            *string `json:"email,omitempty"`              // 用户邮箱
	EnterpriseEmail  *string `json:"enterprise_email,omitempty"`   // 企业邮箱,请先确保已在管理后台启用飞书邮箱服务
	UserId           *string `json:"user_id,omitempty"`            // 用户 user_id
	Mobile           *string `json:"mobile,omitempty"`             // 用户手机号
	TenantKey        *string `json:"tenant_key,omitempty"`         // 当前企业标识
	RefreshExpiresIn *int    `json:"refresh_expires_in,omitempty"` // `refresh_token` 的有效期,单位: 秒
	RefreshToken     *string `json:"refresh_token,omitempty"`      // 刷新用户 `access_token` 时使用的 token
	Sid              *string `json:"sid,omitempty"`                // 用户当前登录态session的唯一标识,为空则不返回
}

type GetUserInfoResp

type GetUserInfoResp struct {
	*larkcore.ApiResp `json:"-"`
	larkcore.CodeError
	Data *GetUserInfoRespData `json:"data"` // 业务数据
}

func (*GetUserInfoResp) Success

func (resp *GetUserInfoResp) Success() bool

type GetUserInfoRespData

type GetUserInfoRespData struct {
	Name            *string `json:"name,omitempty"`             // 用户姓名
	EnName          *string `json:"en_name,omitempty"`          // 用户英文名称
	AvatarUrl       *string `json:"avatar_url,omitempty"`       // 用户头像
	AvatarThumb     *string `json:"avatar_thumb,omitempty"`     // 用户头像 72x72
	AvatarMiddle    *string `json:"avatar_middle,omitempty"`    // 用户头像 240x240
	AvatarBig       *string `json:"avatar_big,omitempty"`       // 用户头像 640x640
	OpenId          *string `json:"open_id,omitempty"`          // 用户在应用内的唯一标识
	UnionId         *string `json:"union_id,omitempty"`         // 用户统一ID
	Email           *string `json:"email,omitempty"`            // 用户邮箱
	EnterpriseEmail *string `json:"enterprise_email,omitempty"` // 企业邮箱,请先确保已在管理后台启用飞书邮箱服务
	UserId          *string `json:"user_id,omitempty"`          // 用户 user_id
	Mobile          *string `json:"mobile,omitempty"`           // 用户手机号
	TenantKey       *string `json:"tenant_key,omitempty"`       // 当前企业标识
	EmployeeNo      *string `json:"employee_no,omitempty"`      // 用户工号
}

type UserAccessTokenInfo

type UserAccessTokenInfo struct {
	AccessToken      *string `json:"access_token,omitempty"`       // user_access_token,用于获取用户资源
	TokenType        *string `json:"token_type,omitempty"`         // token 类型
	ExpiresIn        *int    `json:"expires_in,omitempty"`         // `access_token`的有效期,单位: 秒
	Name             *string `json:"name,omitempty"`               // 用户姓名
	EnName           *string `json:"en_name,omitempty"`            // 用户英文名称
	AvatarUrl        *string `json:"avatar_url,omitempty"`         // 用户头像
	AvatarThumb      *string `json:"avatar_thumb,omitempty"`       // 用户头像 72x72
	AvatarMiddle     *string `json:"avatar_middle,omitempty"`      // 用户头像 240x240
	AvatarBig        *string `json:"avatar_big,omitempty"`         // 用户头像 640x640
	OpenId           *string `json:"open_id,omitempty"`            // 用户在应用内的唯一标识
	UnionId          *string `json:"union_id,omitempty"`           // 用户统一ID
	Email            *string `json:"email,omitempty"`              // 用户邮箱
	EnterpriseEmail  *string `json:"enterprise_email,omitempty"`   // 企业邮箱,请先确保已在管理后台启用飞书邮箱服务
	UserId           *string `json:"user_id,omitempty"`            // 用户 user_id
	Mobile           *string `json:"mobile,omitempty"`             // 用户手机号
	TenantKey        *string `json:"tenant_key,omitempty"`         // 当前企业标识
	RefreshExpiresIn *int    `json:"refresh_expires_in,omitempty"` // `refresh_token` 的有效期,单位: 秒
	RefreshToken     *string `json:"refresh_token,omitempty"`      // 刷新用户 `access_token` 时使用的 token
	Sid              *string `json:"sid,omitempty"`                // 用户当前登录态session的唯一标识,为空则不返回
}

type UserAccessTokenInfoBuilder

type UserAccessTokenInfoBuilder struct {
	// contains filtered or unexported fields
}

func NewUserAccessTokenInfoBuilder

func NewUserAccessTokenInfoBuilder() *UserAccessTokenInfoBuilder

func (*UserAccessTokenInfoBuilder) AccessToken

func (builder *UserAccessTokenInfoBuilder) AccessToken(accessToken string) *UserAccessTokenInfoBuilder

user_access_token,用于获取用户资源

示例值:

func (*UserAccessTokenInfoBuilder) AvatarBig

func (builder *UserAccessTokenInfoBuilder) AvatarBig(avatarBig string) *UserAccessTokenInfoBuilder

用户头像 640x640

示例值:

func (*UserAccessTokenInfoBuilder) AvatarMiddle

func (builder *UserAccessTokenInfoBuilder) AvatarMiddle(avatarMiddle string) *UserAccessTokenInfoBuilder

用户头像 240x240

示例值:

func (*UserAccessTokenInfoBuilder) AvatarThumb

func (builder *UserAccessTokenInfoBuilder) AvatarThumb(avatarThumb string) *UserAccessTokenInfoBuilder

用户头像 72x72

示例值:

func (*UserAccessTokenInfoBuilder) AvatarUrl

func (builder *UserAccessTokenInfoBuilder) AvatarUrl(avatarUrl string) *UserAccessTokenInfoBuilder

用户头像

示例值:

func (*UserAccessTokenInfoBuilder) Build

func (*UserAccessTokenInfoBuilder) Email

用户邮箱

示例值:

func (*UserAccessTokenInfoBuilder) EnName

用户英文名称

示例值:

func (*UserAccessTokenInfoBuilder) EnterpriseEmail

func (builder *UserAccessTokenInfoBuilder) EnterpriseEmail(enterpriseEmail string) *UserAccessTokenInfoBuilder

企业邮箱,请先确保已在管理后台启用飞书邮箱服务

示例值:

func (*UserAccessTokenInfoBuilder) ExpiresIn

func (builder *UserAccessTokenInfoBuilder) ExpiresIn(expiresIn int) *UserAccessTokenInfoBuilder

`access_token`的有效期,单位: 秒

示例值:

func (*UserAccessTokenInfoBuilder) Mobile

用户手机号

示例值:

func (*UserAccessTokenInfoBuilder) Name

用户姓名

示例值:

func (*UserAccessTokenInfoBuilder) OpenId

用户在应用内的唯一标识

示例值:

func (*UserAccessTokenInfoBuilder) RefreshExpiresIn

func (builder *UserAccessTokenInfoBuilder) RefreshExpiresIn(refreshExpiresIn int) *UserAccessTokenInfoBuilder

`refresh_token` 的有效期,单位: 秒

示例值:

func (*UserAccessTokenInfoBuilder) RefreshToken

func (builder *UserAccessTokenInfoBuilder) RefreshToken(refreshToken string) *UserAccessTokenInfoBuilder

刷新用户 `access_token` 时使用的 token

示例值:

func (*UserAccessTokenInfoBuilder) Sid

用户当前登录态session的唯一标识,为空则不返回

示例值:

func (*UserAccessTokenInfoBuilder) TenantKey

func (builder *UserAccessTokenInfoBuilder) TenantKey(tenantKey string) *UserAccessTokenInfoBuilder

当前企业标识

示例值:

func (*UserAccessTokenInfoBuilder) TokenType

func (builder *UserAccessTokenInfoBuilder) TokenType(tokenType string) *UserAccessTokenInfoBuilder

token 类型

示例值:

func (*UserAccessTokenInfoBuilder) UnionId

用户统一ID

示例值:

func (*UserAccessTokenInfoBuilder) UserId

用户 user_id

示例值:

type UserInfo

type UserInfo struct {
	Name            *string `json:"name,omitempty"`             // 用户姓名
	EnName          *string `json:"en_name,omitempty"`          // 用户英文名称
	AvatarUrl       *string `json:"avatar_url,omitempty"`       // 用户头像
	AvatarThumb     *string `json:"avatar_thumb,omitempty"`     // 用户头像 72x72
	AvatarMiddle    *string `json:"avatar_middle,omitempty"`    // 用户头像 240x240
	AvatarBig       *string `json:"avatar_big,omitempty"`       // 用户头像 640x640
	OpenId          *string `json:"open_id,omitempty"`          // 用户在应用内的唯一标识
	UnionId         *string `json:"union_id,omitempty"`         // 用户统一ID
	Email           *string `json:"email,omitempty"`            // 用户邮箱
	EnterpriseEmail *string `json:"enterprise_email,omitempty"` // 企业邮箱,请先确保已在管理后台启用飞书邮箱服务
	UserId          *string `json:"user_id,omitempty"`          // 用户 user_id
	Mobile          *string `json:"mobile,omitempty"`           // 用户手机号
	TenantKey       *string `json:"tenant_key,omitempty"`       // 当前企业标识
	EmployeeNo      *string `json:"employee_no,omitempty"`      // 用户工号
}

type UserInfoBuilder

type UserInfoBuilder struct {
	// contains filtered or unexported fields
}

func NewUserInfoBuilder

func NewUserInfoBuilder() *UserInfoBuilder

func (*UserInfoBuilder) AvatarBig

func (builder *UserInfoBuilder) AvatarBig(avatarBig string) *UserInfoBuilder

用户头像 640x640

示例值:

func (*UserInfoBuilder) AvatarMiddle

func (builder *UserInfoBuilder) AvatarMiddle(avatarMiddle string) *UserInfoBuilder

用户头像 240x240

示例值:

func (*UserInfoBuilder) AvatarThumb

func (builder *UserInfoBuilder) AvatarThumb(avatarThumb string) *UserInfoBuilder

用户头像 72x72

示例值:

func (*UserInfoBuilder) AvatarUrl

func (builder *UserInfoBuilder) AvatarUrl(avatarUrl string) *UserInfoBuilder

用户头像

示例值:

func (*UserInfoBuilder) Build

func (builder *UserInfoBuilder) Build() *UserInfo

func (*UserInfoBuilder) Email

func (builder *UserInfoBuilder) Email(email string) *UserInfoBuilder

用户邮箱

示例值:

func (*UserInfoBuilder) EmployeeNo

func (builder *UserInfoBuilder) EmployeeNo(employeeNo string) *UserInfoBuilder

用户工号

示例值:

func (*UserInfoBuilder) EnName

func (builder *UserInfoBuilder) EnName(enName string) *UserInfoBuilder

用户英文名称

示例值:

func (*UserInfoBuilder) EnterpriseEmail

func (builder *UserInfoBuilder) EnterpriseEmail(enterpriseEmail string) *UserInfoBuilder

企业邮箱,请先确保已在管理后台启用飞书邮箱服务

示例值:

func (*UserInfoBuilder) Mobile

func (builder *UserInfoBuilder) Mobile(mobile string) *UserInfoBuilder

用户手机号

示例值:

func (*UserInfoBuilder) Name

func (builder *UserInfoBuilder) Name(name string) *UserInfoBuilder

用户姓名

示例值:

func (*UserInfoBuilder) OpenId

func (builder *UserInfoBuilder) OpenId(openId string) *UserInfoBuilder

用户在应用内的唯一标识

示例值:

func (*UserInfoBuilder) TenantKey

func (builder *UserInfoBuilder) TenantKey(tenantKey string) *UserInfoBuilder

当前企业标识

示例值:

func (*UserInfoBuilder) UnionId

func (builder *UserInfoBuilder) UnionId(unionId string) *UserInfoBuilder

用户统一ID

示例值:

func (*UserInfoBuilder) UserId

func (builder *UserInfoBuilder) UserId(userId string) *UserInfoBuilder

用户 user_id

示例值:

Jump to

Keyboard shortcuts

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