lark

package
v1.17.0 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ApproveTypeAnd ApprovalType = "AND"
	ApproveTypeOr  ApprovalType = "OR"

	QueryTypeEmail  = "email"
	QueryTypeMobile = "mobile"
)
View Source
const (
	// ApproverSelectionMethodFree is the approver selection method in the definition of approval
	// Free means the approval sponsor can choose the approver freely
	ApproverSelectionMethodFree = "Free"
)

Variables

This section is empty.

Functions

func Validate

func Validate(appID, secret string) error

Validate check whether the lark app id and secret are correct

Types

type ApprovalInstanceInfo

type ApprovalInstanceInfo struct {
	config.ApproveOrReject
	ApproverInfo *UserInfo
	Comment      string
	Time         int64
}

type ApprovalType added in v1.16.0

type ApprovalType string

type CancelApprovalInstanceArgs

type CancelApprovalInstanceArgs struct {
	ApprovalID string
	InstanceID string
	UserID     string
}

type Client

type Client struct {
	*lark.Client
}

func NewClient

func NewClient(appID, secret string) *Client

func (*Client) CancelApprovalInstance

func (client *Client) CancelApprovalInstance(args *CancelApprovalInstanceArgs) error

func (*Client) CreateApprovalDefinition

func (client *Client) CreateApprovalDefinition(arg *CreateApprovalDefinitionArgs) (string, error)

func (*Client) CreateApprovalInstance

func (client *Client) CreateApprovalInstance(args *CreateApprovalInstanceArgs) (string, error)

func (*Client) GetApprovalInstance

func (client *Client) GetApprovalInstance(args *GetApprovalInstanceArgs) (*ApprovalInstanceInfo, error)

func (*Client) GetDepartmentInfoByID

func (client *Client) GetDepartmentInfoByID(id string) (*DepartmentInfo, error)

func (*Client) GetUserInfoByID

func (client *Client) GetUserInfoByID(id string) (*UserInfo, error)

func (*Client) GetUserOpenIDByEmailOrMobile

func (client *Client) GetUserOpenIDByEmailOrMobile(_type, value string) (string, error)

func (*Client) ListAppContactRange

func (client *Client) ListAppContactRange() (*ContactRange, error)

ListAppContactRange get users, departments, groups open id authorized by the lark app

func (*Client) ListSubDepartmentsInfo

func (client *Client) ListSubDepartmentsInfo(departmentID string) ([]*DepartmentInfo, error)

func (*Client) ListUserFromDepartment

func (client *Client) ListUserFromDepartment(departmentID string) ([]*UserInfo, error)

func (*Client) SubscribeApprovalDefinition

func (client *Client) SubscribeApprovalDefinition(args *SubscribeApprovalDefinitionArgs) error

type ContactRange

type ContactRange struct {
	UserIDs       []string `json:"user_id_list"`
	DepartmentIDs []string `json:"department_id_list"`
	GroupIDs      []string `json:"group_id_list,omitempty"`
}

type CreateApprovalDefinitionArgs

type CreateApprovalDefinitionArgs struct {
	Name        string
	Description string
	Type        ApprovalType
}

type CreateApprovalInstanceArgs

type CreateApprovalInstanceArgs struct {
	ApprovalCode   string
	UserOpenID     string
	ApproverIDList []string
	FormContent    string
}

type DepartmentInfo

type DepartmentInfo struct {
	ID   string `json:"id" yaml:"id" bson:"id"`
	Name string `json:"name" yaml:"name" bson:"name"`
}

type GetApprovalInstanceArgs

type GetApprovalInstanceArgs struct {
	InstanceID string
}

type SubscribeApprovalDefinitionArgs

type SubscribeApprovalDefinitionArgs struct {
	ApprovalID string
}

type UserInfo

type UserInfo struct {
	ID     string `json:"id" yaml:"id" bson:"id"`
	Name   string `json:"name" yaml:"name" bson:"name"`
	Avatar string `json:"avatar" yaml:"avatar" bson:"avatar"`
}

Jump to

Keyboard shortcuts

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