From f5da8f17adb389daa7ae30d37015c433cbe2bb4c Mon Sep 17 00:00:00 2001 From: tianfengyuan Date: Thu, 12 Nov 2020 14:06:49 +0800 Subject: [PATCH] add service contact Change-Id: I888ea1515b9767e1beb49512e66c996f3bd2715e --- README.md | 2 + README.zh.md | 2 + sample/api/contact.go | 61 ++ sample/event/contact.go | 43 ++ service/contact/v3/api.go | 1206 +++++++++++++++++++++++++++++++++++ service/contact/v3/event.go | 328 ++++++++++ service/contact/v3/model.go | 455 +++++++++++++ 7 files changed, 2097 insertions(+) create mode 100644 sample/api/contact.go create mode 100644 sample/event/contact.go create mode 100644 service/contact/v3/api.go create mode 100644 service/contact/v3/event.go create mode 100644 service/contact/v3/model.go diff --git a/README.md b/README.md index 35eeabd4..926f45f9 100644 --- a/README.md +++ b/README.md @@ -75,6 +75,7 @@ $ go get -u github.com/larksuite/oapi-sdk-go | Authentication | v1 | [service/authen](service/authen) | [sample/api/authen.go](sample/api/authen.go)| | Image | v4 | [service/image](service/image)|[sample/api/image.go](sample/api/image.go)| | Calendar | v4 | [service/calendar](service/calendar)|[sample/api/calendar.go](sample/api/calendar.go)| + | contact | v3 | [service/contact](service/contact) | [sample/api/contact.go](sample/api/contact.go) | - Instructions for use(For`No business API SDK is generated`the processing method) @@ -133,6 +134,7 @@ $ go get -u github.com/larksuite/oapi-sdk-go | Business service | version | path | sample | |--------------|--------------|------|------| | application | v1 | [service/application](service/application) | [sample/event/application.go](sample/event/application.go) | + | contact | v3 | [service/contact](service/contact) | [sample/event/contact.go](sample/event/contact.go) | - Instructions for use - Event monitoring service started diff --git a/README.zh.md b/README.zh.md index 99e9d71a..b3d22315 100644 --- a/README.zh.md +++ b/README.zh.md @@ -81,6 +81,7 @@ $ go get -u github.com/larksuite/oapi-sdk-go | 身份验证 | v1 | [service/authen](service/authen) | [sample/api/authen.go](sample/api/authen.go)| | 图片 | v4 | [service/image](service/image)|[sample/api/image.go](sample/api/image.go)| | 日历 | v4 | [service/calendar](service/calendar)|[sample/api/calendar.go](sample/api/calendar.go)| + | 通讯录 | v3 | [service/contact](service/contact)|[sample/api/contact.go](sample/api/contact.go)| - 使用说明(对于`没有生成业务API SDK`的处理方式) @@ -139,6 +140,7 @@ $ go get -u github.com/larksuite/oapi-sdk-go | 业务服务 | 版本 | 路径 | 示例 | |--------------|--------------|------|------| | 应用 | v1 | [service/application](service/application) | [sample/event/application.go](sample/event/application.go) | + | 通讯录 | v3 | [service/contact](service/contact) | [sample/event/contact.go](sample/event/contact.go) | - 使用说明 - 事件监听服务启动 diff --git a/sample/api/contact.go b/sample/api/contact.go new file mode 100644 index 00000000..4d677f42 --- /dev/null +++ b/sample/api/contact.go @@ -0,0 +1,61 @@ +package main + +import ( + "context" + "fmt" + + "github.com/larksuite/oapi-sdk-go/api/core/response" + "github.com/larksuite/oapi-sdk-go/core" + "github.com/larksuite/oapi-sdk-go/core/tools" + contact "github.com/larksuite/oapi-sdk-go/service/contact/v3" +) + +var contactService = contact.NewService(conf) + +func main() { + testUserServiceList() + testDepartmentServiceUpdate() +} +func testUserServiceList() { + + coreCtx := core.WarpContext(context.Background()) + reqCall := contactService.Users.List(coreCtx) + reqCall.SetDepartmentIdType("open_id") + reqCall.SetPageSize(20) + reqCall.SetDepartmentIdType("open_department_id") + reqCall.SetDepartmentId("od_XXXXXXXXX") + reqCall.SetUserIdType("open_id") + result, err := reqCall.Do() + fmt.Printf("request_id:%s", coreCtx.GetRequestID()) + fmt.Printf("http status code:%d", coreCtx.GetHTTPStatusCode()) + if err != nil { + e := err.(*response.Error) + fmt.Printf(tools.Prettify(e)) + return + } + fmt.Printf("reault:%s", tools.Prettify(result)) +} + +func testDepartmentServiceUpdate() { + coreCtx := core.WarpContext(context.Background()) + updateBody := &contact.Department{ + Name: "xxxxx", + ParentDepartmentId: "od_xxxxxx", + LeaderUserId: "ou-xxxxxxx", + Order: 666, + CreateGroupChat: false, + } + reqCall := contactService.Departments.Create(coreCtx, updateBody) + reqCall.SetDepartmentIdType("open_department_id") + reqCall.SetUserIdType("open_id") + reqCall.SetClientToken("xxxxxxx") + result, err := reqCall.Do() + fmt.Printf("request_id:%s", coreCtx.GetRequestID()) + fmt.Printf("http status code:%d", coreCtx.GetHTTPStatusCode()) + if err != nil { + e := err.(*response.Error) + fmt.Printf(tools.Prettify(e)) + return + } + fmt.Printf("reault:%s", tools.Prettify(result)) +} diff --git a/sample/event/contact.go b/sample/event/contact.go new file mode 100644 index 00000000..47756c3d --- /dev/null +++ b/sample/event/contact.go @@ -0,0 +1,43 @@ +package main + +import ( + "fmt" + "path" + + "github.com/gin-gonic/gin" + "github.com/larksuite/oapi-sdk-go/core" + "github.com/larksuite/oapi-sdk-go/core/test" + "github.com/larksuite/oapi-sdk-go/core/tools" + eventginserver "github.com/larksuite/oapi-sdk-go/event/http/gin" + contact "github.com/larksuite/oapi-sdk-go/service/contact/v3" +) + +func main() { + + conf := test.GetInternalConf("staging") + + contact.SetDepartmentCreatedEventHandler(conf, func(ctx *core.Context, event *contact.DepartmentCreatedEvent) error { + fmt.Println(ctx.GetRequestID()) + fmt.Println(tools.Prettify(event)) + return nil + }) + + contact.SetUserCreateEventHandler(conf, func(ctx *core.Context, event *contact.UserCreateEvent) error { + fmt.Println(ctx.GetRequestID()) + fmt.Println(tools.Prettify(event)) + return nil + }) + contact.SetDepartmentDeletedEventHandler(conf, func(ctx *core.Context, event *contact.DepartmentDeletedEvent) error { + fmt.Println(ctx.GetRequestID()) + fmt.Println(tools.Prettify(event)) + return nil + }) + + g := gin.Default() + eventginserver.Register(path.Join("/", conf.GetAppSettings().AppID, "webhook/event"), conf, g) + err := g.Run(":8089") + if err != nil { + fmt.Println(err) + } + +} diff --git a/service/contact/v3/api.go b/service/contact/v3/api.go new file mode 100644 index 00000000..5ba65503 --- /dev/null +++ b/service/contact/v3/api.go @@ -0,0 +1,1206 @@ +// Code generated by lark suite oapi sdk gen +package v3 + +import ( + "github.com/larksuite/oapi-sdk-go/api" + "github.com/larksuite/oapi-sdk-go/api/core/request" + "github.com/larksuite/oapi-sdk-go/api/core/response" + "github.com/larksuite/oapi-sdk-go/core" + "github.com/larksuite/oapi-sdk-go/core/config" + "path" +) + +const serviceBasePath = "contact/v3" + +type Service struct { + conf *config.Config + basePath string + Departments *DepartmentService + DepartmentEvents *DepartmentEventService + DepartmentUnits *DepartmentUnitService + GroupEvents *GroupEventService + Members *MemberService + Scopes *ScopeService + Users *UserService + UserEvents *UserEventService + UserGroups *UserGroupService + UserGroupMembers *UserGroupMemberService +} + +func NewService(conf *config.Config) *Service { + s := &Service{ + conf: conf, + basePath: serviceBasePath, + } + s.Departments = newDepartmentService(s) + s.DepartmentEvents = newDepartmentEventService(s) + s.DepartmentUnits = newDepartmentUnitService(s) + s.GroupEvents = newGroupEventService(s) + s.Members = newMemberService(s) + s.Scopes = newScopeService(s) + s.Users = newUserService(s) + s.UserEvents = newUserEventService(s) + s.UserGroups = newUserGroupService(s) + s.UserGroupMembers = newUserGroupMemberService(s) + return s +} + +type DepartmentService struct { + service *Service +} + +func newDepartmentService(service *Service) *DepartmentService { + return &DepartmentService{ + service: service, + } +} + +type DepartmentEventService struct { + service *Service +} + +func newDepartmentEventService(service *Service) *DepartmentEventService { + return &DepartmentEventService{ + service: service, + } +} + +type DepartmentUnitService struct { + service *Service +} + +func newDepartmentUnitService(service *Service) *DepartmentUnitService { + return &DepartmentUnitService{ + service: service, + } +} + +type GroupEventService struct { + service *Service +} + +func newGroupEventService(service *Service) *GroupEventService { + return &GroupEventService{ + service: service, + } +} + +type MemberService struct { + service *Service +} + +func newMemberService(service *Service) *MemberService { + return &MemberService{ + service: service, + } +} + +type ScopeService struct { + service *Service +} + +func newScopeService(service *Service) *ScopeService { + return &ScopeService{ + service: service, + } +} + +type UserService struct { + service *Service +} + +func newUserService(service *Service) *UserService { + return &UserService{ + service: service, + } +} + +type UserEventService struct { + service *Service +} + +func newUserEventService(service *Service) *UserEventService { + return &UserEventService{ + service: service, + } +} + +type UserGroupService struct { + service *Service +} + +func newUserGroupService(service *Service) *UserGroupService { + return &UserGroupService{ + service: service, + } +} + +type UserGroupMemberService struct { + service *Service +} + +func newUserGroupMemberService(service *Service) *UserGroupMemberService { + return &UserGroupMemberService{ + service: service, + } +} + +type DepartmentCreateReqCall struct { + ctx *core.Context + departments *DepartmentService + body *Department + + queryParams map[string]interface{} + optFns []request.OptFn +} + +func (rc *DepartmentCreateReqCall) SetUserIdType(userIdType string) { + rc.queryParams["user_id_type"] = userIdType +} +func (rc *DepartmentCreateReqCall) SetDepartmentIdType(departmentIdType string) { + rc.queryParams["department_id_type"] = departmentIdType +} +func (rc *DepartmentCreateReqCall) SetClientToken(clientToken string) { + rc.queryParams["client_token"] = clientToken +} +func (rc *DepartmentCreateReqCall) Do() (*DepartmentCreateResult, error) { + httpPath := path.Join(rc.departments.service.basePath, "departments") + rc.optFns = append(rc.optFns, request.SetQueryParams(rc.queryParams)) + var result = &DepartmentCreateResult{} + req := request.NewRequest(httpPath, "POST", + []request.AccessTokenType{request.AccessTokenTypeTenant}, rc.body, result, rc.optFns...) + err := api.Send(rc.ctx, rc.departments.service.conf, req) + return result, err +} + +func (departments *DepartmentService) Create(ctx *core.Context, body *Department, optFns ...request.OptFn) *DepartmentCreateReqCall { + return &DepartmentCreateReqCall{ + ctx: ctx, + departments: departments, + body: body, + queryParams: map[string]interface{}{}, + optFns: optFns, + } +} + +type DepartmentDeleteReqCall struct { + ctx *core.Context + departments *DepartmentService + pathParams map[string]interface{} + + queryParams map[string]interface{} + optFns []request.OptFn +} + +func (rc *DepartmentDeleteReqCall) SetDepartmentId(departmentId string) { + rc.pathParams["department_id"] = departmentId +} +func (rc *DepartmentDeleteReqCall) SetUserIdType(userIdType string) { + rc.queryParams["user_id_type"] = userIdType +} +func (rc *DepartmentDeleteReqCall) SetDepartmentIdType(departmentIdType string) { + rc.queryParams["department_id_type"] = departmentIdType +} +func (rc *DepartmentDeleteReqCall) Do() (*response.NoData, error) { + httpPath := path.Join(rc.departments.service.basePath, "departments/:department_id") + rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams)) + rc.optFns = append(rc.optFns, request.SetQueryParams(rc.queryParams)) + var result = &response.NoData{} + req := request.NewRequest(httpPath, "DELETE", + []request.AccessTokenType{request.AccessTokenTypeTenant}, nil, result, rc.optFns...) + err := api.Send(rc.ctx, rc.departments.service.conf, req) + return result, err +} + +func (departments *DepartmentService) Delete(ctx *core.Context, optFns ...request.OptFn) *DepartmentDeleteReqCall { + return &DepartmentDeleteReqCall{ + ctx: ctx, + departments: departments, + pathParams: map[string]interface{}{}, + queryParams: map[string]interface{}{}, + optFns: optFns, + } +} + +type DepartmentGetReqCall struct { + ctx *core.Context + departments *DepartmentService + pathParams map[string]interface{} + + queryParams map[string]interface{} + optFns []request.OptFn +} + +func (rc *DepartmentGetReqCall) SetDepartmentId(departmentId string) { + rc.pathParams["department_id"] = departmentId +} +func (rc *DepartmentGetReqCall) SetUserIdType(userIdType string) { + rc.queryParams["user_id_type"] = userIdType +} +func (rc *DepartmentGetReqCall) SetDepartmentIdType(departmentIdType string) { + rc.queryParams["department_id_type"] = departmentIdType +} +func (rc *DepartmentGetReqCall) Do() (*DepartmentGetResult, error) { + httpPath := path.Join(rc.departments.service.basePath, "departments/:department_id") + rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams)) + rc.optFns = append(rc.optFns, request.SetQueryParams(rc.queryParams)) + var result = &DepartmentGetResult{} + req := request.NewRequest(httpPath, "GET", + []request.AccessTokenType{request.AccessTokenTypeTenant}, nil, result, rc.optFns...) + err := api.Send(rc.ctx, rc.departments.service.conf, req) + return result, err +} + +func (departments *DepartmentService) Get(ctx *core.Context, optFns ...request.OptFn) *DepartmentGetReqCall { + return &DepartmentGetReqCall{ + ctx: ctx, + departments: departments, + pathParams: map[string]interface{}{}, + queryParams: map[string]interface{}{}, + optFns: optFns, + } +} + +type DepartmentListReqCall struct { + ctx *core.Context + departments *DepartmentService + + queryParams map[string]interface{} + optFns []request.OptFn +} + +func (rc *DepartmentListReqCall) SetUserIdType(userIdType string) { + rc.queryParams["user_id_type"] = userIdType +} +func (rc *DepartmentListReqCall) SetDepartmentIdType(departmentIdType string) { + rc.queryParams["department_id_type"] = departmentIdType +} +func (rc *DepartmentListReqCall) SetParentDepartmentId(parentDepartmentId string) { + rc.queryParams["parent_department_id"] = parentDepartmentId +} +func (rc *DepartmentListReqCall) SetPageToken(pageToken string) { + rc.queryParams["page_token"] = pageToken +} +func (rc *DepartmentListReqCall) SetPageSize(pageSize int) { + rc.queryParams["page_size"] = pageSize +} +func (rc *DepartmentListReqCall) Do() (*DepartmentListResult, error) { + httpPath := path.Join(rc.departments.service.basePath, "departments") + rc.optFns = append(rc.optFns, request.SetQueryParams(rc.queryParams)) + var result = &DepartmentListResult{} + req := request.NewRequest(httpPath, "GET", + []request.AccessTokenType{request.AccessTokenTypeTenant}, nil, result, rc.optFns...) + err := api.Send(rc.ctx, rc.departments.service.conf, req) + return result, err +} + +func (departments *DepartmentService) List(ctx *core.Context, optFns ...request.OptFn) *DepartmentListReqCall { + return &DepartmentListReqCall{ + ctx: ctx, + departments: departments, + queryParams: map[string]interface{}{}, + optFns: optFns, + } +} + +type DepartmentNomalizeReqCall struct { + ctx *core.Context + departments *DepartmentService + body *DepartmentNomalizeReqBody + + queryParams map[string]interface{} + optFns []request.OptFn +} + +func (rc *DepartmentNomalizeReqCall) SetDepartmentIdType(departmentIdType string) { + rc.queryParams["department_id_type"] = departmentIdType +} +func (rc *DepartmentNomalizeReqCall) SetPageToken(pageToken string) { + rc.queryParams["page_token"] = pageToken +} +func (rc *DepartmentNomalizeReqCall) SetPageSize(pageSize int) { + rc.queryParams["page_size"] = pageSize +} +func (rc *DepartmentNomalizeReqCall) Do() (*response.NoData, error) { + httpPath := path.Join(rc.departments.service.basePath, "departments/nomalize") + rc.optFns = append(rc.optFns, request.SetQueryParams(rc.queryParams)) + var result = &response.NoData{} + req := request.NewRequest(httpPath, "POST", + []request.AccessTokenType{request.AccessTokenTypeTenant}, rc.body, result, rc.optFns...) + err := api.Send(rc.ctx, rc.departments.service.conf, req) + return result, err +} + +func (departments *DepartmentService) Nomalize(ctx *core.Context, body *DepartmentNomalizeReqBody, optFns ...request.OptFn) *DepartmentNomalizeReqCall { + return &DepartmentNomalizeReqCall{ + ctx: ctx, + departments: departments, + body: body, + queryParams: map[string]interface{}{}, + optFns: optFns, + } +} + +type DepartmentNomalizeDepartmentChatReqCall struct { + ctx *core.Context + departments *DepartmentService + body *DepartmentNomalizeDepartmentChatReqBody + + queryParams map[string]interface{} + optFns []request.OptFn +} + +func (rc *DepartmentNomalizeDepartmentChatReqCall) SetDepartmentIdType(departmentIdType string) { + rc.queryParams["department_id_type"] = departmentIdType +} +func (rc *DepartmentNomalizeDepartmentChatReqCall) SetPageToken(pageToken string) { + rc.queryParams["page_token"] = pageToken +} +func (rc *DepartmentNomalizeDepartmentChatReqCall) SetPageSize(pageSize int) { + rc.queryParams["page_size"] = pageSize +} +func (rc *DepartmentNomalizeDepartmentChatReqCall) Do() (*response.NoData, error) { + httpPath := path.Join(rc.departments.service.basePath, "departments/nomalize_department_chat") + rc.optFns = append(rc.optFns, request.SetQueryParams(rc.queryParams)) + var result = &response.NoData{} + req := request.NewRequest(httpPath, "POST", + []request.AccessTokenType{request.AccessTokenTypeTenant}, rc.body, result, rc.optFns...) + err := api.Send(rc.ctx, rc.departments.service.conf, req) + return result, err +} + +func (departments *DepartmentService) NomalizeDepartmentChat(ctx *core.Context, body *DepartmentNomalizeDepartmentChatReqBody, optFns ...request.OptFn) *DepartmentNomalizeDepartmentChatReqCall { + return &DepartmentNomalizeDepartmentChatReqCall{ + ctx: ctx, + departments: departments, + body: body, + queryParams: map[string]interface{}{}, + optFns: optFns, + } +} + +type DepartmentParentReqCall struct { + ctx *core.Context + departments *DepartmentService + + queryParams map[string]interface{} + optFns []request.OptFn +} + +func (rc *DepartmentParentReqCall) SetUserIdType(userIdType string) { + rc.queryParams["user_id_type"] = userIdType +} +func (rc *DepartmentParentReqCall) SetDepartmentIdType(departmentIdType string) { + rc.queryParams["department_id_type"] = departmentIdType +} +func (rc *DepartmentParentReqCall) SetDepartmentId(departmentId string) { + rc.queryParams["department_id"] = departmentId +} +func (rc *DepartmentParentReqCall) SetPageToken(pageToken string) { + rc.queryParams["page_token"] = pageToken +} +func (rc *DepartmentParentReqCall) SetPageSize(pageSize int) { + rc.queryParams["page_size"] = pageSize +} +func (rc *DepartmentParentReqCall) Do() (*DepartmentParentResult, error) { + httpPath := path.Join(rc.departments.service.basePath, "departments/parent") + rc.optFns = append(rc.optFns, request.SetQueryParams(rc.queryParams)) + var result = &DepartmentParentResult{} + req := request.NewRequest(httpPath, "GET", + []request.AccessTokenType{request.AccessTokenTypeTenant}, nil, result, rc.optFns...) + err := api.Send(rc.ctx, rc.departments.service.conf, req) + return result, err +} + +func (departments *DepartmentService) Parent(ctx *core.Context, optFns ...request.OptFn) *DepartmentParentReqCall { + return &DepartmentParentReqCall{ + ctx: ctx, + departments: departments, + queryParams: map[string]interface{}{}, + optFns: optFns, + } +} + +type DepartmentPatchReqCall struct { + ctx *core.Context + departments *DepartmentService + body *Department + pathParams map[string]interface{} + + queryParams map[string]interface{} + optFns []request.OptFn +} + +func (rc *DepartmentPatchReqCall) SetDepartmentId(departmentId string) { + rc.pathParams["department_id"] = departmentId +} +func (rc *DepartmentPatchReqCall) SetUserIdType(userIdType string) { + rc.queryParams["user_id_type"] = userIdType +} +func (rc *DepartmentPatchReqCall) SetDepartmentIdType(departmentIdType string) { + rc.queryParams["department_id_type"] = departmentIdType +} +func (rc *DepartmentPatchReqCall) Do() (*DepartmentPatchResult, error) { + httpPath := path.Join(rc.departments.service.basePath, "departments/:department_id") + rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams)) + rc.optFns = append(rc.optFns, request.SetQueryParams(rc.queryParams)) + var result = &DepartmentPatchResult{} + req := request.NewRequest(httpPath, "PATCH", + []request.AccessTokenType{request.AccessTokenTypeTenant}, rc.body, result, rc.optFns...) + err := api.Send(rc.ctx, rc.departments.service.conf, req) + return result, err +} + +func (departments *DepartmentService) Patch(ctx *core.Context, body *Department, optFns ...request.OptFn) *DepartmentPatchReqCall { + return &DepartmentPatchReqCall{ + ctx: ctx, + departments: departments, + body: body, + pathParams: map[string]interface{}{}, + queryParams: map[string]interface{}{}, + optFns: optFns, + } +} + +type DepartmentUpdateReqCall struct { + ctx *core.Context + departments *DepartmentService + body *Department + pathParams map[string]interface{} + + queryParams map[string]interface{} + optFns []request.OptFn +} + +func (rc *DepartmentUpdateReqCall) SetDepartmentId(departmentId string) { + rc.pathParams["department_id"] = departmentId +} +func (rc *DepartmentUpdateReqCall) SetUserIdType(userIdType string) { + rc.queryParams["user_id_type"] = userIdType +} +func (rc *DepartmentUpdateReqCall) SetDepartmentIdType(departmentIdType string) { + rc.queryParams["department_id_type"] = departmentIdType +} +func (rc *DepartmentUpdateReqCall) Do() (*DepartmentUpdateResult, error) { + httpPath := path.Join(rc.departments.service.basePath, "departments/:department_id") + rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams)) + rc.optFns = append(rc.optFns, request.SetQueryParams(rc.queryParams)) + var result = &DepartmentUpdateResult{} + req := request.NewRequest(httpPath, "PUT", + []request.AccessTokenType{request.AccessTokenTypeTenant}, rc.body, result, rc.optFns...) + err := api.Send(rc.ctx, rc.departments.service.conf, req) + return result, err +} + +func (departments *DepartmentService) Update(ctx *core.Context, body *Department, optFns ...request.OptFn) *DepartmentUpdateReqCall { + return &DepartmentUpdateReqCall{ + ctx: ctx, + departments: departments, + body: body, + pathParams: map[string]interface{}{}, + queryParams: map[string]interface{}{}, + optFns: optFns, + } +} + +type DepartmentUpdateDepartmentIdReqCall struct { + ctx *core.Context + departments *DepartmentService + body *DepartmentUpdateDepartmentIdReqBody + pathParams map[string]interface{} + + queryParams map[string]interface{} + optFns []request.OptFn +} + +func (rc *DepartmentUpdateDepartmentIdReqCall) SetDepartmentId(departmentId string) { + rc.pathParams["department_id"] = departmentId +} +func (rc *DepartmentUpdateDepartmentIdReqCall) SetDepartmentIdType(departmentIdType string) { + rc.queryParams["department_id_type"] = departmentIdType +} +func (rc *DepartmentUpdateDepartmentIdReqCall) Do() (*response.NoData, error) { + httpPath := path.Join(rc.departments.service.basePath, "departments/:department_id/update_department_id") + rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams)) + rc.optFns = append(rc.optFns, request.SetQueryParams(rc.queryParams)) + var result = &response.NoData{} + req := request.NewRequest(httpPath, "PATCH", + []request.AccessTokenType{request.AccessTokenTypeTenant}, rc.body, result, rc.optFns...) + err := api.Send(rc.ctx, rc.departments.service.conf, req) + return result, err +} + +func (departments *DepartmentService) UpdateDepartmentId(ctx *core.Context, body *DepartmentUpdateDepartmentIdReqBody, optFns ...request.OptFn) *DepartmentUpdateDepartmentIdReqCall { + return &DepartmentUpdateDepartmentIdReqCall{ + ctx: ctx, + departments: departments, + body: body, + pathParams: map[string]interface{}{}, + queryParams: map[string]interface{}{}, + optFns: optFns, + } +} + +type DepartmentUnitCreateReqCall struct { + ctx *core.Context + departmentUnits *DepartmentUnitService + body *DepartmentUnit + + optFns []request.OptFn +} + +func (rc *DepartmentUnitCreateReqCall) Do() (*DepartmentUnitCreateResult, error) { + httpPath := path.Join(rc.departmentUnits.service.basePath, "department_units") + var result = &DepartmentUnitCreateResult{} + req := request.NewRequest(httpPath, "POST", + []request.AccessTokenType{request.AccessTokenTypeTenant}, rc.body, result, rc.optFns...) + err := api.Send(rc.ctx, rc.departmentUnits.service.conf, req) + return result, err +} + +func (departmentUnits *DepartmentUnitService) Create(ctx *core.Context, body *DepartmentUnit, optFns ...request.OptFn) *DepartmentUnitCreateReqCall { + return &DepartmentUnitCreateReqCall{ + ctx: ctx, + departmentUnits: departmentUnits, + body: body, + optFns: optFns, + } +} + +type DepartmentUnitDeleteReqCall struct { + ctx *core.Context + departmentUnits *DepartmentUnitService + pathParams map[string]interface{} + + optFns []request.OptFn +} + +func (rc *DepartmentUnitDeleteReqCall) SetUnitId(unitId string) { + rc.pathParams["unit_id"] = unitId +} +func (rc *DepartmentUnitDeleteReqCall) Do() (*response.NoData, error) { + httpPath := path.Join(rc.departmentUnits.service.basePath, "department_units/:unit_id") + rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams)) + var result = &response.NoData{} + req := request.NewRequest(httpPath, "DELETE", + []request.AccessTokenType{request.AccessTokenTypeTenant}, nil, result, rc.optFns...) + err := api.Send(rc.ctx, rc.departmentUnits.service.conf, req) + return result, err +} + +func (departmentUnits *DepartmentUnitService) Delete(ctx *core.Context, optFns ...request.OptFn) *DepartmentUnitDeleteReqCall { + return &DepartmentUnitDeleteReqCall{ + ctx: ctx, + departmentUnits: departmentUnits, + pathParams: map[string]interface{}{}, + optFns: optFns, + } +} + +type DepartmentUnitPatchReqCall struct { + ctx *core.Context + departmentUnits *DepartmentUnitService + body *DepartmentUnitPatchReqBody + pathParams map[string]interface{} + + optFns []request.OptFn +} + +func (rc *DepartmentUnitPatchReqCall) SetUnitId(unitId string) { + rc.pathParams["unit_id"] = unitId +} +func (rc *DepartmentUnitPatchReqCall) Do() (*DepartmentUnitPatchResult, error) { + httpPath := path.Join(rc.departmentUnits.service.basePath, "department_units/:unit_id") + rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams)) + var result = &DepartmentUnitPatchResult{} + req := request.NewRequest(httpPath, "PATCH", + []request.AccessTokenType{request.AccessTokenTypeTenant}, rc.body, result, rc.optFns...) + err := api.Send(rc.ctx, rc.departmentUnits.service.conf, req) + return result, err +} + +func (departmentUnits *DepartmentUnitService) Patch(ctx *core.Context, body *DepartmentUnitPatchReqBody, optFns ...request.OptFn) *DepartmentUnitPatchReqCall { + return &DepartmentUnitPatchReqCall{ + ctx: ctx, + departmentUnits: departmentUnits, + body: body, + pathParams: map[string]interface{}{}, + optFns: optFns, + } +} + +type UserCreateReqCall struct { + ctx *core.Context + users *UserService + body *User + + queryParams map[string]interface{} + optFns []request.OptFn +} + +func (rc *UserCreateReqCall) SetUserIdType(userIdType string) { + rc.queryParams["user_id_type"] = userIdType +} +func (rc *UserCreateReqCall) SetDepartmentIdType(departmentIdType string) { + rc.queryParams["department_id_type"] = departmentIdType +} +func (rc *UserCreateReqCall) SetClientToken(clientToken string) { + rc.queryParams["client_token"] = clientToken +} +func (rc *UserCreateReqCall) Do() (*UserCreateResult, error) { + httpPath := path.Join(rc.users.service.basePath, "users") + rc.optFns = append(rc.optFns, request.SetQueryParams(rc.queryParams)) + var result = &UserCreateResult{} + req := request.NewRequest(httpPath, "POST", + []request.AccessTokenType{request.AccessTokenTypeTenant}, rc.body, result, rc.optFns...) + err := api.Send(rc.ctx, rc.users.service.conf, req) + return result, err +} + +func (users *UserService) Create(ctx *core.Context, body *User, optFns ...request.OptFn) *UserCreateReqCall { + return &UserCreateReqCall{ + ctx: ctx, + users: users, + body: body, + queryParams: map[string]interface{}{}, + optFns: optFns, + } +} + +type UserDeleteReqCall struct { + ctx *core.Context + users *UserService + body *UserDeleteReqBody + pathParams map[string]interface{} + + queryParams map[string]interface{} + optFns []request.OptFn +} + +func (rc *UserDeleteReqCall) SetUserId(userId string) { + rc.pathParams["user_id"] = userId +} +func (rc *UserDeleteReqCall) SetUserIdType(userIdType string) { + rc.queryParams["user_id_type"] = userIdType +} +func (rc *UserDeleteReqCall) Do() (*response.NoData, error) { + httpPath := path.Join(rc.users.service.basePath, "users/:user_id") + rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams)) + rc.optFns = append(rc.optFns, request.SetQueryParams(rc.queryParams)) + var result = &response.NoData{} + req := request.NewRequest(httpPath, "DELETE", + []request.AccessTokenType{request.AccessTokenTypeTenant}, rc.body, result, rc.optFns...) + err := api.Send(rc.ctx, rc.users.service.conf, req) + return result, err +} + +func (users *UserService) Delete(ctx *core.Context, body *UserDeleteReqBody, optFns ...request.OptFn) *UserDeleteReqCall { + return &UserDeleteReqCall{ + ctx: ctx, + users: users, + body: body, + pathParams: map[string]interface{}{}, + queryParams: map[string]interface{}{}, + optFns: optFns, + } +} + +type UserGetReqCall struct { + ctx *core.Context + users *UserService + pathParams map[string]interface{} + + queryParams map[string]interface{} + optFns []request.OptFn +} + +func (rc *UserGetReqCall) SetUserId(userId string) { + rc.pathParams["user_id"] = userId +} +func (rc *UserGetReqCall) SetUserIdType(userIdType string) { + rc.queryParams["user_id_type"] = userIdType +} +func (rc *UserGetReqCall) SetDepartmentIdType(departmentIdType string) { + rc.queryParams["department_id_type"] = departmentIdType +} +func (rc *UserGetReqCall) Do() (*UserGetResult, error) { + httpPath := path.Join(rc.users.service.basePath, "users/:user_id") + rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams)) + rc.optFns = append(rc.optFns, request.SetQueryParams(rc.queryParams)) + var result = &UserGetResult{} + req := request.NewRequest(httpPath, "GET", + []request.AccessTokenType{request.AccessTokenTypeTenant}, nil, result, rc.optFns...) + err := api.Send(rc.ctx, rc.users.service.conf, req) + return result, err +} + +func (users *UserService) Get(ctx *core.Context, optFns ...request.OptFn) *UserGetReqCall { + return &UserGetReqCall{ + ctx: ctx, + users: users, + pathParams: map[string]interface{}{}, + queryParams: map[string]interface{}{}, + optFns: optFns, + } +} + +type UserListReqCall struct { + ctx *core.Context + users *UserService + + queryParams map[string]interface{} + optFns []request.OptFn +} + +func (rc *UserListReqCall) SetUserIdType(userIdType string) { + rc.queryParams["user_id_type"] = userIdType +} +func (rc *UserListReqCall) SetDepartmentIdType(departmentIdType string) { + rc.queryParams["department_id_type"] = departmentIdType +} +func (rc *UserListReqCall) SetDepartmentId(departmentId string) { + rc.queryParams["department_id"] = departmentId +} +func (rc *UserListReqCall) SetPageToken(pageToken string) { + rc.queryParams["page_token"] = pageToken +} +func (rc *UserListReqCall) SetPageSize(pageSize int) { + rc.queryParams["page_size"] = pageSize +} +func (rc *UserListReqCall) Do() (*UserListResult, error) { + httpPath := path.Join(rc.users.service.basePath, "users") + rc.optFns = append(rc.optFns, request.SetQueryParams(rc.queryParams)) + var result = &UserListResult{} + req := request.NewRequest(httpPath, "GET", + []request.AccessTokenType{request.AccessTokenTypeTenant}, nil, result, rc.optFns...) + err := api.Send(rc.ctx, rc.users.service.conf, req) + return result, err +} + +func (users *UserService) List(ctx *core.Context, optFns ...request.OptFn) *UserListReqCall { + return &UserListReqCall{ + ctx: ctx, + users: users, + queryParams: map[string]interface{}{}, + optFns: optFns, + } +} + +type UserPatchReqCall struct { + ctx *core.Context + users *UserService + body *User + pathParams map[string]interface{} + + queryParams map[string]interface{} + optFns []request.OptFn +} + +func (rc *UserPatchReqCall) SetUserId(userId string) { + rc.pathParams["user_id"] = userId +} +func (rc *UserPatchReqCall) SetUserIdType(userIdType string) { + rc.queryParams["user_id_type"] = userIdType +} +func (rc *UserPatchReqCall) SetDepartmentIdType(departmentIdType string) { + rc.queryParams["department_id_type"] = departmentIdType +} +func (rc *UserPatchReqCall) Do() (*UserPatchResult, error) { + httpPath := path.Join(rc.users.service.basePath, "users/:user_id") + rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams)) + rc.optFns = append(rc.optFns, request.SetQueryParams(rc.queryParams)) + var result = &UserPatchResult{} + req := request.NewRequest(httpPath, "PATCH", + []request.AccessTokenType{request.AccessTokenTypeTenant}, rc.body, result, rc.optFns...) + err := api.Send(rc.ctx, rc.users.service.conf, req) + return result, err +} + +func (users *UserService) Patch(ctx *core.Context, body *User, optFns ...request.OptFn) *UserPatchReqCall { + return &UserPatchReqCall{ + ctx: ctx, + users: users, + body: body, + pathParams: map[string]interface{}{}, + queryParams: map[string]interface{}{}, + optFns: optFns, + } +} + +type UserUpdateReqCall struct { + ctx *core.Context + users *UserService + body *User + pathParams map[string]interface{} + + queryParams map[string]interface{} + optFns []request.OptFn +} + +func (rc *UserUpdateReqCall) SetUserId(userId string) { + rc.pathParams["user_id"] = userId +} +func (rc *UserUpdateReqCall) SetUserIdType(userIdType string) { + rc.queryParams["user_id_type"] = userIdType +} +func (rc *UserUpdateReqCall) SetDepartmentIdType(departmentIdType string) { + rc.queryParams["department_id_type"] = departmentIdType +} +func (rc *UserUpdateReqCall) Do() (*UserUpdateResult, error) { + httpPath := path.Join(rc.users.service.basePath, "users/:user_id") + rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams)) + rc.optFns = append(rc.optFns, request.SetQueryParams(rc.queryParams)) + var result = &UserUpdateResult{} + req := request.NewRequest(httpPath, "PUT", + []request.AccessTokenType{request.AccessTokenTypeTenant}, rc.body, result, rc.optFns...) + err := api.Send(rc.ctx, rc.users.service.conf, req) + return result, err +} + +func (users *UserService) Update(ctx *core.Context, body *User, optFns ...request.OptFn) *UserUpdateReqCall { + return &UserUpdateReqCall{ + ctx: ctx, + users: users, + body: body, + pathParams: map[string]interface{}{}, + queryParams: map[string]interface{}{}, + optFns: optFns, + } +} + +type UserUpdateUserIdReqCall struct { + ctx *core.Context + users *UserService + body *UserUpdateUserIdReqBody + pathParams map[string]interface{} + + queryParams map[string]interface{} + optFns []request.OptFn +} + +func (rc *UserUpdateUserIdReqCall) SetUserId(userId string) { + rc.pathParams["user_id"] = userId +} +func (rc *UserUpdateUserIdReqCall) SetUserIdType(userIdType string) { + rc.queryParams["user_id_type"] = userIdType +} +func (rc *UserUpdateUserIdReqCall) Do() (*response.NoData, error) { + httpPath := path.Join(rc.users.service.basePath, "users/:user_id/update_user_id") + rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams)) + rc.optFns = append(rc.optFns, request.SetQueryParams(rc.queryParams)) + var result = &response.NoData{} + req := request.NewRequest(httpPath, "PATCH", + []request.AccessTokenType{request.AccessTokenTypeTenant}, rc.body, result, rc.optFns...) + err := api.Send(rc.ctx, rc.users.service.conf, req) + return result, err +} + +func (users *UserService) UpdateUserId(ctx *core.Context, body *UserUpdateUserIdReqBody, optFns ...request.OptFn) *UserUpdateUserIdReqCall { + return &UserUpdateUserIdReqCall{ + ctx: ctx, + users: users, + body: body, + pathParams: map[string]interface{}{}, + queryParams: map[string]interface{}{}, + optFns: optFns, + } +} + +type UserGroupCreateReqCall struct { + ctx *core.Context + userGroups *UserGroupService + body *UserGroup + + optFns []request.OptFn +} + +func (rc *UserGroupCreateReqCall) Do() (*UserGroupCreateResult, error) { + httpPath := path.Join(rc.userGroups.service.basePath, "user_groups") + var result = &UserGroupCreateResult{} + req := request.NewRequest(httpPath, "POST", + []request.AccessTokenType{request.AccessTokenTypeTenant}, rc.body, result, rc.optFns...) + err := api.Send(rc.ctx, rc.userGroups.service.conf, req) + return result, err +} + +func (userGroups *UserGroupService) Create(ctx *core.Context, body *UserGroup, optFns ...request.OptFn) *UserGroupCreateReqCall { + return &UserGroupCreateReqCall{ + ctx: ctx, + userGroups: userGroups, + body: body, + optFns: optFns, + } +} + +type UserGroupDeleteReqCall struct { + ctx *core.Context + userGroups *UserGroupService + pathParams map[string]interface{} + + optFns []request.OptFn +} + +func (rc *UserGroupDeleteReqCall) SetUserGroupId(userGroupId string) { + rc.pathParams["user_group_id"] = userGroupId +} +func (rc *UserGroupDeleteReqCall) Do() (*response.NoData, error) { + httpPath := path.Join(rc.userGroups.service.basePath, "user_groups/:user_group_id") + rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams)) + var result = &response.NoData{} + req := request.NewRequest(httpPath, "DELETE", + []request.AccessTokenType{request.AccessTokenTypeTenant}, nil, result, rc.optFns...) + err := api.Send(rc.ctx, rc.userGroups.service.conf, req) + return result, err +} + +func (userGroups *UserGroupService) Delete(ctx *core.Context, optFns ...request.OptFn) *UserGroupDeleteReqCall { + return &UserGroupDeleteReqCall{ + ctx: ctx, + userGroups: userGroups, + pathParams: map[string]interface{}{}, + optFns: optFns, + } +} + +type UserGroupGetReqCall struct { + ctx *core.Context + userGroups *UserGroupService + pathParams map[string]interface{} + + optFns []request.OptFn +} + +func (rc *UserGroupGetReqCall) SetUserGroupId(userGroupId string) { + rc.pathParams["user_group_id"] = userGroupId +} +func (rc *UserGroupGetReqCall) Do() (*UserGroupGetResult, error) { + httpPath := path.Join(rc.userGroups.service.basePath, "user_groups/:user_group_id") + rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams)) + var result = &UserGroupGetResult{} + req := request.NewRequest(httpPath, "GET", + []request.AccessTokenType{request.AccessTokenTypeTenant}, nil, result, rc.optFns...) + err := api.Send(rc.ctx, rc.userGroups.service.conf, req) + return result, err +} + +func (userGroups *UserGroupService) Get(ctx *core.Context, optFns ...request.OptFn) *UserGroupGetReqCall { + return &UserGroupGetReqCall{ + ctx: ctx, + userGroups: userGroups, + pathParams: map[string]interface{}{}, + optFns: optFns, + } +} + +type UserGroupListReqCall struct { + ctx *core.Context + userGroups *UserGroupService + + queryParams map[string]interface{} + optFns []request.OptFn +} + +func (rc *UserGroupListReqCall) SetPageSize(pageSize int) { + rc.queryParams["page_size"] = pageSize +} +func (rc *UserGroupListReqCall) SetPageToken(pageToken string) { + rc.queryParams["page_token"] = pageToken +} +func (rc *UserGroupListReqCall) Do() (*UserGroupListResult, error) { + httpPath := path.Join(rc.userGroups.service.basePath, "user_groups") + rc.optFns = append(rc.optFns, request.SetQueryParams(rc.queryParams)) + var result = &UserGroupListResult{} + req := request.NewRequest(httpPath, "GET", + []request.AccessTokenType{request.AccessTokenTypeTenant}, nil, result, rc.optFns...) + err := api.Send(rc.ctx, rc.userGroups.service.conf, req) + return result, err +} + +func (userGroups *UserGroupService) List(ctx *core.Context, optFns ...request.OptFn) *UserGroupListReqCall { + return &UserGroupListReqCall{ + ctx: ctx, + userGroups: userGroups, + queryParams: map[string]interface{}{}, + optFns: optFns, + } +} + +type UserGroupMemberCreateReqCall struct { + ctx *core.Context + userGroupMembers *UserGroupMemberService + body *UserGroupMemberCreateReqBody + pathParams map[string]interface{} + + queryParams map[string]interface{} + optFns []request.OptFn +} + +func (rc *UserGroupMemberCreateReqCall) SetUserGroupId(userGroupId string) { + rc.pathParams["user_group_id"] = userGroupId +} +func (rc *UserGroupMemberCreateReqCall) SetUserIdType(userIdType string) { + rc.queryParams["user_id_type"] = userIdType +} +func (rc *UserGroupMemberCreateReqCall) Do() (*response.NoData, error) { + httpPath := path.Join(rc.userGroupMembers.service.basePath, "user_groups/:user_group_id/members") + rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams)) + rc.optFns = append(rc.optFns, request.SetQueryParams(rc.queryParams)) + var result = &response.NoData{} + req := request.NewRequest(httpPath, "POST", + []request.AccessTokenType{request.AccessTokenTypeTenant}, rc.body, result, rc.optFns...) + err := api.Send(rc.ctx, rc.userGroupMembers.service.conf, req) + return result, err +} + +func (userGroupMembers *UserGroupMemberService) Create(ctx *core.Context, body *UserGroupMemberCreateReqBody, optFns ...request.OptFn) *UserGroupMemberCreateReqCall { + return &UserGroupMemberCreateReqCall{ + ctx: ctx, + userGroupMembers: userGroupMembers, + body: body, + pathParams: map[string]interface{}{}, + queryParams: map[string]interface{}{}, + optFns: optFns, + } +} + +type UserGroupMemberDeleteReqCall struct { + ctx *core.Context + userGroupMembers *UserGroupMemberService + pathParams map[string]interface{} + + queryParams map[string]interface{} + optFns []request.OptFn +} + +func (rc *UserGroupMemberDeleteReqCall) SetUserGroupId(userGroupId string) { + rc.pathParams["user_group_id"] = userGroupId +} +func (rc *UserGroupMemberDeleteReqCall) SetUserId(userId string) { + rc.pathParams["user_id"] = userId +} +func (rc *UserGroupMemberDeleteReqCall) SetUserIdType(userIdType string) { + rc.queryParams["user_id_type"] = userIdType +} +func (rc *UserGroupMemberDeleteReqCall) Do() (*response.NoData, error) { + httpPath := path.Join(rc.userGroupMembers.service.basePath, "user_groups/:user_group_id/members/:user_id") + rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams)) + rc.optFns = append(rc.optFns, request.SetQueryParams(rc.queryParams)) + var result = &response.NoData{} + req := request.NewRequest(httpPath, "DELETE", + []request.AccessTokenType{request.AccessTokenTypeTenant}, nil, result, rc.optFns...) + err := api.Send(rc.ctx, rc.userGroupMembers.service.conf, req) + return result, err +} + +func (userGroupMembers *UserGroupMemberService) Delete(ctx *core.Context, optFns ...request.OptFn) *UserGroupMemberDeleteReqCall { + return &UserGroupMemberDeleteReqCall{ + ctx: ctx, + userGroupMembers: userGroupMembers, + pathParams: map[string]interface{}{}, + queryParams: map[string]interface{}{}, + optFns: optFns, + } +} + +type UserGroupMemberListReqCall struct { + ctx *core.Context + userGroupMembers *UserGroupMemberService + pathParams map[string]interface{} + + queryParams map[string]interface{} + optFns []request.OptFn +} + +func (rc *UserGroupMemberListReqCall) SetUserGroupId(userGroupId string) { + rc.pathParams["user_group_id"] = userGroupId +} +func (rc *UserGroupMemberListReqCall) SetUserIdType(userIdType string) { + rc.queryParams["user_id_type"] = userIdType +} +func (rc *UserGroupMemberListReqCall) SetDepartmentIdType(departmentIdType string) { + rc.queryParams["department_id_type"] = departmentIdType +} +func (rc *UserGroupMemberListReqCall) Do() (*UserGroupMemberListResult, error) { + httpPath := path.Join(rc.userGroupMembers.service.basePath, "user_groups/:user_group_id/members") + rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams)) + rc.optFns = append(rc.optFns, request.SetQueryParams(rc.queryParams)) + var result = &UserGroupMemberListResult{} + req := request.NewRequest(httpPath, "GET", + []request.AccessTokenType{request.AccessTokenTypeTenant}, nil, result, rc.optFns...) + err := api.Send(rc.ctx, rc.userGroupMembers.service.conf, req) + return result, err +} + +func (userGroupMembers *UserGroupMemberService) List(ctx *core.Context, optFns ...request.OptFn) *UserGroupMemberListReqCall { + return &UserGroupMemberListReqCall{ + ctx: ctx, + userGroupMembers: userGroupMembers, + pathParams: map[string]interface{}{}, + queryParams: map[string]interface{}{}, + optFns: optFns, + } +} + +type UserGroupPatchReqCall struct { + ctx *core.Context + userGroups *UserGroupService + body *UserGroup + pathParams map[string]interface{} + + optFns []request.OptFn +} + +func (rc *UserGroupPatchReqCall) SetUserGroupId(userGroupId string) { + rc.pathParams["user_group_id"] = userGroupId +} +func (rc *UserGroupPatchReqCall) Do() (*UserGroupPatchResult, error) { + httpPath := path.Join(rc.userGroups.service.basePath, "user_groups/:user_group_id") + rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams)) + var result = &UserGroupPatchResult{} + req := request.NewRequest(httpPath, "PATCH", + []request.AccessTokenType{request.AccessTokenTypeTenant}, rc.body, result, rc.optFns...) + err := api.Send(rc.ctx, rc.userGroups.service.conf, req) + return result, err +} + +func (userGroups *UserGroupService) Patch(ctx *core.Context, body *UserGroup, optFns ...request.OptFn) *UserGroupPatchReqCall { + return &UserGroupPatchReqCall{ + ctx: ctx, + userGroups: userGroups, + body: body, + pathParams: map[string]interface{}{}, + optFns: optFns, + } +} + +type UserGroupUpdateUserGroupIdReqCall struct { + ctx *core.Context + userGroups *UserGroupService + body *UserGroupUpdateUserGroupIdReqBody + pathParams map[string]interface{} + + optFns []request.OptFn +} + +func (rc *UserGroupUpdateUserGroupIdReqCall) SetUserGroupId(userGroupId string) { + rc.pathParams["user_group_id"] = userGroupId +} +func (rc *UserGroupUpdateUserGroupIdReqCall) Do() (*response.NoData, error) { + httpPath := path.Join(rc.userGroups.service.basePath, "user_groups/:user_group_id/update_user_group_id") + rc.optFns = append(rc.optFns, request.SetPathParams(rc.pathParams)) + var result = &response.NoData{} + req := request.NewRequest(httpPath, "PATCH", + []request.AccessTokenType{request.AccessTokenTypeTenant}, rc.body, result, rc.optFns...) + err := api.Send(rc.ctx, rc.userGroups.service.conf, req) + return result, err +} + +func (userGroups *UserGroupService) UpdateUserGroupId(ctx *core.Context, body *UserGroupUpdateUserGroupIdReqBody, optFns ...request.OptFn) *UserGroupUpdateUserGroupIdReqCall { + return &UserGroupUpdateUserGroupIdReqCall{ + ctx: ctx, + userGroups: userGroups, + body: body, + pathParams: map[string]interface{}{}, + optFns: optFns, + } +} diff --git a/service/contact/v3/event.go b/service/contact/v3/event.go new file mode 100644 index 00000000..b1ebf52f --- /dev/null +++ b/service/contact/v3/event.go @@ -0,0 +1,328 @@ +// Code generated by lark suite oapi sdk gen +package v3 + +import ( + "github.com/larksuite/oapi-sdk-go/core" + "github.com/larksuite/oapi-sdk-go/core/config" + "github.com/larksuite/oapi-sdk-go/event" +) + +type DepartmentCreateEventHandler struct { + Fn func(*core.Context, *DepartmentCreateEvent) error +} + +func (h *DepartmentCreateEventHandler) GetEvent() interface{} { + return &DepartmentCreateEvent{} +} + +func (h *DepartmentCreateEventHandler) Handle(ctx *core.Context, event interface{}) error { + return h.Fn(ctx, event.(*DepartmentCreateEvent)) +} + +func SetDepartmentCreateEventHandler(conf *config.Config, fn func(ctx *core.Context, event *DepartmentCreateEvent) error) { + event.SetTypeHandler(conf, "department.create_v3", &DepartmentCreateEventHandler{Fn: fn}) +} + +type DepartmentCreatedEventHandler struct { + Fn func(*core.Context, *DepartmentCreatedEvent) error +} + +func (h *DepartmentCreatedEventHandler) GetEvent() interface{} { + return &DepartmentCreatedEvent{} +} + +func (h *DepartmentCreatedEventHandler) Handle(ctx *core.Context, event interface{}) error { + return h.Fn(ctx, event.(*DepartmentCreatedEvent)) +} + +func SetDepartmentCreatedEventHandler(conf *config.Config, fn func(ctx *core.Context, event *DepartmentCreatedEvent) error) { + event.SetTypeHandler(conf, "department.created_v3", &DepartmentCreatedEventHandler{Fn: fn}) +} + +type DepartmentCreatedV3EventHandler struct { + Fn func(*core.Context, *DepartmentCreatedV3Event) error +} + +func (h *DepartmentCreatedV3EventHandler) GetEvent() interface{} { + return &DepartmentCreatedV3Event{} +} + +func (h *DepartmentCreatedV3EventHandler) Handle(ctx *core.Context, event interface{}) error { + return h.Fn(ctx, event.(*DepartmentCreatedV3Event)) +} + +func SetDepartmentCreatedV3EventHandler(conf *config.Config, fn func(ctx *core.Context, event *DepartmentCreatedV3Event) error) { + event.SetTypeHandler(conf, "department.created_v3_v3", &DepartmentCreatedV3EventHandler{Fn: fn}) +} + +type DepartmentDeleteEventHandler struct { + Fn func(*core.Context, *DepartmentDeleteEvent) error +} + +func (h *DepartmentDeleteEventHandler) GetEvent() interface{} { + return &DepartmentDeleteEvent{} +} + +func (h *DepartmentDeleteEventHandler) Handle(ctx *core.Context, event interface{}) error { + return h.Fn(ctx, event.(*DepartmentDeleteEvent)) +} + +func SetDepartmentDeleteEventHandler(conf *config.Config, fn func(ctx *core.Context, event *DepartmentDeleteEvent) error) { + event.SetTypeHandler(conf, "department.delete_v3", &DepartmentDeleteEventHandler{Fn: fn}) +} + +type DepartmentDeletedEventHandler struct { + Fn func(*core.Context, *DepartmentDeletedEvent) error +} + +func (h *DepartmentDeletedEventHandler) GetEvent() interface{} { + return &DepartmentDeletedEvent{} +} + +func (h *DepartmentDeletedEventHandler) Handle(ctx *core.Context, event interface{}) error { + return h.Fn(ctx, event.(*DepartmentDeletedEvent)) +} + +func SetDepartmentDeletedEventHandler(conf *config.Config, fn func(ctx *core.Context, event *DepartmentDeletedEvent) error) { + event.SetTypeHandler(conf, "department.deleted_v3", &DepartmentDeletedEventHandler{Fn: fn}) +} + +type DepartmentUpdateEventHandler struct { + Fn func(*core.Context, *DepartmentUpdateEvent) error +} + +func (h *DepartmentUpdateEventHandler) GetEvent() interface{} { + return &DepartmentUpdateEvent{} +} + +func (h *DepartmentUpdateEventHandler) Handle(ctx *core.Context, event interface{}) error { + return h.Fn(ctx, event.(*DepartmentUpdateEvent)) +} + +func SetDepartmentUpdateEventHandler(conf *config.Config, fn func(ctx *core.Context, event *DepartmentUpdateEvent) error) { + event.SetTypeHandler(conf, "department.update_v3", &DepartmentUpdateEventHandler{Fn: fn}) +} + +type DepartmentUpdatedEventHandler struct { + Fn func(*core.Context, *DepartmentUpdatedEvent) error +} + +func (h *DepartmentUpdatedEventHandler) GetEvent() interface{} { + return &DepartmentUpdatedEvent{} +} + +func (h *DepartmentUpdatedEventHandler) Handle(ctx *core.Context, event interface{}) error { + return h.Fn(ctx, event.(*DepartmentUpdatedEvent)) +} + +func SetDepartmentUpdatedEventHandler(conf *config.Config, fn func(ctx *core.Context, event *DepartmentUpdatedEvent) error) { + event.SetTypeHandler(conf, "department.updated_v3", &DepartmentUpdatedEventHandler{Fn: fn}) +} + +type ScopeUpdatedEventHandler struct { + Fn func(*core.Context, *ScopeUpdatedEvent) error +} + +func (h *ScopeUpdatedEventHandler) GetEvent() interface{} { + return &ScopeUpdatedEvent{} +} + +func (h *ScopeUpdatedEventHandler) Handle(ctx *core.Context, event interface{}) error { + return h.Fn(ctx, event.(*ScopeUpdatedEvent)) +} + +func SetScopeUpdatedEventHandler(conf *config.Config, fn func(ctx *core.Context, event *ScopeUpdatedEvent) error) { + event.SetTypeHandler(conf, "scope.updated_v3", &ScopeUpdatedEventHandler{Fn: fn}) +} + +type UserCreateEventHandler struct { + Fn func(*core.Context, *UserCreateEvent) error +} + +func (h *UserCreateEventHandler) GetEvent() interface{} { + return &UserCreateEvent{} +} + +func (h *UserCreateEventHandler) Handle(ctx *core.Context, event interface{}) error { + return h.Fn(ctx, event.(*UserCreateEvent)) +} + +func SetUserCreateEventHandler(conf *config.Config, fn func(ctx *core.Context, event *UserCreateEvent) error) { + event.SetTypeHandler(conf, "user.create_v3", &UserCreateEventHandler{Fn: fn}) +} + +type UserCreatedEventHandler struct { + Fn func(*core.Context, *UserCreatedEvent) error +} + +func (h *UserCreatedEventHandler) GetEvent() interface{} { + return &UserCreatedEvent{} +} + +func (h *UserCreatedEventHandler) Handle(ctx *core.Context, event interface{}) error { + return h.Fn(ctx, event.(*UserCreatedEvent)) +} + +func SetUserCreatedEventHandler(conf *config.Config, fn func(ctx *core.Context, event *UserCreatedEvent) error) { + event.SetTypeHandler(conf, "user.created_v3", &UserCreatedEventHandler{Fn: fn}) +} + +type UserDeleteEventHandler struct { + Fn func(*core.Context, *UserDeleteEvent) error +} + +func (h *UserDeleteEventHandler) GetEvent() interface{} { + return &UserDeleteEvent{} +} + +func (h *UserDeleteEventHandler) Handle(ctx *core.Context, event interface{}) error { + return h.Fn(ctx, event.(*UserDeleteEvent)) +} + +func SetUserDeleteEventHandler(conf *config.Config, fn func(ctx *core.Context, event *UserDeleteEvent) error) { + event.SetTypeHandler(conf, "user.delete_v3", &UserDeleteEventHandler{Fn: fn}) +} + +type UserDeletedEventHandler struct { + Fn func(*core.Context, *UserDeletedEvent) error +} + +func (h *UserDeletedEventHandler) GetEvent() interface{} { + return &UserDeletedEvent{} +} + +func (h *UserDeletedEventHandler) Handle(ctx *core.Context, event interface{}) error { + return h.Fn(ctx, event.(*UserDeletedEvent)) +} + +func SetUserDeletedEventHandler(conf *config.Config, fn func(ctx *core.Context, event *UserDeletedEvent) error) { + event.SetTypeHandler(conf, "user.deleted_v3", &UserDeletedEventHandler{Fn: fn}) +} + +type UserUpdateEventHandler struct { + Fn func(*core.Context, *UserUpdateEvent) error +} + +func (h *UserUpdateEventHandler) GetEvent() interface{} { + return &UserUpdateEvent{} +} + +func (h *UserUpdateEventHandler) Handle(ctx *core.Context, event interface{}) error { + return h.Fn(ctx, event.(*UserUpdateEvent)) +} + +func SetUserUpdateEventHandler(conf *config.Config, fn func(ctx *core.Context, event *UserUpdateEvent) error) { + event.SetTypeHandler(conf, "user.update_v3", &UserUpdateEventHandler{Fn: fn}) +} + +type UserUpdatedEventHandler struct { + Fn func(*core.Context, *UserUpdatedEvent) error +} + +func (h *UserUpdatedEventHandler) GetEvent() interface{} { + return &UserUpdatedEvent{} +} + +func (h *UserUpdatedEventHandler) Handle(ctx *core.Context, event interface{}) error { + return h.Fn(ctx, event.(*UserUpdatedEvent)) +} + +func SetUserUpdatedEventHandler(conf *config.Config, fn func(ctx *core.Context, event *UserUpdatedEvent) error) { + event.SetTypeHandler(conf, "user.updated_v3", &UserUpdatedEventHandler{Fn: fn}) +} + +type UserGroupCreateEventHandler struct { + Fn func(*core.Context, *UserGroupCreateEvent) error +} + +func (h *UserGroupCreateEventHandler) GetEvent() interface{} { + return &UserGroupCreateEvent{} +} + +func (h *UserGroupCreateEventHandler) Handle(ctx *core.Context, event interface{}) error { + return h.Fn(ctx, event.(*UserGroupCreateEvent)) +} + +func SetUserGroupCreateEventHandler(conf *config.Config, fn func(ctx *core.Context, event *UserGroupCreateEvent) error) { + event.SetTypeHandler(conf, "user_group.create_v3", &UserGroupCreateEventHandler{Fn: fn}) +} + +type UserGroupCreatedEventHandler struct { + Fn func(*core.Context, *UserGroupCreatedEvent) error +} + +func (h *UserGroupCreatedEventHandler) GetEvent() interface{} { + return &UserGroupCreatedEvent{} +} + +func (h *UserGroupCreatedEventHandler) Handle(ctx *core.Context, event interface{}) error { + return h.Fn(ctx, event.(*UserGroupCreatedEvent)) +} + +func SetUserGroupCreatedEventHandler(conf *config.Config, fn func(ctx *core.Context, event *UserGroupCreatedEvent) error) { + event.SetTypeHandler(conf, "user_group.created_v3", &UserGroupCreatedEventHandler{Fn: fn}) +} + +type UserGroupDeleteEventHandler struct { + Fn func(*core.Context, *UserGroupDeleteEvent) error +} + +func (h *UserGroupDeleteEventHandler) GetEvent() interface{} { + return &UserGroupDeleteEvent{} +} + +func (h *UserGroupDeleteEventHandler) Handle(ctx *core.Context, event interface{}) error { + return h.Fn(ctx, event.(*UserGroupDeleteEvent)) +} + +func SetUserGroupDeleteEventHandler(conf *config.Config, fn func(ctx *core.Context, event *UserGroupDeleteEvent) error) { + event.SetTypeHandler(conf, "user_group.delete_v3", &UserGroupDeleteEventHandler{Fn: fn}) +} + +type UserGroupDeletedEventHandler struct { + Fn func(*core.Context, *UserGroupDeletedEvent) error +} + +func (h *UserGroupDeletedEventHandler) GetEvent() interface{} { + return &UserGroupDeletedEvent{} +} + +func (h *UserGroupDeletedEventHandler) Handle(ctx *core.Context, event interface{}) error { + return h.Fn(ctx, event.(*UserGroupDeletedEvent)) +} + +func SetUserGroupDeletedEventHandler(conf *config.Config, fn func(ctx *core.Context, event *UserGroupDeletedEvent) error) { + event.SetTypeHandler(conf, "user_group.deleted_v3", &UserGroupDeletedEventHandler{Fn: fn}) +} + +type UserGroupUpdateEventHandler struct { + Fn func(*core.Context, *UserGroupUpdateEvent) error +} + +func (h *UserGroupUpdateEventHandler) GetEvent() interface{} { + return &UserGroupUpdateEvent{} +} + +func (h *UserGroupUpdateEventHandler) Handle(ctx *core.Context, event interface{}) error { + return h.Fn(ctx, event.(*UserGroupUpdateEvent)) +} + +func SetUserGroupUpdateEventHandler(conf *config.Config, fn func(ctx *core.Context, event *UserGroupUpdateEvent) error) { + event.SetTypeHandler(conf, "user_group.update_v3", &UserGroupUpdateEventHandler{Fn: fn}) +} + +type UserGroupUpdatedEventHandler struct { + Fn func(*core.Context, *UserGroupUpdatedEvent) error +} + +func (h *UserGroupUpdatedEventHandler) GetEvent() interface{} { + return &UserGroupUpdatedEvent{} +} + +func (h *UserGroupUpdatedEventHandler) Handle(ctx *core.Context, event interface{}) error { + return h.Fn(ctx, event.(*UserGroupUpdatedEvent)) +} + +func SetUserGroupUpdatedEventHandler(conf *config.Config, fn func(ctx *core.Context, event *UserGroupUpdatedEvent) error) { + event.SetTypeHandler(conf, "user_group.updated_v3", &UserGroupUpdatedEventHandler{Fn: fn}) +} diff --git a/service/contact/v3/model.go b/service/contact/v3/model.go new file mode 100644 index 00000000..bd79664c --- /dev/null +++ b/service/contact/v3/model.go @@ -0,0 +1,455 @@ +// Code generated by lark suite oapi sdk gen +package v3 + +import ( + "github.com/larksuite/oapi-sdk-go/event/core/model" +) + +type Department struct { + Name string `json:"name,omitempty"` + ParentDepartmentId string `json:"parent_department_id,omitempty"` + DepartmentId string `json:"department_id,omitempty"` + OpenDepartmentId string `json:"open_department_id,omitempty"` + LeaderUserId string `json:"leader_user_id,omitempty"` + ChatId string `json:"chat_id,omitempty"` + Order int `json:"order,omitempty"` + UnitIds []string `json:"unit_ids,omitempty"` + MemberCount int `json:"member_count,omitempty"` + Status int `json:"status,omitempty"` + CreateGroupChat bool `json:"create_group_chat,omitempty"` +} +type DepartmentEvent struct { + Name string `json:"name,omitempty"` + ParentDepartmentId string `json:"parent_department_id,omitempty"` + DepartmentId string `json:"department_id,omitempty"` + OpenDepartmentId string `json:"open_department_id,omitempty"` + LeaderUserId string `json:"leader_user_id,omitempty"` + ChatId string `json:"chat_id,omitempty"` + Order int `json:"order,omitempty"` + UnitIds []string `json:"unit_ids,omitempty"` + MemberCount int `json:"member_count,omitempty"` + Status int `json:"status,omitempty"` +} +type DepartmentUnit struct { + UnitId string `json:"unit_id,omitempty"` + UnitType string `json:"unit_type,omitempty"` + UnitName string `json:"unit_name,omitempty"` +} +type GroupEvent struct { + UserGroupId string `json:"user_group_id,omitempty"` + Name string `json:"name,omitempty"` +} +type Member struct { + UserGroupId string `json:"user_group_id,omitempty"` + UserId string `json:"user_id,omitempty"` +} +type Scope struct { + Departments []*Department `json:"departments,omitempty"` + Users []*User `json:"users,omitempty"` + UserGroups []*UserGroup `json:"user_groups,omitempty"` +} +type User struct { + UnionId string `json:"union_id,omitempty"` + UserId string `json:"user_id,omitempty"` + OpenId string `json:"open_id,omitempty"` + Name string `json:"name,omitempty"` + EnName string `json:"en_name,omitempty"` + Email string `json:"email,omitempty"` + Mobile string `json:"mobile,omitempty"` + MobileVisible bool `json:"mobile_visible,omitempty"` + Gender int `json:"gender,omitempty"` + AvatarKey string `json:"avatar_key,omitempty"` + Avatar *AvatarInfo `json:"avatar,omitempty"` + Status *UserStatus `json:"status,omitempty"` + DepartmentIds []string `json:"department_ids,omitempty"` + LeaderUserId string `json:"leader_user_id,omitempty"` + City string `json:"city,omitempty"` + Country string `json:"country,omitempty"` + WorkStation string `json:"work_station,omitempty"` + JoinTime int `json:"join_time,omitempty"` + IsTenantManager bool `json:"is_tenant_manager,omitempty"` + EmployeeNo string `json:"employee_no,omitempty"` + EmployeeType int `json:"employee_type,omitempty"` + Positions []*UserPosition `json:"positions,omitempty"` + Orders []*UserOrder `json:"orders,omitempty"` + TimeZone string `json:"time_zone,omitempty"` + CustomAttrs []*UserCustomAttr `json:"custom_attrs,omitempty"` +} +type UserEvent struct { + OpenId string `json:"open_id,omitempty"` + UserId string `json:"user_id,omitempty"` + Name string `json:"name,omitempty"` + EnName string `json:"en_name,omitempty"` + Email string `json:"email,omitempty"` + Mobile string `json:"mobile,omitempty"` + MobileVisible bool `json:"mobile_visible,omitempty"` + Gender int `json:"gender,omitempty"` + Avatar *AvatarInfo `json:"avatar,omitempty"` + Status *UserStatus `json:"status,omitempty"` + DepartmentIds []string `json:"department_ids,omitempty"` + LeaderUserId string `json:"leader_user_id,omitempty"` + City string `json:"city,omitempty"` + Country string `json:"country,omitempty"` + WorkStation string `json:"work_station,omitempty"` + JoinTime int `json:"join_time,omitempty"` + IsTenantManager bool `json:"is_tenant_manager,omitempty"` + EmployeeNo string `json:"employee_no,omitempty"` + EmployeeType int `json:"employee_type,omitempty"` + Positions []*UserPosition `json:"positions,omitempty"` + Orders []*UserOrder `json:"orders,omitempty"` + TimeZone string `json:"time_zone,omitempty"` + CustomAttrs []*UserCustomAttr `json:"custom_attrs,omitempty"` +} +type UserGroup struct { + UserGroupId string `json:"user_group_id,omitempty"` + Name string `json:"name,omitempty"` + Type int `json:"type,omitempty"` + MemberCount int `json:"member_count,omitempty"` + Status int `json:"status,omitempty"` +} +type UserGroupMember struct { +} + +type AvatarInfo struct { + Avatar72 string `json:"avatar_72,omitempty"` + Avatar240 string `json:"avatar_240,omitempty"` + Avatar640 string `json:"avatar_640,omitempty"` + AvatarOrigin string `json:"avatar_origin,omitempty"` +} +type UserCustomAttr struct { + Type string `json:"type,omitempty"` + Id string `json:"id,omitempty"` + Value *UserCustomAttrValue `json:"value,omitempty"` +} +type UserCustomAttrValue struct { + Text string `json:"text,omitempty"` + Url string `json:"url,omitempty"` + PcUrl string `json:"pc_url,omitempty"` +} +type UserOrder struct { + DepartmentId string `json:"department_id,omitempty"` + UserOrder int `json:"user_order,omitempty"` + DepartmentOrder int `json:"department_order,omitempty"` +} +type UserPosition struct { + PositionCode string `json:"position_code,omitempty"` + PositionName string `json:"position_name,omitempty"` + DepartmentId string `json:"department_id,omitempty"` + LeaderUserId string `json:"leader_user_id,omitempty"` + LeaderPositionCode string `json:"leader_position_code,omitempty"` + IsMajor bool `json:"is_major,omitempty"` +} +type UserStatus struct { + IsFrozen bool `json:"is_frozen,omitempty"` + IsResigned bool `json:"is_resigned,omitempty"` + IsActivated bool `json:"is_activated,omitempty"` +} + +type DepartmentCreateResult struct { + Department *Department `json:"department,omitempty"` +} + +type DepartmentGetResult struct { + Department *Department `json:"department,omitempty"` +} + +type DepartmentListResult struct { + HasMore bool `json:"has_more,omitempty"` + PageToken string `json:"page_token,omitempty"` + Items []*Department `json:"items,omitempty"` +} + +type DepartmentNomalizeReqBody struct { + DepartmentId string `json:"department_id,omitempty"` +} + +type DepartmentNomalizeDepartmentChatReqBody struct { + DepartmentId string `json:"department_id,omitempty"` +} + +type DepartmentParentResult struct { + HasMore bool `json:"has_more,omitempty"` + PageToken string `json:"page_token,omitempty"` + Items []*Department `json:"items,omitempty"` +} + +type DepartmentPatchResult struct { + Department *Department `json:"department,omitempty"` +} + +type DepartmentUpdateResult struct { + Department *Department `json:"department,omitempty"` +} + +type DepartmentUpdateDepartmentIdReqBody struct { + NewDepartmentId string `json:"new_department_id,omitempty"` +} + +type DepartmentUnitCreateResult struct { + DepartmentUnit *DepartmentUnit `json:"department_unit,omitempty"` +} + +type DepartmentUnitPatchReqBody struct { + UnitType string `json:"unit_type,omitempty"` + UnitName string `json:"unit_name,omitempty"` +} + +type DepartmentUnitPatchResult struct { + DepartmentUnit *DepartmentUnit `json:"department_unit,omitempty"` +} + +type UserCreateResult struct { + User *User `json:"user,omitempty"` +} + +type UserDeleteReqBody struct { + DepartmentChatAcceptorUserId string `json:"department_chat_acceptor_user_id,omitempty"` + ExternalChatAcceptorUserId string `json:"external_chat_acceptor_user_id,omitempty"` + DocsAcceptorUserId string `json:"docs_acceptor_user_id,omitempty"` + CalendarAcceptorUserId string `json:"calendar_acceptor_user_id,omitempty"` + ApplicationAcceptorUserId string `json:"application_acceptor_user_id,omitempty"` + HelpdeskAcceptorUserId string `json:"helpdesk_acceptor_user_id,omitempty"` +} + +type UserGetResult struct { + User *User `json:"user,omitempty"` +} + +type UserListResult struct { + HasMore bool `json:"has_more,omitempty"` + PageToken string `json:"page_token,omitempty"` + Items []*User `json:"items,omitempty"` +} + +type UserPatchResult struct { + User *User `json:"user,omitempty"` +} + +type UserUpdateResult struct { + User *User `json:"user,omitempty"` +} + +type UserUpdateUserIdReqBody struct { + NewUserId string `json:"new_user_id,omitempty"` +} + +type UserGroupCreateResult struct { + UserGroup *UserGroup `json:"user_group,omitempty"` +} + +type UserGroupGetResult struct { + UserGroup *UserGroup `json:"user_group,omitempty"` +} + +type UserGroupListResult struct { + HasMore bool `json:"has_more,omitempty"` + PageToken string `json:"page_token,omitempty"` + Items []*UserGroup `json:"items,omitempty"` +} + +type UserGroupMemberCreateReqBody struct { + UserId string `json:"user_id,omitempty"` +} + +type UserGroupMemberListResult struct { + HasMore bool `json:"has_more,omitempty"` + PageToken string `json:"page_token,omitempty"` + Items []*User `json:"items,omitempty"` +} + +type UserGroupPatchResult struct { + UserGroup *UserGroup `json:"user_group,omitempty"` +} + +type UserGroupUpdateUserGroupIdReqBody struct { + NewUserGroupId string `json:"new_user_group_id,omitempty"` +} + +type DepartmentCreateEventData struct { + Object *DepartmentEvent `json:"object,omitempty"` +} + +type DepartmentCreateEvent struct { + *model.BaseEventV2 + Event *DepartmentCreateEventData `json:"event"` +} + +type DepartmentCreatedEventData struct { + Object *DepartmentEvent `json:"object,omitempty"` +} + +type DepartmentCreatedEvent struct { + *model.BaseEventV2 + Event *DepartmentCreatedEventData `json:"event"` +} + +type DepartmentCreatedV3EventData struct { + Object *DepartmentEvent `json:"object,omitempty"` +} + +type DepartmentCreatedV3Event struct { + *model.BaseEventV2 + Event *DepartmentCreatedV3EventData `json:"event"` +} + +type DepartmentDeleteEventData struct { + Object *DepartmentEvent `json:"object,omitempty"` + OldObject *DepartmentEvent `json:"old_object,omitempty"` +} + +type DepartmentDeleteEvent struct { + *model.BaseEventV2 + Event *DepartmentDeleteEventData `json:"event"` +} + +type DepartmentDeletedEventData struct { + Object *DepartmentEvent `json:"object,omitempty"` +} + +type DepartmentDeletedEvent struct { + *model.BaseEventV2 + Event *DepartmentDeletedEventData `json:"event"` +} + +type DepartmentUpdateEventData struct { + Object *DepartmentEvent `json:"object,omitempty"` + OldObject *DepartmentEvent `json:"old_object,omitempty"` +} + +type DepartmentUpdateEvent struct { + *model.BaseEventV2 + Event *DepartmentUpdateEventData `json:"event"` +} + +type DepartmentUpdatedEventData struct { + Object *DepartmentEvent `json:"object,omitempty"` + OldObject *DepartmentEvent `json:"old_object,omitempty"` +} + +type DepartmentUpdatedEvent struct { + *model.BaseEventV2 + Event *DepartmentUpdatedEventData `json:"event"` +} + +type ScopeUpdatedEventData struct { + Added *Scope `json:"added,omitempty"` + Removed *Scope `json:"removed,omitempty"` +} + +type ScopeUpdatedEvent struct { + *model.BaseEventV2 + Event *ScopeUpdatedEventData `json:"event"` +} + +type UserCreateEventData struct { + Object *UserEvent `json:"object,omitempty"` +} + +type UserCreateEvent struct { + *model.BaseEventV2 + Event *UserCreateEventData `json:"event"` +} + +type UserCreatedEventData struct { + Object *UserEvent `json:"object,omitempty"` +} + +type UserCreatedEvent struct { + *model.BaseEventV2 + Event *UserCreatedEventData `json:"event"` +} + +type UserDeleteEventData struct { + Object *UserEvent `json:"object,omitempty"` +} + +type UserDeleteEvent struct { + *model.BaseEventV2 + Event *UserDeleteEventData `json:"event"` +} + +type UserDeletedEventData struct { + Object *UserEvent `json:"object,omitempty"` +} + +type UserDeletedEvent struct { + *model.BaseEventV2 + Event *UserDeletedEventData `json:"event"` +} + +type UserUpdateEventData struct { + Object *UserEvent `json:"object,omitempty"` + OldObject *UserEvent `json:"old_object,omitempty"` +} + +type UserUpdateEvent struct { + *model.BaseEventV2 + Event *UserUpdateEventData `json:"event"` +} + +type UserUpdatedEventData struct { + Object *UserEvent `json:"object,omitempty"` + OldObject *UserEvent `json:"old_object,omitempty"` +} + +type UserUpdatedEvent struct { + *model.BaseEventV2 + Event *UserUpdatedEventData `json:"event"` +} + +type UserGroupCreateEventData struct { + Object *GroupEvent `json:"object,omitempty"` +} + +type UserGroupCreateEvent struct { + *model.BaseEventV2 + Event *UserGroupCreateEventData `json:"event"` +} + +type UserGroupCreatedEventData struct { + Object *GroupEvent `json:"object,omitempty"` +} + +type UserGroupCreatedEvent struct { + *model.BaseEventV2 + Event *UserGroupCreatedEventData `json:"event"` +} + +type UserGroupDeleteEventData struct { + Object *GroupEvent `json:"object,omitempty"` + OldObject *GroupEvent `json:"old_object,omitempty"` +} + +type UserGroupDeleteEvent struct { + *model.BaseEventV2 + Event *UserGroupDeleteEventData `json:"event"` +} + +type UserGroupDeletedEventData struct { + Object *GroupEvent `json:"object,omitempty"` +} + +type UserGroupDeletedEvent struct { + *model.BaseEventV2 + Event *UserGroupDeletedEventData `json:"event"` +} + +type UserGroupUpdateEventData struct { + Object *GroupEvent `json:"object,omitempty"` + OldObject *GroupEvent `json:"old_object,omitempty"` +} + +type UserGroupUpdateEvent struct { + *model.BaseEventV2 + Event *UserGroupUpdateEventData `json:"event"` +} + +type UserGroupUpdatedEventData struct { + Object *GroupEvent `json:"object,omitempty"` + OldObject *GroupEvent `json:"old_object,omitempty"` +} + +type UserGroupUpdatedEvent struct { + *model.BaseEventV2 + Event *UserGroupUpdatedEventData `json:"event"` +}