1 Star 0 Fork 0

Larksuite/oapi-sdk-go

Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
Clone or Download
delete_publicMailboxMember.go 1.99 KB
Copy Edit Raw Blame History
zhailuxu authored 2022-09-07 13:50 . add sdk
// Package mail code generated by oapi sdk gen
/*
* MIT License
*
* Copyright (c) 2022 Lark Technologies Pte. Ltd.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice, shall be included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package main
import (
"context"
"fmt"
"gitee.com/larksuite/oapi-sdk-go/v3"
"gitee.com/larksuite/oapi-sdk-go/v3/core"
"gitee.com/larksuite/oapi-sdk-go/v3/service/mail/v1"
)
// DELETE /open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members/:member_id
func main() {
// 创建 Client
client := lark.NewClient("appID", "appSecret")
// 创建请求对象
req := larkmail.NewDeletePublicMailboxMemberReqBuilder().
PublicMailboxId("xxxxxxxxxxxxxxx 或 test_public_mailbox@xxx.xx").
MemberId("xxxxxxxxxxxxxxx").
Build()
// 发起请求
resp, err := client.Mail.PublicMailboxMember.Delete(context.Background(), req)
// 处理错误
if err != nil {
fmt.Println(err)
return
}
// 服务端错误处理
if !resp.Success() {
fmt.Println(resp.Code, resp.Msg, resp.RequestId())
return
}
// 业务处理
fmt.Println(larkcore.Prettify(resp))
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/larksuite/oapi-sdk-go.git
git@gitee.com:larksuite/oapi-sdk-go.git
larksuite
oapi-sdk-go
oapi-sdk-go
94932eb86f11

Search